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.
An XML document is considered as:
nodes
array.An XML node is basically what lies between the '<' and '>' characters. It is composed of:
<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:
TAG_FATHER
(<mytag>
) is a node that will have children.
Nodes read after it will be added as children of this tag.
TAG_SELF
(<mytag/>
) is a "self-contained" node that has no children.
Nodes read after it are siblings of this tag.
TAG_END
(</mytag>
) is an ending node that closes its father (if tag names matches).
Nodes read after it are siblings of father tag.XMLNode
associated with this as it is only used internally by the parser.
TAG_INSTR
(<?text?>
) is a node used for prolog and processing instructions.
TAG_COMMENT
(<!--text-->
) is a comment node.
TAG_CDATA
(<![CDATA[text]]/>
) is a CDATA escaped node.
TAG_DOCTYPE
(<!DOCTYPE text]/>
) is a DOCTYPE node.
The user
attribute is where you can put any type of data related to the node (e.g. pointer
to a struct, ...).
©Copyright 1999-2010 - Geeknet, Inc., All Rights Reserved