0% found this document useful (0 votes)
3 views56 pages

IXML Programming Guide

IXML v1.2 is a lightweight, portable XML parser that supports the Document Object Model (DOM) Level 2 interfaces, designed for small embedded applications. The document outlines the supported interfaces, including Node, Attr, Document, and others, along with their respective methods and functionalities. It also includes licensing information and clarifies IXML-specific behaviors in relation to the W3C DOM2 recommendations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views56 pages

IXML Programming Guide

IXML v1.2 is a lightweight, portable XML parser that supports the Document Object Model (DOM) Level 2 interfaces, designed for small embedded applications. The document outlines the supported interfaces, including Node, Attr, Document, and others, along with their respective methods and functionalities. It also includes licensing information and clarifies IXML-specific behaviors in relation to the W3C DOM2 recommendations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IXML v1.

2
IXML v1.2

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 BOOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 DOM Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1 Interface Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Interface Attr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Interface CDATASection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.4 Interface Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.5 Interface Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.6 Interface NamedNodeMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.7 Interface NodeList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5 IXML API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

This page was generated with the help of DOC++

[Link]
July 4, 2006 2
IXML v1.2

Linux DOM2 XML Parser Version 1.2


Copyright (C) 2000-2003 Intel Corporation ALL RIGHTS RESERVED
Revision 1.2.1 (Tue 04 Jul 2006 04:58:49 PM EEST)

This page was generated with the help of DOC++

[Link]
July 4, 2006 3
1 Introduction

Introduction

The Linux DOM2 XML Parser Version 1.2 (IXML) is a lightweight, portable XML parser support-
ing the standard Document Object Model (DOM) Level 2 interfaces. The parser uses a C-style
interface, making it idea for small, embedded applications. This document describes the interfaces
supported by IXML 1.2, referencing the W3C DOM2 recommendations when necessary, and the
additional utility application programming interfaces (APIs) that it supports.
Note that this document assumes that the reader has a copy of the DOM2-Core recommen-
dation. Refer to the link below to obtain a copy. Only a brief description is included here and
the reader is pointed to the DOM2-Core recommendation for more details. This document does,
however, clarify IXML-specific behavior when the recommendation is unclear.
About DOM
The Document Object Model (DOM) is a set of interfaces that give a programmatic interface
to documents. It provides a platform-neutral and language-neutral interface for random access
and updating elements inside XML documents. DOM Level 1 provided the basic interfaces to
access document elements. DOM Level 2 extended the interfaces to provide proper support for
XML namespaces.
The latest DOM 2 recommendation is maintained by W3C and is available from
[Link]

This page was generated with the help of DOC++

[Link]
July 4, 2006 4
2 License

License

Copyright (c) 2000-2003 Intel Corporation All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

• Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
• Redistributions in binary form must reproduce the above copyright notice, this list of con-
ditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
• Neither name of Intel Corporation nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS


”AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM-
ITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR CON-
TRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEM-
PLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PRO-
CUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIA-
BILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLI-
GENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This page was generated with the help of DOC++

[Link]
July 4, 2006 5
3 BOOL

typedef int BOOL

This page was generated with the help of DOC++

[Link]
July 4, 2006 6
4 DOM Interfaces

DOM Interfaces

Names
4.1 Interface Node ........................................ 7
4.2 Interface Attr ........................................ 19
4.3 Interface CDATASection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.4 Interface Document ........................................ 21
4.5 Interface Element ........................................ 33
4.6 Interface NamedNodeMap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.7 Interface NodeList ........................................ 49

The Document Object Model consists of a set of objects and interfaces for accessing and manip-
ulating 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.

4.1

Interface Node

Names
4.1.1 EXPORT SPEC const DOMString
ixmlNode getNodeName (IXML Node* nodeptr )
Returns the name of the Node, depend-
ing on what type of Node it is, in a read-
only string. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.1.2 EXPORT SPEC DOMString
ixmlNode getNodeValue (IXML Node* nodeptr )
Returns the value of the Node as a string.
........................................ 10
4.1.3 EXPORT SPEC int
ixmlNode setNodeValue (IXML Node* nodeptr,
char* newNodeValue )
Assigns a new value to a Node. . . . . . . . 10
4.1.4 EXPORT SPEC unsigned short
ixmlNode getNodeType (IXML Node* nodeptr )
Retrieves the type of a Node. ......... 11
4.1.5 EXPORT SPEC IXML Node*
ixmlNode getParentNode (IXML Node* nodeptr )
Retrieves the parent Node for a Node. 11
4.1.6 EXPORT SPEC IXML NodeList*

This page was generated with the help of DOC++

[Link]
July 4, 2006 7
4 DOM Interfaces

ixmlNode getChildNodes (IXML Node* nodeptr )


Retrieves the list of children of a Node in
a NodeList structure. . . . . . . . . . . . . . . . . . 12
4.1.7 EXPORT SPEC IXML Node*
ixmlNode getFirstChild (IXML Node* nodeptr )
Retrieves the first child Node of a Node.
........................................ 12
4.1.8 EXPORT SPEC IXML Node*
ixmlNode getLastChild (IXML Node* nodeptr )
Retrieves the last child Node of a Node.
........................................ 12
4.1.9 EXPORT SPEC IXML Node*
ixmlNode getPreviousSibling (IXML Node* nodeptr )
Retrieves the sibling Node immediately
preceding this Node. . . . . . . . . . . . . . . . . . . 13
4.1.10 EXPORT SPEC IXML Node*
ixmlNode getNextSibling (IXML Node* nodeptr )
Retrieves the sibling Node immediately
following this Node. . . . . . . . . . . . . . . . . . . 13
4.1.11 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. . . . . . . . . . . 13
4.1.12 EXPORT SPEC IXML Document*
ixmlNode getOwnerDocument (IXML Node* nodeptr )
Retrieves the document object associated
with this Node. . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.13 EXPORT SPEC const DOMString
ixmlNode getNamespaceURI (IXML Node* nodeptr )
Retrieves the namespace URI for a Node
as a DOMString. . . . . . . . . . . . . . . . . . . . . 14
4.1.14 EXPORT SPEC DOMString
ixmlNode getPrefix (IXML Node* nodeptr )
Retrieves the namespace prefix, if present.
........................................ 14
4.1.15 EXPORT SPEC const DOMString
ixmlNode getLocalName (IXML Node* nodeptr )
Retrieves the local name of a Node, if
present. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.16 EXPORT SPEC int
ixmlNode insertBefore (IXML Node* nodeptr,
IXML Node* newChild,
IXML Node* refChild )
Inserts a new child Node before the exist-
ing child Node. . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.17 EXPORT SPEC int

This page was generated with the help of DOC++

[Link]
July 4, 2006 8
4 DOM Interfaces

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. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.1.18 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. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1.19 EXPORT SPEC int
ixmlNode appendChild (IXML Node* nodeptr,
IXML Node* newChild )
Appends a child Node to the list of chil-
dren of a Node. . . . . . . . . . . . . . . . . . . . . . . . 17
4.1.20 EXPORT SPEC BOOL
ixmlNode hasChildNodes (IXML Node* nodeptr )
Queries whether or not a Node has chil-
dren. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1.21 EXPORT SPEC IXML Node*
ixmlNode cloneNode (IXML Node* nodeptr, BOOL deep )
Clones a Node. . . . . . . . . . . . . . . . . . . . . . . . 18
4.1.22 EXPORT SPEC BOOL
ixmlNode hasAttributes (IXML Node* node )
Queries whether this Node has attributes.
........................................ 19
4.1.23 EXPORT SPEC void
ixmlNode free (IXML Node* IXML Node )
Frees a Node and all Nodes in its sub-
tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

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.

4.1.1

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.

Returns the name of the Node, depending on what type of Node it is, in a read-only string.
Refer to the table in the DOM2-Core for a description of the node names for various interfaces.

This page was generated with the help of DOC++

[Link]
July 4, 2006 9
4 DOM Interfaces

Return Value: [const DOMString] A constant DOMString of the


node name.
Parameters: nodeptr Pointer to the node to retrieve the name.

4.1.2

EXPORT SPEC DOMString ixmlNode getNodeValue (IXML Node*


nodeptr )

Returns the value of the Node as a string.

Returns the value of the Node as a string. Note that this string is not a copy and modifying it
will modify the value of the Node.

