#include <cpl_minixml.h>
Public Attributes | |
CPLXMLNodeType | eType |
Node type. | |
char * | pszValue |
Node value. | |
struct CPLXMLNode * | psNext |
Next sibling. | |
struct CPLXMLNode * | psChild |
Child node. |
This C structure is used to hold a single text fragment representing a component of the document when parsed. It should be allocated with the appropriate CPL function, and freed with CPLDestroyXMLNode(). The structure contents should not normally be altered by application code, but may be freely examined by application code.
Using the psChild and psNext pointers, a heirarchical tree structure for a document can be represented as a tree of CPLXMLNode structures.
Node type.
One of CXT_Element, CXT_Text, CXT_Attribute, CXT_Comment, or CXT_Literal.
Referenced by CPLAddXMLChild(), CPLCloneXMLTree(), CPLCreateXMLNode(), CPLGetXMLNode(), CPLGetXMLValue(), CPLSearchXMLNode(), CPLSetXMLValue(), and CPLStripXMLNamespace().
struct CPLXMLNode* CPLXMLNode::psChild [read] |
Child node.
Pointer to first child node, if any. Only CXT_Element and CXT_Attribute nodes should have children. For CXT_Attribute it should be a single CXT_Text value node, while CXT_Element can have any kind of child. The full list of children for a node are identified by walking the psNext's starting with the psChild node.
Referenced by CPLAddXMLChild(), CPLCloneXMLTree(), CPLCreateXMLNode(), CPLDestroyXMLNode(), CPLGetXMLNode(), CPLGetXMLValue(), CPLRemoveXMLChild(), CPLSearchXMLNode(), CPLSetXMLValue(), CPLStripXMLNamespace(), and GDALValidateCreationOptions().
struct CPLXMLNode* CPLXMLNode::psNext [read] |
Next sibling.
Pointer to next sibling, that is the next node appearing after this one that has the same parent as this node. NULL if this node is the last child of the parent element.
Referenced by CPLAddXMLChild(), CPLAddXMLSibling(), CPLCloneXMLTree(), CPLCreateXMLNode(), CPLDestroyXMLNode(), CPLGetXMLNode(), CPLGetXMLValue(), CPLRemoveXMLChild(), CPLSearchXMLNode(), CPLSerializeXMLTree(), CPLSetXMLValue(), CPLStripXMLNamespace(), and GDALValidateCreationOptions().
char* CPLXMLNode::pszValue |
Node value.
For CXT_Element this is the name of the element, without the angle brackets. Note there is a single CXT_Element even when the document contains a start and end element tag. The node represents the pair. All text or other elements between the start and end tag will appear as children nodes of this CXT_Element node.
For CXT_Attribute the pszValue is the attribute name. The value of the attribute will be a CXT_Text child.
For CXT_Text this is the text itself (value of an attribute, or a text fragment between an element start and end tags.
For CXT_Literal it is all the literal text. Currently this is just used for !DOCTYPE lines, and the value would be the entire line.
For CXT_Comment the value is all the literal text within the comment, but not including the comment start/end indicators ("<--" and "-->").
Referenced by CPLCloneXMLTree(), CPLCreateXMLNode(), CPLDestroyXMLNode(), CPLGetXMLNode(), CPLGetXMLValue(), CPLParseXMLString(), CPLSearchXMLNode(), CPLSetXMLValue(), CPLStripXMLNamespace(), and GDALValidateCreationOptions().