|
libUPnP 1.18.4
|
#include "ixmlparser.h"#include <assert.h>#include <stdlib.h>#include <string.h>#include "posix_overwrites.h"
Functions | |
| void | ixmlNode_init (IXML_Node *nodeptr) |
| Intializes a node. | |
| void | ixmlCDATASection_init (IXML_CDATASection *nodeptr) |
| Initializes a CDATASection node. | |
| void | ixmlCDATASection_free (IXML_CDATASection *nodeptr) |
| Frees a CDATASection node. | |
| static void | ixmlNode_freeSingleNode (IXML_Node *nodeptr) |
| Frees a node content. | |
| void | ixmlNode_free (IXML_Node *nodeptr) |
| Frees a Node and all Nodes in its subtree. | |
| const DOMString | ixmlNode_getNodeName (IXML_Node *nodeptr) |
| Returns the name of the Node, depending on what type of Node it is, in a read-only string. | |
| const DOMString | ixmlNode_getLocalName (IXML_Node *nodeptr) |
| Retrieves the local name of a Node, if present. | |
| static int | ixmlNode_setNamespaceURI (IXML_Node *nodeptr, const char *namespaceURI) |
| Sets the namespace URI of the node. | |
| static int | ixmlNode_setPrefix (IXML_Node *nodeptr, const char *prefix) |
| static int | ixmlNode_setLocalName (IXML_Node *nodeptr, const char *localName) |
| Set the localName of the node. | |
| const DOMString | ixmlNode_getNamespaceURI (IXML_Node *nodeptr) |
| Retrieves the namespace URI for a Node as a DOMString. | |
| const DOMString | ixmlNode_getPrefix (IXML_Node *nodeptr) |
| Retrieves the namespace prefix, if present. | |
| const DOMString | ixmlNode_getNodeValue (IXML_Node *nodeptr) |
| Returns the value of the Node as a string. | |
| int | ixmlNode_setNodeValue (IXML_Node *nodeptr, const char *newNodeValue) |
| Assigns a new value to a Node. | |
| unsigned short | ixmlNode_getNodeType (IXML_Node *nodeptr) |
| Retrieves the type of a Node. Note that not all possible return values are actually implemented. | |
| IXML_Node * | ixmlNode_getParentNode (IXML_Node *nodeptr) |
| Retrieves the parent Node for a Node. | |
| IXML_Node * | ixmlNode_getFirstChild (IXML_Node *nodeptr) |
| Retrieves the first child Node of a Node. | |
| IXML_Node * | ixmlNode_getLastChild (IXML_Node *nodeptr) |
| Retrieves the last child Node of a Node. | |
| IXML_Node * | ixmlNode_getPreviousSibling (IXML_Node *nodeptr) |
| Retrieves the sibling Node immediately preceding this Node. | |
| IXML_Node * | ixmlNode_getNextSibling (IXML_Node *nodeptr) |
| Retrieves the sibling Node immediately following this Node. | |
| IXML_Document * | ixmlNode_getOwnerDocument (IXML_Node *nodeptr) |
| Retrieves the document object associated with this Node. | |
| static int | ixmlNode_isAncestor (IXML_Node *ancestorNode, IXML_Node *toFind) |
| Check if ancestorNode is ancestor of toFind. | |
| static int | ixmlNode_isParent (IXML_Node *nodeptr, IXML_Node *toFind) |
| Check whether toFind is a children of nodeptr. | |
| static int | ixmlNode_allowChildren (IXML_Node *nodeptr, IXML_Node *newChild) |
| Check to see whether nodeptr allows children of type newChild. | |
| int | ixmlNode_compare (const IXML_Node *srcNode, const IXML_Node *destNode) |
| Compare two nodes to see whether they are the same node. Parent, sibling and children node are ignored. | |
| int | ixmlNode_insertBefore (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild) |
| Inserts a new child Node before the existing child Node. | |
| int | ixmlNode_replaceChild (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *oldChild, IXML_Node **returnNode) |
| Replaces an existing child Node with a new child Node in the list of children of a Node. | |
| int | ixmlNode_removeChild (IXML_Node *nodeptr, IXML_Node *oldChild, IXML_Node **returnNode) |
| Removes a child from the list of children of a Node. | |
| int | ixmlNode_appendChild (IXML_Node *nodeptr, IXML_Node *newChild) |
| Appends a child Node to the list of children of a Node. | |
| static IXML_Node * | ixmlNode_cloneTextNode (IXML_Node *nodeptr) |
| Returns a clone of nodeptr. | |
| static IXML_CDATASection * | ixmlNode_cloneCDATASect (IXML_CDATASection *nodeptr) |
| Return a clone of CDATASection node. | |
| static IXML_Element * | ixmlNode_cloneElement (IXML_Element *nodeptr) |
| Returns a clone of element node. | |
| static IXML_Document * | ixmlNode_newDoc (void) |
| Returns a new document node. | |
| static IXML_Attr * | ixmlNode_cloneAttr (IXML_Attr *nodeptr) |
| Returns a clone of an attribute node. | |
| static IXML_Attr * | ixmlNode_cloneAttrDirect (IXML_Attr *nodeptr) |
| Return a clone of attribute node, with specified field set to 1. | |
| static void | ixmlNode_setSiblingNodesParent (IXML_Node *nodeptr) |
| Sets siblings nodes parent to be the same as this node's. | |
| static IXML_Node * | ixmlNode_cloneNodeTreeRecursive (IXML_Node *nodeptr, int deep) |
| Recursive function that clones a node tree of nodeptr. | |
| static IXML_Node * | ixmlNode_cloneNodeTree (IXML_Node *nodeptr, int deep) |
| Function that clones a node tree of nodeptr. | |
| IXML_Node * | ixmlNode_cloneNode (IXML_Node *nodeptr, int deep) |
| Clones a Node. | |
| IXML_NodeList * | ixmlNode_getChildNodes (IXML_Node *nodeptr) |
| Retrieves the list of children of a Node in a NodeList structure. | |
| IXML_NamedNodeMap * | ixmlNode_getAttributes (IXML_Node *nodeptr) |
| Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure. | |
| int | ixmlNode_hasChildNodes (IXML_Node *nodeptr) |
| Queries whether or not a Node has children. | |
| int | ixmlNode_hasAttributes (IXML_Node *nodeptr) |
| Queries whether this Node has attributes. | |
| static void | ixmlNode_getElementsByTagNameRecursive (IXML_Node *n, const char *tagname, IXML_NodeList **list) |
| Recursively traverse the whole tree, search for element with the given tagname. | |
| 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. | |
| static void | ixmlNode_getElementsByTagNameNSRecursive (IXML_Node *n, const char *namespaceURI, const char *localName, IXML_NodeList **list) |
| 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) |
Check to see whether nodeptr allows children of type newChild.
| [in] | nodeptr | The Node to check. |
| [in] | newChild | The child Node to check. |
Referenced by ixmlNode_appendChild(), ixmlNode_insertBefore(), and ixmlNode_replaceChild().
Returns a clone of an attribute node.
| [in] | nodeptr | The Node to clone. |
References ixmlAttr_free(), ixmlNode_setLocalName(), ixmlNode_setNamespaceURI(), ixmlNode_setNodeName(), ixmlNode_setNodeValue(), and ixmlNode_setPrefix().
Referenced by ixmlNode_cloneAttrDirect(), and ixmlNode_cloneNodeTreeRecursive().
Return a clone of attribute node, with specified field set to 1.
| [in] | nodeptr | The Node to clone. |
References ixmlNode_cloneAttr().
Referenced by ixmlNode_cloneNode().
|
static |
Return a clone of CDATASection node.
| [in] | nodeptr | The Node to clone. |
References ixmlCDATASection_free(), ixmlCDATASection_init(), ixmlNode_setNodeName(), and ixmlNode_setNodeValue().
Referenced by ixmlNode_cloneNodeTreeRecursive().
|
static |
Returns a clone of element node.
| [in] | nodeptr | The Node to clone. |
References ixmlElement_free(), ixmlElement_init(), ixmlElement_setTagName(), ixmlNode_setLocalName(), ixmlNode_setNamespaceURI(), ixmlNode_setNodeName(), ixmlNode_setNodeValue(), and ixmlNode_setPrefix().
Referenced by ixmlNode_cloneNodeTree(), and ixmlNode_cloneNodeTreeRecursive().
Function that clones a node tree of nodeptr.
| [in] | nodeptr | Node tree to clone. |
| [in] | deep | 1 if you want to clone the tree. |
References ixmlNode_cloneElement(), and ixmlNode_cloneNodeTreeRecursive().
Referenced by ixmlNode_cloneNode().
Recursive function that clones a node tree of nodeptr.
| [in] | nodeptr | Node tree to clone. |
| [in] | deep | 1 if you want to clone the tree. |
References ixmlNode_cloneAttr(), ixmlNode_cloneCDATASect(), ixmlNode_cloneElement(), ixmlNode_cloneNodeTreeRecursive(), ixmlNode_cloneTextNode(), ixmlNode_newDoc(), and ixmlNode_setSiblingNodesParent().
Referenced by ixmlNode_cloneNodeTree(), and ixmlNode_cloneNodeTreeRecursive().
Returns a clone of nodeptr.
| [in] | nodeptr | The Node to clone. |
References ixmlNode_free(), ixmlNode_init(), ixmlNode_setNodeName(), and ixmlNode_setNodeValue().
Referenced by ixmlNode_cloneNodeTreeRecursive().
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. |
|
static |
| 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().
Referenced by ixmlDocument_getElementsByTagName().
| 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().
Referenced by ixmlDocument_getElementsByTagNameNS().
|
static |
| [in] | n | . |
| [in] | namespaceURI | . |
| [in] | localName | . |
| [out] | list | . |
References DOMString, ixmlNode_getElementsByTagNameNSRecursive(), ixmlNode_getFirstChild(), ixmlNode_getLocalName(), ixmlNode_getNamespaceURI(), ixmlNode_getNextSibling(), ixmlNode_getNodeType(), and ixmlNodeList_addToNodeList().
Referenced by ixmlNode_getElementsByTagNameNS(), and ixmlNode_getElementsByTagNameNSRecursive().
|
static |
Recursively traverse the whole tree, search for element with the given tagname.
| [in] | n | The Node tree. |
| [in] | tagname | The tag name to match. |
| [out] | list | The output NodeList. |
References ixmlNode_getElementsByTagNameRecursive(), ixmlNode_getFirstChild(), ixmlNode_getNextSibling(), ixmlNode_getNodeName(), ixmlNode_getNodeType(), and ixmlNodeList_addToNodeList().
Referenced by ixmlNode_getElementsByTagName(), and ixmlNode_getElementsByTagNameRecursive().
| void ixmlNode_init | ( | IXML_Node * | nodeptr | ) |
Intializes a node.
| [in] | nodeptr | The Node to iniatialize. |
Referenced by ixmlDocument_createTextNodeEx(), ixmlNode_cloneTextNode(), and Parser_parseDocument().
Check if ancestorNode is ancestor of toFind.
| [in] | ancestorNode | The candidate to ancestor Node. |
| [in] | toFind | The Node to check for an ancestor. |
References ixmlNode_isAncestor().
Referenced by ixmlNode_appendChild(), ixmlNode_insertBefore(), ixmlNode_isAncestor(), and ixmlNode_replaceChild().
Check whether toFind is a children of nodeptr.
| [in] | nodeptr | The candidate to parent Node. |
| [in] | toFind | The Node to check for his parent. |
Referenced by ixmlNode_appendChild(), ixmlNode_insertBefore(), ixmlNode_removeChild(), and ixmlNode_replaceChild().
|
static |
Returns a new document node.
Currently, the IXML_Document struct is just a node, so this function just mallocs the IXML_Document, sets the node type and name.
References ixmlDocument_free(), ixmlDocument_init(), and ixmlNode_setNodeName().
Referenced by ixmlNode_cloneNodeTreeRecursive().
|
static |
Set the localName of the node.
| [in] | nodeptr | The pointer to the node. |
| [in] | localName | The local name to set. |
Referenced by ixmlNode_cloneAttr(), ixmlNode_cloneElement(), and ixmlNode_setNodeProperties().
|
static |
Sets the namespace URI of the node.
| [in] | nodeptr | The Node on which to operate. |
| [in] | namespaceURI | The name space string to set. |
Referenced by ixmlNode_cloneAttr(), and ixmlNode_cloneElement().
| [in] | node | The Node. |
| [in] | qualifiedName | . |
References DOMString, and Parser_setNodePrefixAndLocalName().
Referenced by ixmlDocument_createAttributeNSEx(), ixmlDocument_createElementNSEx(), 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().
|
static |
| [in] | nodeptr | The Node on which to operate. |
| [in] | prefix | The prefix string to set. |
Referenced by ixmlNode_cloneAttr(), ixmlNode_cloneElement(), and ixmlNode_setNodeProperties().
|
static |
Sets siblings nodes parent to be the same as this node's.
| [in] | nodeptr | The node to operate on. |
Referenced by ixmlNode_cloneNodeTreeRecursive().