Return Value: [DOMString] A DOMString of the Node value.


Parameters: nodeptr Pointer to the Node to retrieve the value.

4.1.3

EXPORT SPEC int ixmlNode setNodeValue (IXML Node* nodeptr,


char* newNodeValue )

Assigns a new value to a Node.

Assigns a new value to a Node. The newNodeValue string is duplicated and stored in the
Node so that the original does not have to persist past this call.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: The Node* is
not a valid pointer.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: nodeptr The Node to which to assign a new value.


newNodeValue The new value of the Node.

This page was generated with the help of DOC++

[Link]
July 4, 2006 10
4 DOM Interfaces

4.1.4

EXPORT SPEC unsigned short ixmlNode getNodeType (IXML Node*


nodeptr )

Retrieves the type of a Node.

Retrieves the type of a Node. The defined Node constants are:

• eATTRIBUTE NODE
• eCDATA SECTION NODE
• eCOMMENT NODE
• eDOCUMENT FRAGMENT NODE
• eDOCUMENT NODE
• eDOCUMENT TYPE NODE
• eELEMENT NODE
• eENTITY NODE
• eENTITY REFERENCE NODE
• eNOTATION NODE
• ePROCESSING INSTRUCTION NODE
• eTEXT NODE

Return Value: [const unsigned short] An integer representing the type


of the Node.
Parameters: nodeptr The Node from which to retrieve the type.

4.1.5

EXPORT SPEC IXML Node* ixmlNode getParentNode (IXML Node*


nodeptr )

Retrieves the parent Node for a Node.

Retrieves the parent Node for a Node.

Return Value: [Node*] A pointer to the parent Node or NULL if the


Node has no parent.
Parameters: nodeptr The Node from which to retrieve the parent.

This page was generated with the help of DOC++

[Link]
July 4, 2006 11
4 DOM Interfaces

4.1.6

EXPORT SPEC IXML NodeList* ixmlNode getChildNodes


(IXML Node* nodeptr )

Retrieves the list of children of a Node in a NodeList structure.

Retrieves the list of children of a Node in a NodeList structure. If a Node has no children,
ixmlNode getChildNodes returns a NodeList structure that contains no Nodes.

Return Value: [NodeList*] A NodeList of the children of the Node.


Parameters: nodeptr The Node from which to retrieve the children.

4.1.7

EXPORT SPEC IXML Node* ixmlNode getFirstChild (IXML Node*


nodeptr )

Retrieves the first child Node of a Node.

Retrieves the first child Node of a Node.

Return Value: [Node*] A pointer to the first child Node or NULL if the
Node does not have any children.
Parameters: nodeptr The Node from which to retrieve the first child.

4.1.8

EXPORT SPEC IXML Node* ixmlNode getLastChild (IXML Node*


nodeptr )

Retrieves the last child Node of a Node.

Retrieves the last child Node of a Node.

Return Value: [Node*] A pointer to the last child Node or NULL if the
Node does not have any children.
Parameters: nodeptr The Node from which to retrieve the last child.

This page was generated with the help of DOC++

[Link]
July 4, 2006 12
4 DOM Interfaces

4.1.9

EXPORT SPEC IXML Node* ixmlNode getPreviousSibling


(IXML Node* nodeptr )

Retrieves the sibling Node immediately preceding this Node.

Retrieves the sibling Node immediately preceding this Node.

Return Value: [Node*] A pointer to the previous sibling Node or NULL


if no such Node exists.
Parameters: nodeptr The Node for which to retrieve the previous sib-
ling.

4.1.10

EXPORT SPEC IXML Node* ixmlNode getNextSibling (IXML Node*


nodeptr )

Retrieves the sibling Node immediately following this Node.

Retrieves the sibling Node immediately following this Node.

Return Value: [Node*] A pointer to the next sibling Node or NULL if no


such Node exists.
Parameters: nodeptr The Node from which to retrieve the next sib-
ling.

4.1.11

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.

Retrieves the attributes of a Node, if it is an Element node, in a NamedNodeMap structure.

Return Value: [NamedNodeMap*] A NamedNodeMap of the attributes or NULL.


Parameters: nodeptr The Node from which to retrieve the attributes.

This page was generated with the help of DOC++

[Link]
July 4, 2006 13
4 DOM Interfaces

4.1.12

EXPORT SPEC IXML Document* ixmlNode getOwnerDocument


(IXML Node* nodeptr )

Retrieves the document object associated with this Node.

Retrieves the document object associated with this Node. This owner document Node allows
other Nodes to be created in the context of this document. Note that Document nodes do not
have an owner document.

Return Value: [Document*] A pointer to the owning Document or NULL, if


the Node does not have an owner.
Parameters: nodeptr The Node from which to retrieve the owner doc-
ument.

4.1.13

EXPORT SPEC const DOMString ixmlNode getNamespaceURI


(IXML Node* nodeptr )

Retrieves the namespace URI for a Node as a DOMString.

Retrieves the namespace URI for a Node as a DOMString. Only Nodes of type eELEMENT NODE
or eATTRIBUTE NODE can have a namespace URI. Nodes created through the Document interface
will only contain a namespace if created using ixmlDocument createElementNS.

Return Value: [const DOMString] A DOMString representing the


URI of the namespace or NULL.
Parameters: nodeptr The Node for which to retrieve the namespace.

4.1.14

EXPORT SPEC DOMString ixmlNode getPrefix (IXML Node* nodeptr


)

Retrieves the namespace prefix, if present.

Retrieves the namespace prefix, if present. The prefix is the name used as an alias for the names-
pace URI for this element. Only Nodes of type eELEMENT NODE or eATTRIBUTE NODE can have a
prefix. Nodes created through the Document interface will only contain a prefix if created using
ixmlDocument createElementNS.

This page was generated with the help of DOC++

[Link]
July 4, 2006 14
4 DOM Interfaces

Return Value: [DOMString] A DOMString representing the namespace pre-


fix or NULL.
Parameters: nodeptr The Node from which to retrieve the prefix.

4.1.15

EXPORT SPEC const DOMString ixmlNode getLocalName


(IXML Node* nodeptr )

Retrieves the local name of a Node, if present.

Retrieves the local name of a Node, if present. The local name is the tag name without the
namespace prefix. Only Nodes of type eELEMENT NODE or eATTRIBUTE NODE can have a local
name. Nodes created through the Document interface will only contain a local name if created
using ixmlDocument createElementNS.

Return Value: [const DOMString] A DOMString representing the lo-


cal name of the Element or NULL.
Parameters: nodeptr The Node from which to retrieve the local name.

4.1.16

EXPORT SPEC int ixmlNode insertBefore (IXML Node* nodeptr,


IXML Node* newChild,
IXML Node* refChild )

Inserts a new child Node before the existing child Node.

Inserts a new child Node before the existing child Node. refChild can be NULL, which inserts
newChild at the end of the list of children. Note that the Node (or Nodes) in newChild must
already be owned by the owner document (or have no owner at all) of nodeptr for insertion. If not,
the Node (or Nodes) must be imported into the document using ixmlDocument importNode.
If newChild is already in the tree, it is removed first.

This page was generated with the help of DOC++

[Link]
July 4, 2006 15
4 DOM Interfaces

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either nodeptr
or newChild is NULL.

• IXML HIERARCHY REQUEST ERR: The type of


the Node does not allow children of the
type of newChild.
• IXML WRONG DOCUMENT ERR: newChild has
an owner document that does not match
the owner of nodeptr.
• IXML NO MODIFICATION ALLOWED ERR:
nodeptr is read-only or the parent of the
Node being inserted is read-only.
• IXML NOT FOUND ERR: refChild is not a
child of nodeptr.

Parameters: nodeptr The parent of the Node before which to insert


the new child.
newChild The Node to insert into the tree.
refChild The reference child where the new Node should
be inserted. The new Node willappear directly
before the reference child.

4.1.17

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.

Parameters: nodeptr The parent of the Node which contains the child
to replace.
newChild The child with which to replace oldChild.
oldChild The child to replace with newChild.
returnNode Pointer to a Node to place the removed old-
Child Node.

This page was generated with the help of DOC++

[Link]
July 4, 2006 16
4 DOM Interfaces

4.1.18

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.

