libUPnP 1.14.19
|
Go to the source code of this file.
Data Structures | |
struct | _IXML_NamespaceURI |
struct | _IXML_ElementStack |
struct | _Parser |
Macros | |
#define | QUOT """ |
#define | LT "<" |
#define | GT ">" |
#define | APOS "'" |
#define | 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 | |
int | Parser_isValidXmlName (const DOMString name) |
Check to see whether name is a valid xml name. | |
void | Parser_setErrorChar (char c) |
Sets the error character. | |
void | Parser_freeNodeContent (IXML_Node *IXML_Nodeptr) |
Fees a node contents. | |
int | Parser_LoadDocument (IXML_Document **retDoc, const char *xmlFile, int file) |
Parses a xml file and return the DOM tree. | |
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. | |
void | ixmlAttr_init (IXML_Attr *attrNode) |
int | ixmlElement_setTagName (IXML_Element *element, const char *tagName) |
Set the given element's tagName. | |
void | ixmlNamedNodeMap_init (IXML_NamedNodeMap *nnMap) |
Initializes a NamedNodeMap object. | |
int | ixmlNamedNodeMap_addToNamedNodeMap (IXML_NamedNodeMap **nnMap, IXML_Node *add) |
Add a node to a NamedNodeMap. | |
int | ixmlNodeList_addToNodeList (IXML_NodeList **nList, IXML_Node *add) |
Add a node to nodelist. | |
void | ixmlNode_init (IXML_Node *nodeptr) |
Intializes a node. | |
int | 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. | |
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. | |
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. | |
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. | |
int ixmlElement_setTagName | ( | IXML_Element * | element, |
const char * | tagName | ||
) |
Set the given element's tagName.
[in] | element | The element to change the tagname. |
[in] | tagName | The new tagName for the element. |
Referenced by ixmlNode_cloneElement().
int ixmlNamedNodeMap_addToNamedNodeMap | ( | IXML_NamedNodeMap ** | nnMap, |
IXML_Node * | add | ||
) |
Add a node to a NamedNodeMap.
References ixmlNamedNodeMap_init().
Referenced by ixmlNode_getAttributes().
void ixmlNamedNodeMap_init | ( | IXML_NamedNodeMap * | nnMap | ) |
Initializes a NamedNodeMap object.
[in] | nnMap | The named node map to process. |
Referenced by ixmlNamedNodeMap_addToNamedNodeMap(), and ixmlNode_getAttributes().
Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignored.
[in] | srcNode | The first Node. |
[in] | destNode | The second Node. |
Referenced by ixmlElement_findAttributeNode().
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.
[in] | n | The Node tree. |
[in] | tagname | The tag name to match. |
[out] | list | The output NodeList. |
References ixmlNode_getElementsByTagNameRecursive(), ixmlNode_getFirstChild(), ixmlNode_getNodeName(), ixmlNode_getNodeType(), and ixmlNodeList_addToNodeList().
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.
[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, ixmlNode_getElementsByTagNameNSRecursive(), ixmlNode_getFirstChild(), ixmlNode_getLocalName(), ixmlNode_getNamespaceURI(), ixmlNode_getNodeType(), and ixmlNodeList_addToNodeList().
void ixmlNode_init | ( | IXML_Node * | nodeptr | ) |
Intializes a node.
[in] | nodeptr | The Node to iniatialize. |
Referenced by ixmlNode_cloneTextNode(), and Parser_parseDocument().
[in] | node | The Node. |
[in] | qualifiedName | . |
References Parser_setNodePrefixAndLocalName().
Referenced by ixmlNode_cloneAttr(), ixmlNode_cloneCDATASect(), ixmlNode_cloneElement(), ixmlNode_cloneTextNode(), and ixmlNode_newDoc().
[in] | destNode | . |
[in] | src | . |
References ixmlNode_setLocalName(), ixmlNode_setNodeValue(), and ixmlNode_setPrefix().
Referenced by Parser_processAttributeName(), and Parser_processElementName().
int ixmlNodeList_addToNodeList | ( | IXML_NodeList ** | nList, |
IXML_Node * | add | ||
) |
Add a node to nodelist.
[in] | nList | The pointer to the nodelist. |
[in] | add | The node to add. |
References ixmlNodeList_init().
Referenced by ixmlNode_getChildNodes(), ixmlNode_getElementsByTagName(), ixmlNode_getElementsByTagNameNS(), ixmlNode_getElementsByTagNameNSRecursive(), and ixmlNode_getElementsByTagNameRecursive().
void ixmlNodeList_init | ( | IXML_NodeList * | nList | ) |
Initializes a nodelist.
[in,out] | nList | The NodeList to initialize. |
Referenced by ixmlNode_getChildNodes(), and ixmlNodeList_addToNodeList().
void Parser_freeNodeContent | ( | IXML_Node * | IXML_Nodeptr | ) |
Fees a node contents.
[in] | IXML_Nodeptr | The Node to process. |
Referenced by Parser_parseDocument().
int Parser_isValidXmlName | ( | const DOMString | name | ) |
Check to see whether name is a valid xml name.
[in] | name | The string to be checked. |
References Parser_isNameChar().
int Parser_LoadDocument | ( | IXML_Document ** | retDoc, |
const char * | xmlFile, | ||
int | file | ||
) |
Parses a xml file and return the DOM tree.
[out] | retDoc | The output document tree. |
[in] | xmlFile | The file name or the buffer to copy, according to the parameter "file". |
[in] | file | 1 if you want to read from a file, 0 if xmlFileName is the buffer to copy to the parser. |
References _Parser::curPtr, _Parser::dataBuffer, Parser_free(), Parser_init(), Parser_parseDocument(), and Parser_readFileOrBuffer().
Referenced by ixmlLoadDocumentEx(), and ixmlParseBufferEx().
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.
[in] | c | The character to become the error character. |
Referenced by ixmlRelaxParser().
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.
[in,out] | newIXML_NodeIXML_Attr | The Node to process. |
References safe_strdup().
Referenced by ixmlNode_setNodeName(), Parser_processSTag(), and Parser_xmlNamespace().