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

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. More...
#define | TRUE 1
#define | FALSE 0
#define | IN
#define | OUT
#define | INOUT

## Typedefs

typedef int | BOOL

## 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.
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. More...
const char * | ixmlNode_getNodeValue (IXML_Node *nodeptr)
| Returns the value of the Node as a string. More...
int | ixmlNode_setNodeValue (IXML_Node *nodeptr, const char *newNodeValue)
| Assigns a new value to a Node. More...
unsigned short | ixmlNode_getNodeType (IXML_Node *nodeptr)
| Retrieves the type of a Node. More...
IXML_Node * | ixmlNode_getParentNode (IXML_Node *nodeptr)
| Retrieves the parent Node for a Node. More...
IXML_NodeList * | ixmlNode_getChildNodes (IXML_Node *nodeptr)
| Retrieves the list of children of a Node in a NodeList structure. More...
IXML_Node * | ixmlNode_getFirstChild (IXML_Node *nodeptr)
| Retrieves the first child Node of a Node. More...
IXML_Node * | ixmlNode_getLastChild (IXML_Node *nodeptr)
| Retrieves the last child Node of a Node. More...
IXML_Node * | ixmlNode_getPreviousSibling (IXML_Node *nodeptr)
| Retrieves the sibling Node immediately preceding this Node. More...
IXML_Node * | ixmlNode_getNextSibling (IXML_Node *nodeptr)
| Retrieves the sibling Node immediately following this Node. More...
IXML_NamedNodeMap * | ixmlNode_getAttributes (IXML_Node *nodeptr)
| Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure. More...
IXML_Document * | ixmlNode_getOwnerDocument (IXML_Node *nodeptr)
| Retrieves the document object associated with this Node. More...
const char * | ixmlNode_getNamespaceURI (IXML_Node *nodeptr)
| Retrieves the namespace URI for a Node as a DOMString. More...
const char * | ixmlNode_getPrefix (IXML_Node *nodeptr)
| Retrieves the namespace prefix, if present. More...
const char * | ixmlNode_getLocalName (IXML_Node *nodeptr)
| Retrieves the local name of a Node, if present. More...
int | ixmlNode_insertBefore (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild)
| Inserts a new child Node before the existing child Node. More...
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. More...
int | ixmlNode_removeChild (IXML_Node *nodeptr, IXML_Node *oldChild, IXML_Node **returnNode)
| Removes a child from the list of children of a Node. More...
int | ixmlNode_appendChild (IXML_Node *nodeptr, IXML_Node *newChild)
| Appends a child Node to the list of children of a Node. More...
BOOL | ixmlNode_hasChildNodes (IXML_Node *nodeptr)
| Queries whether or not a Node has children. More...
IXML_Node * | ixmlNode_cloneNode (IXML_Node *nodeptr, BOOL deep)
| Clones a Node. More...
BOOL | ixmlNode_hasAttributes (IXML_Node *nodeptr)
| Queries whether this Node has attributes. More...
void | ixmlNode_free (IXML_Node *nodeptr)
| Frees a Node and all Nodes in its subtree. More...
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. More...
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. More...
void | ixmlCDATASection_free (IXML_CDATASection *nodeptr)
| Frees a CDATASection node. More...
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. More...
int | ixmlDocument_createDocumentEx (IXML_Document **doc)
| Creates a new empty Document node. More...
IXML_Document * | ixmlDocument_createDocument ()
| Creates a new empty Document node. More...
int | ixmlDocument_createElementEx (IXML_Document *doc, const char *tagName, IXML_Element **rtElement)
| Creates a new Element node with the given tag name. More...
IXML_Element * | ixmlDocument_createElement (IXML_Document *doc, const char *tagName)
| Creates a new Element node with the given tag name. More...
int | ixmlDocument_createTextNodeEx (IXML_Document *doc, const char *data, IXML_Node **textNode)
| Creates a new Text node with the given data. More...
IXML_Node * | ixmlDocument_createTextNode (IXML_Document *doc, const char *data)
| Creates a new Text node with the given data. More...
int | ixmlDocument_createCDATASectionEx (IXML_Document *doc, const char *data, IXML_CDATASection **cdNode)
| Creates a new CDATASection node with given data. More...
IXML_CDATASection * | ixmlDocument_createCDATASection (IXML_Document *doc, const char *data)
| Creates a new CDATASection node with given data. More...
IXML_Attr * | ixmlDocument_createAttribute (IXML_Document *doc, const char *name)
| Creates a new Attr node with the given name. More...
int | ixmlDocument_createAttributeEx (IXML_Document *doc, const char *name, IXML_Attr **attrNode)
| Creates a new Attr node with the given name. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
IXML_Element * | ixmlDocument_getElementById (IXML_Document *doc, const char *tagName)
| Returns the Element whose `ID` matches that given id. More...
void | ixmlDocument_free (IXML_Document *doc)
| Frees a Document object and all Nodes associated with it. More...
int | ixmlDocument_importNode (IXML_Document *doc, IXML_Node *importNode, BOOL deep, IXML_Node **rtNode)
| Imports a Node from another Document into this Document. More...
Interface Element
The Element interface represents an element in an XML document. Only Elements are allowed to have attributes, which are stored in the `attributes` member of a Node. The Element interface extends the Node interface and adds more operations to manipulate attributes.
void | ixmlElement_init (IXML_Element *element)
| Initializes a IXML_Element node. More...
const char * | ixmlElement_getTagName (IXML_Element *element)
| Returns the name of the tag as a constant string. More...
const char * | ixmlElement_getAttribute (IXML_Element *element, const char *name)
| Retrieves an attribute of an Element by name. More...
int | ixmlElement_setAttribute (IXML_Element *element, const char *name, const char *value)
| Adds a new attribute to an Element. More...
int | ixmlElement_removeAttribute (IXML_Element *element, const char *name)
| Removes an attribute value by name. The attribute node is not removed. More...
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. More...
int | ixmlElement_setAttributeNode (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr)
| Adds a new attribute node to an Element. More...
int | ixmlElement_removeAttributeNode (IXML_Element *element, IXML_Attr *oldAttr, IXML_Attr **rtAttr)
| Removes the specified attribute node from an Element. More...
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. More...
const char * | ixmlElement_getAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localname)
| Retrieves an attribute value using the local name and namespace URI. More...
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. More...
int | ixmlElement_removeAttributeNS (IXML_Element *element, const char *namespaceURI, const char *localName)
| Removes an attribute using the namespace URI and local name. More...
IXML_Attr * | ixmlElement_getAttributeNodeNS (IXML_Element *element, const char *namespaceURI, const char *localName)
| Retrieves an Attr node by local name and namespace URI. More...
int | ixmlElement_setAttributeNodeNS (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rcAttr)
| Adds a new attribute node to the element node specified. More...
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. More...
BOOL | ixmlElement_hasAttribute (IXML_Element *element, const char *name)
| Queries whether the Element has an attribute with the given name or a default value. More...
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. More...
void | ixmlElement_free (IXML_Element *element)
| Frees the given Element and any subtree of the Element. More...
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. More...
IXML_Node * | ixmlNamedNodeMap_getNamedItem (IXML_NamedNodeMap *nnMap, const char *name)
| Retrieves a Node from the NamedNodeMap by name. More...
IXML_Node * | ixmlNamedNodeMap_setNamedItem (IXML_NamedNodeMap *nnMap, IXML_Node *arg)
| Adds a new Node to the NamedNodeMap using the Node name attribute. More...
IXML_Node * | ixmlNamedNodeMap_removeNamedItem (IXML_NamedNodeMap *nnMap, const char *name)
| Removes a Node from a NamedNodeMap specified by name. More...
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. More...
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. More...
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. More...
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. More...
void | ixmlNamedNodeMap_free (IXML_NamedNodeMap *nnMap)
| Frees a NamedNodeMap. More...
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. More...
unsigned long | ixmlNodeList_length (IXML_NodeList *nList)
| Returns the number of Nodes in a NodeList. More...
void | ixmlNodeList_free (IXML_NodeList *nList)
| Frees a NodeList object. More...
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. More...
char * | ixmlPrintNode (IXML_Node *doc)
| Renders a Node and all sub-elements into an XML text representation. More...
char * | ixmlDocumenttoString (IXML_Document *doc)
| Renders a Node and all sub-elements into an XML document representation. More...
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. More...
void | ixmlRelaxParser (char errorChar)
| Makes the XML parser more tolerant to malformed text. More...
IXML_Document * | ixmlParseBuffer (const char *buffer)
| Parses an XML text buffer converting it into an IXML DOM representation. More...
int | ixmlParseBufferEx (const char *buffer, IXML_Document **doc)
| Parses an XML text buffer converting it into an IXML DOM representation. More...
IXML_Document * | ixmlLoadDocument (const char *xmlFile)
| Parses an XML text file converting it into an IXML DOM representation. More...
int | ixmlLoadDocumentEx (const char *xmlFile, IXML_Document **doc)
| Parses an XML text file converting it into an IXML DOM representation. More...
char * | ixmlCloneDOMString (const char *src)
| Clones an existing DOMString. More...
void | ixmlFreeDOMString (char *buf)
| Frees a DOMString. More...

## 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. More...
typedef struct _IXML_Document | IXML_Document
| Data structure representing the DOM Document. More...
typedef struct _IXML_CDATASection | IXML_CDATASection
| Data structure representing a CDATA section node. More...
typedef struct _IXML_Element | IXML_Element
| Data structure representing an Element node. More...
typedef struct _IXML_ATTR | IXML_Attr
| Data structure representing an Attribute node. More...
typedef struct _IXML_Text | IXML_Text
| Data structure representing a Text node. More...
typedef struct _IXML_NodeList | IXML_NodeList
| Data structure representing a list of nodes. More...
typedef struct _IXML_NamedNodeMap | IXML_NamedNodeMap
| Data structure representing a list of named nodes. More...