ixmlparser.h File Reference
`#include "ixml.h"`
`#include "ixmlmembuf.h"`
Include dependency graph for ixmlparser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | _IXML_NamespaceURI
struct | _IXML_ElementStack
struct | _Parser

## Macros

#define | QUOT "&quot;"
#define | LT "&lt;"
#define | GT "&gt;"
#define | APOS "&apos;"
#define | AMP "&amp;"
#define | ESC_HEX "&#x"
#define | ESC_DEC "&#"

## Typedefs

typedef struct _IXML_NamespaceURI | IXML_NamespaceURI
typedef struct _IXML_ElementStack | IXML_ElementStack
typedef struct _Parser | Parser

## Enumerations

enum | PARSER_STATE { eELEMENT, eATTRIBUTE, eCONTENT }

## Functions

BOOL | Parser_isValidXmlName (const DOMString name)
| Check to see whether name is a valid xml name. More...
void | Parser_setErrorChar (char c)
| Sets the error character. More...
void | Parser_freeNodeContent (IXML_Node *IXML_Nodeptr)
| Fees a node contents. More...
int | Parser_LoadDocument (IXML_Document **retDoc, const char *xmlFile, BOOL file)
| Parses a xml file and return the DOM tree. More...
int | Parser_setNodePrefixAndLocalName (IXML_Node *newIXML_NodeIXML_Attr)
| Set the node prefix and localName as defined by the nodeName in the form of ns:name. More...
void | ixmlAttr_init (IXML_Attr *attrNode)
int | ixmlElement_setTagName (IXML_Element *element, const char *tagName)
| Set the given element's tagName. More...
void | ixmlNamedNodeMap_init (IXML_NamedNodeMap *nnMap)
| Initializes a NamedNodeMap object. More...
int | ixmlNamedNodeMap_addToNamedNodeMap (IXML_NamedNodeMap **nnMap, IXML_Node *add)
| Add a node to a NamedNodeMap. More...
int | ixmlNodeList_addToNodeList (IXML_NodeList **nList, IXML_Node *add)
| Add a node to nodelist. More...
void | ixmlNode_init (IN IXML_Node *nodeptr)
| Intializes a node. More...
BOOL | ixmlNode_compare (IXML_Node *srcNode, IXML_Node *destNode)
| Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignored. More...
void | ixmlNode_getElementsByTagName (IXML_Node *n, const char *tagname, IXML_NodeList **list)
| Returns a nodeList of all descendant Elements with a given tagName, in the order in which they are encountered in a traversal of this element tree. More...
void | ixmlNode_getElementsByTagNameNS (IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list)
| Returns a nodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Elememt tree. More...
int | ixmlNode_setNodeName (IXML_Node *node, const DOMString qualifiedName)
int | ixmlNode_setNodeProperties (IXML_Node *destNode, IXML_Node *src)
void | ixmlNodeList_init (IXML_NodeList *nList)
| Initializes a nodelist. More...

## Function Documentation

## ixmlElement_setTagName()

int ixmlElement_setTagName | ( | IXML_Element * | element,
|  | const char * | tagName
| ) |  |

Set the given element's tagName.

Returns
  One of the following:
  - IXML_SUCCESS, if successfull.
  - IXML_FAILED, if element of tagname is NULL.
  - IXML_INSUFFICIENT_MEMORY, if there is no memory to allocate the buffer for the element's tagname.

Parameters

  [in] | element | The element to change the tagname.
  [in] | tagName | The new tagName for the element.

Referenced by ixmlNode_cloneElement().

## ixmlNamedNodeMap_addToNamedNodeMap()

int ixmlNamedNodeMap_addToNamedNodeMap | ( | IXML_NamedNodeMap ** | nnMap,
|  | IXML_Node * | add
| ) |  |

Add a node to a NamedNodeMap.

Returns
  IXML_SUCCESS or failure.

## ixmlNamedNodeMap_init()

void ixmlNamedNodeMap_init | ( | IXML_NamedNodeMap * | nnMap | ) |

Initializes a NamedNodeMap object.

Parameters

  [in] | nnMap | The named node map to process.

References DOMString, ixmlNamedNodeMap_getItemNumber(), and ixmlNamedNodeMap_getNamedItem().

## ixmlNode_compare()

BOOL ixmlNode_compare | ( | IXML_Node * | srcNode,
|  | IXML_Node * | destNode
| ) |  |

Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignored.

Returns
  - TRUE, the two nodes are the same.
  - FALSE, the two nodes are not the same.

