UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
ixml.hpp File Reference
+ Include dependency graph for ixml.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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)

PUPNP_Api const DOMString ixmlNode_getNodeName (IXML_Node *nodeptr)
 Returns the name of the Node, depending on what type of Node it is, in a read-only string.
 
PUPNP_Api const DOMString ixmlNode_getNodeValue (IXML_Node *nodeptr)
 Returns the value of the Node as a string.
 
PUPNP_Api int ixmlNode_setNodeValue (IXML_Node *nodeptr, const char *newNodeValue)
 Assigns a new value to a Node.
 
PUPNP_Api unsigned short ixmlNode_getNodeType (IXML_Node *nodeptr)
 Retrieves the type of a Node. Note that not all possible return values are actually implemented.
 
PUPNP_Api IXML_NodeixmlNode_getParentNode (IXML_Node *nodeptr)
 Retrieves the parent Node for a Node.
 
PUPNP_Api IXML_NodeListixmlNode_getChildNodes (IXML_Node *nodeptr)
 Retrieves the list of children of a Node in a NodeList structure.
 
PUPNP_Api IXML_NodeixmlNode_getFirstChild (IXML_Node *nodeptr)
 Retrieves the first child Node of a Node.
 
PUPNP_Api IXML_NodeixmlNode_getLastChild (IXML_Node *nodeptr)
 Retrieves the last child Node of a Node.
 
PUPNP_Api IXML_NodeixmlNode_getPreviousSibling (IXML_Node *nodeptr)
 Retrieves the sibling Node immediately preceding this Node.
 
PUPNP_Api IXML_NodeixmlNode_getNextSibling (IXML_Node *nodeptr)
 Retrieves the sibling Node immediately following this Node.
 
PUPNP_Api IXML_NamedNodeMapixmlNode_getAttributes (IXML_Node *nodeptr)
 Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.
 
PUPNP_Api IXML_DocumentixmlNode_getOwnerDocument (IXML_Node *nodeptr)
 Retrieves the document object associated with this Node.
 
PUPNP_Api const DOMString ixmlNode_getNamespaceURI (IXML_Node *nodeptr)
 Retrieves the namespace URI for a Node as a DOMString.
 
PUPNP_Api const DOMString ixmlNode_getPrefix (IXML_Node *nodeptr)
 Retrieves the namespace prefix, if present.
 
PUPNP_Api const DOMString ixmlNode_getLocalName (IXML_Node *nodeptr)
 Retrieves the local name of a Node, if present.
 
PUPNP_Api int ixmlNode_insertBefore (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild)
 Inserts a new child Node before the existing child Node.
 
PUPNP_Api 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.
 
PUPNP_Api int ixmlNode_removeChild (IXML_Node *nodeptr, IXML_Node *oldChild, IXML_Node **returnNode)
 Removes a child from the list of children of a Node.
 
PUPNP_Api int ixmlNode_appendChild (IXML_Node *nodeptr, IXML_Node *newChild)
 Appends a child Node to the list of children of a Node.
 
PUPNP_Api int ixmlNode_hasChildNodes (IXML_Node *nodeptr)
 Queries whether or not a Node has children.
 
PUPNP_Api IXML_NodeixmlNode_cloneNode (IXML_Node *nodeptr, int deep)
 Clones a Node.
 
PUPNP_Api int ixmlNode_hasAttributes (IXML_Node *nodeptr)
 Queries whether this Node has attributes.
 
PUPNP_Api 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.

PUPNP_Api 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.

PUPNP_Api void ixmlCDATASection_init (IXML_CDATASection *nodeptr)
 Initializes a CDATASection node.
 
PUPNP_Api 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.

PUPNP_Api void ixmlDocument_init (IXML_Document *nodeptr)
 Initializes a Document node.
 
PUPNP_Api int ixmlDocument_createDocumentEx (IXML_Document **doc)
 Creates a new empty Document node.
 
PUPNP_Api IXML_DocumentixmlDocument_createDocument (void)
 Creates a new empty Document node.
 
PUPNP_Api int ixmlDocument_createElementEx (IXML_Document *doc, const DOMString tagName, IXML_Element **rtElement)
 Creates a new Element node with the given tag name.
 
PUPNP_Api IXML_ElementixmlDocument_createElement (IXML_Document *doc, const DOMString tagName)
 Creates a new Element node with the given tag name.
 
PUPNP_Api int ixmlDocument_createTextNodeEx (IXML_Document *doc, const DOMString data, IXML_Node **textNode)
 Creates a new Text node with the given data.
 
