Logo Search packages:      
Sourcecode: libupnp4 version File versions  Download package

XML API


Classes

struct  _IXML_ATTR
 Data structure representing an Attribute node. More...
struct  _IXML_CDATASection
 Data structure representing a CDATA section node. More...
struct  _IXML_Document
 Data structure representing the DOM Document. More...
struct  _IXML_Element
 Data structure representing an Element node. More...
struct  _IXML_NamedNodeMap
 Data structure representing a list of named nodes. More...
struct  _IXML_Node
 Data structure common to all types of nodes. More...
struct  _IXML_NodeList
 Data structure representing a list of nodes. More...
struct  _IXML_Text
 Data structure representing a Text node. 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.

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.
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.
typedef struct _IXML_DocumentDocptr
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.
typedef struct _IXML_NodeNodeptr
#define CDATANODENAME   "#cdata-section"
#define DOCUMENTNODENAME   "#document"
#define TEXTNODENAME   "#text"

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.

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.

EXPORT_SPEC void ixmlCDATASection_free (IXML_CDATASection *nodeptr)
 Frees a CDATASection node.
EXPORT_SPEC void ixmlCDATASection_init (IXML_CDATASection *nodeptr)
 Initializes a CDATASection node.

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.

EXPORT_SPEC DOMString ixmlCloneDOMString (const DOMString src)
 Clones an existing DOMString.
EXPORT_SPEC DOMString ixmlDocumenttoString (IXML_Document *doc)
 Renders a Node and all sub-elements into an XML document representation.
EXPORT_SPEC void ixmlFreeDOMString (DOMString buf)
 Frees a DOMString.
EXPORT_SPEC IXML_DocumentixmlLoadDocument (const char *xmlFile)
 Parses an XML text file converting it into an IXML DOM representation.
EXPORT_SPEC int ixmlLoadDocumentEx (const char *xmlFile, IXML_Document **doc)
 Parses an XML text file converting it into an IXML DOM representation.
EXPORT_SPEC 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.
EXPORT_SPEC IXML_DocumentixmlParseBuffer (const char *buffer)
 Parses an XML text buffer converting it into an IXML DOM representation.
EXPORT_SPEC int ixmlParseBufferEx (const char *buffer, IXML_Document **doc)
 Parses an XML text buffer converting it into an IXML DOM representation.
EXPORT_SPEC DOMString ixmlPrintDocument (IXML_Document *doc)
 Renders a Node and all sub-elements into an XML document representation.
EXPORT_SPEC DOMString ixmlPrintNode (IXML_Node *doc)
 Renders a Node and all sub-elements into an XML text representation.
EXPORT_SPEC void ixmlRelaxParser (char errorChar)
 Makes the XML parser more tolerant to malformed text.

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.

EXPORT_SPEC IXML_AttrixmlDocument_createAttribute (IXML_Document *doc, const char *name)
 Creates a new Attr node with the given name.
EXPORT_SPEC int ixmlDocument_createAttributeEx (IXML_Document *doc, const char *name, IXML_Attr **attrNode)
 Creates a new Attr node with the given name.
EXPORT_SPEC 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.
EXPORT_SPEC 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.
EXPORT_SPEC IXML_CDATASectionixmlDocument_createCDATASection (IXML_Document *doc, const DOMString data)
 Creates a new CDATASection node with given data.
EXPORT_SPEC int ixmlDocument_createCDATASectionEx (IXML_Document *doc, const DOMString data, IXML_CDATASection **cdNode)
 Creates a new CDATASection node with given data.
EXPORT_SPEC IXML_DocumentixmlDocument_createDocument ()
 Creates a new empty Document node.
EXPORT_SPEC int ixmlDocument_createDocumentEx (IXML_Document **doc)
 Creates a new empty Document node.
EXPORT_SPEC IXML_ElementixmlDocument_createElement (IXML_Document *doc, const DOMString tagName)
 Creates a new Element node with the given tag name.
EXPORT_SPEC int ixmlDocument_createElementEx (IXML_Document *doc, const DOMString tagName, IXML_Element **rtElement)
 Creates a new Element node with the given tag name.
EXPORT_SPEC 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.
EXPORT_SPEC 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.
EXPORT_SPEC IXML_NodeixmlDocument_createTextNode (IXML_Document *doc, const DOMString data)
 Creates a new Text node with the given data.
EXPORT_SPEC int ixmlDocument_createTextNodeEx (IXML_Document *doc, const DOMString data, IXML_Node **textNode)
 Creates a new Text node with the given data.
EXPORT_SPEC void ixmlDocument_free (IXML_Document *doc)
 Frees a Document object and all Nodes associated with it.
EXPORT_SPEC IXML_ElementixmlDocument_getElementById (IXML_Document *doc, const DOMString tagName)
 Returns the Element whose ID matches that given id.
EXPORT_SPEC 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.
EXPORT_SPEC 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.
EXPORT_SPEC int ixmlDocument_importNode (IXML_Document *doc, IXML_Node *importNode, BOOL deep, IXML_Node **rtNode)
 Imports a Node from another Document into this Document.
