Coding Philosophy

Data structures

How to

Handling Unicode

Download sxmlc files

Project detail and discuss

Get support

More on data structures

You will find most of the inline documentation in comments in header files.
Comments in C files are mostly to explain how the code is working, not how it should be used.

An XML document is a list of XML nodes, described by the XMLNode struct.

XML document

An XML document is considered as:

  1. a file name
  2. a list of nodes.
  3. the root node
The root node is given by its index in the nodes array.
It usually happens that the root index is > 0, typically when XML prolog and comments are given before.

XML node

An XML node is basically what lies between the '<' and '>' characters. It is composed of:

  1. tag name that lies right after the <
  2. attributes between the tag name and the >:
    1. attribute name
    2. = sign
    3. attribute value
  3. potentially a tag "finisher" / before the >
<tag attribName="attribValue" ...>

Therefore, the XMLNode struct has pointers to all of these information, all of them being transparently allocated by sxmlc.

The tag_type attribute is an internal representation of the type, for the program to know how to handle the tag attribute.
Many nodes (e.g. prolog or comments) use the tag attribute to store its content. Hence, knowing the tag type eases its display:

The user attribute is where you can put any type of data related to the node (e.g. pointer to a struct, ...).

Project Web Hosted by

©Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved

About - Legal - Help