PUPNP_Api IXML_NodeixmlDocument_createTextNode (IXML_Document *doc, const DOMString data)
 Creates a new Text node with the given data.
 
PUPNP_Api int ixmlDocument_createCDATASectionEx (IXML_Document *doc, const DOMString data, IXML_CDATASection **cdNode)
 Creates a new CDATASection node with given data.
 
PUPNP_Api IXML_CDATASectionixmlDocument_createCDATASection (IXML_Document *doc, const DOMString data)
 Creates a new CDATASection node with given data.
 
PUPNP_Api IXML_AttrixmlDocument_createAttribute (IXML_Document *doc, const DOMString name)
 Creates a new Attr node with the given name.
 
PUPNP_Api int ixmlDocument_createAttributeEx (IXML_Document *doc, const DOMString name, IXML_Attr **attrNode)
 Creates a new Attr node with the given name.
 
PUPNP_Api IXML_NodeListixmlDocument_getElementsByTagName (IXML_Document *doc, const DOMString 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.
 
PUPNP_Api int ixmlDocument_createElementNSEx (IXML_Document *doc, const DOMString namespaceURI, const DOMString qualifiedName, IXML_Element **rtElement)
 Creates a new Element node in the given qualified name and namespace URI.
 
PUPNP_Api IXML_ElementixmlDocument_createElementNS (IXML_Document *doc, const DOMString namespaceURI, const DOMString qualifiedName)
 Creates a new Element node in the given qualified name and namespace URI.
 
PUPNP_Api int ixmlDocument_createAttributeNSEx (IXML_Document *doc, const DOMString namespaceURI, const DOMString qualifiedName, IXML_Attr **attrNode)
 Creates a new Attr node with the given qualified name and namespace URI.
 
PUPNP_Api IXML_AttrixmlDocument_createAttributeNS (IXML_Document *doc, const DOMString namespaceURI, const DOMString qualifiedName)
 Creates a new Attribute node with the given qualified name and namespace URI.
 
PUPNP_Api IXML_NodeListixmlDocument_getElementsByTagNameNS (IXML_Document *doc, const DOMString namespaceURI, const DOMString 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.
 
PUPNP_Api IXML_ElementixmlDocument_getElementById (IXML_Document *doc, const DOMString tagName)
 Returns the Element whose ID matches that given id.
 
PUPNP_Api void ixmlDocument_free (IXML_Document *doc)
 Frees a Document object and all Nodes associated with it.
 
PUPNP_Api 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 attributes member of a Node. The Element interface extends the Node interface and adds more operations to manipulate attributes.

PUPNP_Api void ixmlElement_init (IXML_Element *element)
 Initializes a IXML_Element node.
 
PUPNP_Api const DOMString ixmlElement_getTagName (IXML_Element *element)
 Returns the name of the tag as a constant string.
 
PUPNP_Api const DOMString ixmlElement_getAttribute (IXML_Element *element, const DOMString name)
 Retrieves an attribute of an Element by name.
 
PUPNP_Api int ixmlElement_setAttribute (IXML_Element *element, const DOMString name, const DOMString value)
 Adds a new attribute to an Element.
 
PUPNP_Api int ixmlElement_removeAttribute (IXML_Element *element, const DOMString name)
 Removes an attribute value by name. The attribute node is not removed.
 
PUPNP_Api IXML_AttrixmlElement_getAttributeNode (IXML_Element *element, const DOMString name)
 Retrieves an attribute node by name. See ixmlElement_getAttributeNodeNS to retrieve an attribute node using a qualified name or namespace URI.
 
PUPNP_Api int ixmlElement_setAttributeNode (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr)
 Adds a new attribute node to an Element.
 
PUPNP_Api int ixmlElement_removeAttributeNode (IXML_Element *element, IXML_Attr *oldAttr, IXML_Attr **rtAttr)
 Removes the specified attribute node from an Element.
 
PUPNP_Api IXML_NodeListixmlElement_getElementsByTagName (IXML_Element *element, const DOMString 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.
 
PUPNP_Api const DOMString ixmlElement_getAttributeNS (IXML_Element *element, const DOMString namespaceURI, const DOMString localname)
 Retrieves an attribute value using the local name and namespace URI.
 
PUPNP_Api int ixmlElement_setAttributeNS (IXML_Element *element, const DOMString namespaceURI, const DOMString qualifiedName, const DOMString value)
 Adds a new attribute to an Element using the local name and namespace URI.
 
PUPNP_Api int ixmlElement_removeAttributeNS (IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
 Removes an attribute using the namespace URI and local name.
 
PUPNP_Api IXML_AttrixmlElement_getAttributeNodeNS (IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
 Retrieves an Attr node by local name and namespace URI.
 
PUPNP_Api int ixmlElement_setAttributeNodeNS (IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rcAttr)
 Adds a new attribute node to the element node specified.
 
PUPNP_Api IXML_NodeListixmlElement_getElementsByTagNameNS (IXML_Element *element, const DOMString namespaceURI, const DOMString 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.
 
PUPNP_Api int ixmlElement_hasAttribute (IXML_Element *element, const DOMString name)
 Queries whether the Element has an attribute with the given name or a default value.
 
PUPNP_Api int ixmlElement_hasAttributeNS (IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
 Queries whether the Element has an attribute with the given local name and namespace URI or has a default value for that attribute.
 
PUPNP_Api 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.

PUPNP_Api unsigned long ixmlNamedNodeMap_getLength (IXML_NamedNodeMap *nnMap)
 Returns the number of items contained in this NamedNodeMap.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_getNamedItem (IXML_NamedNodeMap *nnMap, const DOMString name)
 Retrieves a Node from the NamedNodeMap by name.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_setNamedItem (IXML_NamedNodeMap *nnMap, IXML_Node *arg)
 Adds a new Node to the NamedNodeMap using the Node name attribute.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_removeNamedItem (IXML_NamedNodeMap *nnMap, const DOMString name)
 Removes a Node from a NamedNodeMap specified by name.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_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.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_getNamedItemNS (IXML_NamedNodeMap *nnMap, const DOMString *namespaceURI, const DOMString localName)
 Retrieves a Node from a NamedNodeMap specified by namespace URI and local name.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_setNamedItemNS (IXML_NamedNodeMap *nnMap, IXML_Node *arg)
 Adds a new Node to the NamedNodeMap using the Node local name and namespace URI attributes.
 
PUPNP_Api IXML_NodeixmlNamedNodeMap_removeNamedItemNS (IXML_NamedNodeMap *nnMap, const DOMString namespaceURI, const DOMString localName)
 Removes a Node from a NamedNodeMap specified by namespace URI and local name.
 
PUPNP_Api 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.

PUPNP_Api IXML_NodeixmlNodeList_item (IXML_NodeList *nList, unsigned long index)
 Retrieves a Node from a NodeList specified by a numerical index.
 
PUPNP_Api unsigned long ixmlNodeList_length (IXML_NodeList *nList)
 Returns the number of Nodes in a NodeList.
 
PUPNP_Api 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.

PUPNP_Api DOMString ixmlPrintDocument (IXML_Document *doc)
 Renders a Node and all sub-elements into an XML document representation.
 
PUPNP_Api DOMString ixmlPrintNode (IXML_Node *doc)
 Renders a Node and all sub-elements into an XML text representation.
 
PUPNP_Api DOMString ixmlDocumenttoString (IXML_Document *doc)
 Renders a Node and all sub-elements into an XML document representation.
 
PUPNP_Api DOMString 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.
 
PUPNP_Api void ixmlRelaxParser (char errorChar)
 Makes the XML parser more tolerant to malformed text.
 
PUPNP_Api IXML_DocumentixmlParseBuffer (const char *buffer)
 Parses an XML text buffer converting it into an IXML DOM representation.
 
PUPNP_Api int ixmlParseBufferEx (const char *buffer, IXML_Document **doc)
 Parses an XML text buffer converting it into an IXML DOM representation.
 
PUPNP_Api IXML_DocumentixmlLoadDocument (const char *xmlFile)
 Parses an XML text file converting it into an IXML DOM representation.
 
PUPNP_Api int ixmlLoadDocumentEx (const char *xmlFile, IXML_Document **doc)
 Parses an XML text file converting it into an IXML DOM representation.
 
PUPNP_Api DOMString ixmlCloneDOMString (const DOMString src)
 Clones an existing DOMString.
 
PUPNP_Api void ixmlFreeDOMString (DOMString 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"
 The type of the DOM node.
 
#define TEXTNODENAME   "#text"
 The type of the DOM node.
 
#define CDATANODENAME   "#cdata-section"
 The type of the DOM node.
 
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_DocumentDocptr
 The type of the DOM node.
 
typedef struct _IXML_NodeNodeptr
 The type of the DOM node.
 
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.