libUPnP 1.14.19
|
#include "UpnpGlobal.h"
Go to the source code of this file.
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... | |
Macros | |
#define | DOMString char * |
The type of DOM strings. | |
Functions | |
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. (Note: within the IXML library the NamedNodeMap and NodeList interfaces are the only interfaces that are not DOM objects and hence do not inherit from Node) | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC const char * | ixmlNode_getNodeValue (IXML_Node *nodeptr) |
Returns the value of the Node as a string. | |
UPNP_EXPORT_SPEC int | ixmlNode_setNodeValue (IXML_Node *nodeptr, const char *newNodeValue) |
Assigns a new value to a Node. | |
UPNP_EXPORT_SPEC unsigned short | ixmlNode_getNodeType (IXML_Node *nodeptr) |
Retrieves the type of a Node. Note that not all possible return values are actually implemented. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNode_getParentNode (IXML_Node *nodeptr) |
Retrieves the parent Node for a Node. | |
UPNP_EXPORT_SPEC IXML_NodeList * | ixmlNode_getChildNodes (IXML_Node *nodeptr) |
Retrieves the list of children of a Node in a NodeList structure. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNode_getFirstChild (IXML_Node *nodeptr) |
Retrieves the first child Node of a Node. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNode_getLastChild (IXML_Node *nodeptr) |
Retrieves the last child Node of a Node. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNode_getPreviousSibling (IXML_Node *nodeptr) |
Retrieves the sibling Node immediately preceding this Node. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNode_getNextSibling (IXML_Node *nodeptr) |
Retrieves the sibling Node immediately following this Node. | |
UPNP_EXPORT_SPEC IXML_NamedNodeMap * | ixmlNode_getAttributes (IXML_Node *nodeptr) |
Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure. | |
UPNP_EXPORT_SPEC IXML_Document * | ixmlNode_getOwnerDocument (IXML_Node *nodeptr) |
Retrieves the document object associated with this Node. | |
UPNP_EXPORT_SPEC const char * | ixmlNode_getNamespaceURI (IXML_Node *nodeptr) |
Retrieves the namespace URI for a Node as a DOMString. | |
UPNP_EXPORT_SPEC const char * | ixmlNode_getPrefix (IXML_Node *nodeptr) |
Retrieves the namespace prefix, if present. | |
UPNP_EXPORT_SPEC const char * | ixmlNode_getLocalName (IXML_Node *nodeptr) |
Retrieves the local name of a Node, if present. | |
UPNP_EXPORT_SPEC int | ixmlNode_insertBefore (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild) |
Inserts a new child Node before the existing child Node. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC int | ixmlNode_removeChild (IXML_Node *nodeptr, IXML_Node *oldChild, IXML_Node **returnNode) |
Removes a child from the list of children of a Node. | |
UPNP_EXPORT_SPEC int | ixmlNode_appendChild (IXML_Node *nodeptr, IXML_Node *newChild) |
Appends a child Node to the list of children of a Node. | |
UPNP_EXPORT_SPEC int | ixmlNode_hasChildNodes (IXML_Node *nodeptr) |
Queries whether or not a Node has children. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNode_cloneNode (IXML_Node *nodeptr, int deep) |
Clones a Node. | |
UPNP_EXPORT_SPEC int | ixmlNode_hasAttributes (IXML_Node *nodeptr) |
Queries whether this Node has attributes. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC void | ixmlCDATASection_init (IXML_CDATASection *nodeptr) |
Initializes a CDATASection node. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC void | ixmlDocument_init (IXML_Document *nodeptr) |
Initializes a Document node. | |
UPNP_EXPORT_SPEC int | ixmlDocument_createDocumentEx (IXML_Document **doc) |
Creates a new empty Document node. | |
UPNP_EXPORT_SPEC IXML_Document * | ixmlDocument_createDocument (void) |
Creates a new empty Document node. | |
UPNP_EXPORT_SPEC int | ixmlDocument_createElementEx (IXML_Document *doc, const char *tagName, IXML_Element **rtElement) |
Creates a new Element node with the given tag name. | |
UPNP_EXPORT_SPEC IXML_Element * | ixmlDocument_createElement (IXML_Document *doc, const char *tagName) |
Creates a new Element node with the given tag name. | |
UPNP_EXPORT_SPEC int | ixmlDocument_createTextNodeEx (IXML_Document *doc, const char *data, IXML_Node **textNode) |
Creates a new Text node with the given data. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlDocument_createTextNode (IXML_Document *doc, const char *data) |
Creates a new Text node with the given data. | |
UPNP_EXPORT_SPEC int | ixmlDocument_createCDATASectionEx (IXML_Document *doc, const char *data, IXML_CDATASection **cdNode) |
Creates a new CDATASection node with given data. | |
UPNP_EXPORT_SPEC IXML_CDATASection * | ixmlDocument_createCDATASection (IXML_Document *doc, const char *data) |
Creates a new CDATASection node with given data. | |
UPNP_EXPORT_SPEC IXML_Attr * | ixmlDocument_createAttribute (IXML_Document *doc, const char *name) |
Creates a new Attr node with the given name. | |
UPNP_EXPORT_SPEC int | ixmlDocument_createAttributeEx (IXML_Document *doc, const char *name, IXML_Attr **attrNode) |
Creates a new Attr node with the given name. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC IXML_Element * | ixmlDocument_getElementById (IXML_Document *doc, const char *tagName) |
Returns the Element whose ID matches that given id. | |
UPNP_EXPORT_SPEC void | ixmlDocument_free (IXML_Document *doc) |
Frees a Document object and all Nodes associated with it. | |
UPNP_EXPORT_SPEC int | ixmlDocument_importNode (IXML_Document *doc, IXML_Node *importNode, int 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 | |
UPNP_EXPORT_SPEC void | ixmlElement_init (IXML_Element *element) |
Initializes a IXML_Element node. | |
UPNP_EXPORT_SPEC const char * | ixmlElement_getTagName (IXML_Element *element) |
Returns the name of the tag as a constant string. | |
UPNP_EXPORT_SPEC const char * | ixmlElement_getAttribute (IXML_Element *element, const char *name) |
Retrieves an attribute of an Element by name. | |
UPNP_EXPORT_SPEC int | ixmlElement_setAttribute (IXML_Element *element, const char *name, const char *value) |
Adds a new attribute to an Element. | |
UPNP_EXPORT_SPEC int | ixmlElement_removeAttribute (IXML_Element *element, const char *name) |
Removes an attribute value by name. The attribute node is not removed. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC int | ixmlElement_setAttributeNode (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr) |
Adds a new attribute node to an Element. | |
UPNP_EXPORT_SPEC int | ixmlElement_removeAttributeNode (IXML_Element *element, IXML_Attr *oldAttr, IXML_Attr **rtAttr) |
Removes the specified attribute node from an Element. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC const char * | ixmlElement_getAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localname) |
Retrieves an attribute value using the local name and namespace URI. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC int | ixmlElement_removeAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localName) |
Removes an attribute using the namespace URI and local name. | |
UPNP_EXPORT_SPEC IXML_Attr * | ixmlElement_getAttributeNodeNS (IXML_Element *element, const char *namespaceURI, const char *localName) |
Retrieves an Attr node by local name and namespace URI. | |
UPNP_EXPORT_SPEC int | ixmlElement_setAttributeNodeNS (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rcAttr) |
Adds a new attribute node to the element node specified. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC int | ixmlElement_hasAttribute (IXML_Element *element, const char *name) |
Queries whether the Element has an attribute with the given name or a default value. | |
UPNP_EXPORT_SPEC int | 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC unsigned long | ixmlNamedNodeMap_getLength (IXML_NamedNodeMap *nnMap) |
Returns the number of items contained in this NamedNodeMap. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNamedNodeMap_getNamedItem (IXML_NamedNodeMap *nnMap, const char *name) |
Retrieves a Node from the NamedNodeMap by name. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNamedNodeMap_setNamedItem (IXML_NamedNodeMap *nnMap, IXML_Node *arg) |
Adds a new Node to the NamedNodeMap using the Node name attribute. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNamedNodeMap_removeNamedItem (IXML_NamedNodeMap *nnMap, const char *name) |
Removes a Node from a NamedNodeMap specified by name. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC IXML_Node * | ixmlNodeList_item (IXML_NodeList *nList, unsigned long index) |
Retrieves a Node from a NodeList specified by a numerical index. | |
UPNP_EXPORT_SPEC unsigned long | ixmlNodeList_length (IXML_NodeList *nList) |
Returns the number of Nodes in a NodeList. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC char * | ixmlPrintDocument (IXML_Document *doc) |
Renders a Node and all sub-elements into an XML document representation. | |
UPNP_EXPORT_SPEC char * | ixmlPrintNode (IXML_Node *doc) |
Renders a Node and all sub-elements into an XML text representation. | |
UPNP_EXPORT_SPEC char * | ixmlDocumenttoString (IXML_Document *doc) |
Renders a Node and all sub-elements into an XML document representation. | |
UPNP_EXPORT_SPEC 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. | |
UPNP_EXPORT_SPEC void | ixmlRelaxParser (char errorChar) |
Makes the XML parser more tolerant to malformed text. | |
UPNP_EXPORT_SPEC IXML_Document * | ixmlParseBuffer (const char *buffer) |
Parses an XML text buffer converting it into an IXML DOM representation. | |
UPNP_EXPORT_SPEC int | ixmlParseBufferEx (const char *buffer, IXML_Document **doc) |
Parses an XML text buffer converting it into an IXML DOM representation. | |
UPNP_EXPORT_SPEC IXML_Document * | ixmlLoadDocument (const char *xmlFile) |
Parses an XML text file converting it into an IXML DOM representation. | |
UPNP_EXPORT_SPEC int | ixmlLoadDocumentEx (const char *xmlFile, IXML_Document **doc) |
Parses an XML text file converting it into an IXML DOM representation. | |
UPNP_EXPORT_SPEC char * | ixmlCloneDOMString (const char *src) |
Clones an existing DOMString. | |
UPNP_EXPORT_SPEC void | ixmlFreeDOMString (char *buf) |
Frees a DOMString. | |
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. | |
#define | DOCUMENTNODENAME "#document" |
#define | TEXTNODENAME "#text" |
#define | CDATANODENAME "#cdata-section" |
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. | |