1#ifndef UPNPLIB_IXML_HPP
2#define UPNPLIB_IXML_HPP
47#define DOMString char*
73 eCDATA_SECTION_NODE = 4,
74 eENTITY_REFERENCE_NODE = 5,
76 ePROCESSING_INSTRUCTION_NODE = 7,
79 eDOCUMENT_TYPE_NODE = 10,
80 eDOCUMENT_FRAGMENT_NODE = 11,
90 IXML_INDEX_SIZE_ERR = 1,
91 IXML_DOMSTRING_SIZE_ERR = 2,
92 IXML_HIERARCHY_REQUEST_ERR = 3,
93 IXML_WRONG_DOCUMENT_ERR = 4,
94 IXML_INVALID_CHARACTER_ERR = 5,
95 IXML_NO_DATA_ALLOWED_ERR = 6,
96 IXML_NO_MODIFICATION_ALLOWED_ERR = 7,
97 IXML_NOT_FOUND_ERR = 8,
98 IXML_NOT_SUPPORTED_ERR = 9,
99 IXML_INUSE_ATTRIBUTE_ERR = 10,
100 IXML_INVALID_STATE_ERR = 11,
101 IXML_SYNTAX_ERR = 12,
102 IXML_INVALID_MODIFICATION_ERR = 13,
103 IXML_NAMESPACE_ERR = 14,
104 IXML_INVALID_ACCESS_ERR = 15,
106 IXML_NO_SUCH_FILE = 101,
107 IXML_INSUFFICIENT_MEMORY = 102,
108 IXML_FILE_DONE = 104,
109 IXML_INVALID_PARAMETER = 105,
111 IXML_INVALID_ITEM_NUMBER = 107
114#define DOCUMENTNODENAME "#document"
115#define TEXTNODENAME "#text"
116#define CDATANODENAME "#cdata-section"
122#ifdef IXML_HAVE_SCRIPTSUPPORT
126typedef void (*IXML_BeforeFreeNode_t)(
Nodeptr obj);
147#ifdef IXML_HAVE_SCRIPTSUPPORT
267 const char* newNodeValue);
573#ifdef IXML_HAVE_SCRIPTSUPPORT
577PUPNP_Api
void ixmlNode_setCTag(
586PUPNP_Api
void* ixmlNode_getCTag(
1410 unsigned long index);
1488 unsigned long index);
1623#ifdef IXML_HAVE_SCRIPTSUPPORT
1627PUPNP_Api
void ixmlSetBeforeFree(
1633 IXML_BeforeFreeNode_t hndlr);
1645 const char* buffer);
1677 const char* xmlFile);
1695 const char* xmlFile,
Data structure representing a CDATA section node.
Data structure common to all types of nodes.
Data structure representing an Attribute node.
Data structure representing a list of nodes.
Data structure representing a Text node.
Data structure representing a list of named nodes.
Data structure representing an Element node.
Data structure representing the DOM Document.
PUPNP_Api 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.
PUPNP_Api IXML_Element * ixmlDocument_getElementById(IXML_Document *doc, const DOMString tagName)
Returns the Element whose ID matches that given id.
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.
struct _IXML_Node IXML_Node
Data structure common to all types of nodes.
PUPNP_Api IXML_Document * ixmlNode_getOwnerDocument(IXML_Node *nodeptr)
Retrieves the document object associated with this Node.
PUPNP_Api DOMString ixmlPrintNode(IXML_Node *doc)
Renders a Node and all sub-elements into an XML text representation.
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 int ixmlNode_appendChild(IXML_Node *nodeptr, IXML_Node *newChild)
Appends a child Node to the list of children of a Node.
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 t...
PUPNP_Api int ixmlNode_setNodeValue(IXML_Node *nodeptr, const char *newNodeValue)
Assigns a new value to a 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.
struct _IXML_CDATASection IXML_CDATASection
Data structure representing a CDATA section node.
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 int ixmlParseBufferEx(const char *buffer, IXML_Document **doc)
Parses an XML text buffer converting it into an IXML DOM representation.
PUPNP_Api IXML_Element * ixmlDocument_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 ixmlElement_setAttribute(IXML_Element *element, const DOMString name, const DOMString value)
Adds a new attribute to an Element.
struct _IXML_Document * Docptr
The type of the DOM node.
PUPNP_Api IXML_Element * ixmlDocument_createElement(IXML_Document *doc, const DOMString tagName)
Creates a new Element node with the given tag name.
PUPNP_Api void ixmlAttr_free(IXML_Attr *attrNode)
Frees an Attr node.
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 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 IXML_CDATASection * ixmlDocument_createCDATASection(IXML_Document *doc, const DOMString data)
Creates a new CDATASection node with given data.
PUPNP_Api unsigned long ixmlNamedNodeMap_getLength(IXML_NamedNodeMap *nnMap)
Returns the number of items contained in this NamedNodeMap.
struct _IXML_NodeList IXML_NodeList
Data structure representing a list of nodes.
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 void ixmlCDATASection_init(IXML_CDATASection *nodeptr)
Initializes a CDATASection 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 IXML_Node * ixmlNamedNodeMap_setNamedItem(IXML_NamedNodeMap *nnMap, IXML_Node *arg)
Adds a new Node to the NamedNodeMap using the Node name attribute.
PUPNP_Api int ixmlDocument_createAttributeEx(IXML_Document *doc, const DOMString name, IXML_Attr **attrNode)
Creates a new Attr node with the given name.
#define DOMString
The type of DOM strings.
PUPNP_Api IXML_NodeList * ixmlDocument_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 ar...
PUPNP_Api void ixmlNode_free(IXML_Node *nodeptr)
Frees a Node and all Nodes in its subtree.
PUPNP_Api void ixmlCDATASection_free(IXML_CDATASection *nodeptr)
Frees a CDATASection node.
PUPNP_Api IXML_Attr * ixmlDocument_createAttributeNS(IXML_Document *doc, const DOMString namespaceURI, const DOMString qualifiedName)
Creates a new Attribute node with the given qualified name and namespace URI.
struct _IXML_Document IXML_Document
Data structure representing the DOM Document.
PUPNP_Api IXML_Node * ixmlNode_cloneNode(IXML_Node *nodeptr, int deep)
Clones a Node.
PUPNP_Api IXML_Attr * ixmlElement_getAttributeNode(IXML_Element *element, const DOMString name)
Retrieves an attribute node by name. See ixmlElement_getAttributeNodeNS to retrieve an attribute node...
PUPNP_Api IXML_Node * ixmlDocument_createTextNode(IXML_Document *doc, const DOMString data)
Creates a new Text node with the given data.
PUPNP_Api IXML_Node * ixmlNode_getNextSibling(IXML_Node *nodeptr)
Retrieves the sibling Node immediately following this Node.
PUPNP_Api void ixmlRelaxParser(char errorChar)
Makes the XML parser more tolerant to malformed text.
PUPNP_Api void ixmlElement_init(IXML_Element *element)
Initializes a IXML_Element node.
PUPNP_Api const DOMString ixmlNode_getNodeValue(IXML_Node *nodeptr)
Returns the value of the Node as a string.
PUPNP_Api IXML_NodeList * ixmlDocument_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 enco...
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.
IXML_ERRORCODE
Error codes returned by the XML API, see the DOM spec.
PUPNP_Api DOMString ixmlPrintDocument(IXML_Document *doc)
Renders a Node and all sub-elements into an XML document representation.
struct _IXML_ATTR IXML_Attr
Data structure representing an Attribute node.
PUPNP_Api IXML_Node * ixmlNode_getParentNode(IXML_Node *nodeptr)
Retrieves the parent Node for a Node.
PUPNP_Api DOMString ixmlDocumenttoString(IXML_Document *doc)
Renders a Node and all sub-elements into an XML document representation.
PUPNP_Api IXML_Node * ixmlNamedNodeMap_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 const DOMString ixmlElement_getAttribute(IXML_Element *element, const DOMString name)
Retrieves an attribute of an Element by name.
PUPNP_Api void ixmlDocument_init(IXML_Document *nodeptr)
Initializes a Document node.
PUPNP_Api const DOMString ixmlNode_getLocalName(IXML_Node *nodeptr)
Retrieves the local name of a Node, if present.
PUPNP_Api int ixmlLoadDocumentEx(const char *xmlFile, IXML_Document **doc)
Parses an XML text file converting it into an IXML DOM representation.
PUPNP_Api IXML_Node * ixmlNamedNodeMap_removeNamedItem(IXML_NamedNodeMap *nnMap, const DOMString name)
Removes a Node from a NamedNodeMap specified by name.
IXML_NODE_TYPE
The type of the DOM node.
PUPNP_Api IXML_NodeList * ixmlNode_getChildNodes(IXML_Node *nodeptr)
Retrieves the list of children of a Node in a NodeList structure.
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_Document * ixmlLoadDocument(const char *xmlFile)
Parses an XML text file converting it into an IXML DOM representation.
struct _IXML_NamedNodeMap IXML_NamedNodeMap
Data structure representing a list of named nodes.
struct _IXML_Node * Nodeptr
The type of the DOM node.
PUPNP_Api void ixmlFreeDOMString(DOMString buf)
Frees a DOMString.
struct _IXML_Element IXML_Element
Data structure representing an Element node.
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 ixmlElement_removeAttributeNode(IXML_Element *element, IXML_Attr *oldAttr, IXML_Attr **rtAttr)
Removes the specified attribute node from an Element.
struct _IXML_Text IXML_Text
Data structure representing a Text node.
PUPNP_Api IXML_Node * ixmlNode_getLastChild(IXML_Node *nodeptr)
Retrieves the last child Node of a Node.
PUPNP_Api const DOMString ixmlNode_getPrefix(IXML_Node *nodeptr)
Retrieves the namespace prefix, if present.
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.
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_Attr * ixmlElement_getAttributeNodeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Retrieves an Attr node by local name and namespace URI.
PUPNP_Api int ixmlNode_hasAttributes(IXML_Node *nodeptr)
Queries whether this Node has attributes.
PUPNP_Api IXML_Node * ixmlNamedNodeMap_getNamedItem(IXML_NamedNodeMap *nnMap, const DOMString name)
Retrieves a Node from the NamedNodeMap by name.
PUPNP_Api IXML_Node * ixmlNode_getPreviousSibling(IXML_Node *nodeptr)
Retrieves the sibling Node immediately preceding this Node.
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.
PUPNP_Api int ixmlElement_setAttributeNode(IXML_Element *element, IXML_Attr *newAttr, IXML_Attr **rtAttr)
Adds a new attribute node to an Element.
PUPNP_Api void ixmlElement_free(IXML_Element *element)
Frees the given Element and any subtree of the Element.
PUPNP_Api IXML_Document * ixmlDocument_createDocument(void)
Creates a new empty Document node.
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 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 IXML_Node * ixmlNamedNodeMap_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 int ixmlElement_removeAttributeNS(IXML_Element *element, const DOMString namespaceURI, const DOMString localName)
Removes an attribute using the namespace URI and local name.
PUPNP_Api DOMString ixmlCloneDOMString(const DOMString src)
Clones an existing DOMString.
PUPNP_Api const DOMString ixmlNode_getNamespaceURI(IXML_Node *nodeptr)
Retrieves the namespace URI for a Node as a DOMString.
PUPNP_Api IXML_Attr * ixmlDocument_createAttribute(IXML_Document *doc, const DOMString name)
Creates a new Attr node with the given name.
PUPNP_Api IXML_Node * ixmlNode_getFirstChild(IXML_Node *nodeptr)
Retrieves the first child Node of a Node.
PUPNP_Api int ixmlDocument_createDocumentEx(IXML_Document **doc)
Creates a new empty Document node.
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 def...
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_NamedNodeMap * ixmlNode_getAttributes(IXML_Node *nodeptr)
Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.
PUPNP_Api IXML_Node * ixmlNodeList_item(IXML_NodeList *nList, unsigned long index)
Retrieves a Node from a NodeList specified by a numerical index.
PUPNP_Api 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 th...
PUPNP_Api void ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap)
Frees a NamedNodeMap.
PUPNP_Api IXML_Document * ixmlParseBuffer(const char *buffer)
Parses an XML text buffer converting it into an IXML DOM representation.
PUPNP_Api int ixmlNode_hasChildNodes(IXML_Node *nodeptr)
Queries whether or not a Node has children.
PUPNP_Api IXML_NodeList * ixmlElement_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 w...
PUPNP_Api void ixmlDocument_free(IXML_Document *doc)
Frees a Document object and all Nodes associated with it.
PUPNP_Api const DOMString ixmlElement_getTagName(IXML_Element *element)
Returns the name of the tag as a constant string.
PUPNP_Api IXML_NodeList * ixmlElement_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 e...
Macros to support visibility of external symbols.