Parameters

  [in] | srcNode | The first Node.
  [in] | destNode | The second Node.

Referenced by ixmlElement_findAttributeNode().

## ixmlNode_getElementsByTagName()

void ixmlNode_getElementsByTagName | ( | IXML_Node * | n,
|  | const char * | tagname,
|  | IXML_NodeList ** | list
| ) |  |

Returns a nodeList of all descendant Elements with a given tagName, in the order in which they are encountered in a traversal of this element tree.

Parameters

  [in] | n | The Node tree.
  [in] | tagname | The tag name to match.
  [out] | list | The output NodeList.

References ixmlNode_getNodeType().

## ixmlNode_getElementsByTagNameNS()

void ixmlNode_getElementsByTagNameNS | ( | IXML_Node * | n,
|  | const char * | namespaceURI,
|  | const char * | localName,
|  | IXML_NodeList ** | list
| ) |  |

Returns a nodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Elememt tree.

Parameters

  [in] | n | The Element tree.
  [in] | namespaceURI | The name space to match.
  [in] | localName | The local name to match.
  [out] | list | The output NodeList.

References DOMString, and ixmlNode_getNodeType().

## ixmlNode_init()

void ixmlNode_init | ( | IN IXML_Node * | nodeptr | ) |

Intializes a node.

Parameters

  [in] | nodeptr | The Node to iniatialize.

Referenced by ixmlNode_cloneTextNode().

## ixmlNode_setNodeName()

int ixmlNode_setNodeName | ( | IXML_Node * | node,
|  | const DOMString | qualifiedName
| ) |  |

Returns

Parameters

  [in] | node | The Node.
  [in] | qualifiedName | .

Referenced by ixmlNode_cloneCDATASect(), ixmlNode_cloneTextNode(), and ixmlNode_newDoc().

## ixmlNode_setNodeProperties()

int ixmlNode_setNodeProperties | ( | IXML_Node * | destNode,
|  | IXML_Node * | src
| ) |  |

Returns

Parameters

  [in] | destNode | .
  [in] | src | .

## ixmlNodeList_addToNodeList()

int ixmlNodeList_addToNodeList | ( | IXML_NodeList ** | nList,
|  | IXML_Node * | add
| ) |  |

Add a node to nodelist.

Parameters

  [in] | nList | The pointer to the nodelist.
  [in] | add | The node to add.

Referenced by ixmlNode_getChildNodes().

## ixmlNodeList_init()

void ixmlNodeList_init | ( | IXML_NodeList * | nList | ) |

Initializes a nodelist.

Parameters

  [in,out] | nList | The NodeList to initialize.

Referenced by ixmlNode_getChildNodes().

## Parser_freeNodeContent()

void Parser_freeNodeContent | ( | IXML_Node * | IXML_Nodeptr | ) |

Fees a node contents.

Parameters

  [in] | IXML_Nodeptr | The Node to process.

## Parser_isValidXmlName()

BOOL Parser_isValidXmlName | ( | const DOMString | name | ) |

Check to see whether name is a valid xml name.

Parameters

  [in] | name | The string to be checked.

References Parser_isNameChar().

## Parser_LoadDocument()

int Parser_LoadDocument | ( | IXML_Document ** | retDoc,
|  | const char * | xmlFile,
|  | BOOL | file
| ) |  |

Parses a xml file and return the DOM tree.

Parameters

  [out] | retDoc | The output document tree.
  [in] | xmlFile | The file name or the buffer to copy, according to the parameter "file".
  [in] | file | TRUE if you want to read from a file, false if xmlFileName is the buffer to copy to the parser.

## Parser_setErrorChar()

void Parser_setErrorChar | ( | char | c | ) |

Sets the error character.

If 'c' is 0 (default), the parser is strict about XML encoding: invalid UTF-8 sequences or "&" entities are rejected, and the parsing aborts.

If 'c' is not 0, the parser is relaxed: invalid UTF-8 characters are replaced by this character, and invalid "&" entities are left untranslated. The parsing is then allowed to continue.

Parameters

  [in] | c | The character to become the error character.

Referenced by ixmlRelaxParser().

## Parser_setNodePrefixAndLocalName()

int Parser_setNodePrefixAndLocalName | ( | IXML_Node * | newIXML_NodeIXML_Attr | ) |

Set the node prefix and localName as defined by the nodeName in the form of ns:name.

Parameters

  [in,out] | newIXML_NodeIXML_Attr | The Node to process.