EXPORT_SPEC void ixmlDocument_init (IXML_Document *nodeptr)
 Initializes a Document node.

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.

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

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.

EXPORT_SPEC void ixmlNamedNodeMap_free (IXML_NamedNodeMap *nnMap)
 Frees a NamedNodeMap.
EXPORT_SPEC unsigned long ixmlNamedNodeMap_getLength (IXML_NamedNodeMap *nnMap)
 Returns the number of items contained in this NamedNodeMap.
EXPORT_SPEC IXML_NodeixmlNamedNodeMap_getNamedItem (IXML_NamedNodeMap *nnMap, const DOMString name)
 Retrieves a Node from the NamedNodeMap by name.
EXPORT_SPEC 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.
EXPORT_SPEC 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.
EXPORT_SPEC IXML_NodeixmlNamedNodeMap_removeNamedItem (IXML_NamedNodeMap *nnMap, const DOMString name)
 Removes a Node from a NamedNodeMap specified by name.
EXPORT_SPEC 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.
EXPORT_SPEC IXML_NodeixmlNamedNodeMap_setNamedItem (IXML_NamedNodeMap *nnMap, IXML_Node *arg)
 Adds a new Node to the NamedNodeMap using the Node name attribute.
EXPORT_SPEC 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.

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.

EXPORT_SPEC int ixmlNode_appendChild (IXML_Node *nodeptr, IXML_Node *newChild)
 Appends a child Node to the list of children of a Node.
EXPORT_SPEC IXML_NodeixmlNode_cloneNode (IXML_Node *nodeptr, BOOL deep)
 Clones a Node.
EXPORT_SPEC void ixmlNode_free (IXML_Node *nodeptr)
 Frees a Node and all Nodes in its subtree.
EXPORT_SPEC IXML_NamedNodeMapixmlNode_getAttributes (IXML_Node *nodeptr)
 Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.
EXPORT_SPEC IXML_NodeListixmlNode_getChildNodes (IXML_Node *nodeptr)
 Retrieves the list of children of a Node in a NodeList structure.
EXPORT_SPEC IXML_NodeixmlNode_getFirstChild (IXML_Node *nodeptr)
 Retrieves the first child Node of a Node.
EXPORT_SPEC IXML_NodeixmlNode_getLastChild (IXML_Node *nodeptr)
 Retrieves the last child Node of a Node.
EXPORT_SPEC const DOMString ixmlNode_getLocalName (IXML_Node *nodeptr)
 Retrieves the local name of a Node, if present.
EXPORT_SPEC const DOMString ixmlNode_getNamespaceURI (IXML_Node *nodeptr)
 Retrieves the namespace URI for a Node as a DOMString.
EXPORT_SPEC IXML_NodeixmlNode_getNextSibling (IXML_Node *nodeptr)
 Retrieves the sibling Node immediately following this Node.
EXPORT_SPEC 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.
EXPORT_SPEC unsigned short ixmlNode_getNodeType (IXML_Node *nodeptr)
 Retrieves the type of a Node.
EXPORT_SPEC const DOMString ixmlNode_getNodeValue (IXML_Node *nodeptr)
 Returns the value of the Node as a string.
EXPORT_SPEC IXML_DocumentixmlNode_getOwnerDocument (IXML_Node *nodeptr)
 Retrieves the document object associated with this Node.
EXPORT_SPEC IXML_NodeixmlNode_getParentNode (IXML_Node *nodeptr)
 Retrieves the parent Node for a Node.
EXPORT_SPEC const DOMString ixmlNode_getPrefix (IXML_Node *nodeptr)
 Retrieves the namespace prefix, if present.
EXPORT_SPEC IXML_NodeixmlNode_getPreviousSibling (IXML_Node *nodeptr)
 Retrieves the sibling Node immediately preceding this Node.
EXPORT_SPEC BOOL ixmlNode_hasAttributes (IXML_Node *nodeptr)
 Queries whether this Node has attributes.
EXPORT_SPEC BOOL ixmlNode_hasChildNodes (IXML_Node *nodeptr)
 Queries whether or not a Node has children.
EXPORT_SPEC int ixmlNode_insertBefore (IXML_Node *nodeptr, IXML_Node *newChild, IXML_Node *refChild)
 Inserts a new child Node before the existing child Node.
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.
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.
EXPORT_SPEC int ixmlNode_setNodeValue (IXML_Node *nodeptr, const char *newNodeValue)
 Assigns a new value to a Node.

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.

EXPORT_SPEC void ixmlNodeList_free (IXML_NodeList *nList)
 Frees a NodeList object.
EXPORT_SPEC IXML_NodeixmlNodeList_item (IXML_NodeList *nList, unsigned long index)
 Retrieves a Node from a NodeList specified by a numerical index.
EXPORT_SPEC unsigned long ixmlNodeList_length (IXML_NodeList *nList)
 Returns the number of Nodes in a NodeList.

Defines

#define DOMString   char *
 The type of DOM strings.
#define FALSE   0
#define TRUE   1

Typedefs

typedef int BOOL


Generated by  Doxygen 1.6.0   Back to index