Removes a child from the list of children of a Node. returnNode will contain the oldChild
Node, appropriately removed from the tree (i.e. it will no longer have an owner document).

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either nodeptr
or oldChild is NULL.
• IXML NO MODIFICATION ALLOWED ERR:
nodeptr or its parent is read-only.
• IXML NOT FOUND ERR: oldChild is not
among the children of nodeptr.

Parameters: nodeptr The parent of the child to remove.


oldChild The child Node to remove.
returnNode Pointer to a Node to place the removed old-
Child Node.

4.1.19

EXPORT SPEC int ixmlNode appendChild (IXML Node* nodeptr,


IXML Node* newChild )

Appends a child Node to the list of children of a Node.

Appends a child Node to the list of children of a Node. If newChild is already in the tree, it is
removed first.

This page was generated with the help of DOC++

[Link]
July 4, 2006 17
4 DOM Interfaces

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either nodeptr
or newChild is NULL.

• IXML HIERARCHY REQUEST ERR: newChild


is of a type that cannot be added as a child
of nodeptr or newChild is an ancestor of
nodeptr.

• IXML WRONG DOCUMENT ERR: newChild was


created from a different document than
nodeptr.
• IXML NO MODIFICATION ALLOWED ERR:
nodeptr is a read-only Node.

Parameters: nodeptr The Node in which to append the new child.


newChild The new child to append.

4.1.20

EXPORT SPEC BOOL ixmlNode hasChildNodes (IXML Node*


nodeptr )

Queries whether or not a Node has children.

Queries whether or not a Node has children.

Return Value: [BOOL] TRUE if the Node has one or more children oth-
erwise FALSE.
Parameters: nodeptr The Node to query for children.

4.1.21

EXPORT SPEC IXML Node* ixmlNode cloneNode (IXML Node*


nodeptr, BOOL deep )

Clones a Node.

Clones a Node. The new Node does not have a parent. The deep parameter controls whether
the subtree of the Node is also cloned. For details on cloning specific types of Nodes, refer to
the DOM2-Core recommendation.

This page was generated with the help of DOC++

[Link]
July 4, 2006 18
4 DOM Interfaces

Return Value: [Node*] A clone of nodeptr or NULL.


Parameters: nodeptr The Node to clone.
deep TRUE to clone the subtree also or FALSE to clone
only nodeptr.

4.1.22

EXPORT SPEC BOOL ixmlNode hasAttributes (IXML Node* node )

Queries whether this Node has attributes.

Queries whether this Node has attributes. Note that only Element nodes have attributes.

Return Value: [BOOL] TRUE if the Node has attributes otherwise FALSE.
Parameters: node The Node to query for attributes.

4.1.23

EXPORT SPEC void ixmlNode free (IXML Node* IXML Node )

Frees a Node and all Nodes in its subtree.

Frees a Node and all Nodes in its subtree.

Return Value: [void] This function does not return a value.


Parameters: IXML Node The Node to free.

4.2

Interface Attr

Names
4.2.1 EXPORT SPEC void
ixmlAttr free (IXML Attr* attrNode )
Frees an Attr node. . . . . . . . . . . . . . . . . . . . 20

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.

This page was generated with the help of DOC++

[Link]
July 4, 2006 19
4 DOM Interfaces

4.2.1

EXPORT SPEC void ixmlAttr free (IXML Attr* attrNode )

Frees an Attr node.

Frees an Attr node.

Return Value: [void] This function does not return a value.


Parameters: attrNode The Attr node to free.

4.3

Interface CDATASection

Names
4.3.1 EXPORT SPEC void
ixmlCDATASection init (IXML CDATASection* nodeptr )
Initializes a CDATASection node. . . . 20
4.3.2 EXPORT SPEC void
ixmlCDATASection free (IXML CDATASection* nodeptr )
Frees a CDATASection node. . . . . . . . . 21

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.

4.3.1

EXPORT SPEC void ixmlCDATASection init (IXML CDATASection*


nodeptr )

Initializes a CDATASection node.

Initializes a CDATASection node.

Return Value: [void] This function does not return a value.


Parameters: nodeptr The CDATASection node to initialize.

This page was generated with the help of DOC++

[Link]
July 4, 2006 20
4 DOM Interfaces

4.3.2

EXPORT SPEC void ixmlCDATASection free (IXML CDATASection*


nodeptr )

Frees a CDATASection node.

Frees a CDATASection node.

Return Value: [void] This function does not return a value.


Parameters: nodeptr The CDATASection node to free.

4.4

Interface Document

Names
4.4.1 EXPORT SPEC void
ixmlDocument init (IXML Document* nodeptr )
Initializes a Document node. . . . . . . . . . 24
4.4.2 EXPORT SPEC int
ixmlDocument createDocumentEx (IXML Document** doc
)
Creates a new empty Document node. 24
4.4.3 EXPORT SPEC IXML Document*
ixmlDocument createDocument ()
Creates a new empty Document node. 25
4.4.4 EXPORT SPEC int
ixmlDocument createElementEx (IXML Document* doc,
const DOMString
tagName,
IXML Element**
rtElement )
Creates a new Element node with the
given tag name. . . . . . . . . . . . . . . . . . . . . . . . 25
4.4.5 EXPORT SPEC IXML Element*
ixmlDocument createElement (IXML Document* doc,
const DOMString tagName )
Creates a new Element node with the
given tag name. . . . . . . . . . . . . . . . . . . . . . . . 26
4.4.6 EXPORT SPEC int

This page was generated with the help of DOC++

[Link]
July 4, 2006 21
4 DOM Interfaces

