libUPnP
1.6.17
|
Data Structures | |
struct | _IXML_Node |
Data structure common to all types of nodes. More... | |
struct | _IXML_Document |
Data structure representing the DOM Document. More... | |
struct | _IXML_CDATASection |
Data structure representing a CDATA section node. More... | |
struct | _IXML_Element |
Data structure representing an Element node. More... | |
struct | _IXML_ATTR |
Data structure representing an Attribute node. More... | |
struct | _IXML_Text |
Data structure representing a Text node. More... | |
struct | _IXML_NodeList |
Data structure representing a list of nodes. More... | |
struct | _IXML_NamedNodeMap |
Data structure representing a list of named nodes. More... | |
Defines | |
#define | DOMString char * |
The type of DOM strings. | |
#define | TRUE 1 |
#define | FALSE 0 |
#define | IN |
#define | OUT |
#define | INOUT |
Typedefs | |
typedef int | BOOL |
DOM Interfaces | |
The Document Object Model consists of a set of objects and interfaces for accessing and manipulating documents. IXML does not implement all the interfaces documented in the DOM2-Core recommendation but defines a subset of the most useful interfaces. A description of the supported interfaces and methods is presented in this section. For a complete discussion on the object model, the object hierarchy, etc., refer to section 1.1 of the DOM2-Core recommendation. | |
enum | IXML_NODE_TYPE { eINVALID_NODE = 0, eELEMENT_NODE = 1, eATTRIBUTE_NODE = 2, eTEXT_NODE = 3, eCDATA_SECTION_NODE = 4, eENTITY_REFERENCE_NODE = 5, eENTITY_NODE = 6, ePROCESSING_INSTRUCTION_NODE = 7, eCOMMENT_NODE = 8, eDOCUMENT_NODE = 9, eDOCUMENT_TYPE_NODE = 10, eDOCUMENT_FRAGMENT_NODE = 11, eNOTATION_NODE = 12 } |
The type of the DOM node. More... | |
enum | IXML_ERRORCODE { IXML_SUCCESS = 0, IXML_INDEX_SIZE_ERR = 1, IXML_DOMSTRING_SIZE_ERR = 2, IXML_HIERARCHY_REQUEST_ERR = 3, IXML_WRONG_DOCUMENT_ERR = 4, IXML_INVALID_CHARACTER_ERR = 5, IXML_NO_DATA_ALLOWED_ERR = 6, IXML_NO_MODIFICATION_ALLOWED_ERR = 7, IXML_NOT_FOUND_ERR = 8, IXML_NOT_SUPPORTED_ERR = 9, IXML_INUSE_ATTRIBUTE_ERR = 10, IXML_INVALID_STATE_ERR = 11, IXML_SYNTAX_ERR = 12, IXML_INVALID_MODIFICATION_ERR = 13, IXML_NAMESPACE_ERR = 14, IXML_INVALID_ACCESS_ERR = 15, IXML_NO_SUCH_FILE = 101, IXML_INSUFFICIENT_MEMORY = 102, IXML_FILE_DONE = 104, IXML_INVALID_PARAMETER = 105, IXML_FAILED = 106, IXML_INVALID_ITEM_NUMBER = 107 } |
Error codes returned by the XML API, see the DOM spec. More... | |
typedef struct _IXML_Document * | Docptr |
typedef struct _IXML_Node * | Nodeptr |
typedef struct _IXML_Node | IXML_Node |
Data structure common to all types of nodes. | |
typedef struct _IXML_Document | IXML_Document |
Data structure representing the DOM Document. | |
typedef struct _IXML_CDATASection | IXML_CDATASection |
Data structure representing a CDATA section node. | |
typedef struct _IXML_Element | IXML_Element |
Data structure representing an Element node. | |
typedef struct _IXML_ATTR | IXML_Attr |
Data structure representing an Attribute node. | |
typedef struct _IXML_Text | IXML_Text |
Data structure representing a Text node. | |
typedef struct _IXML_NodeList | IXML_NodeList |
Data structure representing a list of nodes. | |
typedef struct _IXML_NamedNodeMap | IXML_NamedNodeMap |
Data structure representing a list of named nodes. | |
#define | DOCUMENTNODENAME "#document" |
#define | TEXTNODENAME "#text" |
#define | CDATANODENAME "#cdata-section" |
Interface Node | |
The Node interface forms the primary datatype for all other DOM objects. Every other interface is derived from this interface, inheriting its functionality. For more information, refer to DOM2-Core page 34. | |
const char * | 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 char * | 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. | |
IXML_Node * | ixmlNode_getParentNode (IXML_Node *nodeptr) |
Retrieves the parent Node for a Node. | |
IXML_NodeList * | ixmlNode_getChildNodes (IXML_Node *nodeptr) |
Retrieves the list of children of a Node in a NodeList structure. | |
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_NamedNodeMap * | ixmlNode_getAttributes (IXML_Node *nodeptr) |
Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure. | |
IXML_Document * | ixmlNode_getOwnerDocument (IXML_Node *nodeptr) |
Retrieves the document object associated with this Node. | |
const char * | ixmlNode_getNamespaceURI (IXML_Node *nodeptr) |
Retrieves the namespace URI for a Node as a DOMString. | |
const char * | ixmlNode_getPrefix (IXML_Node *nodeptr) |
Retrieves the namespace prefix, if present. | |
const char * | ixmlNode_getLocalName (IXML_Node *nodeptr) |
Retrieves the local name of a Node, if present. | |
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. | |
BOOL | ixmlNode_hasChildNodes (IXML_Node *nodeptr) |
Queries whether or not a Node has children. | |
IXML_Node * | ixmlNode_cloneNode (IXML_Node *nodeptr, BOOL deep) |
Clones a Node. | |
BOOL | ixmlNode_hasAttributes (IXML_Node *nodeptr) |
Queries whether this Node has attributes. | |
void | ixmlNode_free (IXML_Node *nodeptr) |
Frees a Node and all Nodes in its subtree. | |
Interface Attr | |
The Attr interface represents an attribute of an Element. The document type definition (DTD) or schema usually dictate the allowable attributes and values for a particular element. For more information, refer to the Interface Attr section in the DOM2-Core. | |
void | ixmlAttr_free (IXML_Attr *attrNode) |
Frees an Attr node. | |
Interface CDATASection | |
The CDATASection is used to escape blocks of text containing characters that would otherwise be regarded as markup. CDATA sections cannot be nested. Their primary purpose is for including material such XML fragments, without needing to escape all the delimiters. For more information, refer to the Interface CDATASection section in the DOM2-Core. | |
void | ixmlCDATASection_init (IXML_CDATASection *nodeptr) |
Initializes a CDATASection node. | |
void | ixmlCDATASection_free (IXML_CDATASection *nodeptr) |
Frees a CDATASection node. | |
Interface Document | |
The Document interface represents the entire XML document. In essence, it is the root of the document tree and provides the primary interface to the elements of the document. For more information, refer to the Interface Document section in the DOM2Core. | |
void | ixmlDocument_init (IXML_Document *nodeptr) |
Initializes a Document node. | |
int | ixmlDocument_createDocumentEx (IXML_Document **doc) |
Creates a new empty Document node. | |
IXML_Document * | ixmlDocument_createDocument (void) |
Creates a new empty Document node. | |
int | ixmlDocument_createElementEx (IXML_Document *doc, const char *tagName, IXML_Element **rtElement) |
Creates a new Element node with the given tag name. | |
IXML_Element * | ixmlDocument_createElement (IXML_Document *doc, const char *tagName) |
Creates a new Element node with the given tag name. | |
int | ixmlDocument_createTextNodeEx (IXML_Document *doc, const char *data, IXML_Node **textNode) |
Creates a new Text node with the given data. | |
IXML_Node * | ixmlDocument_createTextNode (IXML_Document *doc, const char *data) |
Creates a new Text node with the given data. | |
int | ixmlDocument_createCDATASectionEx (IXML_Document *doc, const char *data, IXML_CDATASection **cdNode) |
Creates a new CDATASection node with given data. | |
IXML_CDATASection * | ixmlDocument_createCDATASection (IXML_Document *doc, const char *data) |
Creates a new CDATASection node with given data. | |
IXML_Attr * | ixmlDocument_createAttribute (IXML_Document *doc, const char *name) |
Creates a new Attr node with the given name. | |
int | ixmlDocument_createAttributeEx (IXML_Document *doc, const char *name, IXML_Attr **attrNode) |
Creates a new Attr node with the given name. | |
IXML_NodeList * | ixmlDocument_getElementsByTagName (IXML_Document *doc, const char *tagName) |
Returns a NodeList of all Elements that match the given tag name in the order in which they were encountered in a preorder traversal of the Document tree. | |
int | ixmlDocument_createElementNSEx (IXML_Document *doc, const char *namespaceURI, const char *qualifiedName, IXML_Element **rtElement) |
Creates a new Element node in the given qualified name and namespace URI. | |
IXML_Element * | ixmlDocument_createElementNS (IXML_Document *doc, const char *namespaceURI, const char *qualifiedName) |
Creates a new Element node in the given qualified name and namespace URI. | |
int | ixmlDocument_createAttributeNSEx (IXML_Document *doc, const char *namespaceURI, const char *qualifiedName, IXML_Attr **attrNode) |
Creates a new Attr node with the given qualified name and namespace URI. | |
IXML_Attr * | ixmlDocument_createAttributeNS (IXML_Document *doc, const char *namespaceURI, const char *qualifiedName) |
Creates a new Attribute node with the given qualified name and namespace URI. | |
IXML_NodeList * | ixmlDocument_getElementsByTagNameNS (IXML_Document *doc, const char *namespaceURI, const char *localName) |
Returns a NodeList of Elements that match the given local name and namespace URI in the order they are encountered in a preorder traversal of the Document tree. | |
IXML_Element * | ixmlDocument_getElementById (IXML_Document *doc, const char *tagName) |
Returns the Element whose ID matches that given id. | |
void | ixmlDocument_free (IXML_Document *doc) |
Frees a Document object and all Nodes associated with it. | |
int | ixmlDocument_importNode (IXML_Document *doc, IXML_Node *importNode, BOOL deep, IXML_Node **rtNode) |
Imports a Node from another Document into this Document. | |
Interface Element | |
The Element interface represents an element in an XML document. Only Elements are allowed to have attributes, which are stored in the | |
void | ixmlElement_init (IXML_Element *element) |
Initializes a IXML_Element node. | |
const char * | ixmlElement_getTagName (IXML_Element *element) |
Returns the name of the tag as a constant string. | |
const char * | ixmlElement_getAttribute (IXML_Element *element, const char *name) |
Retrieves an attribute of an Element by name. | |
int | ixmlElement_setAttribute (IXML_Element *element, const char *name, const char *value) |
Adds a new attribute to an Element. | |
int | ixmlElement_removeAttribute (IXML_Element *element, const char *name) |
Removes an attribute value by name. The attribute node is not removed. | |
IXML_Attr * | ixmlElement_getAttributeNode (IXML_Element *element, const char *name) |
Retrieves an attribute node by name. See ixmlElement_getAttributeNodeNS to retrieve an attribute node using a qualified name or namespace URI. | |
int | ixmlElement_setAttributeNode (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr) |
Adds a new attribute node to an Element. | |
int | ixmlElement_removeAttributeNode (IXML_Element *element, IXML_Attr *oldAttr, IXML_Attr **rtAttr) |
Removes the specified attribute node from an Element. | |
IXML_NodeList * | ixmlElement_getElementsByTagName (IXML_Element *element, const char *tagName) |
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a pre-order traversal of this Element tree. | |
const char * | ixmlElement_getAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localname) |
Retrieves an attribute value using the local name and namespace URI. | |
int | ixmlElement_setAttributeNS (IXML_Element *element, const char *namespaceURI, const char *qualifiedName, const char *value) |
Adds a new attribute to an Element using the local name and namespace URI. | |
int | ixmlElement_removeAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localName) |
Removes an attribute using the namespace URI and local name. | |
IXML_Attr * | ixmlElement_getAttributeNodeNS (IXML_Element *element, const char *namespaceURI, const char *localName) |
Retrieves an Attr node by local name and namespace URI. | |
int | ixmlElement_setAttributeNodeNS (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rcAttr) |
Adds a new attribute node to the element node specified. | |
IXML_NodeList * | ixmlElement_getElementsByTagNameNS (IXML_Element *element, const char *namespaceURI, const char *localName) |
Returns a NodeList of all descendant Elements with a given local name and namespace in the order in which they are encountered in the pre-order traversal of the Element tree. | |
BOOL | ixmlElement_hasAttribute (IXML_Element *element, const char *name) |
Queries whether the Element has an attribute with the given name or a default value. | |
BOOL | ixmlElement_hasAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localName) |
Queries whether the Element has an attribute with the given local name and namespace URI or has a default value for that attribute. | |
void | ixmlElement_free (IXML_Element *element) |
Frees the given Element and any subtree of the Element. | |
Interface NamedNodeMap | |
A NamedNodeMap object represents a list of objects that can be accessed by name. A NamedNodeMap maintains the objects in no particular order. The Node interface uses a NamedNodeMap to maintain the attributes of a node. | |
unsigned long | ixmlNamedNodeMap_getLength (IXML_NamedNodeMap *nnMap) |
Returns the number of items contained in this NamedNodeMap. | |
IXML_Node * | ixmlNamedNodeMap_getNamedItem (IXML_NamedNodeMap *nnMap, const char *name) |
Retrieves a Node from the NamedNodeMap by name. | |
IXML_Node * | ixmlNamedNodeMap_setNamedItem (IXML_NamedNodeMap *nnMap, IXML_Node *arg) |
Adds a new Node to the NamedNodeMap using the Node name attribute. | |
IXML_Node * | ixmlNamedNodeMap_removeNamedItem (IXML_NamedNodeMap *nnMap, const char *name) |
Removes a Node from a NamedNodeMap specified by name. | |
IXML_Node * | ixmlNamedNodeMap_item (IXML_NamedNodeMap *nnMap, unsigned long index) |
Retrieves the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns NULL. | |
IXML_Node * | ixmlNamedNodeMap_getNamedItemNS (IXML_NamedNodeMap *nnMap, const char **namespaceURI, const char *localName) |
Retrieves a Node from a NamedNodeMap specified by namespace URI and local name. | |
IXML_Node * | ixmlNamedNodeMap_setNamedItemNS (IXML_NamedNodeMap *nnMap, IXML_Node *arg) |
Adds a new Node to the NamedNodeMap using the Node local name and namespace URI attributes. | |
IXML_Node * | ixmlNamedNodeMap_removeNamedItemNS (IXML_NamedNodeMap *nnMap, const char *namespaceURI, const char *localName) |
Removes a Node from a NamedNodeMap specified by namespace URI and local name. | |
void | ixmlNamedNodeMap_free (IXML_NamedNodeMap *nnMap) |
Frees a NamedNodeMap. | |
Interface NodeList | |
The NodeList interface abstracts an ordered collection of nodes. Note that changes to the underlying nodes will change the nodes contained in a NodeList. The DOM2-Core refers to this as being live. | |
IXML_Node * | ixmlNodeList_item (IXML_NodeList *nList, unsigned long index) |
Retrieves a Node from a NodeList specified by a numerical index. | |
unsigned long | ixmlNodeList_length (IXML_NodeList *nList) |
Returns the number of Nodes in a NodeList. | |
void | ixmlNodeList_free (IXML_NodeList *nList) |
Frees a NodeList object. | |
IXML API | |
The IXML API contains utility functions that are not part of the standard DOM interfaces. They include functions to create a DOM structure from a file or buffer, create an XML file from a DOM structure, and manipulate DOMString objects. | |
char * | ixmlPrintDocument (IXML_Document *doc) |
Renders a Node and all sub-elements into an XML document representation. | |
char * | ixmlPrintNode (IXML_Node *doc) |
Renders a Node and all sub-elements into an XML text representation. | |
char * | ixmlDocumenttoString (IXML_Document *doc) |
Renders a Node and all sub-elements into an XML document representation. | |
char * | ixmlNodetoString (IXML_Node *doc) |
Renders a Node and all sub-elements into an XML text representation. The caller is required to free the DOMString returned from this function using ixmlFreeDOMString when it is no longer required. | |
void | ixmlRelaxParser (char errorChar) |
Makes the XML parser more tolerant to malformed text. | |
IXML_Document * | ixmlParseBuffer (const char *buffer) |
Parses an XML text buffer converting it into an IXML DOM representation. | |
int | ixmlParseBufferEx (const char *buffer, IXML_Document **doc) |
Parses an XML text buffer converting it into an IXML DOM representation. | |
IXML_Document * | ixmlLoadDocument (const char *xmlFile) |
Parses an XML text file converting it into an IXML DOM representation. | |
int | ixmlLoadDocumentEx (const char *xmlFile, IXML_Document **doc) |
Parses an XML text file converting it into an IXML DOM representation. | |
char * | ixmlCloneDOMString (const char *src) |
Clones an existing DOMString. | |
void | ixmlFreeDOMString (char *buf) |
Frees a DOMString. |
#define DOMString char * |
The type of DOM strings.
Referenced by AdvertiseAndReply(), check_soap_body(), genaInitNotify(), genaInitNotifyExt(), genaNotifyAll(), genaNotifyAllExt(), get_action_node(), get_var_name(), getElementValue(), getSubElement(), ixmlNode_getElementsByTagNameNS(), ixmlNode_getElementsByTagNameNSRecursive(), ixmlNode_getNamespaceURI(), ixmlNode_getPrefix(), printNodes(), removeServiceTable(), UpnpSendActionAsync(), and UpnpSendActionExAsync().
typedef struct _IXML_ATTR IXML_Attr |
Data structure representing an Attribute node.
typedef struct _IXML_CDATASection IXML_CDATASection |
Data structure representing a CDATA section node.
typedef struct _IXML_Document IXML_Document |
Data structure representing the DOM Document.
typedef struct _IXML_Element IXML_Element |
Data structure representing an Element node.
typedef struct _IXML_NamedNodeMap IXML_NamedNodeMap |
Data structure representing a list of named nodes.
typedef struct _IXML_Node IXML_Node |
Data structure common to all types of nodes.
typedef struct _IXML_NodeList IXML_NodeList |
Data structure representing a list of nodes.
typedef struct _IXML_Text IXML_Text |
Data structure representing a Text node.
enum IXML_ERRORCODE |
Error codes returned by the XML API, see the DOM spec.
enum IXML_NODE_TYPE |
The type of the DOM node.
void ixmlAttr_free | ( | IXML_Attr * | attrNode | ) |
Frees an Attr node.
attrNode | The Attr node to free. |
Referenced by ixmlDocument_createAttributeEx(), ixmlElement_setAttributeNode(), ixmlNode_cloneAttr(), and Parser_processAttributeName().
void ixmlCDATASection_free | ( | IXML_CDATASection * | nodeptr | ) |
Frees a CDATASection node.
nodeptr | The CDATASection node to free. |
References ixmlNode_free().
Referenced by ixmlNode_cloneCDATASect().
void ixmlCDATASection_init | ( | IXML_CDATASection * | nodeptr | ) |
Initializes a CDATASection node.
[in] | nodeptr | The CDATA Section Node to iniatialize. |
Referenced by ixmlNode_cloneCDATASect().
char* ixmlCloneDOMString | ( | const char * | src | ) |
Clones an existing DOMString.
NULL
if the operation could not be completed. [in] | src | The source DOMString to clone. |
Referenced by addServiceTable(), GeneratePropertySet(), get_content_type(), getElementValue(), getServiceTable(), process_request(), and TvDeviceHandleGetVarRequest().
IXML_Attr* ixmlDocument_createAttribute | ( | IXML_Document * | doc, |
const char * | name | ||
) |
Creates a new Attr node with the given name.
NULL
on failure.The value of the attribute is the empty string.
[in] | doc | The owner Document of the new node. |
[in] | name | The name of the new attribute. |
References ixmlDocument_createAttributeEx().
int ixmlDocument_createAttributeEx | ( | IXML_Document * | doc, |
const char * | name, | ||
IXML_Attr ** | attrNode | ||
) |
Creates a new Attr node with the given name.
The ixmlDocument_createAttributeEx API differs from the ixmlDocument_createAttribute API in that it returns an error code describing the reason for failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc or name is NULL
. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | doc | The owner Document of the new node. |
[in] | name | The name of the new attribute. |
[out] | attrNode | A pointer to a Attr where the new object will be stored. |
References ixmlAttr_free().
Referenced by ixmlDocument_createAttribute(), and Parser_processAttributeName().
IXML_Attr* ixmlDocument_createAttributeNS | ( | IXML_Document * | doc, |
const char * | namespaceURI, | ||
const char * | qualifiedName | ||
) |
Creates a new Attribute node with the given qualified name and namespace URI.
NULL
on failure. [in] | doc | The owner Document of the new Attribute. |
[in] | namespaceURI | The namespace URI for the attribute. |
[in] | qualifiedName | The qualified name of the attribute. |
int ixmlDocument_createAttributeNSEx | ( | IXML_Document * | doc, |
const char * | namespaceURI, | ||
const char * | qualifiedName, | ||
IXML_Attr ** | attrNode | ||
) |
Creates a new Attr node with the given qualified name and namespace URI.
The ixmlDocument_createAttributeNSEx API differs from the ixmlDocument_createAttributeNS API in that it returns an error code describing the reason for failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc, namespaceURI, or qualifiedName is NULL
. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | doc | The owner Document of the new Attr. |
[in] | namespaceURI | The namespace URI for the attribute. |
[in] | qualifiedName | The qualified name of the attribute. |
[out] | attrNode | A pointer to an Attr where the new object will be stored. |
IXML_CDATASection* ixmlDocument_createCDATASection | ( | IXML_Document * | doc, |
const char * | data | ||
) |
Creates a new CDATASection node with given data.
NULL
on failure. [in] | doc | The owner Document of the new node. |
[in] | data | The data to associate with the new CDATASection node. |
int ixmlDocument_createCDATASectionEx | ( | IXML_Document * | doc, |
const char * | data, | ||
IXML_CDATASection ** | cdNode | ||
) |
Creates a new CDATASection node with given data.
The ixmlDocument_createCDATASectionEx API differs from the ixmlDocument_createCDATASection API in that it returns an error code describing the reason for failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc or data is NULL
. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | doc | The owner Document of the new node. |
[in] | data | The data to associate with the new CDATASection node. |
[out] | cdNode | A pointer to a Node where the new object will be stored. |
Referenced by Parser_parseDocument().
IXML_Document* ixmlDocument_createDocument | ( | void | ) |
Creates a new empty Document node.
NULL
on failure. References ixmlDocument_createDocumentEx().
int ixmlDocument_createDocumentEx | ( | IXML_Document ** | doc | ) |
Creates a new empty Document node.
The ixmlDocument_createDocumentEx API differs from the ixmlDocument_createDocument API in that it returns an error code describing the reason for the failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [out] | doc | Pointer to a Document where the new object will be stored. |
References ixmlDocument_free(), and ixmlDocument_init().
Referenced by ixmlDocument_createDocument(), and Parser_parseDocument().
IXML_Element* ixmlDocument_createElement | ( | IXML_Document * | doc, |
const char * | tagName | ||
) |
Creates a new Element node with the given tag name.
The new Element node has a nodeName
of tagName and the localName
, prefix
, and namespaceURI
set to NULL
. To create an Element with a namespace, see ixmlDocument_createElementNS.
NULL
, or NULL
on failure. [in] | doc | The owner Document of the new node. |
[in] | tagName | The tag name of the new Element node (case-sensitive). |
Referenced by addToAction(), makeAction(), UpnpAddToPropertySet(), and UpnpCreatePropertySet().
int ixmlDocument_createElementEx | ( | IXML_Document * | doc, |
const char * | tagName, | ||
IXML_Element ** | rtElement | ||
) |
Creates a new Element node with the given tag name.
The new Element node has a nodeName
of tagName and the localName
, prefix
, and namespaceURI
set to NULL
. To create an Element with a namespace, see ixmlDocument_createElementNS.
The ixmlDocument_createElementEx API differs from the ixmlDocument_createElement API in that it returns an error code describing the reason for failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc or tagName is NULL
. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | doc | The owner Document of the new node. |
[in] | tagName | The tag name of the new Element node. |
[out] | rtElement | Pointer to an Element where the new object will be stored. |
Referenced by Parser_processElementName().
IXML_Element* ixmlDocument_createElementNS | ( | IXML_Document * | doc, |
const char * | namespaceURI, | ||
const char * | qualifiedName | ||
) |
Creates a new Element node in the given qualified name and namespace URI.
NULL
on failure. [in] | doc | The owner Document of the new node. |
[in] | namespaceURI | The namespace URI for the new Element. |
[in] | qualifiedName | The qualified name of the new Element. |
int ixmlDocument_createElementNSEx | ( | IXML_Document * | doc, |
const char * | namespaceURI, | ||
const char * | qualifiedName, | ||
IXML_Element ** | rtElement | ||
) |
Creates a new Element node in the given qualified name and namespace URI.
The ixmlDocument_createElementNSEx API differs from the ixmlDocument_createElementNS API in that it returns an error code describing the reason for failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc, namespaceURI, or qualifiedName is NULL
. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | doc | The owner Document of the new node. |
[in] | namespaceURI | The namespace URI for the new Element. |
[in] | qualifiedName | The qualified name of the new Element. |
[out] | rtElement | A pointer to an Element where the new object will be stored. |
IXML_Node* ixmlDocument_createTextNode | ( | IXML_Document * | doc, |
const char * | data | ||
) |
Creates a new Text node with the given data.
NULL
on failure. [in] | doc | The owner Document of the new node. |
[in] | data | The data to associate with the new Text node. It is stored in the nodeValue field. |
Referenced by addToAction(), makeAction(), UpnpAddToPropertySet(), and UpnpCreatePropertySet().
int ixmlDocument_createTextNodeEx | ( | IXML_Document * | doc, |
const char * | data, | ||
IXML_Node ** | textNode | ||
) |
Creates a new Text node with the given data.
The ixmlDocument_createTextNodeEx() API differs from the ixmlDocument_createTextNode API in that it returns an error code describing the reason for failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc or data is NULL
. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | doc | The owner Document of the new node. |
[in] | data | The data to associate with the new Text node. It is stored in nodeValue field. |
[out] | textNode | A pointer to a Node where the new object will be stored. |
Referenced by Parser_parseDocument().
void ixmlDocument_free | ( | IXML_Document * | doc | ) |
Frees a Document object and all Nodes associated with it.
Any Nodes extracted via any other interface function, e.g. ixmlDocument_GetElementById, become invalid after this call unless explicitly cloned.
[in] | doc | The Document to free. |
References ixmlNode_free().
Referenced by gena_process_notification_event(), handle_invoke_action(), ixmlDocument_createDocumentEx(), ixmlNode_newDoc(), Parser_parseDocument(), soap_device_callback(), TvDeviceStateTableInit(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice4(), UpnpSendActionExAsync(), UpnpThreadDistribution(), and UpnpUnRegisterRootDeviceLowPower().
IXML_Element* ixmlDocument_getElementById | ( | IXML_Document * | doc, |
const char * | tagName | ||
) |
Returns the Element whose ID
matches that given id.
NULL
on an error. [in] | doc | The owner Document of the Element. |
[in] | tagName | The name of the Element. |
IXML_NodeList* ixmlDocument_getElementsByTagName | ( | IXML_Document * | doc, |
const char * | tagName | ||
) |
Returns a NodeList of all Elements that match the given tag name in the order in which they were encountered in a preorder traversal of the Document tree.
NULL
on an error. [in] | doc | The Document to search. |
[in] | tagName | The tag name to find. The special value "*" matches all tags. |
Referenced by SampleUtil_GetFirstDocumentItem(), SampleUtil_GetFirstServiceList(), TvStateUpdate(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), and UpnpRegisterRootDevice4().
IXML_NodeList* ixmlDocument_getElementsByTagNameNS | ( | IXML_Document * | doc, |
const char * | namespaceURI, | ||
const char * | localName | ||
) |
Returns a NodeList of Elements that match the given local name and namespace URI in the order they are encountered in a preorder traversal of the Document tree.
Either namespaceURI or localName can be the special "*"
character, which matches any namespace or any local name respectively.
NULL
on an error. [in] | doc | The Document to search. |
[in] | namespaceURI | The namespace of the elements to find or "*" to match any namespace. |
[in] | localName | The local name of the elements to find or "*" to match any local name. |
Referenced by check_soap_body().
int ixmlDocument_importNode | ( | IXML_Document * | doc, |
IXML_Node * | importNode, | ||
BOOL | deep, | ||
IXML_Node ** | rtNode | ||
) |
Imports a Node from another Document into this Document.
The returned new Node does not a have parent node (parentNode is null): it is a clone of the original Node with the ownerDocument
set to doc. The source node is not altered or removed from the original document.
For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's nodeName and nodeType, plus the attributes related to namespaces (prefix, localName, and namespaceURI).
As in the cloneNode operation on a node, the source node is not altered.
The deep parameter controls whether all the children of the Node are imported.
Refer to the DOM2-Core recommendation for details on importing specific node types.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either doc or importNode is not a valid pointer. IXML_NOT_SUPPORTED_ERR:
importNode is a Document, which cannot be imported. IXML_FAILED:
The import operation failed because the Node to be imported could not be cloned. [in] | doc | The Document into which to import. |
[in] | importNode | The Node to import. |
[in] | deep | TRUE to import all children of importNode or FALSE to import only the root node. |
[out] | rtNode | A pointer to a new Node owned by doc. |
References ixmlDocument_setOwnerDocument(), ixmlNode_cloneNode(), and ixmlNode_getNodeType().
void ixmlDocument_init | ( | IXML_Document * | nodeptr | ) |
Initializes a Document node.
[in] | nodeptr | The Document node to initialize. |
Referenced by ixmlDocument_createDocumentEx(), and ixmlNode_newDoc().
char* ixmlDocumenttoString | ( | IXML_Document * | doc | ) |
Renders a Node and all sub-elements into an XML document representation.
The caller is required to free the DOMString returned from this function using ixmlFreeDOMString when it is no longer required.
Note that this function can be used for any Node-derived interface. The difference between ixmlDocumenttoString and ixmlNodetoString is ixmlDocumenttoString includes the XML prolog while ixmlNodetoString only produces XML elements. An XML document is not well formed unless it includes the prolog and at least one element.
NULL
on an error. [in] | doc | The root of the Node tree to render to XML text. |
References ixml_membuf_append_str(), ixml_membuf_init(), and ixmlDomTreetoString().
void ixmlElement_free | ( | IXML_Element * | element | ) |
Frees the given Element and any subtree of the Element.
[in] | element | The Element to free. |
References ixmlNode_free().
Referenced by ixmlNode_cloneElement(), and Parser_processElementName().
const char* ixmlElement_getAttribute | ( | IXML_Element * | element, |
const char * | name | ||
) |
Retrieves an attribute of an Element by name.
[in] | element | The Element from which to retrieve the attribute. |
[in] | name | The name of the attribute to retrieve. |
IXML_Attr* ixmlElement_getAttributeNode | ( | IXML_Element * | element, |
const char * | name | ||
) |
Retrieves an attribute node by name. See ixmlElement_getAttributeNodeNS to retrieve an attribute node using a qualified name or namespace URI.
NULL
on if there is no such attribute. [in] | element | The Element from which to get the attribute node. |
[in] | name | The name of the attribute node to find. |
IXML_Attr* ixmlElement_getAttributeNodeNS | ( | IXML_Element * | element, |
const char * | namespaceURI, | ||
const char * | localName | ||
) |
Retrieves an Attr node by local name and namespace URI.
NULL
if there is no such attribute. [in] | element | The Element from which to get the attribute. |
[in] | namespaceURI | The namespace URI of the attribute. |
[in] | localName | The local name of the attribute. |
const char* ixmlElement_getAttributeNS | ( | IXML_Element * | element, |
const char * | namespaceURI, | ||
const char * | localname | ||
) |
Retrieves an attribute value using the local name and namespace URI.
[in] | element | The Element from which to get the attribute value. |
[in] | namespaceURI | The namespace URI of the attribute. |
[in] | localname | The local name of the attribute. |
IXML_NodeList* ixmlElement_getElementsByTagName | ( | IXML_Element * | element, |
const char * | tagName | ||
) |
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a pre-order traversal of this Element tree.
NULL
on an error. [in] | element | The Element from which to start the search. |
[in] | tagName | The name of the tag for which to search. |
Referenced by AdvertiseAndReply(), removeServiceTable(), SampleUtil_GetFirstElementItem(), SampleUtil_GetFirstServiceList(), and TvStateUpdate().
IXML_NodeList* ixmlElement_getElementsByTagNameNS | ( | IXML_Element * | element, |
const char * | namespaceURI, | ||
const char * | localName | ||
) |
Returns a NodeList of all descendant Elements with a given local name and namespace in the order in which they are encountered in the pre-order traversal of the Element tree.
NULL
on an error. [in] | element | The Element from which to start the search. |
[in] | namespaceURI | The namespace URI of the Elements to find. The special value "*" matches all namespaces. |
[in] | localName | The local name of the Elements to find. The special value "*" matches all local names. |
Referenced by get_action_node().
const char* ixmlElement_getTagName | ( | IXML_Element * | element | ) |
Returns the name of the tag as a constant string.
[in] | element | The Element from which to retrieve the name. |
BOOL ixmlElement_hasAttribute | ( | IXML_Element * | element, |
const char * | name | ||
) |
Queries whether the Element has an attribute with the given name or a default value.
TRUE
if the Element has an attribute with this name or has a default value for that attribute, otherwise FALSE
. [in] | element | The Element on which to check for an attribute. |
[in] | name | The name of the attribute for which to check. |
BOOL ixmlElement_hasAttributeNS | ( | IXML_Element * | element, |
const char * | namespaceURI, | ||
const char * | localName | ||
) |
Queries whether the Element has an attribute with the given local name and namespace URI or has a default value for that attribute.
TRUE
if the Element has an attribute with the given namespace and local name or has a default value for that attribute, otherwise FALSE
. [in] | element | The Element on which to check for the attribute. |
[in] | namespaceURI | The namespace URI of the attribute. |
[in] | localName | The local name of the attribute. |
void ixmlElement_init | ( | IXML_Element * | element | ) |
Initializes a IXML_Element node.
[in] | element | The Element to initialize. |
Referenced by ixmlNode_cloneElement().
int ixmlElement_removeAttribute | ( | IXML_Element * | element, |
const char * | name | ||
) |
Removes an attribute value by name. The attribute node is not removed.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element or name is NULL
. [in] | element | The Element from which to remove the attribute. |
[in] | name | The name of the attribute to remove. |
int ixmlElement_removeAttributeNode | ( | IXML_Element * | element, |
IXML_Attr * | oldAttr, | ||
IXML_Attr ** | rtAttr | ||
) |
Removes the specified attribute node from an Element.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element or oldAttr is NULL
. IXML_NOT_FOUND_ERR:
oldAttr is not among the list attributes of element. [in] | element | The Element from which to remove the attribute. |
[in] | oldAttr | The attribute to remove from the Element. |
[out] | rtAttr | A pointer to an attribute in which to place the removed attribute. |
References ixmlElement_findAttributeNode().
int ixmlElement_removeAttributeNS | ( | IXML_Element * | element, |
const char * | namespaceURI, | ||
const char * | localName | ||
) |
Removes an attribute using the namespace URI and local name.
The replacing attribute has the same namespace URI and local name, as well as the original prefix.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element, namespaceURI, or localName is NULL
. [in] | element | The Element from which to remove the the attribute. |
[in] | namespaceURI | The namespace URI of the attribute. |
[in] | localName | The local name of the attribute. |
int ixmlElement_setAttribute | ( | IXML_Element * | element, |
const char * | name, | ||
const char * | value | ||
) |
Adds a new attribute to an Element.
If an attribute with the same name already exists in the element, the attribute value will be updated with the new value parameter. Otherwise, a new attribute is inserted into the element.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element, name, or value is NULL
. IXML_INVALID_CHARACTER_ERR:
name contains an illegal character. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete the operation. [in] | element | The Element on which to set the attribute. |
[in] | name | The name of the attribute. |
[in] | value | The value of the attribute. Note that this is a non-parsed string and any markup must be escaped. |
int ixmlElement_setAttributeNode | ( | IXML_Element * | element, |
IXML_Attr * | newAttr, | ||
IXML_Attr ** | rtAttr | ||
) |
Adds a new attribute node to an Element.
If an attribute already exists with newAttr as a name, it will be replaced with the new one and the old one will be returned in rtAttr.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element or newAttr is NULL
. IXML_WRONG_DOCUMENT_ERR:
newAttr does not belong to the same one as element. IXML_INUSE_ATTRIBUTE_ERR:
newAttr is already an attribute of another Element. [in] | element | The Element in which to add the new attribute. |
[in] | newAttr | The new Attr to add. |
[out] | rtAttr | A pointer to an Attr where the old Attr will be stored. This will have a NULL if no prior node existed. |
References ixmlAttr_free().
Referenced by Parser_processAttributeName().
int ixmlElement_setAttributeNodeNS | ( | IXML_Element * | element, |
IXML_Attr * | newAttr, | ||
IXML_Attr ** | rcAttr | ||
) |
Adds a new attribute node to the element node specified.
If an attribute with the same local name and namespace URI already exists in the Element, the existing attribute node is replaced with newAttr and the old returned in rcAttr.
The function return value is an integer representing one of the following:
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element or newAttr is NULL
. IXML_WRONG_DOCUMENT_ERR:
newAttr does not belong to the same document as element. IXML_INUSE_ATTRIBUTE_ERR:
newAttr already is an attribute of another Element. [in] | element | The Element in which to add the attribute node. |
[in] | newAttr | The new Attr to add. |
[out] | rcAttr | A pointer to the replaced Attr, if it exists. |
int ixmlElement_setAttributeNS | ( | IXML_Element * | element, |
const char * | namespaceURI, | ||
const char * | qualifiedName, | ||
const char * | value | ||
) |
Adds a new attribute to an Element using the local name and namespace URI.
If another attribute matches the same local name and namespace, the prefix is changed to be the prefix part of the qualifiedName
and the value is changed to value.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either element, namespaceURI, qualifiedName, or value is NULL
. IXML_INVALID_CHARACTER_ERR:
qualifiedName contains an invalid character. IXML_NAMESPACE_ERR:
Either the qualifiedName or namespaceURI is malformed. Refer to the DOM2-Core for possible reasons. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exist to complete the operation. IXML_FAILED:
The operation could not be completed. [in] | element | The Element on which to set the attribute. |
[in] | namespaceURI | The namespace URI of the new attribute. |
[in] | qualifiedName | The qualified name of the attribute. |
[in] | value | The new value for the attribute. |
void ixmlFreeDOMString | ( | char * | buf | ) |
Frees a DOMString.
[in] | buf | The DOMString to free. |
Referenced by free_notify_struct(), freeService(), freeServiceList(), freeServiceTable(), genaInitNotify(), genaInitNotifyExt(), genaNotifyAll(), genaNotifyAllExt(), get_action_node(), get_file_info(), handle_query_variable(), process_request(), removeServiceTable(), SampleUtil_PrintEvent(), send_action_response(), UpnpDownloadXmlDoc(), UpnpSendActionAsync(), and UpnpSendActionExAsync().
IXML_Document* ixmlLoadDocument | ( | const char * | xmlFile | ) |
Parses an XML text file converting it into an IXML DOM representation.
NULL
on an error. [in] | xmlFile | The filename of the XML text to convert to a Document. |
References ixmlLoadDocumentEx().
int ixmlLoadDocumentEx | ( | const char * | xmlFile, |
IXML_Document ** | doc | ||
) |
Parses an XML text file converting it into an IXML DOM representation.
The ixmlLoadDocumentEx API differs from the ixmlLoadDocument API in that it returns a an error code representing the actual failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
The xmlFile is not a valid pointer. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | xmlFile | The filename of the XML text to convert to a Document. |
[out] | doc | A pointer to the Document if file correctly parses or NULL on an error. |
References Parser_LoadDocument().
Referenced by ixmlLoadDocument().
void ixmlNamedNodeMap_free | ( | IXML_NamedNodeMap * | nnMap | ) |
Frees a NamedNodeMap.
The Nodes inside the map are not freed, just the NamedNodeMap object.
[in] | nnMap | The NamedNodeMap to free. |
Referenced by ixmlNode_getAttributes().
unsigned long ixmlNamedNodeMap_getLength | ( | IXML_NamedNodeMap * | nnMap | ) |
Returns the number of items contained in this NamedNodeMap.
[in] | nnMap | The NamedNodeMap from which to retrieve the size. |
IXML_Node* ixmlNamedNodeMap_getNamedItem | ( | IXML_NamedNodeMap * | nnMap, |
const char * | name | ||
) |
Retrieves a Node from the NamedNodeMap by name.
[in] | nnMap | The NamedNodeMap to search. |
[in] | name | The name of the Node to find. |
IXML_Node* ixmlNamedNodeMap_getNamedItemNS | ( | IXML_NamedNodeMap * | nnMap, |
const char ** | namespaceURI, | ||
const char * | localName | ||
) |
Retrieves a Node from a NamedNodeMap specified by namespace URI and local name.
NULL
if it wasn't nnMap | The NamedNodeMap from which to remove the Node. |
namespaceURI | The namespace URI of the Node to remove. |
localName | The local name of the Node to remove. |
IXML_Node* ixmlNamedNodeMap_item | ( | IXML_NamedNodeMap * | nnMap, |
unsigned long | index | ||
) |
Retrieves the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns NULL.
[in] | nnMap | The NamedNodeMap from which to remove the Node. |
[in] | index | The index into the map to remove. |
IXML_Node* ixmlNamedNodeMap_removeNamedItem | ( | IXML_NamedNodeMap * | nnMap, |
const char * | name | ||
) |
Removes a Node from a NamedNodeMap specified by name.
NULL
if it wasn't. nnMap | The NamedNodeMap from which to remove the item. |
name | The name of the item to remove. |
IXML_Node* ixmlNamedNodeMap_removeNamedItemNS | ( | IXML_NamedNodeMap * | nnMap, |
const char * | namespaceURI, | ||
const char * | localName | ||
) |
Removes a Node from a NamedNodeMap specified by namespace URI and local name.
NULL
if it wasn't. nnMap | The NamedNodeMap from which to remove the Node. |
namespaceURI | The namespace URI of the Node to remove. |
localName | The local name of the Node to remove. |
IXML_Node* ixmlNamedNodeMap_setNamedItem | ( | IXML_NamedNodeMap * | nnMap, |
IXML_Node * | arg | ||
) |
Adds a new Node to the NamedNodeMap using the Node name attribute.
NULL
if the Node was not in the NamedNodeMap before. nnMap | The NamedNodeMap in which to add the new Node. |
arg | The new Node to add to the NamedNodeMap. |
IXML_Node* ixmlNamedNodeMap_setNamedItemNS | ( | IXML_NamedNodeMap * | nnMap, |
IXML_Node * | arg | ||
) |
Adds a new Node to the NamedNodeMap using the Node local name and namespace URI attributes.
NULL
if the Node was not in the NamedNodeMap before. nnMap | The NamedNodeMap in which to add the Node. |
arg | The Node to add to the map. |
int ixmlNode_appendChild | ( | IXML_Node * | nodeptr, |
IXML_Node * | newChild | ||
) |
Appends a child Node to the list of children of a Node.
If newChild is already in the tree, it is removed first.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either nodeptr or newChild is NULL
. IXML_HIERARCHY_REQUEST_ERR:
newChild is of a type that cannot be added as a child of nodeptr or newChild is an ancestor of nodeptr. IXML_WRONG_DOCUMENT_ERR:
newChild was created from a different document than nodeptr. IXML_NO_MODIFICATION_ALLOWED_ERR:
nodeptr is a read-only Node. [in] | nodeptr | The Node in which to append the new child. |
[in] | newChild | The new child to append. |
References FALSE, ixmlNode_allowChildren(), ixmlNode_isAncestor(), ixmlNode_isParent(), and ixmlNode_removeChild().
Referenced by addToAction(), ixmlNode_insertBefore(), makeAction(), Parser_parseDocument(), Parser_processElementName(), UpnpAddToPropertySet(), and UpnpCreatePropertySet().
IXML_Node* ixmlNode_cloneNode | ( | IXML_Node * | nodeptr, |
BOOL | deep | ||
) |
Clones a Node.
The new Node does not have a parent. The deep parameter controls whether the subtree of the Node is also cloned.
For details on cloning specific types of Nodes, refer to the DOM2-Core recommendation.
NULL
. [in] | nodeptr | The Node to clone. |
[in] | deep | TRUE to clone the subtree also or FALSE to clone only nodeptr. |
References ixmlNode_cloneAttrDirect(), and ixmlNode_cloneNodeTree().
Referenced by ixmlDocument_importNode().
void ixmlNode_free | ( | IXML_Node * | nodeptr | ) |
Frees a Node and all Nodes in its subtree.
[in] | nodeptr | The Node tree to free. |
References ixmlNode_free(), and ixmlNode_freeSingleNode().
Referenced by ixmlCDATASection_free(), ixmlDocument_free(), ixmlElement_free(), ixmlNode_cloneTextNode(), ixmlNode_free(), and ixmlNode_removeChild().
IXML_NamedNodeMap* ixmlNode_getAttributes | ( | IXML_Node * | nodeptr | ) |
Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.
NULL
. [in] | nodeptr | The Node from which to retrieve the attributes. |
References ixmlNamedNodeMap_addToNamedNodeMap(), ixmlNamedNodeMap_free(), and ixmlNamedNodeMap_init().
IXML_NodeList* ixmlNode_getChildNodes | ( | IXML_Node * | nodeptr | ) |
Retrieves the list of children of a Node in a NodeList structure.
If a Node has no children, ixmlNode_getChildNodes returns a NodeList structure that contains no Nodes.
[in] | nodeptr | The Node from which to retrieve the children. |
References ixmlNodeList_addToNodeList(), ixmlNodeList_free(), and ixmlNodeList_init().
Referenced by printNodes().
IXML_Node* ixmlNode_getFirstChild | ( | IXML_Node * | nodeptr | ) |
Retrieves the first child Node of a Node.
NULL
if the Node does not have any children. [in] | nodeptr | The Node from which to retrieve the first child. |
Referenced by addToAction(), AdvertiseAndReply(), check_soap_body(), get_action_node(), get_var_name(), getElementValue(), getSubElement(), ixmlDocument_setOwnerDocument(), ixmlDomTreetoString(), ixmlNode_getElementsByTagName(), ixmlNode_getElementsByTagNameNS(), ixmlNode_getElementsByTagNameNSRecursive(), ixmlNode_getElementsByTagNameRecursive(), ixmlPrintDomTree(), ixmlPrintDomTreeRecursive(), makeAction(), SampleUtil_GetElementValue(), SampleUtil_GetFirstDocumentItem(), SampleUtil_GetFirstElementItem(), UpnpAddToPropertySet(), and UpnpCreatePropertySet().
IXML_Node* ixmlNode_getLastChild | ( | IXML_Node * | nodeptr | ) |
Retrieves the last child Node of a Node.
NULL
if the Node does not have any children. [in] | nodeptr | The Node from which to retrieve the last child. |
const char* ixmlNode_getLocalName | ( | IXML_Node * | nodeptr | ) |
Retrieves the local name of a Node, if present.
The local name is the tag name without the namespace prefix. Only Nodes of type eELEMENT_NODE
or eATTRIBUTE_NODE
can have a local name. Nodes created through the Document interface will only contain a local name if created using ixmlDocument_createElementNS.
NULL
. [in] | nodeptr | The Node from which to retrieve the local name. |
Referenced by check_soap_body(), ixmlNode_getElementsByTagNameNS(), and ixmlNode_getElementsByTagNameNSRecursive().
const char* ixmlNode_getNamespaceURI | ( | IXML_Node * | nodeptr | ) |
Retrieves the namespace URI for a Node as a DOMString.
Only Nodes of type eELEMENT_NODE
or eATTRIBUTE_NODE
can have a namespace URI. Nodes created through the Document interface will only contain a namespace if created using ixmlDocument_createElementNS.
NULL
. [in] | nodeptr | The Node for which to retrieve the namespace. |
References DOMString.
Referenced by check_soap_body(), ixmlNode_getElementsByTagNameNS(), and ixmlNode_getElementsByTagNameNSRecursive().
IXML_Node* ixmlNode_getNextSibling | ( | IXML_Node * | nodeptr | ) |
Retrieves the sibling Node immediately following this Node.
NULL
if no such Node exists. [in] | nodeptr | The Node from which to retrieve the next sibling. |
Referenced by AdvertiseAndReply(), getSubElement(), ixmlDocument_setOwnerDocument(), ixmlNode_getElementsByTagNameNSRecursive(), ixmlNode_getElementsByTagNameRecursive(), and ixmlPrintDomTreeRecursive().
const char* ixmlNode_getNodeName | ( | IXML_Node * | nodeptr | ) |
Returns the name of the Node, depending on what type of Node it is, in a read-only string.
Refer to the table in the DOM2-Core for a description of the node names for various interfaces.
[in] | nodeptr | Pointer to the node to retrieve the name. |
Referenced by AdvertiseAndReply(), get_action_node(), get_var_name(), getSubElement(), ixmlDomTreetoString(), ixmlNode_getElementsByTagName(), ixmlNode_getElementsByTagNameRecursive(), ixmlPrintDomTree(), ixmlPrintDomTreeRecursive(), and printNodes().
unsigned short ixmlNode_getNodeType | ( | IXML_Node * | nodeptr | ) |
Retrieves the type of a Node.
[in] | nodeptr | The Node from which to retrieve the type. |
Referenced by getElementValue(), getSubElement(), ixmlDocument_importNode(), ixmlDomTreetoString(), ixmlNode_getElementsByTagName(), ixmlNode_getElementsByTagNameNS(), ixmlNode_getElementsByTagNameNSRecursive(), ixmlNode_getElementsByTagNameRecursive(), ixmlPrintDomTree(), ixmlPrintDomTreeRecursive(), printNodes(), and SampleUtil_GetElementValue().
const char* ixmlNode_getNodeValue | ( | IXML_Node * | nodeptr | ) |
Returns the value of the Node as a string.
Note that this string is not a copy and modifying it will modify the value of the Node.
[in] | nodeptr | Pointer to the Node to retrieve the value. |
Referenced by AdvertiseAndReply(), get_var_name(), getElementValue(), ixmlDomTreetoString(), ixmlPrintDomTree(), ixmlPrintDomTreeRecursive(), printNodes(), SampleUtil_GetElementValue(), SampleUtil_GetFirstDocumentItem(), and SampleUtil_GetFirstElementItem().
IXML_Document* ixmlNode_getOwnerDocument | ( | IXML_Node * | nodeptr | ) |
Retrieves the document object associated with this Node.
This owner document Node allows other Nodes to be created in the context of this document. Note that Document nodes do not have an owner document.
NULL
, if the Node does not have an owner. [in] | nodeptr | The Node from which to retrieve the owner document. |
IXML_Node* ixmlNode_getParentNode | ( | IXML_Node * | nodeptr | ) |
Retrieves the parent Node for a Node.
NULL
if the Node has no parent. [in] | nodeptr | The Node from which to retrieve the parent. |
const char* ixmlNode_getPrefix | ( | IXML_Node * | nodeptr | ) |
Retrieves the namespace prefix, if present.
The prefix is the name used as an alias for the namespace URI for this element. Only Nodes of type eELEMENT_NODE
or eATTRIBUTE_NODE
can have a prefix. Nodes created through the Document interface will only contain a prefix if created using ixmlDocument_createElementNS.
NULL
. nodeptr | The Node from which to retrieve the prefix. |
References DOMString.
IXML_Node* ixmlNode_getPreviousSibling | ( | IXML_Node * | nodeptr | ) |
Retrieves the sibling Node immediately preceding this Node.
NULL
if no such Node exists. [in] | nodeptr | The Node for which to retrieve the previous sibling. |
BOOL ixmlNode_hasAttributes | ( | IXML_Node * | nodeptr | ) |
Queries whether this Node has attributes.
Note that only Element nodes have attributes.
TRUE
if the Node has attributes otherwise FALSE
. [in] | nodeptr | The Node to query for attributes. |
References FALSE.
BOOL ixmlNode_hasChildNodes | ( | IXML_Node * | nodeptr | ) |
Queries whether or not a Node has children.
TRUE
if the Node has one or more children otherwise FALSE
. [in] | nodeptr | The Node to query for children. |
References FALSE.
int ixmlNode_insertBefore | ( | IXML_Node * | nodeptr, |
IXML_Node * | newChild, | ||
IXML_Node * | refChild | ||
) |
Inserts a new child Node before the existing child Node.
refChild can be NULL
, which inserts newChild at the end of the list of children. Note that the Node (or Nodes) in newChild must already be owned by the owner document (or have no owner at all) of nodeptr for insertion. If not, the Node (or Nodes) must be imported into the document using ixmlDocument_importNode. If newChild is already in the tree, it is removed first.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either nodeptr or newChild is NULL
. IXML_HIERARCHY_REQUEST_ERR:
The type of the Node does not allow children of the type of newChild. IXML_WRONG_DOCUMENT_ERR:
newChild has an owner document that does not match the owner of nodeptr. IXML_NO_MODIFICATION_ALLOWED_ERR:
nodeptr is read-only or the parent of the Node being inserted is read-only. IXML_NOT_FOUND_ERR:
refChild is not a child of nodeptr. [in] | nodeptr | The parent of the Node before which to insert the new child. |
[in] | newChild | The Node to insert into the tree. |
[in] | refChild | The reference child where the new Node should be inserted. The new Node will appear directly before the reference child. |
References FALSE, ixmlNode_allowChildren(), ixmlNode_appendChild(), ixmlNode_isAncestor(), ixmlNode_isParent(), and ixmlNode_removeChild().
Referenced by ixmlNode_replaceChild().
int ixmlNode_removeChild | ( | IXML_Node * | nodeptr, |
IXML_Node * | oldChild, | ||
IXML_Node ** | returnNode | ||
) |
Removes a child from the list of children of a Node.
returnNode will contain the oldChild Node, appropriately removed from the tree (i.e. it will no longer have an owner document).
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
Either nodeptr or oldChild is NULL
. IXML_NO_MODIFICATION_ALLOWED_ERR:
nodeptr or its parent is read-only. IXML_NOT_FOUND_ERR:
oldChild is not among the children of nodeptr. [in] | nodeptr | The parent of the child to remove. |
[in] | oldChild | The child Node to remove. |
[out] | returnNode | Pointer to a Node to place the removed oldChild Node. |
References ixmlNode_free(), and ixmlNode_isParent().
Referenced by ixmlNode_appendChild(), ixmlNode_insertBefore(), and ixmlNode_replaceChild().
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.
If newChild is already in the tree, it will first be removed. returnNode will contain the oldChild Node, appropriately removed from the tree (i.e. it will no longer have an owner document).
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMTER:
Either nodeptr, newChild, or oldChild is NULL
. IXML_HIERARCHY_REQUEST_ERR:
The newChild is not a type of Node that can be inserted into this tree or newChild is an ancestor of nodePtr. IXML_WRONG_DOCUMENT_ERR:
newChild was created from a different document than nodeptr. IXML_NO_MODIFICATION_ALLOWED_ERR:
nodeptr or its parent is read-only. IXML_NOT_FOUND_ERR:
oldChild is not a child of nodeptr. [in] | nodeptr | The parent of the Node which contains the child to replace. |
[in] | newChild | The child with which to replace oldChild. |
[in] | oldChild | The child to replace with newChild. |
[out] | returnNode | Pointer to a Node to place the removed oldChild Node. |
References FALSE, ixmlNode_allowChildren(), ixmlNode_insertBefore(), ixmlNode_isAncestor(), ixmlNode_isParent(), and ixmlNode_removeChild().
int ixmlNode_setNodeValue | ( | IXML_Node * | nodeptr, |
const char * | newNodeValue | ||
) |
Assigns a new value to a Node.
The newNodeValue string is duplicated and stored in the Node so that the original does not have to persist past this call.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
The Node * is not a valid pointer. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | nodeptr | The Node to which to assign a new value. |
[in] | newNodeValue | The new value of the Node. |
Referenced by ixmlNode_cloneAttr(), ixmlNode_cloneCDATASect(), ixmlNode_cloneElement(), ixmlNode_cloneTextNode(), and ixmlNode_setNodeProperties().
void ixmlNodeList_free | ( | IXML_NodeList * | nList | ) |
Frees a NodeList object.
Since the underlying Nodes are references, they are not freed using this operation. This only frees the NodeList object.
[in] | nList | The NodeList to free. |
Referenced by AdvertiseAndReply(), check_soap_body(), get_action_node(), ixmlNode_getChildNodes(), removeServiceTable(), SampleUtil_FindAndParseService(), SampleUtil_GetFirstDocumentItem(), SampleUtil_GetFirstElementItem(), SampleUtil_GetFirstServiceList(), TvStateUpdate(), and UpnpUnRegisterRootDeviceLowPower().
IXML_Node* ixmlNodeList_item | ( | IXML_NodeList * | nList, |
unsigned long | index | ||
) |
Retrieves a Node from a NodeList specified by a numerical index.
NULL
if there was an error. [in] | nList | The NodeList from which to retrieve the Node. |
[in] | index | The index into the NodeList to retrieve. |
References ixmlNodeList_length().
Referenced by AdvertiseAndReply(), check_soap_body(), get_action_node(), printNodes(), SampleUtil_FindAndParseService(), SampleUtil_GetFirstDocumentItem(), SampleUtil_GetFirstElementItem(), SampleUtil_GetFirstServiceList(), and TvStateUpdate().
unsigned long ixmlNodeList_length | ( | IXML_NodeList * | nList | ) |
Returns the number of Nodes in a NodeList.
[in] | nList | The NodeList for which to retrieve the number of Nodes. |
Referenced by ixmlNodeList_item(), removeServiceTable(), SampleUtil_FindAndParseService(), SampleUtil_GetFirstServiceList(), and TvStateUpdate().
char* ixmlNodetoString | ( | IXML_Node * | doc | ) |
Renders a Node and all sub-elements into an XML text representation. The caller is required to free the DOMString returned from this function using ixmlFreeDOMString when it is no longer required.
Note that this function can be used for any Node-derived interface. The difference between ixmlNodetoString and ixmlDocumenttoString is ixmlNodetoString does not include the XML prolog, it only produces XML elements.
NULL
on an error. [in] | doc | The root of the Node tree to render to XML text. |
References ixml_membuf_init(), and ixmlDomTreetoString().
IXML_Document* ixmlParseBuffer | ( | const char * | buffer | ) |
Parses an XML text buffer converting it into an IXML DOM representation.
NULL
on an error. [in] | buffer | The buffer that contains the XML text to convert to a Document. |
References ixmlParseBufferEx().
int ixmlParseBufferEx | ( | const char * | buffer, |
IXML_Document ** | doc | ||
) |
Parses an XML text buffer converting it into an IXML DOM representation.
The ixmlParseBufferEx API differs from the ixmlParseBuffer API in that it returns an error code representing the actual failure rather than just NULL
.
IXML_SUCCESS:
The operation completed successfully. IXML_INVALID_PARAMETER:
The buffer is not a valid pointer. IXML_INSUFFICIENT_MEMORY:
Not enough free memory exists to complete this operation. [in] | buffer | The buffer that contains the XML text to convert to a Document. |
[out] | doc | A point to store the Document if file correctly parses or NULL on an error. |
References FALSE, and Parser_LoadDocument().
Referenced by addToAction(), gena_process_notification_event(), get_action_node(), ixmlParseBuffer(), makeAction(), soap_device_callback(), UpnpAddToPropertySet(), UpnpCreatePropertySet(), UpnpDownloadXmlDoc(), UpnpSendActionAsync(), and UpnpSendActionExAsync().
char* ixmlPrintDocument | ( | IXML_Document * | doc | ) |
Renders a Node and all sub-elements into an XML document representation.
The caller is required to free the DOMString returned from this function using ixmlFreeDOMString when it is no longer required.
Note that this function can be used for any Node-derived interface. The difference between ixmlPrintDocument and ixmlPrintNode is ixmlPrintDocument includes the XML prolog while ixmlPrintNode only produces XML elements. An XML document is not well formed unless it includes the prolog and at least one element.
This function introduces lots of white space to print the DOMString in readable format.
NULL
on an error. [in] | doc | The document node to print. |
References ixml_membuf_append_str(), ixml_membuf_init(), and ixmlPrintDomTree().
char* ixmlPrintNode | ( | IXML_Node * | doc | ) |
Renders a Node and all sub-elements into an XML text representation.
The caller is required to free the DOMString returned from this function using ixmlFreeDOMString when it is no longer required.
Note that this function can be used for any Node-derived interface. A similar ixmlPrintDocument function is defined to avoid casting when printing whole documents. This function introduces lots of white space to print the DOMString in readable format.
NULL
on an error. [in] | doc | The root of the Node tree to render to XML text. |
References ixml_membuf_init(), and ixmlPrintDomTree().
Referenced by genaInitNotifyExt(), genaNotifyAllExt(), get_action_node(), SampleUtil_PrintEvent(), send_action_response(), UpnpDownloadXmlDoc(), UpnpSendActionAsync(), and UpnpSendActionExAsync().
void ixmlRelaxParser | ( | char | errorChar | ) |
Makes the XML parser more tolerant to malformed text.
[in] | errorChar | If errorChar is 0 (default), the parser is strict about XML encoding : invalid UTF-8 sequences or "&" entities are rejected, and the parsing aborts. |
If errorChar is not 0, the parser is relaxed: invalid UTF-8 characters are replaced by the errorChar, and invalid "&" entities are left untranslated. The parsing is then allowed to continue.
References Parser_setErrorChar().