ixmlDocument createTextNodeEx (IXML Document* doc,


const DOMString data,
IXML Node** textNode
)
Creates a new Text node with the given
data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4.7 EXPORT SPEC IXML Node*
ixmlDocument createTextNode (IXML Document* doc,
const DOMString data )
Creates a new Text node with the given
data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4.8 EXPORT SPEC int
ixmlDocument createCDATASectionEx (IXML Document*
doc,
DOMString data,
IXML CDATASection**
cdNode )
Creates a new CDATASection node with
given data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4.9 EXPORT SPEC IXML CDATASection*
ixmlDocument createCDATASection (IXML Document*
doc,
DOMString data )
Creates a new CDATASection node with
given data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.10 EXPORT SPEC IXML Attr*
ixmlDocument createAttribute (IXML Document* doc,
char* name )
Creates a new Attr node with the given
name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.11 EXPORT SPEC int
ixmlDocument createAttributeEx (IXML Document* doc,
char* name,
IXML Attr** attrNode )
Creates a new Attr node with the given
name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.12 EXPORT SPEC IXML NodeList*
ixmlDocument getElementsByTagName (IXML Document*
doc, 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. . . . . . . . 29
4.4.13 EXPORT SPEC int

This page was generated with the help of DOC++

[Link]
July 4, 2006 22
4 DOM Interfaces

ixmlDocument createElementNSEx (IXML Document* doc,


DOMString
namespaceURI,
DOMString
qualifiedName,
IXML Element**
rtElement )
Creates a new Element node in the given
qualified name and namespace URI. . . . . 29
4.4.14 EXPORT SPEC IXML Element*
ixmlDocument createElementNS (IXML Document* doc,
DOMString
namespaceURI,
DOMString
qualifiedName )
Creates a new Element node in the given
qualified name and namespace URI. . . . . 30
4.4.15 EXPORT SPEC int
ixmlDocument createAttributeNSEx (IXML Document*
doc, DOMString
namespaceURI,
DOMString
qualifiedName,
IXML Attr**
attrNode )
Creates a new Attr node with the given
qualified name and namespace URI. . . . . 30
4.4.16 EXPORT SPEC IXML Attr*
ixmlDocument createAttributeNS (IXML Document* doc,
DOMString
namespaceURI,
DOMString
qualifiedName )
Creates a new Attr node with the given
qualified name and namespace URI. . . . . 31
4.4.17 EXPORT SPEC IXML NodeList*
ixmlDocument getElementsByTagNameNS
(IXML Document*
doc,
DOMString
names-
paceURI,
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.
........................................ 31
4.4.18 EXPORT SPEC IXML Element*

This page was generated with the help of DOC++

[Link]
July 4, 2006 23
4 DOM Interfaces

ixmlDocument getElementById (IXML Document* doc,


DOMString tagName )
Returns the Element whose ID matches
that given id. . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.4.19 EXPORT SPEC void
ixmlDocument free (IXML Document* doc )
Frees a Document object and all Nodes
associated with it. . . . . . . . . . . . . . . . . . . . . . . 32
4.4.20 EXPORT SPEC int
ixmlDocument importNode (IXML Document* doc,
IXML Node* importNode,
BOOL deep,
IXML Node** rtNode )
Imports a Node from another Docu-
ment into this Document. . . . . . . . . . . . 33

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.

4.4.1

EXPORT SPEC void ixmlDocument init (IXML Document* nodeptr )

Initializes a Document node.

Initializes a Document node.

Return Value: [void] This function does not return a value.


Parameters: nodeptr The Document node to initialize.

4.4.2

EXPORT SPEC int ixmlDocument createDocumentEx


(IXML Document** doc )

Creates a new empty Document node.

Creates a new empty Document node. The ixmlDocument createDocumentEx API differs
from the ixmlDocument createDocument API in that it returns an error code describing the
reason for the failure rather than just NULL.

This page was generated with the help of DOC++

[Link]
July 4, 2006 24
4 DOM Interfaces

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: doc Pointer to a Document where the new object


will be stored.

4.4.3

EXPORT SPEC IXML Document* ixmlDocument createDocument ()

Creates a new empty Document node.

Creates a new empty Document node.

Return Value: [Document*] A pointer to the new Document or NULL on fail-


ure.

4.4.4

EXPORT SPEC int ixmlDocument createElementEx


(IXML Document* doc, const DOMString tagName, IXML Element**
rtElement )

Creates a new Element node with the given tag name.

Creates a new Element node with the given tag name. The new Element node has a nodeName
of tagName and the localName, prefix, and namespaceURI set to NULL. To create an Element
with a namespace, see ixmlDocument createElementNS.
The ixmlDocument createElementEx API differs from the ixmlDocu-
ment createElement API in that it returns an error code describing the reason for failure
rather than just NULL.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc or
tagName is NULL.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

This page was generated with the help of DOC++

[Link]
July 4, 2006 25
4 DOM Interfaces

Parameters: doc The owner Document of the new node.


tagName The tag name of the new Element node.
rtElement Pointer to an Element where the new object will
be stored.

4.4.5

EXPORT SPEC IXML Element* ixmlDocument createElement


(IXML Document* doc, const DOMString tagName )

Creates a new Element node with the given tag name.

Creates a new Element node with the given tag name. The new Element node has a nodeName
of tagName and the localName, prefix, and namespaceURI set to NULL. To create an Element
with a namespace, see ixmlDocument createElementNS.

Return Value: [Document*] A pointer to the new Element or NULL on failure.


Parameters: doc The owner Document of the new node.
tagName The tag name of the new Element node.

4.4.6

EXPORT SPEC int ixmlDocument createTextNodeEx


(IXML Document* doc, const DOMString data, IXML Node** textNode
)

Creates a new Text node with the given data.

Creates a new Text node with the given data. The ixmlDocument createTextNodeEx API
differs from the ixmlDocument createTextNode API in that it returns an error code describing
the reason for failure rather than just NULL.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc or
data is NULL.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: doc The owner Document of the new node.


data The data to associate with the new Text node.
textNode A pointer to a Node where the new object will
be stored.

This page was generated with the help of DOC++

[Link]
July 4, 2006 26
4 DOM Interfaces

4.4.7

EXPORT SPEC IXML Node* ixmlDocument createTextNode


(IXML Document* doc, const DOMString data )

Creates a new Text node with the given data.

Creates a new Text node with the given data.

Return Value: [Node*] A pointer to the new Node or NULL on failure.


Parameters: doc The owner Document of the new node.
data The data to associate with the new Text node.

4.4.8

EXPORT SPEC int ixmlDocument createCDATASectionEx


(IXML Document* doc, DOMString data, IXML CDATASection**
cdNode )

Creates a new CDATASection node with given data.

Creates a new CDATASection node with given data.


The ixmlDocument createCDATASectionEx API differs from the ixmlDocu-
ment createCDATASection API in that it returns an error code describing the reason for
failure rather than just NULL.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc or
data is NULL.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: doc The owner Document of the new node.


data The data to associate with the new CDATA-
Section node.
cdNode A pointer to a Node where the new object will
be stored.

This page was generated with the help of DOC++

[Link]
July 4, 2006 27
4 DOM Interfaces

4.4.9

EXPORT SPEC IXML CDATASection* ixmlDocu-


ment createCDATASection (IXML Document* doc, DOMString
data )

Creates a new CDATASection node with given data.

Creates a new CDATASection node with given data.

Return Value: [CDATASection*] A pointer to the new CDATASection or NULL


on failure.
Parameters: doc The owner Document of the new node.
data The data to associate with the new CDATA-
Section node.

4.4.10

EXPORT SPEC IXML Attr* ixmlDocument createAttribute


(IXML Document* doc, char* name )

Creates a new Attr node with the given name.

Creates a new Attr node with the given name.

Return Value: [Attr*] A pointer to the new Attr or NULL on failure.


Parameters: doc The owner Document of the new node.
name The name of the new attribute.

4.4.11

EXPORT SPEC int ixmlDocument createAttributeEx


(IXML Document* doc, char* name, IXML Attr** attrNode )

Creates a new Attr node with the given name.

Creates a new Attr node with the given name.


The ixmlDocument createAttributeEx API differs from the ixmlDocu-
ment createAttribute API in that it returns an error code describing the reason for
failure rather than just NULL.

This page was generated with the help of DOC++

[Link]
July 4, 2006 28
4 DOM Interfaces

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc or
name is NULL.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: doc The owner Document of the new node.


name The name of the new attribute.
attrNode A pointer to a Attr where the new object will be
stored.

4.4.12

EXPORT SPEC IXML NodeList* ixmlDocument getElementsByTagName


(IXML Document* doc, 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.

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.

Return Value: [NodeList*] A pointer to a NodeList containing the match-


ing items or NULL on an error.
Parameters: doc The Document to search.
tagName The tag name to find.

4.4.13

EXPORT SPEC int ixmlDocument createElementNSEx


(IXML Document* doc, DOMString namespaceURI, DOMString quali-
fiedName, IXML Element** rtElement )

Creates a new Element node in the given qualified name and namespace URI.

Creates a new Element node in the given qualified name and namespace URI.
The ixmlDocument createElementNSEx API differs from the ixmlDocu-
ment createElementNS API in that it returns an error code describing the reason for
failure rather than just NULL.

This page was generated with the help of DOC++

[Link]
July 4, 2006 29
4 DOM Interfaces

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc,
namespaceURI, or qualifiedName is
NULL.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: doc The owner Document of the new node.


namespaceURI The namespace URI for the new Element.
qualifiedName The qualified name of the new Element.
rtElement A pointer to an Element where the new object
will be stored.

4.4.14

EXPORT SPEC IXML Element* ixmlDocument createElementNS


(IXML Document* doc, DOMString namespaceURI, DOMString quali-
fiedName )

Creates a new Element node in the given qualified name and namespace URI.

Creates a new Element node in the given qualified name and namespace URI.

Return Value: [Element*] A pointer to the new Element or NULL on failure.


Parameters: doc The owner Document of the new node.
namespaceURI The namespace URI for the new Element.
qualifiedName The qualified name of the new Element.

4.4.15

EXPORT SPEC int ixmlDocument createAttributeNSEx


(IXML Document* doc, DOMString namespaceURI, DOMString quali-
fiedName, IXML Attr** attrNode )

Creates a new Attr node with the given qualified name and namespace URI.

Creates a new Attr node with the given qualified name and namespace URI.
The ixmlDocument createAttributeNSEx API differs from the ixmlDocu-
ment createAttributeNS API in that it returns an error code describing the reason for
failure rather than just NULL.

This page was generated with the help of DOC++

[Link]
July 4, 2006 30
4 DOM Interfaces

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc,
namespaceURI, or qualifiedName is
NULL.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: doc The owner Document of the new Attr.


namespaceURI The namespace URI for the attribute.
qualifiedName The qualified name of the attribute.
attrNode A pointer to an Attr where the new object will
be stored.

4.4.16

EXPORT SPEC IXML Attr* ixmlDocument createAttributeNS


(IXML Document* doc, DOMString namespaceURI, DOMString quali-
fiedName )

Creates a new Attr node with the given qualified name and namespace URI.

Creates a new Attr node with the given qualified name and namespace URI.

Return Value: [Attr*] A pointer to the new Attr or NULL on failure.


Parameters: doc The owner Document of the new Attr.
namespaceURI The namespace URI for the attribute.
qualifiedName The qualified name of the attribute.

4.4.17

EXPORT SPEC IXML NodeList* ixmlDocument getElementsByTagNameNS


(IXML Document* doc, DOMString namespaceURI, DOMString local-
Name )

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.

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. Either namespaceURI
or localName can be the special "*" character, which matches any namespace or any local name
respectively.

This page was generated with the help of DOC++

[Link]
July 4, 2006 31
4 DOM Interfaces

Return Value: [NodeList*] A pointer to a NodeList containing the match-


ing items or NULL on an error.
Parameters: doc The Document to search.
namespaceURI The namespace of the elements to find or "*" to
match any namespace.
localName The local name of the elements to find or "*" to
match any local name.

4.4.18

EXPORT SPEC IXML Element* ixmlDocument getElementById


(IXML Document* doc, DOMString tagName )

Returns the Element whose ID matches that given id.

Returns the Element whose ID matches that given id.

Return Value: [Element*] A pointer to the matching Element or NULL on


an error.
Parameters: doc The owner Document of the Element.
tagName The name of the Element.

4.4.19

EXPORT SPEC void ixmlDocument free (IXML Document* doc )

Frees a Document object and all Nodes associated with it.

Frees a Document object and all Nodes associated with it. Any Nodes extracted via any other
interface function, e.g. ixmlDocument GetElementById, become invalid after this call unless
explicitly cloned.

Return Value: [void] This function does not return a value.


Parameters: doc The Document to free.

4.4.20

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.

This page was generated with the help of DOC++

[Link]
July 4, 2006 32
4 DOM Interfaces

Imports a Node from another Document into this Document. The new Node does not a have
parent node: it is a clone of the original Node with the ownerDocument set to doc. The deep
parameter controls whether all the children of the Node are imported. Refer to the DOM2-Core
recommendation for details on importing specific node types.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either doc or
importNode is not a valid pointer.
• IXML NOT SUPPORTED ERR: importNode is
a Document, which cannot be imported.
• IXML FAILED: The import operation failed
because the Node to be imported could not
be cloned.

Parameters: doc The Document into which to import.


importNode The Node to import.
deep TRUE to import all children of importNode or
FALSE to import only the root node.
rtNode A pointer to a new Node owned by doc.

4.5

Interface Element

Names
4.5.1 EXPORT SPEC void
ixmlElement init (IXML Element* element )
Initializes a IXML Element node. ... 36
4.5.2 EXPORT SPEC const DOMString
ixmlElement getTagName (IXML Element* element )
Returns the name of the tag as a constant
string. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.5.3 EXPORT SPEC DOMString
ixmlElement getAttribute (IXML Element* element,
DOMString name )
Retrieves an attribute of an Element by
name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.5.4 EXPORT SPEC int
ixmlElement setAttribute (IXML Element* element,
DOMString name,
DOMString value )
Adds a new attribute to an Element. . . 37
4.5.5 EXPORT SPEC int

This page was generated with the help of DOC++

[Link]
July 4, 2006 33
4 DOM Interfaces

ixmlElement removeAttribute (IXML Element* element,


DOMString name )
Removes an attribute by name. . . . . . . . . 37
4.5.6 EXPORT SPEC IXML Attr*
ixmlElement getAttributeNode (IXML Element* element,
DOMString name )
Retrieves an attribute node by name. . . . 38
4.5.7 EXPORT SPEC int
ixmlElement setAttributeNode (IXML Element* element,
IXML Attr* newAttr,
IXML Attr** rtAttr )
Adds a new attribute node to an Element.
........................................ 38
4.5.8 EXPORT SPEC int
ixmlElement removeAttributeNode (IXML Element*
element,
IXML Attr* oldAttr,
IXML Attr** rtAttr )
Removes the specified attribute node from
an Element. . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.5.9 EXPORT SPEC IXML NodeList*
ixmlElement getElementsByTagName (IXML Element*
element,
DOMString
tagName )
Returns a NodeList of all descendant El-
ements with a given tag name, in the
order in which they are encountered in a
pre-order traversal of this Element tree.
39
4.5.10 EXPORT SPEC DOMString
ixmlElement getAttributeNS (IXML Element* element,
DOMString namespaceURI,
DOMString localname )
Retrieves an attribute value using the local
name and namespace URI. . . . . . . . . . . . . . 40
4.5.11 EXPORT SPEC int
ixmlElement setAttributeNS (IXML Element* element,
DOMString namespaceURI,
DOMString qualifiedName,
DOMString value )
Adds a new attribute to an Element using
the local name and namespace URI. . . . . 40
4.5.12 EXPORT SPEC int
ixmlElement removeAttributeNS (IXML Element* element,
DOMString
namespaceURI,
DOMString localName )
Removes an attribute using the namespace
URI and local name. . . . . . . . . . . . . . . . . . . . 41
4.5.13 EXPORT SPEC IXML Attr*

This page was generated with the help of DOC++

[Link]
July 4, 2006 34
4 DOM Interfaces

ixmlElement getAttributeNodeNS (IXML Element*


element, DOMString
namespaceURI,
DOMString localName )
Retrieves an Attr node by local name and
namespace URI. . . . . . . . . . . . . . . . . . . . . . . . 41
4.5.14 EXPORT SPEC int
ixmlElement setAttributeNodeNS (IXML Element*
element,
IXML Attr* newAttr,
IXML Attr** rcAttr )
Adds a new attribute node. . . . . . . . . . . . . . 42
4.5.15 EXPORT SPEC IXML NodeList*
ixmlElement getElementsByTagNameNS (IXML Element*
element,
DOMString
namespaceURI,
DOMString
localName )
Returns a NodeList of all descendant El-
ements with a given tag name, in the
order in which they are encountered in the
pre-order traversal of the Element tree. 42
4.5.16 EXPORT SPEC BOOL
ixmlElement hasAttribute (IXML Element* element,
DOMString name )
Queries whether the Element has an at-
tribute with the given name or a default
value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.5.17 EXPORT SPEC BOOL
ixmlElement hasAttributeNS (IXML Element* element,
DOMString namespaceURI,
DOMString localName )
Queries whether the Element has an at-
tribute with the given local name and
namespace URI or has a default value for
that attribute. . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.5.18 EXPORT SPEC void
ixmlElement free (IXML Element* element )
Frees the given Element and any subtree
of the Element. . . . . . . . . . . . . . . . . . . . . . . . 43

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.

4.5.1

EXPORT SPEC void ixmlElement init (IXML Element* element )

This page was generated with the help of DOC++

[Link]
July 4, 2006 35
4 DOM Interfaces

Initializes a IXML Element node.

Initializes a IXML Element node.

Return Value: [void] This function does not return a value.


Parameters: element The Element to initialize.

4.5.2

EXPORT SPEC const DOMString ixmlElement getTagName


(IXML Element* element )

Returns the name of the tag as a constant string.

Returns the name of the tag as a constant string.

Return Value: [const DOMString] A DOMString representing the


name of the Element.
Parameters: element The Element from which to retrieve the name.

4.5.3

EXPORT SPEC DOMString ixmlElement getAttribute


(IXML Element* element, DOMString name )

Retrieves an attribute of an Element by name.

Retrieves an attribute of an Element by name.

Return Value: [DOMString] A DOMString representing the value of the at-


tribute.
Parameters: element The Element from which to retrieve the at-
tribute.
name The name of the attribute to retrieve.

4.5.4

EXPORT SPEC int ixmlElement setAttribute (IXML Element* el-


ement, DOMString
name, DOMString
value )

This page was generated with the help of DOC++

[Link]
July 4, 2006 36
4 DOM Interfaces

Adds a new attribute to an Element.

Adds a new attribute to an Element. If an attribute with the same name already exists, the
attribute value will be updated with the new value in value.

Return Value: [int] An integer representing of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element,
name, or value is NULL.
• IXML INVALID CHARACTER ERR: name con-
tains an illegal character.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete the opera-
tion.

Parameters: element The Element on which to set the attribute.


name The name of the attribute.
value The value of the attribute. Note that this is a
non-parsed string and any markup must be es-
caped.

4.5.5

EXPORT SPEC int ixmlElement removeAttribute (IXML Element* el-


ement, DOMString name )

Removes an attribute by name.

Removes an attribute by name.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element
or name is NULL.

Parameters: element The Element from which to remove the at-


tribute.
name The name of the attribute to remove.

This page was generated with the help of DOC++

[Link]
July 4, 2006 37
4 DOM Interfaces

4.5.6

EXPORT SPEC IXML Attr* ixmlElement getAttributeNode


(IXML Element* element, DOMString name )

Retrieves an attribute node by name.

Retrieves an attribute node by name. See ixmlElement getAttributeNodeNS to retrieve an


attribute node using a qualified name or namespace URI.

Return Value: [Attr*] A pointer to the attribute matching name or


NULL on an error.
Parameters: element The Element from which to get the attribute
node.
name The name of the attribute node to find.

4.5.7

EXPORT SPEC int ixmlElement setAttributeNode (IXML Element*


element, IXML Attr* newAttr, IXML Attr** rtAttr )

Adds a new attribute node to an Element.

Adds a new attribute node to an Element. If an attribute already exists with newAttr as a
name, it will be replaced with the new one and the old one will be returned in rtAttr.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element
or newAttr is NULL.
• IXML WRONG DOCUMENT ERR: newAttr does
not belong to the same one as element.
• IXML INUSE ATTRIBUTE ERR: newAttr is
already an attribute of another Element.

Parameters: element The Element in which to add the new attribute.


newAttr The new Attr to add.
rtAttr A pointer to an Attr where the old Attr will be
stored. This will have a NULL if no prior node
existed.

This page was generated with the help of DOC++

[Link]
July 4, 2006 38
4 DOM Interfaces

4.5.8

EXPORT SPEC int ixmlElement removeAttributeNode


(IXML Element* element, IXML Attr* oldAttr, IXML Attr** rtAttr
)

Removes the specified attribute node from an Element.

Removes the specified attribute node from an Element.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element
or oldAttr is NULL.
• IXML NOT FOUND ERR: oldAttr is not among
the list attributes of element.

Parameters: element The Element from which to remove the at-


tribute.
oldAttr The attribute to remove from the Element.
rtAttr A pointer to an attribute in which to place the
removed attribute.

4.5.9

EXPORT SPEC IXML NodeList* ixmlElement getElementsByTagName


(IXML Element* element, 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.

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.

Return Value: [NodeList*] A NodeList of the matching Elements or NULL


on an error.
Parameters: element The Element from which to start the search.
tagName The name of the tag for which to search.

This page was generated with the help of DOC++

[Link]
July 4, 2006 39
4 DOM Interfaces

4.5.10

EXPORT SPEC DOMString ixmlElement getAttributeNS


(IXML Element* element, DOMString namespaceURI, DOMString
localname )

Retrieves an attribute value using the local name and namespace URI.

Retrieves an attribute value using the local name and namespace URI.

Return Value: [DOMString] A DOMString representing the value of the


matching attribute.
Parameters: element The Element from which to get the attribute
value.
namespaceURI The namespace URI of the attribute.
localname The local name of the attribute.

4.5.11

EXPORT SPEC int ixmlElement setAttributeNS (IXML Element* ele-


ment, DOMString namespaceURI, DOMString qualifiedName, DOMString
value )

Adds a new attribute to an Element using the local name and namespace URI.

Adds a new attribute to an Element using the local name and namespace URI. If another attribute
matches the same local name and namespace, the prefix is changed to be the prefix part of the
qualifiedName and the value is changed to value.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element,
namespaceURI, qualifiedName, or
value is NULL.
• IXML INVALID CHARACTER ERR: qualified-
Name contains an invalid character.
• IXML NAMESPACE ERR: Either the qualified-
Name or namespaceURI is malformed.
Refer to the DOM2-Core for possible rea-
sons.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exist to complete the opera-
tion.
• IXML FAILED: The operation could not be
completed.

This page was generated with the help of DOC++

[Link]
July 4, 2006 40
4 DOM Interfaces

Parameters: element The Element on which to set the attribute.


namespaceURI The namespace URI of the new attribute.
qualifiedName The qualified name of the attribute.
value The new value for the attribute.

4.5.12

EXPORT SPEC int ixmlElement removeAttributeNS


(IXML Element* element, DOMString namespaceURI, DOMString
localName )

Removes an attribute using the namespace URI and local name.

Removes an attribute using the namespace URI and local name.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element,
namespaceURI, or localName is NULL.

Parameters: element The Element from which to remove the the at-
tribute.
namespaceURI The namespace URI of the attribute.
localName The local name of the attribute.

4.5.13

EXPORT SPEC IXML Attr* ixmlElement getAttributeNodeNS


(IXML Element* element, DOMString namespaceURI, DOMString
localName )

Retrieves an Attr node by local name and namespace URI.

Retrieves an Attr node by local name and namespace URI.

Return Value: [Attr*] A pointer to an Attr or NULL on an error.


Parameters: element The Element from which to get the attribute.
namespaceURI The namespace URI of the attribute.
localName The local name of the attribute.

This page was generated with the help of DOC++

[Link]
July 4, 2006 41
4 DOM Interfaces

4.5.14

EXPORT SPEC int ixmlElement setAttributeNodeNS


(IXML Element* element, IXML Attr* newAttr, IXML Attr** rcAttr )

Adds a new attribute node.

Adds a new attribute node. If an attribute with the same local name and namespace URI already
exists in the Element, the existing attribute node is replaced with newAttr and the old returned
in rcAttr.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: Either element
or newAttr is NULL.
• IXML WRONG DOCUMENT ERR: newAttr does
not belong to the same document as ele-
ment.
• IXML INUSE ATTRIBUTE ERR: newAttr al-
ready is an attribute of another Element.

Parameters: element The Element in which to add the attribute node.


newAttr The new Attr to add.
rcAttr A pointer to the replaced Attr, if it exists.

4.5.15

EXPORT SPEC IXML NodeList* ixmlElement getElementsByTagNameNS


(IXML Element* element, DOMString namespaceURI, DOMString local-
Name )

Returns a NodeList of all descendant Elements with a given tag name, in the order in which
they are encountered in the pre-order traversal of the Element tree.

Returns a NodeList of all descendant Elements with a given tag name, in the order in which
they are encountered in the pre-order traversal of the Element tree.

Return Value: [NodeList*] A NodeList of matching Elements or NULL on


an error.
Parameters: element The Element from which to start the search.
namespaceURI The namespace URI of the Elements to find.
localName The local name of the Elements to find.

This page was generated with the help of DOC++

[Link]
July 4, 2006 42
4 DOM Interfaces

4.5.16

EXPORT SPEC BOOL ixmlElement hasAttribute (IXML Element* el-


ement, DOMString name )

Queries whether the Element has an attribute with the given name or a default value.

Queries whether the Element has an attribute with the given name or a default value.

Return Value: [BOOL] TRUE if the Element has an attribute with this
name or has a default value for that attribute,
otherwise FALSE.
Parameters: element The Element on which to check for an attribute.
name The name of the attribute for which to check.

4.5.17

EXPORT SPEC BOOL ixmlElement hasAttributeNS (IXML Element*


element, DOMString namespaceURI, 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.

Queries whether the Element has an attribute with the given local name and namespace URI or
has a default value for that attribute.

Return Value: [BOOL] TRUE if the Element has an attribute with the
given namespace and local name or has a default
value for that attribute, otherwise FALSE.
Parameters: element The Element on which to check for the at-
tribute.
namespaceURI The namespace URI of the attribute.
localName The local name of the attribute.

4.5.18

EXPORT SPEC void ixmlElement free (IXML Element* element )

Frees the given Element and any subtree of the Element.

Frees the given Element and any subtree of the Element.

Return Value: [void] This function does not return a value.


Parameters: element The Element to free.

This page was generated with the help of DOC++

[Link]
July 4, 2006 43
4 DOM Interfaces

4.6

Interface NamedNodeMap

Names
4.6.1 EXPORT SPEC unsigned long
ixmlNamedNodeMap getLength (IXML NamedNodeMap*
nnMap )
Returns the number of items contained in
this NamedNodeMap. . . . . . . . . . . . . . . . 45
4.6.2 EXPORT SPEC IXML Node*
ixmlNamedNodeMap getNamedItem
(IXML NamedNodeMap*
nnMap,
DOMString name )
Retrieves a Node from the
NamedNodeMap by name. . . . . . . . . . . 46
4.6.3 EXPORT SPEC IXML Node*
ixmlNamedNodeMap setNamedItem
(IXML NamedNodeMap*
nnMap,
IXML Node* arg )
Adds a new Node to the
NamedNodeMap using the Node
name attribute. . . . . . . . . . . . . . . . . . . . . . . . . 46
4.6.4 EXPORT SPEC IXML Node*
ixmlNamedNodeMap removeNamedItem
(IXML NamedNodeMap*
nnMap,
DOMString
name )
Removes a Node from a
NamedNodeMap specified by name. . 47
4.6.5 EXPORT SPEC IXML Node*
ixmlNamedNodeMap item (IXML NamedNodeMap* nnMap,
unsigned long index )
Retrieves a Node from a
NamedNodeMap specified by a nu-
merical index. . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.6.6 EXPORT SPEC IXML Node*

This page was generated with the help of DOC++

[Link]
July 4, 2006 44
4 DOM Interfaces

ixmlNamedNodeMap getNamedItemNS
(IXML NamedNodeMap*
nnMap,
DOMString*
namespaceURI,
DOMString
localName )
Retrieves a Node from a
NamedNodeMap specified by names-
pace URI and local name. . . . . . . . . . . . . . . 47
4.6.7 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.
........................................ 48
4.6.8 EXPORT SPEC IXML Node*
ixmlNamedNodeMap removeNamedItemNS
(IXML NamedNodeMap*
nnMap,
DOMString
names-
paceURI,
DOMString
localName )
Removes a Node from a
NamedNodeMap specified by names-
pace URI and local name. . . . . . . . . . . . . . . 48
4.6.9 EXPORT SPEC void
ixmlNamedNodeMap free (IXML NamedNodeMap* nnMap )
Frees a NamedNodeMap. . . . . . . . . . . . 48

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.

4.6.1

EXPORT SPEC unsigned long ixmlNamedNodeMap getLength


(IXML NamedNodeMap* nnMap )

Returns the number of items contained in this NamedNodeMap.

Returns the number of items contained in this NamedNodeMap.

This page was generated with the help of DOC++

[Link]
July 4, 2006 45
4 DOM Interfaces

Return Value: [unsigned long] The number of nodes in this map.


Parameters: nnMap The NamedNodeMap from which to retrieve
the size.

4.6.2

EXPORT SPEC IXML Node* ixmlNamedNodeMap getNamedItem


(IXML NamedNodeMap* nnMap, DOMString name )

Retrieves a Node from the NamedNodeMap by name.

Retrieves a Node from the NamedNodeMap by name.

Return Value: [Node*] A Node or NULL if there is an error.


Parameters: nnMap The NamedNodeMap to search.
name The name of the Node to find.

4.6.3

EXPORT SPEC IXML Node* ixmlNamedNodeMap setNamedItem


(IXML NamedNodeMap* nnMap, IXML Node* arg )

Adds a new Node to the NamedNodeMap using the Node name attribute.

Adds a new Node to the NamedNodeMap using the Node name attribute.

Return Value: [Node*] The old Node if the new Node replaces
it or NULL if the Node was not in the
NamedNodeMap before.
Parameters: nnMap The NamedNodeMap in which to add the new
Node.
arg The new Node to add to the
NamedNodeMap.

4.6.4

EXPORT SPEC IXML Node* ixmlNamedNodeMap removeNamedItem


(IXML NamedNodeMap* nnMap, DOMString name )

Removes a Node from a NamedNodeMap specified by name.

This page was generated with the help of DOC++

[Link]
July 4, 2006 46
4 DOM Interfaces

Removes a Node from a NamedNodeMap specified by name.

Return Value: [Node*] A pointer to the Node, if found, or NULL if it


wasn’t.
Parameters: nnMap The NamedNodeMap from which to remove
the item.
name The name of the item to remove.

4.6.5

EXPORT SPEC IXML Node* ixmlNamedNodeMap item


(IXML NamedNodeMap* nnMap, unsigned long index )

Retrieves a Node from a NamedNodeMap specified by a numerical index.

Retrieves a Node from a NamedNodeMap specified by a numerical index.

Return Value: [Node*] A pointer to the Node, if found, or NULL if it


wasn’t.
Parameters: nnMap The NamedNodeMap from which to remove
the Node.
index The index into the map to remove.

4.6.6

EXPORT SPEC IXML Node* ixmlNamedNodeMap getNamedItemNS


(IXML NamedNodeMap* nnMap, DOMString* namespaceURI, DOM-
String localName )

Retrieves a Node from a NamedNodeMap specified by namespace URI and local name.

Retrieves a Node from a NamedNodeMap specified by namespace URI and local name.

Return Value: [Node*] A pointer to the Node, if found, or NULL if it


wasn’t
Parameters: nnMap The NamedNodeMap from which to remove
the Node.
namespaceURI The namespace URI of the Node to remove.
localName The local name of the Node to remove.

This page was generated with the help of DOC++

[Link]
July 4, 2006 47
4 DOM Interfaces

4.6.7

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.

Adds a new Node to the NamedNodeMap using the Node local name and namespace URI
attributes.

Return Value: [Node*] The old Node if the new Node replaces
it or NULL if the Node was not in the
NamedNodeMap before.
Parameters: nnMap The NamedNodeMap in which to add the
Node.
arg The Node to add to the map.

4.6.8

EXPORT SPEC IXML Node* ixmlNamedNodeMap removeNamedItemNS


(IXML NamedNodeMap* nnMap, DOMString namespaceURI, DOMString
localName )

Removes a Node from a NamedNodeMap specified by namespace URI and local name.

Removes a Node from a NamedNodeMap specified by namespace URI and local name.

Return Value: [Node*] A pointer to the Node, if found, or NULL if it


wasn’t.
Parameters: nnMap The NamedNodeMap from which to remove
the Node.
namespaceURI The namespace URI of the Node to remove.
localName The local name of the Node to remove.

4.6.9

EXPORT SPEC void ixmlNamedNodeMap free (IXML NamedNodeMap*


nnMap )

Frees a NamedNodeMap.

Frees a NamedNodeMap. The Nodes inside the map are not freed, just the NamedNodeMap
object.

This page was generated with the help of DOC++

[Link]
July 4, 2006 48
4 DOM Interfaces

Return Value: [void] This function does not return a value.


Parameters: nnMap The NamedNodeMap to free.

4.7

Interface NodeList

Names
4.7.1 EXPORT SPEC IXML Node*
ixmlNodeList item (IXML NodeList* nList,
unsigned long index )
Retrieves a Node from a NodeList spec-
ified by a numerical index. . . . . . . . . . . . . . 49
4.7.2 EXPORT SPEC unsigned long
ixmlNodeList length (IXML NodeList* nList )
Returns the number of Nodes in a
NodeList. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.7.3 EXPORT SPEC void
ixmlNodeList free (IXML NodeList* nList )
Frees a NodeList object. . . . . . . . . . . . . . . 50

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.

4.7.1

EXPORT SPEC IXML Node* ixmlNodeList item (IXML NodeList*


nList, unsigned long index )

Retrieves a Node from a NodeList specified by a numerical index.

Retrieves a Node from a NodeList specified by a numerical index.

Return Value: [Node*] A pointer to a Node or NULL if there was an


error.
Parameters: nList The NodeList from which to retrieve the Node.
index The index into the NodeList to retrieve.

This page was generated with the help of DOC++

[Link]
July 4, 2006 49
4 DOM Interfaces

4.7.2

EXPORT SPEC unsigned long ixmlNodeList length (IXML NodeList*


nList )

Returns the number of Nodes in a NodeList.

Returns the number of Nodes in a NodeList.

Return Value: [unsigned long] The number of Nodes in the NodeList.


Parameters: nList The NodeList for which to retrieve the number
of Nodes.

4.7.3

EXPORT SPEC void ixmlNodeList free (IXML NodeList* nList )

Frees a NodeList object.

Frees a NodeList object. Since the underlying Nodes are references, they are not freed using
this operating. This only frees the NodeList object.

Return Value: [void] This function does not return a value.


Parameters: nList The NodeList to free.

This page was generated with the help of DOC++

[Link]
July 4, 2006 50
5 IXML API

IXML API

Names
5.1 DOMString ixmlPrintDocument (IXML Document* doc)
Renders a Node and all sub-elements into
an XML document representation. . . . . . 52
5.2 DOMString ixmlPrintNode (IXML Node* doc )
Renders a Node and all sub-elements into
an XML text representation. . . . . . . . . . . . 52
5.3 DOMString ixmlDocumenttoString (IXML Document* doc)
Renders a Node and all sub-elements into
an XML document representation. . . . . . 53
5.4 EXPORT SPEC DOMString
ixmlNodetoString (IXML Node* doc )
Renders a Node and all sub-elements into
an XML text representation. . . . . . . . . . . . 53
5.5 void ixmlRelaxParser (char errorChar)
Makes the XML parser more tolerant to
malformed text. . . . . . . . . . . . . . . . . . . . . . . . . 53
5.6 EXPORT SPEC IXML Document*
ixmlParseBuffer (char* buffer )
Parses an XML text buffer converting it
into an IXML DOM representation. . . . 54
5.7 EXPORT SPEC int
ixmlParseBufferEx (char* buffer, IXML Document** doc )
Parses an XML text buffer converting it
into an IXML DOM representation. . . . 54
5.8 EXPORT SPEC IXML Document*
ixmlLoadDocument (char* xmlFile )
Parses an XML text file converting it into
an IXML DOM representation. . . . . . . . . 55
5.9 EXPORT SPEC int
ixmlLoadDocumentEx (char* xmlFile,
IXML Document** doc )
Parses an XML text file converting it into
an IXML DOM representation. . . . . . . . . 55
5.10 EXPORT SPEC DOMString
ixmlCloneDOMString (const DOMString src )
Clones an existing DOMString. . . . . . . 56
5.11 EXPORT SPEC void
ixmlFreeDOMString (DOMString buf )
Frees a DOMString. ................. 56

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

This page was generated with the help of DOC++

[Link]
July 4, 2006 51
5 IXML API

structure, and manipulate DOMString objects.

5.1

DOMString ixmlPrintDocument (IXML Document* doc)

Renders a Node and all sub-elements into an XML document representation.

Renders a Node and all sub-elements into an XML document representation. The caller is required
to free the DOMString returned from this function using ixmlFreeDOMString when it is no
longer required.
Note that this function can be used for any Node-derived interface. The difference between
ixmlPrintDocument and ixmlPrintNode is ixmlPrintDocument includes the XML prolog
while ixmlPrintNode only produces XML elements. An XML document is not well formed
unless it includes the prolog and at least one element.
This function introduces lots of white space to print the DOMString in readable format.

Return Value: [DOMString] A DOMString with the XML document repre-


sentation of the DOM tree or NULL on an error.

5.2

DOMString ixmlPrintNode (IXML Node* doc )

Renders a Node and all sub-elements into an XML text representation.

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.
Note that this function can be used for any Node-derived interface. A similar ixmlPrint-
Document function is defined to avoid casting when printing whole documents. This function
introduces lots of white space to print the DOMString in readable format.

Return Value: [DOMString] A DOMString with the XML text representa-


tion of the DOM tree or NULL on an error.
Parameters: doc The root of the Node tree to render to XML
text.

This page was generated with the help of DOC++

[Link]
July 4, 2006 52
5 IXML API

5.3

DOMString ixmlDocumenttoString (IXML Document* doc)

Renders a Node and all sub-elements into an XML document representation.

Renders a Node and all sub-elements into an XML document representation. The caller is required
to free the DOMString returned from this function using ixmlFreeDOMString when it is no
longer required.
Note that this function can be used for any Node-derived interface. The difference be-
tween ixmlDocumenttoString and ixmlNodetoString is ixmlDocumenttoString includes
the XML prolog while ixmlNodetoString only produces XML elements. An XML document is
not well formed unless it includes the prolog and at least one element.

Return Value: [DOMString] A DOMString with the XML text representa-


tion of the DOM tree or NULL on an error.

5.4

EXPORT SPEC DOMString ixmlNodetoString (IXML Node* doc )

Renders a Node and all sub-elements into an XML text representation.

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.
Note that this function can be used for any Node-derived interface. The difference between
ixmlNodetoString and ixmlDocumenttoString is ixmlNodetoString does not include the
XML prolog, it only produces XML elements.

Return Value: [DOMString] A DOMString with the XML text representa-


tion of the DOM tree or NULL on an error.
Parameters: doc The root of the Node tree to render to XML
text.

5.5

void ixmlRelaxParser (char errorChar)

Makes the XML parser more tolerant to malformed text.

Makes the XML parser more tolerant to malformed text.

This page was generated with the help of DOC++

[Link]
July 4, 2006 53
5 IXML API

If errorChar is 0 (default), the parser is strict about XML encoding : invalid UTF-8 sequences
or ”&” entities are rejected, and the parsing aborts. If errorChar is not 0, the parser is relaxed
: invalid UTF-8 characters are replaced by the errorChar, and invalid ”&” entities are left
untranslated. The parsing is then allowed to continue.

5.6

EXPORT SPEC IXML Document* ixmlParseBuffer (char* buffer )

Parses an XML text buffer converting it into an IXML DOM representation.

Parses an XML text buffer converting it into an IXML DOM representation.

Return Value: [Document*] A Document if the buffer correctly parses or


NULL on an error.
Parameters: buffer The buffer that contains the XML text to convert
to a Document.

5.7

EXPORT SPEC int ixmlParseBufferEx (char* buffer,


IXML Document** doc )

Parses an XML text buffer converting it into an IXML DOM representation.

Parses an XML text buffer converting it into an IXML DOM representation.


The ixmlParseBufferEx API differs from the ixmlParseBuffer API in that it returns an
error code representing the actual failure rather than just NULL.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: The buffer is
not a valid pointer.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: buffer The buffer that contains the XML text to convert
to a Document.
doc A point to store the Document if file correctly
parses or NULL on an error.

This page was generated with the help of DOC++

[Link]
July 4, 2006 54
5 IXML API

5.8

EXPORT SPEC IXML Document* ixmlLoadDocument (char* xmlFile


)

Parses an XML text file converting it into an IXML DOM representation.

Parses an XML text file converting it into an IXML DOM representation.

Return Value: [Document*] A Document if the file correctly parses or NULL


on an error.
Parameters: xmlFile The filename of the XML text to convert to a
Document.

5.9

EXPORT SPEC int ixmlLoadDocumentEx (char* xmlFile,


IXML Document** doc
)

Parses an XML text file converting it into an IXML DOM representation.

Parses an XML text file converting it into an IXML DOM representation.


The ixmlLoadDocumentEx API differs from the ixmlLoadDocument API in that it re-
turns a an error code representing the actual failure rather than just NULL.

Return Value: [int] An integer representing one of the following:


• IXML SUCCESS: The operation completed
successfully.
• IXML INVALID PARAMETER: The xmlFile is
not a valid pointer.
• IXML INSUFFICIENT MEMORY: Not enough
free memory exists to complete this oper-
ation.

Parameters: xmlFile The filename of the XML text to convert to a


Document.
doc A pointer to the Document if file correctly
parses or NULL on an error.

This page was generated with the help of DOC++

[Link]
July 4, 2006 55
5 IXML API

5.10

EXPORT SPEC DOMString ixmlCloneDOMString (const DOMString


src )

Clones an existing DOMString.

Clones an existing DOMString.

Return Value: [DOMString] A new DOMString that is a duplicate of the


original or NULL if the operation could not be
completed.
Parameters: src The source DOMString to clone.

5.11

EXPORT SPEC void ixmlFreeDOMString (DOMString buf )

Frees a DOMString.

Frees a DOMString.

Return Value: [void] This function does not return a value.


Parameters: buf The DOMString to free.

This page was generated with the help of DOC++

[Link]
July 4, 2006 56

You might also like