Packages: All | Callback | DOM | Range | SAX | Schema | Traversal | XML | XPath | XPointer | XSLT | XSLTVM Functions | Datatypes

Package DOM

Since the DOM standard is object-oriented, for this C adaptation, some changes had to be made:

Reused function names had to be expanded, e.g. getValue in the attribute class is given the unique name XmlDomGetAttrValue, matching the pattern established by DOM 2's "getNodeValue".

Also, some functions were added to extend the DOM. For example, there is no function defined which returns the number of children of a node, so XmlDomNumChildNodes was invented, etc.

The implementation of this DOM interface follows REC-DOM-Level-1-19981001.


Function Index

FunctionInterfaceDescription
XmlDomAppendChild Node Append new child to node's list of children
XmlDomAppendData CharacterData Append data to end of node's current data
XmlDomCleanNode Node "Clean" a node (free DOM allocations)
XmlDomCloneNode Node Clone a node
XmlDomCreateAttr Document Create attribute node
XmlDomCreateAttrNS Document Create attribute node with namespace information
XmlDomCreateCDATA Document Create CDATA node
XmlDomCreateComment Document Create comment node
XmlDomCreateElem Document Create an element node
XmlDomCreateElemNS Document Create an element node with namespace information
XmlDomCreateEntityRef Document Create entity reference node
XmlDomCreateFragment Document Create a document fragment
XmlDomCreatePI Document Create PI node
XmlDomCreateText Document Create text node
XmlDomDeleteData CharacterData Remove part of node's data
XmlDomFreeNode Node Free a node allocated with XmlDomCreateXXX
XmlDomFreeNodeList NodeList Free a node list returned by XmlDomGetElemsByTag etc
XmlDomFreeString Document Frees a string allocate by XmlDomSubstringData etc
XmlDomGetAttr Element Return attribute's value given its name
XmlDomGetAttrLocal Attr Returns an attribute's namespace local name as NULL-terminated string
XmlDomGetAttrLocalLen Attr Returns an attribute's namespace local name as length-encoded string
XmlDomGetAttrNS Element Return attribute's value given its URI and localname
XmlDomGetAttrName Attr Return attribute's name as NULL-terminated string
XmlDomGetAttrNameLen Attr Return attribute's name as length-encoded string
XmlDomGetAttrNode Element Get attribute by name
XmlDomGetAttrNodeNS Element Get attribute by name (namespace aware version)
XmlDomGetAttrPrefix Attr Returns an attribute's namespace prefix
XmlDomGetAttrSpecified Attr Return flag saying whether an attribute was explicitly created
XmlDomGetAttrURI Attr Returns an attribute's namespace URI as NULL-terminated string
XmlDomGetAttrURILen Attr Returns an attribute's namespace URI as length-encoded string
XmlDomGetAttrValue Attr Return attribute's value as NULL-terminated string
XmlDomGetAttrValueLen Attr Return attribute's value as length-encoded string
XmlDomGetAttrs Node Return attributes of node
XmlDomGetBaseURI Document Returns the base URI for a document
XmlDomGetCharData CharacterData Return data for node
XmlDomGetCharDataLength CharacterData Return length of data for node
XmlDomGetChildNodes Node Return children of node
XmlDomGetChildrenByTag Element Get children of element with given tag name [non-namespace-aware]
XmlDomGetChildrenByTagNS Element Get children of element with tag name [namespace-aware version]
XmlDomGetDTD Document Get DTD (Document Type) for document
XmlDomGetDTDEntities DocumentType Get entities of DTD
XmlDomGetDTDInternalSubset DocumentType Get DTD's internal subset
XmlDomGetDTDName DocumentType Get name of DTD
XmlDomGetDTDNotations DocumentType Get notations of DTD
XmlDomGetDTDPubID DocumentType Get DTD's public ID
XmlDomGetDTDSysID DocumentType Get DTD's system ID
XmlDomGetDecl Document Returns a document's XMLDecl information
XmlDomGetDefaultNS Node Get default namespace for node
XmlDomGetDocElem Document Get top-level element for document
XmlDomGetDocElemByID Document Get document element given ID
XmlDomGetDocElemsByTag Document Obtain doc elements
XmlDomGetDocElemsByTagNS Document Obtain doc elements (namespace aware version)
XmlDomGetElemsByTag Element Get elements with given tag name [non-namespace-aware version]
XmlDomGetElemsByTagNS Element Get elements with given URI and localname [namespace aware version]
XmlDomGetEntityNotation Entity Get entity's notation
XmlDomGetEntityPubID Entity Get entity's public ID
XmlDomGetEntitySysID Entity Get entity's system ID
XmlDomGetEntityType Entity Get entity's type
XmlDomGetFirstChild Node Returns first child of node
XmlDomGetFirstPfnsPair Node Get first prefix namespace pair
XmlDomGetLastChild Node Returns last child of node
XmlDomGetLastError Document Return last error code for document
XmlDomGetNamedItem NamedNodeMap Return named node from list
XmlDomGetNamedItemNS NamedNodeMap Return named node from list (namespace aware version)
XmlDomGetNextPfnsPair Node Get subsequent prefix namespace pair
XmlDomGetNextSibling Node Return next sibling of node
XmlDomGetNodeListItem NodeList Return nth node in list
XmlDomGetNodeListLength NodeList Return length of node list
XmlDomGetNodeLocal Node Get local part of node's qualified name as NULL-terminated string
XmlDomGetNodeLocalLen Node Get local part of node's qualified name as length-encoded string
XmlDomGetNodeMapItem NamedNodeMap Return nth node in list
XmlDomGetNodeMapLength NamedNodeMap Return length of named node map
XmlDomGetNodeName Node Get node's name as NULL-terminated string
XmlDomGetNodeNameLen Node Get node's name as length-encoded string
XmlDomGetNodePrefix Node Return namespace prefix of node
XmlDomGetNodeType Node Get node's numeric type code
XmlDomGetNodeURI Node Return namespace URI of node as a NULL-terminated string
XmlDomGetNodeURILen Node Return namespace URI of node as length-encoded string
XmlDomGetNodeValue Node Get node's value as NULL-terminated string
XmlDomGetNodeValueLen Node Get node value as length-encoded string
XmlDomGetNotationPubID Notation Get notation's public ID
XmlDomGetNotationSysID Notation Get notation's system ID
XmlDomGetOwnerDocument Node Get the owner document of node
XmlDomGetOwnerElem Attr Return an attribute's owning element
XmlDomGetPIData ProcessingInstruction Get processing instruction's data
XmlDomGetPITarget ProcessingInstruction Get PI's target
XmlDomGetParentNode Node Get parent node
XmlDomGetPrevSibling Node Return previous sibling of node
XmlDomGetSchema Document Returns URI of schema associated with document
XmlDomGetSourceEntity Node Return the entity node if the input file is an external entity
XmlDomGetSourceLine Node Return source line# of node
XmlDomGetSourceLocation Node Return source location (path, URI, etc) of node
XmlDomGetTag Element Return an element node's tagname
XmlDomHasAttr Element Does named attribute exist?
XmlDomHasAttrNS Element Does named attribute exist? (namespace aware version)
XmlDomHasAttrs Node Test if element has attributes
XmlDomHasChildNodes Node Test if node has children
XmlDomImportNode Document Import a node from another DOM
XmlDomInsertBefore Node Insert new child into node's list of children
XmlDomInsertData CharacterData Insert string into node's current data
XmlDomIsSchemaBased Document Indicate whether a schema is associated with a document
XmlDomNormalize Node "Normalize" a node, that is, merge adjacent text nodes
XmlDomNumAttrs Node Return number of attributes of element
XmlDomNumChildNodes Node Return number of children of node
XmlDomPrefixToURI Node Get namespace URI for prefix
XmlDomRemoveAttr Element Remove attribute with specified name
XmlDomRemoveAttrNS Element Remove attribute with specified URI and local name
XmlDomRemoveAttrNode Element Remove attribute node
XmlDomRemoveChild Node Remove an existing child node
XmlDomRemoveNamedItem NamedNodeMap Remove node from named node map
XmlDomRemoveNamedItemNS NamedNodeMap Remove node from named node map (namespace aware version)
XmlDomReplaceChild Node Replace an existing child of a node
XmlDomReplaceData CharacterData Replace part of node's data
XmlDomSaveString Document Saves a string permanently in a document's memory pool
XmlDomSaveString2 Document Saves a Unicode string permanently in a document's memory pool
XmlDomSetAttr Element Set new attribute for element
XmlDomSetAttrNS Element Set new attribute for element (namespace aware version)
XmlDomSetAttrNode Element Set attribute node
XmlDomSetAttrNodeNS Element Set attribute node (namespace aware version)
XmlDomSetAttrValue Attr Set an attribute's value
XmlDomSetBaseURI Document Sets base URI for document
XmlDomSetCharData CharacterData Set data for node
XmlDomSetDTD Document Sets DTD (Document Type Definition) for document
XmlDomSetDefaultNS Node Set default namespace for node
XmlDomSetDocOrder Document Set document order for all nodes
XmlDomSetNamedItem NamedNodeMap Set node in named node list
XmlDomSetNamedItemNS NamedNodeMap Set node in named node list (namespace aware version)
XmlDomSetNodePrefix Node Set namespace prefix of node
XmlDomSetNodeValue Node Set node value
XmlDomSetNodeValueLen Node Set node value as length-encoded string
XmlDomSetPIData ProcessingInstruction Set processing instruction's data
XmlDomSplitText Text Split text node into two
XmlDomSubstringData CharacterData Return substring of node's data
XmlDomSync Document Synchronizes the persistent version of a document with its DOM.
XmlDomValidate Node Validate a node against current DTD


Interface Attr (XML Attribute functions)

First paragraph is extra documentation that's not really necessary but is just here to test the doc stripper.

Second paragraph is not any more exciting. Read a book!

Example

	
	XmlDomGetAttrLocal(attr pfx:bar) --> "bar\0"

Function Index

FunctionDescription
XmlDomGetAttrLocal Returns an attribute's namespace local name as NULL-terminated string
XmlDomGetAttrLocalLen Returns an attribute's namespace local name as length-encoded string
XmlDomGetAttrName Return attribute's name as NULL-terminated string
XmlDomGetAttrNameLen Return attribute's name as length-encoded string
XmlDomGetAttrPrefix Returns an attribute's namespace prefix
XmlDomGetAttrSpecified Return flag saying whether an attribute was explicitly created
XmlDomGetAttrURI Returns an attribute's namespace URI as NULL-terminated string
XmlDomGetAttrURILen Returns an attribute's namespace URI as length-encoded string
XmlDomGetAttrValue Return attribute's value as NULL-terminated string
XmlDomGetAttrValueLen Return attribute's value as length-encoded string
XmlDomGetOwnerElem Return an attribute's owning element
XmlDomSetAttrValue Set an attribute's value


Interface CharacterData

Function Index

FunctionDescription
XmlDomAppendData Append data to end of node's current data
XmlDomDeleteData Remove part of node's data
XmlDomGetCharData Return data for node
XmlDomGetCharDataLength Return length of data for node
XmlDomInsertData Insert string into node's current data
XmlDomReplaceData Replace part of node's data
XmlDomSetCharData Set data for node
XmlDomSubstringData Return substring of node's data


Interface Document

Function Index

FunctionDescription
XmlDomCreateAttr Create attribute node
XmlDomCreateAttrNS Create attribute node with namespace information
XmlDomCreateCDATA Create CDATA node
XmlDomCreateComment Create comment node
XmlDomCreateElem Create an element node
XmlDomCreateElemNS Create an element node with namespace information
XmlDomCreateEntityRef Create entity reference node
XmlDomCreateFragment Create a document fragment
XmlDomCreatePI Create PI node
XmlDomCreateText Create text node
XmlDomFreeString Frees a string allocate by XmlDomSubstringData etc
XmlDomGetBaseURI Returns the base URI for a document
XmlDomGetDTD Get DTD (Document Type) for document
XmlDomGetDecl Returns a document's XMLDecl information
XmlDomGetDocElem Get top-level element for document
XmlDomGetDocElemByID Get document element given ID
XmlDomGetDocElemsByTag Obtain doc elements
XmlDomGetDocElemsByTagNS Obtain doc elements (namespace aware version)
XmlDomGetLastError Return last error code for document
XmlDomGetSchema Returns URI of schema associated with document
XmlDomImportNode Import a node from another DOM
XmlDomIsSchemaBased Indicate whether a schema is associated with a document
XmlDomSaveString Saves a string permanently in a document's memory pool
XmlDomSaveString2 Saves a Unicode string permanently in a document's memory pool
XmlDomSetBaseURI Sets base URI for document
XmlDomSetDTD Sets DTD (Document Type Definition) for document
XmlDomSetDocOrder Set document order for all nodes
XmlDomSync Synchronizes the persistent version of a document with its DOM.


Interface DocumentType

Function Index

FunctionDescription
XmlDomGetDTDEntities Get entities of DTD
XmlDomGetDTDInternalSubset Get DTD's internal subset
XmlDomGetDTDName Get name of DTD
XmlDomGetDTDNotations Get notations of DTD
XmlDomGetDTDPubID Get DTD's public ID
XmlDomGetDTDSysID Get DTD's system ID


Interface Element

Function Index

FunctionDescription
XmlDomGetAttr Return attribute's value given its name
XmlDomGetAttrNS Return attribute's value given its URI and localname
XmlDomGetAttrNode Get attribute by name
XmlDomGetAttrNodeNS Get attribute by name (namespace aware version)
XmlDomGetChildrenByTag Get children of element with given tag name [non-namespace-aware]
XmlDomGetChildrenByTagNS Get children of element with tag name [namespace-aware version]
XmlDomGetElemsByTag Get elements with given tag name [non-namespace-aware version]
XmlDomGetElemsByTagNS Get elements with given URI and localname [namespace aware version]
XmlDomGetTag Return an element node's tagname
XmlDomHasAttr Does named attribute exist?
XmlDomHasAttrNS Does named attribute exist? (namespace aware version)
XmlDomRemoveAttr Remove attribute with specified name
XmlDomRemoveAttrNS Remove attribute with specified URI and local name
XmlDomRemoveAttrNode Remove attribute node
XmlDomSetAttr Set new attribute for element
XmlDomSetAttrNS Set new attribute for element (namespace aware version)
XmlDomSetAttrNode Set attribute node
XmlDomSetAttrNodeNS Set attribute node (namespace aware version)


Interface Entity

Function Index

FunctionDescription
XmlDomGetEntityNotation Get entity's notation
XmlDomGetEntityPubID Get entity's public ID
XmlDomGetEntitySysID Get entity's system ID
XmlDomGetEntityType Get entity's type


Interface NamedNodeMap

Function Index

FunctionDescription
XmlDomGetNamedItem Return named node from list
XmlDomGetNamedItemNS Return named node from list (namespace aware version)
XmlDomGetNodeMapItem Return nth node in list
XmlDomGetNodeMapLength Return length of named node map
XmlDomRemoveNamedItem Remove node from named node map
XmlDomRemoveNamedItemNS Remove node from named node map (namespace aware version)
XmlDomSetNamedItem Set node in named node list
XmlDomSetNamedItemNS Set node in named node list (namespace aware version)


Interface Node

Function Index

FunctionDescription
XmlDomAppendChild Append new child to node's list of children
XmlDomCleanNode "Clean" a node (free DOM allocations)
XmlDomCloneNode Clone a node
XmlDomFreeNode Free a node allocated with XmlDomCreateXXX
XmlDomGetAttrs Return attributes of node
XmlDomGetChildNodes Return children of node
XmlDomGetDefaultNS Get default namespace for node
XmlDomGetFirstChild Returns first child of node
XmlDomGetFirstPfnsPair Get first prefix namespace pair
XmlDomGetLastChild Returns last child of node
XmlDomGetNextPfnsPair Get subsequent prefix namespace pair
XmlDomGetNextSibling Return next sibling of node
XmlDomGetNodeLocal Get local part of node's qualified name as NULL-terminated string
XmlDomGetNodeLocalLen Get local part of node's qualified name as length-encoded string
XmlDomGetNodeName Get node's name as NULL-terminated string
XmlDomGetNodeNameLen Get node's name as length-encoded string
XmlDomGetNodePrefix Return namespace prefix of node
XmlDomGetNodeType Get node's numeric type code
XmlDomGetNodeURI Return namespace URI of node as a NULL-terminated string
XmlDomGetNodeURILen Return namespace URI of node as length-encoded string
XmlDomGetNodeValue Get node's value as NULL-terminated string
XmlDomGetNodeValueLen Get node value as length-encoded string
XmlDomGetOwnerDocument Get the owner document of node
XmlDomGetParentNode Get parent node
XmlDomGetPrevSibling Return previous sibling of node
XmlDomGetSourceEntity Return the entity node if the input file is an external entity
XmlDomGetSourceLine Return source line# of node
XmlDomGetSourceLocation Return source location (path, URI, etc) of node
XmlDomHasAttrs Test if element has attributes
XmlDomHasChildNodes Test if node has children
XmlDomInsertBefore Insert new child into node's list of children
XmlDomNormalize "Normalize" a node, that is, merge adjacent text nodes
XmlDomNumAttrs Return number of attributes of element
XmlDomNumChildNodes Return number of children of node
XmlDomPrefixToURI Get namespace URI for prefix
XmlDomRemoveChild Remove an existing child node
XmlDomReplaceChild Replace an existing child of a node
XmlDomSetDefaultNS Set default namespace for node
XmlDomSetNodePrefix Set namespace prefix of node
XmlDomSetNodeValue Set node value
XmlDomSetNodeValueLen Set node value as length-encoded string
XmlDomValidate Validate a node against current DTD


Interface NodeList

Function Index

FunctionDescription
XmlDomFreeNodeList Free a node list returned by XmlDomGetElemsByTag etc
XmlDomGetNodeListItem Return nth node in list
XmlDomGetNodeListLength Return length of node list


Interface Notation

Function Index

FunctionDescription
XmlDomGetNotationPubID Get notation's public ID
XmlDomGetNotationSysID Get notation's system ID


Interface ProcessingInstruction

Function Index

FunctionDescription
XmlDomGetPIData Get processing instruction's data
XmlDomGetPITarget Get PI's target
XmlDomSetPIData Set processing instruction's data


Interface Text

Function Index

FunctionDescription
XmlDomSplitText Split text node into two

XmlDomAppendChild

Name XmlDomAppendChild
Interface Node; DOM 2: Node.appendChild()
Purpose Append new child to node's list of children
Prototype xmlnode* XmlDomAppendChild(xmlctx *xctx, xmlnode *parent, xmlnode *newChild)
Arguments
xctx  (IN)  XML context
parent  (IN)  parent to receive new node
newChild  (IN)  node to add
Returns (xmlnode *) node added
Description Appends the node to the end of the parent's list of children and returns the new node. If newChild is a DocumentFragment, all of its children are appended in original order; the DocumentFragment node itself is not.

See Also XmlDomInsertBefore, XmlDomReplaceChild

XmlDomAppendData

Name XmlDomAppendData
Interface CharacterData; DOM 2: Node.appendData()
Purpose Append data to end of node's current data
Prototype void XmlDomAppendData(xmlctx *xctx, xmlnode *node, oratext *data, oratext **old)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [text, comment, or CDATA]
data  (IN)  data to append [data encoding]
old  (OUT)  previous data for node [data encoding]
Returns (void)
Description Append a string to the end of a CharacterData node's data. If the node is not text, comment or CDATA, or if the string to append is NULL, does nothing. The appended data should be in the data encoding. It will not be verified, converted, or checked. If bad data is appended, bad things will happen-- GIGO!

The new node data will be allocated and managed by DOM, but if the previous node value was allocated and manager by the user, they are responsible for freeing it (which is why it's returned).

See Also XmlDomGetCharData, XmlDomInsertData, XmlDomDeleteData, XmlDomReplaceData, XmlDomSplitText

XmlDomCleanNode

Name XmlDomCleanNode
Interface Node
Purpose "Clean" a node (free DOM allocations)
Prototype void XmlDomCleanNode(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  node to clean
Returns (void)
Description Frees parts of the node which were allocated by DOM itself, but does not recurse to children or touch the node's attributes. After freeing part of the node (e.g. name), a DOM call to get that part (e.g. XmlDomGetNodeName) should return a NULL pointer. Used to manage the allocations of a node parts of which are controlled by DOM, and part by the user. Calling clean frees all allocations may by DOM and leaves the user's allocations alone. The user is responsible for freeing their own allocations.

See Also XmlDomFreeNode

XmlDomCloneNode

Name XmlDomCloneNode
Interface Node; DOM 2: Node.cloneNode()
Purpose Clone a node
Prototype xmlnode* XmlDomCloneNode(xmlctx *xctx, xmlnode *node, boolean deep)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
deep  (IN)  recursively clone children?
Returns (xmlnode *) duplicate (cloned) node
Description Creates and returns a duplicate of a node. The duplicate node has no parent. Cloning an element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but it does not copy any text it contains unless it is a deep clone, since the text is contained in a child text node. Cloning any other type of node simply returns a copy of the node. Note that a clone of an unspecified attribute node is specified. If deep is TRUE, all children of the node are recursively cloned, and the cloned node will have cloned children; a non-deep clone will have no children.

See Also XmlDomImportNode

XmlDomCreateAttr

Name XmlDomCreateAttr
Interface Document; DOM 2: Document.createAttribute()
Purpose Create attribute node
Prototype xmlattrnode* XmlDomCreateAttr(xmlctx *xctx, xmldocnode *doc, 
                              oratext *name, oratext *value)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
name  (IN)  new node's name [data encoding; user control]
value  (IN)  new node's value [data encoding; user control]
Returns (xmlattrnode *) new Attr node.
Description Creates an attribute node with the given name and value (in the data encoding). Note this function differs from the DOM specification, which does not allow the initial value of the attribute to be set (see XmlDomSetAttrValue). The name is required, but the value may be NULL; neither is verified, converted, or checked. If bad data is set, bad things will happen-- GIGO!

This is the non-namespace aware function (see XmlDomCreateAttrNS): the new attribute will have NULL namespace URI and prefix, and its local name will be the same as its name, even if the name specified is a QName.

If given an initial value, the attribute's specified flag will be TRUE.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

See XmlDomSetAttr which creates and adds an attribute in a single operation.

The name and value are NOT copied, their pointers are just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomSetAttrValue, XmlDomCreateAttrNS, XmlDomSetAttr, XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateAttrNS

Name XmlDomCreateAttrNS
Interface Document; DOM 2: Document.createAttributeNS()
Purpose Create attribute node with namespace information
Prototype xmlattrnode* XmlDomCreateAttrNS(xmlctx *xctx, xmldocnode *doc, oratext *uri, 
                                oratext *qname, oratext *value)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
uri  (IN)  node's namespace URI [data encoding; user control]
qname  (IN)  node's qualified name [data encoding; user control]
value  (IN)  node's value [data encoding; user control]
Returns (xmlattrnode *) new Attr node.
Description Creates an attribute node with the given namespace URI and QName; this is the namespace-aware version of XmlDomCreateAttr. Note this function differs from the DOM specification, which does not allow the initial value of the attribute to be set (see XmlDomSetAttrValue). The name is required, but the value may be NULL; neither is verified, converted, or checked. If bad data is set, bad things will happen-- GIGO!

If given an initial value, the attribute's specified flag will be TRUE.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild, etc. See XmlDomSetAttr which creates and adds an attribute in a single operation.

The URI, QName and value are NOT copied, their pointers are just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomSetAttrValue, XmlDomCreateAttr, XmlDomSetAttr, XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateCDATA

Name XmlDomCreateCDATA
Interface Document; DOM 2: Document.createCDATASection()
Purpose Create CDATA node
Prototype xmlcdatanode* XmlDomCreateCDATA(xmlctx *xctx, xmldocnode *doc, oratext *data)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
data  (IN)  new node's CDATA [data encoding; user control]
Returns (xmlcdatanode *) new CDATA node.
Description Creates a CDATASection node with the given initial data (which should be in the data encoding). A CDATA section is considered verbatim and is never parsed; it will not be joined with adjacent Text nodes by the normalize operation. The initial data may be NULL; if provided, it is not verified, converted, or checked. If bad data is set, bad things will happen-- GIGO! The name of a CDATA node is always "#cdata-section".

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The CDATA is NOT copied, its pointer is just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomCreateText, XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateComment

Name XmlDomCreateComment
Interface Document; DOM 2: Document.createComment()
Purpose Create comment node
Prototype xmlcommentnode* XmlDomCreateComment(xmlctx *xctx, xmldocnode *doc, oratext *data)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
data  (IN)  new node's comment [data encoding; user control]
Returns (xmlcommentnode *) new Comment node.
Description Creates a Comment node with the given initial data (which must be in the data encoding). The data may be NULL; if provided, it is not verified, converted, or checked. If bad data is set, bad things may happen-- GIGO! The name of a Comment node is always "#comment".

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The comment data is NOT copied, its pointer is just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateElem

Name XmlDomCreateElem
Interface Document; DOM 2: Document.createElement()
Purpose Create an element node
Prototype xmlelemnode* XmlDomCreateElem(xmlctx *xctx, xmldocnode *doc, oratext *tagname)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
tagname  (IN)  new node's name [data encoding; user control]
Returns (xmlelemnode *) new Element node.
Description Creates an element node with the given tag name (which should be in the data encoding). Note that the tag name of an element is CASE SENSITIVE. This is the non-namespace aware function: the new node will have NULL namespace URI and prefix, and its local name will be the same as its tag name, even if the tag name specified is a QName.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The tagname is NOT copied, its pointer is just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomCreateElemNS, XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateElemNS

Name XmlDomCreateElemNS
Interface Document; DOM 2: Document.createElementNS()
Purpose Create an element node with namespace information
Prototype xmlelemnode* XmlDomCreateElemNS(xmlctx *xctx, xmldocnode *doc, 
                                oratext *uri, oratext *qname)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
uri  (IN)  new node's namespace URI [data encoding; user control]
qname  (IN)  new node's qualified name [data encoding; user control]
Returns (xmlelemnode *) new Element node.
Description Creates an element with the given namespace URI and QName. Note that element names are CASE SENSITIVE, and the QName is required though the URI may be NULL. The QName will be split into prefix and local parts, retrievable with XmlDomGetNodePrefix, XmlDomGetNodeLocal, etc; the tagName will be the full QName.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The URI and QName are NOT copied, their pointers are just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomCreateElem, XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateEntityRef

Name XmlDomCreateEntityRef
Interface Document; DOM 2: Document.createEntityReference()
Purpose Create entity reference node
Prototype xmlentrefnode* XmlDomCreateEntityRef(xmlctx *xctx, xmldocnode *doc, oratext *name)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
name  (IN)  name of referenced entity [data encoding; user control]
Returns (xmlentrefnode *) new EntityReference node.
Description Creates an Entity Reference node; the name (which should be in the data encoding) is the name of the entity to be referenced. The named entity does not have to exist. The name is not verified, converted, or checked. If bad data is set, bad things will happen-- GIGO!

Entity Reference nodes are never generated by the parser; instead, entity references are expanded as encountered. On output, an entity reference node will turn into a "&name;" style reference.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The entity reference name is NOT copied, its pointer is just stored. The user is responsible for persistence and freeing of that data.

XmlDomCreateFragment

Name XmlDomCreateFragment
Interface Document; DOM 2: Document.createDocumentFragment()
Purpose Create a document fragment
Prototype xmlfragnode* XmlDomCreateFragment(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (xmlfragnode *) new empty DocumentFragment node
Description Creates an empty Document Fragment node. A document fragment is treated specially when it is inserted into a DOM tree: the children of the fragment are inserted in order instead of the fragment node itself. After insertion, the fragment node will still exist, but have no children. See XmlDomInsertBefore, XmlDomReplaceChild, XmlDomAppendChild, etc. The name of a fragment node is always "#document-fragment".

See Also XmlDomInsertBefore, XmlDomReplaceChild, XmlDomAppendChild

XmlDomCreatePI

Name XmlDomCreatePI
Interface Document; DOM 2: Document.createProcessingInstruction()
Purpose Create PI node
Prototype xmlpinode* XmlDomCreatePI(xmlctx *xctx, xmldocnode *doc, 
                          oratext *target, oratext *data)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
target  (IN)  new node's target [data encoding; user control]
data  (IN)  new node's data [data encoding; user control]
Returns (xmlpinode *) new PI node.
Description Creates a Processing Instruction node with the given target and data (which should be in the data encoding). The data may be NULL initially, and may be changed later (with XmlDomSetPIData), but the target is required and cannot be changed. Note the target and data are not verified, converted, or checked. If bad data is set, bad things will happen-- GIGO! The name of a PI node is the same as the target.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The PI's target and data are NOT copied, their pointers are just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomGetPITarget, XmlDomGetPIData, XmlDomSetPIData, XmlDomCleanNode, XmlDomFreeNode

XmlDomCreateText

Name XmlDomCreateText
Interface Document; DOM 2: Document.createTextNode()
Purpose Create text node
Prototype xmltextnode* XmlDomCreateText(xmlctx *xctx, xmldocnode *doc, oratext *data)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
data  (IN)  new node's text [data encoding; user control]
Returns (xmltextnode *) new Text node.
Description Creates a Text node with the given initial data (which must be non-NULL and in the data encoding). The data may be NULL; if provided, it is not verified, converted, checked, or parsed (entities will not be expanded). If bad data is set, bad things will happen-- GIGO! The name of a fragment node is always "#text". New data for a Text node can be set with XmlDomSetNodeValue; see the CharacterData interface for editing methods.

The new node is an orphan with no parent; it must be added to the DOM tree with XmlDomAppendChild etc.

The text data is NOT copied, its pointer is just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomCreateCDATA, XmlDomSetNodeValue, XmlDomGetNodeValue, XmlDomSetCharData, XmlDomGetCharData, XmlDomGetCharDataLength, XmlDomSubstringData, XmlDomAppendData, XmlDomInsertData, XmlDomDeleteData, XmlDomReplaceData, XmlDomCleanNode, XmlDomFreeNode

XmlDomDeleteData

Name XmlDomDeleteData
Interface CharacterData; DOM 2: CharacterData.deleteData()
Purpose Remove part of node's data
Prototype void XmlDomDeleteData(xmlctx *xctx, xmlnode *node, ub4 offset, 
                      ub4 count, oratext **old)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [Text, Comment, or CDATA]
offset  (IN)  character offset from which to start removing
count  (IN)  number of characters to delete
out  (OUT)  previous data for node [data encoding]
Returns (void)
Description Remove a range of characters from a CharacterData node's data. If the node is not text, comment or CDATA, or if the offset is outside of the original data, does nothing. The offset is zero-based, so offset zero refers to the start of the data. Both offset and count are in characters, not bytes. If the sum of offset and count exceeds the data length then all characters from offset to the end of the data are deleted.

The new node data will be allocated and managed by DOM, but if the previous node value was allocated and managed by the user, they are responsible for freeing it (which is why it's returned).

Example Given a node with data "abcdefgh",
DeleteData(offset=0, count=2) --> "cdefgh"
DeleteData(offset=5, count=5) --> "abcde"
See Also XmlDomGetCharData, XmlDomAppendData, XmlDomInsertData, XmlDomReplaceData, XmlDomSplitText

XmlDomFreeNode

Name XmlDomFreeNode
Interface Node
Purpose Free a node allocated with XmlDomCreateXXX
Prototype void XmlDomFreeNode(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  node to free
Returns (void)
Description Free a node allocated with XmlDomCreateXXX. Frees all resources associated with a node, then frees the node itself. Certain parts of the node are under DOM control, and some parts may be under user control. DOM keeps flags tracking who owns what, and only frees its own allocations. The user is responsible for freeing their own parts of the node before calling XmlDomFreeNode.

See Also XmlDomCleanNode

XmlDomFreeNodeList

Name XmlDomFreeNodeList
Interface NodeList
Purpose Free a node list returned by XmlDomGetElemsByTag etc
Prototype void XmlDomFreeNodeList(xmlctx *xctx, xmlnodelist *list)
Arguments
xctx  (IN)  XML context
list  (IN)  node list to free
Returns (void)
Description Free a node list returned by XmlDomGetElemsByTag or related functions, releasing all resources associated with it. If given a node list that is part of the DOM proper (such as the children of a node), does nothing.

See Also XmlDomGetElemsByTag, XmlDomGetElemsByTagNS, XmlDomGetChildrenByTag, XmlDomGetChildrenByTagNS

XmlDomFreeString

Name XmlDomFreeString
Interface Document
Purpose Frees a string allocate by XmlDomSubstringData etc
Prototype void XmlDomFreeString(xmlctx *xctx, xmldocnode *doc, oratext *str)
Arguments
xctx  (IN)  XML context
doc  (IN)  document string belongs to
str  (IN)  string to free
Returns (void)
Description Frees the string allocated by XmlDomSubstringData or similar functions. Note that strings explicitly saved with XmlDomSaveString et al are NOT freeable individually.

See Also XmlDomSaveString, XmlDomSaveString2

XmlDomGetAttr

Name XmlDomGetAttr
Interface Element; DOM 2: Element.getAttribute()
Purpose Return attribute's value given its name
Prototype oratext* XmlDomGetAttr(xmlctx *xctx, xmlelemnode *elem, oratext *name)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  attribute's name [data encoding]
Returns (oratext *) named attribute's value [data encoding; may be NULL]
Description Returns the value of an element's attribute (specified by name). Note that an attribute may have the empty string as its value, but cannot be NULL. If the element does not have an attribute with the given name, NULL is returned.

See Also XmlDomGetAttrNS, XmlDomGetAttrs, XmlDomGetAttrNode

XmlDomGetAttrLocal

Name XmlDomGetAttrLocal
Interface Attr; DOM 2: Node.localName
Purpose Returns an attribute's namespace local name as NULL-terminated string
Prototype oratext* XmlDomGetAttrLocal(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (oratext *) attribute's local name [data encoding]
Description Returns an attribute's namespace local name (in the data encoding). If the attribute's name is not fully qualified (has no prefix), then the local name is the same as the name.

A length-encoded version is available as XmlDomGetAttrURILen which returns the local name as a pointer and length, for use if the data is known to use XMLType backing store.

Example <foo xmlns:pfx="example_namespace" pfx:bar="bar_value"/>
XmlDomGetAttrLocal(attr pfx:bar) --> "bar\0"
See Also XmlDomGetAttrLocalLen, XmlDomGetAttrName, XmlDomGetAttrURI, XmlDomGetAttrPrefix

XmlDomGetAttrLocalLen

Name XmlDomGetAttrLocalLen
Interface Attr
Purpose Returns an attribute's namespace local name as length-encoded string
Prototype oratext* XmlDomGetAttrLocalLen(xmlctx *xctx, xmlattrnode *attr, oratext *buf, ub4 buflen, 
                               ub4 *len)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of local name [in characters]
Returns (oratext *) attr's local name [data encoding]
Description Returns an attribute's namespace local name (in the data encoding). If the attribute's name is not fully qualified (has no prefix), then the local name is the same as the name.

A NULL-terminated version is available as XmlDomGetAttrLocal which returns the local name as NULL-terminated string. If the backing store is known to be XMLType, then the attribute's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

Example <foo xmlns:pfx="example_namespace" pfx:bar="bar_value"/>
XmlDomGetAttrLocalLen(attr pfx:bar) --> ("bar", 3)
See Also XmlDomGetAttrLocal, XmlDomGetAttrName, XmlDomGetAttrURI, XmlDomGetAttrPrefix

XmlDomGetAttrNS

Name XmlDomGetAttrNS
Interface Element; DOM 2: Element.getAttributeNS()
Purpose Return attribute's value given its URI and localname
Prototype oratext* XmlDomGetAttrNS(xmlctx *xctx, xmlelemnode *elem, 
                         oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  attribute's namespace URI [data encoding]
local  (IN)  attribute's local name [data encoding]
Returns (oratext *) named attribute's value [data encoding; may be NULL]
Description Returns the value of an element's attribute (specified by URI and localname). Note that an attribute may have the empty string as its value, but cannot be NULL. If the element does not have an attribute with the given name, NULL is returned.

See Also XmlDomGetAttr, XmlDomGetAttrs, XmlDomGetAttrNode

XmlDomGetAttrName

Name XmlDomGetAttrName
Interface Attr; DOM 2: Attr.name
Purpose Return attribute's name as NULL-terminated string
Prototype oratext* XmlDomGetAttrName(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (oratext *) name of attribute [data encoding]
Description Returns the fully-qualified name of an attribute (in the data encoding) as a NULL-terminated string, for example "bar\0" or "foo:bar\0".

A length-encoded version is available as XmlDomGetAttrNameLen which returns the attribute name as a pointer and length, for use if the data is known to use XMLType backing store.

See Also XmlDomGetAttrNameLen, XmlDomGetAttrURI, XmlDomGetAttrPrefix, XmlDomGetAttrLocal

XmlDomGetAttrNameLen

Name XmlDomGetAttrNameLen
Interface Attr
Purpose Return attribute's name as length-encoded string
Prototype oratext* XmlDomGetAttrNameLen(xmlctx *xctx, xmlattrnode *attr, oratext *buf, ub4 buflen, 
                              ub4 *len)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of name [in characters]
Returns (oratext *) name of attribute [data encoding]
Description Returns the fully-qualified name of an attribute (in the data encoding) as a length-encoded string, for example ("bar", 3) or ("foo:bar", 7).

A NULL-terminated version is available as XmlDomGetAttrName which returns the attribute name as NULL-terminated string. If the backing store is known to be XMLType, then the attribute's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

See Also XmlDomGetAttrName, XmlDomGetAttrURI, XmlDomGetAttrPrefix, XmlDomGetAttrLocal

XmlDomGetAttrNode

Name XmlDomGetAttrNode
Interface Element; DOM 2: Element.getAttributeNode()
Purpose Get attribute by name
Prototype xmlattrnode* XmlDomGetAttrNode(xmlctx *xctx, xmlelemnode *elem, oratext *name)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  attribute's name [data encoding]
Returns (xmlattrnode *) attribute with the specified name [or NULL]
Description Returns an element's attribute specified by name. If the node is not an element or the named attribute does not exist, returns NULL.

See Also XmlDomGetAttrNodeNS, XmlDomGetAttr

XmlDomGetAttrNodeNS

Name XmlDomGetAttrNodeNS
Interface Element; DOM 2: Element.getAttributeNodeNS()
Purpose Get attribute by name (namespace aware version)
Prototype xmlattrnode* XmlDomGetAttrNodeNS(xmlctx *xctx, xmlelemnode *elem, 
                                 oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  attribute's namespace URI [data encoding]
local  (IN)  attribute's local name [data encoding]
Returns (xmlattrnode *) attribute node with the given URI/local name [or NULL]
Description Returns an element's attribute specified by URI and localname. If the node is not an element or the named attribute does not exist, returns NULL.

See Also XmlDomGetAttrNode, XmlDomGetAttr

XmlDomGetAttrPrefix

Name XmlDomGetAttrPrefix
Interface Attr; DOM 2: Node.prefix
Purpose Returns an attribute's namespace prefix
Prototype oratext* XmlDomGetAttrPrefix(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (oratext *) attribute's namespace prefix [data encoding] or NULL
Description Returns an attribute's namespace prefix (in the data encoding). If the attribute's name is not fully qualified (has no prefix), NULL is returned.

Example <foo xmlns:pfx="example_namespace" pfx:bar="bar_value"/>
XmlDomGetAttrPrefix(attr pfx:bar) --> "pfx\0"
See Also XmlDomGetAttrName, XmlDomGetAttrURI, XmlDomGetAttrLocal

XmlDomGetAttrSpecified

Name XmlDomGetAttrSpecified
Interface Attr; DOM 2: Attr.specified
Purpose Return flag saying whether an attribute was explicitly created
Prototype boolean XmlDomGetAttrSpecified(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (boolean) attribute's "specified" flag
Description Return the 'specified' flag for an attribute. If the attribute was explicitly given a value in the original document, this is TRUE; otherwise, it is FALSE. If the node is not an attribute, returns FALSE. If the user sets an attribute's value through DOM, its specified flag will be TRUE. To return an attribute to its default value (if it has one), the attribute should be deleted-- it will then be re-created automatically with the default value (and specified will be FALSE).

See Also XmlDomSetAttrValue

XmlDomGetAttrURI

Name XmlDomGetAttrURI
Interface Attr; DOM 2: Node.namespaceURI
Purpose Returns an attribute's namespace URI as NULL-terminated string
Prototype oratext* XmlDomGetAttrURI(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (oratext *) attribute's namespace URI [data encoding] or NULL
Description Returns an attribute's namespace URI (in the data encoding). If the attribute's name is not qualified (does not contain a namespace prefix), it will have the default namespace in effect when the node was created (which may be NULL).

A length-encoded version is available as XmlDomGetAttrURILen which returns the URI as a pointer and length, for use if the data is known to use XMLType backing store.

Example <foo xmlns:pfx="example_namespace" pfx:bar="bar_value"/>
XmlDomGetAttrURI(attr pfx:bar) --> "example_namespace\0"
See Also XmlDomGetAttrURILen, XmlDomGetAttrPrefix, XmlDomGetAttrLocal

XmlDomGetAttrURILen

Name XmlDomGetAttrURILen
Interface Attr
Purpose Returns an attribute's namespace URI as length-encoded string
Prototype oratext* XmlDomGetAttrURILen(xmlctx *xctx, xmlattrnode *attr, oratext *buf, ub4 buflen, 
                             ub4 *len)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of URI [in characters]
Returns (oratext *) attribute's namespace URI [data encoding] or NULL
Description Returns an attribute's namespace URI (in the data encoding) as length-encoded string. If the attribute's name is not qualified (does not contain a namespace prefix), it will have the default namespace in effect when the node was created (which may be NULL).

A NULL-terminated version is available as XmlDomGetAttrURI which returns the URI as NULL-terminated string. If the backing store is known to be XMLType, then the attribute's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

Example <foo xmlns:pfx="example_namespace" pfx:bar="bar_value"/>
XmlDomGetAttrURILen(attr pfx:bar) --> ("example_namespace", 17)
See Also XmlDomGetAttrURI, XmlDomGetAttrPrefix, XmlDomGetAttrLocal

XmlDomGetAttrValue

Name XmlDomGetAttrValue
Interface Attr; DOM 2: Attr.value
Purpose Return attribute's value as NULL-terminated string
Prototype oratext* XmlDomGetAttrValue(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (oratext *) attribute's value
Description Returns the "value" (character data) of an attribute (in the data encoding) as NULL-terminated string. Character and general entities will have been replaced.

A length-encoded version is available as XmlDomGetAttrValueLen which returns the attribute value as a pointer and length, for use if the data is known to use XMLType backing store.

See Also XmlDomGetAttrValueLen, XmlDomSetAttrValue

XmlDomGetAttrValueLen

Name XmlDomGetAttrValueLen
Interface Attr
Purpose Return attribute's value as length-encoded string
Prototype oratext* XmlDomGetAttrValueLen(xmlctx *xctx, xmlattrnode *attr, oratext *buf, ub4 buflen, 
                               ub4 *len)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of attr's value [in characters]
Returns (oratext *) attribute's value
Description Returns the "value" (character data) of an attribute (in the data encoding) as length-encoded string. Character and general entities will have been replaced.

A NULL-terminated version is available as XmlDomGetAttrValue which returns the attribute value as NULL-terminated string. If the backing store is known to be XMLType, then the attribute's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

See Also XmlDomGetAttrValue, XmlDomSetAttrValue

XmlDomGetAttrs

Name XmlDomGetAttrs
Interface Node; DOM 2: Node.attributes
Purpose Return attributes of node
Prototype xmlnamedmap* XmlDomGetAttrs(xmlctx *xctx, xmlelemnode *elem)
Arguments
xctx  (IN)  XML context
elem  (IN)  XML element node
Returns (xmlnamedmap *) NamedNodeMap of node's attributes
Description Returns a NamedNodeMap of attributes of an element node, or NULL if it has no attributes. For other node types, NULL is returned. Note that if an element once had attributes, but they have all been removed, an empty list will be returned. So, presense of the list does not mean the element has attributes. You must check the size of the list with XmlDomNumAttrs or use XmlDomHasChildNodes first.

See Also XmlDomNumAttrs, XmlDomHasChildNodes

XmlDomGetBaseURI

Name XmlDomGetBaseURI
Interface Document; DOM 3: Node.baseURI
Purpose Returns the base URI for a document
Prototype oratext *XmlDomGetBaseURI(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (oratext *) document's base URI [or NULL]
Description Returns the base URI for a document. Usually only documents that were loaded from a URI will automatically have a base URI; documents loaded from other sources (stdin, buffer, etc) will not naturally have a base URI, but a base URI may have been set for them using XmlDomSetBaseURI, for the purposes of resolving relative URIs in inclusion.

See Also XmlDomSetBaseURI

XmlDomGetCharData

Name XmlDomGetCharData
Interface CharacterData; DOM 2: CharacterData.data
Purpose Return data for node
Prototype oratext* XmlDomGetCharData(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [text, comment, or CDATA]
Returns (oratext *) character data of node [data encoding]
Description Returns the data for a CharacterData node (type text, comment or CDATA) in the data encoding. For other node types, or if there is no data, returns NULL.

See Also XmlDomSetCharData, XmlDomCreateText, XmlDomCreateComment, XmlDomCreateCDATA

XmlDomGetCharDataLength

Name XmlDomGetCharDataLength
Interface CharacterData; DOM 2: CharacterData.length
Purpose Return length of data for node
Prototype ub4 XmlDomGetCharDataLength(xmlctx *xctx, xmlnode *cdata)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [text, comment, or CDATA]
Returns (ub4) length in characters (not bytes!) of node's data
Description Returns the length of the data for a CharacterData node (type text, comment or CDATA) in characters (not bytes!). For other node types, returns 0.

See Also XmlDomGetCharData

XmlDomGetChildNodes

Name XmlDomGetChildNodes
Interface Node; DOM 2: Node.getChildNodes()
Purpose Return children of node
Prototype xmlnodelist* XmlDomGetChildNodes(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnodelist *) live NodeList containing all children of node
Description Returns a list of the node's children, or NULL if it has no children. Only Element, Document, DTD, and DocumentFragment nodes may have children; all other types will return NULL.

Note that an empty list may be returned if the node once had children, but all have been removed! That is, the list may exist but have no members. So, presense of the list alone does not mean the node has children. You must check the size of the list with XmlDomNumChildNodes or use XmlDomHasChildNodes first.

The xmlnodelist structure is opaque and can only be manipulated with functions in the NodeList interface.

The returned list is live; all changes in the original node are reflected immediately.

XmlDomGetChildrenByTag

Name XmlDomGetChildrenByTag
Interface Element
Purpose Get children of element with given tag name [non-namespace-aware]
Prototype xmlnodelist* XmlDomGetChildrenByTag(xmlctx *xctx, xmlelemnode *elem, oratext *name)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  tag name to match [data encoding; {"*"} for any]
Returns (xmlnodelist *) node list of matching children
Description Returns a list of children of an element with the given tag name, in the order in which they would be encountered in a preorder traversal of the tree. The tag name should be in the data encoding. The special name "*" matches all tag names; a NULL name matches nothing. Note that tag names are CASE SENSITIVE. This function is not namespace aware; the full tag names are compared. If two prefixes which map to the same URI are compared, the comparison will fail. See XmlDomGetChildrenByTagNS for the namespace-aware version. The returned list can be freed with XmlDomFreeNodeList.

See Also XmlDomGetChildrenByTagNS, XmlDomFreeNodeList

XmlDomGetChildrenByTagNS

Name XmlDomGetChildrenByTagNS
Interface Element
Purpose Get children of element with tag name [namespace-aware version]
Prototype xmlnodelist* XmlDomGetChildrenByTagNS(xmlctx *xctx, xmlelemnode *elem, 
                                      oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  namespace URI to match [data encoding; {"*"} for]
local  (IN)  local name to match [data encoding; {"*"} for any]
Returns (xmlnodelist *) node list of matching children
Description Returns a list of children of an element with the given URI and local name, in the order in which they would be encountered in a preorder traversal of the tree. The URI and local name should be in the data encoding. The special name "*" matches all URIs or tag names; a NULL name matches nothing. Note that names are CASE SENSITIVE. See XmlDomGetChildrenByTag for the non-namespace version. The returned list can be freed with XmlDomFreeNodeList.

See Also XmlDomGetChildrenByTag, XmlDomFreeNodeList

XmlDomGetDTD

Name XmlDomGetDTD
Interface Document; DOM 2: Document.doctype
Purpose Get DTD (Document Type) for document
Prototype xmldtdnode* XmlDomGetDTD(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (xmldtdnode *) DTD node for document [or NULL]
Description Returns the DTD node associated with current document; if there is no DTD, returns NULL. The DTD cannot be edited, but its children may be retrieved with XmlDomGetChildNodes as for other node types.

See Also XmlDomSetDTD, XmlCreateDTD, XmlCreateDocument, XmlDomGetDTDName, XmlDomGetDTDEntities, XmlDomGetDTDNotations

XmlDomGetDTDEntities

Name XmlDomGetDTDEntities
Interface DocumentType; DOM 2: DocumentType.entities
Purpose Get entities of DTD
Prototype xmlnamedmap* XmlDomGetDTDEntities(xmlctx *xctx, xmldtdnode *dtd)
Arguments
xctx  (IN)  XML context
dtd  (IN)  DTD node
Returns (xmlnamedmap *) named node map containing entities declared in DTD
Description Returns a named node map of general entities defined by the DTD. If the node is not a DTD, or has no general entities, returns NULL.

See Also XmlDomGetDTD, XmlDomGetDTDName, XmlDomGetDTDNotations, XmlDomGetDTDSysID, XmlDomGetDTDInternalSubset

XmlDomGetDTDInternalSubset

Name XmlDomGetDTDInternalSubset
Interface DocumentType; DOM 2: DocumentType.internalSubset
Purpose Get DTD's internal subset
Prototype xmlnode* XmlDomGetDTDInternalSubset(xmlctx *xctx, xmldtdnode *dtd, oratext *name)
Arguments
xctx  (IN)  XML context
dtd  (IN)  DTD node
name  (IN)  name of Element [data encoding]
Returns (xmlnode *) content model subtree
Description Returns the content model for an element. If there is no DTD, returns NULL.

See Also XmlDomGetDTD, XmlDomGetDTDName, XmlDomGetDTDEntities, XmlDomGetDTDNotations, XmlDomGetDTDPubID

XmlDomGetDTDName

Name XmlDomGetDTDName
Interface DocumentType; DOM 2: DocumentType.name
Purpose Get name of DTD
Prototype oratext* XmlDomGetDTDName(xmlctx *xctx, xmldtdnode *dtd)
Arguments
xctx  (IN)  XML context
dtd  (IN)  DTD node
Returns (oratext *) name of DTD
Description Returns a DTD's name (specified immediately after the DOCTYPE keyword), or NULL if the node is not type DTD.

See Also XmlDomGetDTD, XmlDomGetDTDEntities, XmlDomGetDTDNotations, XmlDomGetDTDSysID, XmlDomGetDTDInternalSubset

XmlDomGetDTDNotations

Name XmlDomGetDTDNotations
Interface DocumentType; DOM 2: DocumentType.notations
Purpose Get notations of DTD
Prototype xmlnamedmap* XmlDomGetDTDNotations(xmlctx *xctx, xmldtdnode *dtd)
Arguments
xctx  (IN)  XML context
dtd  (IN)  DTD node
Returns (xmlnamedmap *) named node map containing notations declared in DTD
Description Returns named node map of notations declared by the DTD. If the node is not a DTD or has no notations, returns NULL.

See Also XmlDomGetDTD, XmlDomGetDTDName, XmlDomGetDTDEntities, XmlDomGetDTDSysID, XmlDomGetDTDInternalSubset

XmlDomGetDTDPubID

Name XmlDomGetDTDPubID
Interface DocumentType; DOM 2: DocumentType.publicID
Purpose Get DTD's public ID
Prototype oratext* XmlDomGetDTDPubID(xmlctx *xctx, xmldtdnode *dtd)
Arguments
xctx  (IN)  XML context
dtd  (IN)  DTD node
Returns (oratext *) DTD's public identifier [data encoding]
Description Returns a DTD's public identifier.

See Also XmlDomGetDTD, XmlDomGetDTDName, XmlDomGetDTDEntities, XmlDomGetDTDSysID, XmlDomGetDTDInternalSubset

XmlDomGetDTDSysID

Name XmlDomGetDTDSysID
Interface DocumentType; DOM 2: DocumentType.systemID
Purpose Get DTD's system ID
Prototype oratext* XmlDomGetDTDSysID(xmlctx *xctx, xmldtdnode *dtd)
Arguments
xctx  (IN)  XML context
dtd  (IN)  DTD node
Returns (oratext *) DTD's system identifier [data encoding]
Description Returns a DTD's system identifier.

See Also XmlDomGetDTD, XmlDomGetDTDName, XmlDomGetDTDEntities, XmlDomGetDTDPubID, XmlDomGetDTDInternalSubset

XmlDomGetDecl

Name XmlDomGetDecl
Interface Document
Purpose Returns a document's XMLDecl information
Prototype xmlerr XmlDomGetDecl(xmlctx *xctx, xmldocnode *doc, oratext **ver, 
                     oratext **enc, sb4 *std)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
ver  (OUT)  XML version
enc  (OUT)  encoding specification
std  (OUT)  standalone specification
Returns (xmlerr) XML error code, perhaps version/encoding/standalone set
Description Returns the information from a document's XMLDecl. If there is no XMLDecl, returns XMLERR_NO_DECL. Returned are the XML version# ("1.0" or "2.0"), the specified encoding, and the standalone value. If encoding is not specified, NULL will be set. The standalone flag is three-state: < 0 if standalone was not specified, 0 if it was specified and FALSE, > 0 if it was specified and TRUE.

XmlDomGetDefaultNS

Name XmlDomGetDefaultNS
Interface Node
Purpose Get default namespace for node
Prototype oratext* XmlDomGetDefaultNS(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  element/attribute DOM node
Returns (oratext *) default namespace for node [data encoding; may be NULL]
Description Gets the default namespace for a node.

XmlDomGetDocElem

Name XmlDomGetDocElem
Interface Document; DOM 2: Document.documentElement
Purpose Get top-level element for document
Prototype xmlelemnode* XmlDomGetDocElem(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (xmlelemnode *) root element [or NULL]
Description Returns the root element (node) of the DOM tree, or NULL if there is none. Each document has only one uppermost Element node, called the root element. It is created after a document is parsed successfully, or manually by XmlDomCreateElem then XmlDomAppendChild, etc.

See Also XmlDomCreateElem

XmlDomGetDocElemByID

Name XmlDomGetDocElemByID
Interface Document; DOM 2: Document.getElementById()
Purpose Get document element given ID
Prototype xmlelemnode* XmlDomGetDocElemByID(xmlctx *xctx, xmldocnode *doc, oratext *id)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
id  (IN)  element's unique ID [data encoding]
Returns (xmlelemnode *) matching element.
Description Returns the element node which has the given ID. If no such ID is defined, returns NULL. Note that attributes named "ID" are not automatically of type ID; ID attributes (which can have any name) must be declared as type ID in the DTD.

The given ID should be in the data encoding or it might not match.

See Also XmlDomGetDocElemsByTag, XmlDomGetDocElemsByTagNS

XmlDomGetDocElemsByTag

Name XmlDomGetDocElemsByTag
Interface Document; DOM 2: Document.getElementsByTagName()
Purpose Obtain doc elements
Prototype xmlnodelist* XmlDomGetDocElemsByTag(xmlctx *xctx, xmldocnode *doc, oratext *name)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
name  (IN)  tagname to match [data encoding; "*" for all]
Returns (xmlnodelist *) new NodeList containing all matched Elements.
Description Returns a list of all elements in the document tree rooted at the root node with a given tag name, in document order (i.e. the order in which they would be encountered in a preorder traversal of the tree). If root is NULL, the entire document is searched.

The special name "*" matches all tag names; a NULL name matches nothing. Note that tag names are CASE SENSITIVE, and should be in the data encoding or a mismatch might occur.

This function is not namespace aware; the full tag names are compared. If two QNames with two different prefixes both of which map to the same URI are compared, the comparison will fail. See XmlDomGetElemsByTagNS for the namespace-aware version.

The list should be freed with XmlDomFreeNodeList when it is no longer needed.

The list is NOT live, it is a snapshot. That is, if a new node which matched the tag name were added to the DOM after the list was returned, the list would not automatically be updated to include the node.

See Also XmlDomGetDocElemByID, XmlDomGetDocElemsByTagNS, XmlDomFreeNodeList

XmlDomGetDocElemsByTagNS

Name XmlDomGetDocElemsByTagNS
Interface Document; DOM 2: Document.getElementsByTagNameNS()
Purpose Obtain doc elements (namespace aware version)
Prototype xmlnodelist* XmlDomGetDocElemsByTagNS(xmlctx *xctx, xmldocnode *doc, 
                                      oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
uri  (IN)  namespace URI to match [data encoding]
local  (IN)  local name to match [data encoding; "*" for all]
Returns (xmlnodelist *) new NodeList containing all matched Elements.
Description Returns a list of all elements (in the document tree rooted at the given node) with a given namespace URI and local name, in the order in which they would be encountered in a preorder traversal of the tree. If root is NULL, the entire document is searched.

The URI and local name should be in the data encoding. The special local name "*" matches all local names; a NULL local name matches nothing. Namespace URIs must always match, however, no wildcard is allowed. Note that comparisons are CASE SENSITIVE. See XmlDomGetDocElemsByTag for the non-namespace aware version.

The list should be freed with XmlDomFreeNodeList when it is no longer needed.

The list is NOT live, it is a snapshot. That is, if a new node which matched the tag name were added to the DOM after the list was returned, the list would not automatically be updated to include the node.

See Also XmlDomGetDocElemByID, XmlDomGetDocElemsByTag, XmlDomFreeNodeList

XmlDomGetElemsByTag

Name XmlDomGetElemsByTag
Interface Element; DOM 2: Element.getElementsByTagName()
Purpose Get elements with given tag name [non-namespace-aware version]
Prototype xmlnodelist* XmlDomGetElemsByTag(xmlctx *xctx, xmlelemnode *elem, oratext *name)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  tag name to match [data encoding; {"*"} for any tag]
Returns (xmlnodelist *) node list of matching elements
Description Returns a list of all elements (in the document tree rooted at the root node) with a given tag name, in the order in which they would be encountered in a preorder traversal of the tree. If root is NULL, the entire document is searched. The tag name should be in the data encoding. The special name "*" matches all tag names; a NULL name matches nothing. Note that tag names are CASE SENSITIVE. This function is not namespace aware; the full tag names are compared. If two prefixes which map to the same URI are compared, the comparison will fail. See XmlDomGetElemsByTagNS for the namespace-aware version. The returned list can be freed with XmlDomFreeNodeList.

See Also XmlDomGetElemsByTagNS, XmlDomFreeNodeList

XmlDomGetElemsByTagNS

Name XmlDomGetElemsByTagNS
Interface Element; DOM 2: Element.getElementsByTagNameNS()
Purpose Get elements with given URI and localname [namespace aware version]
Prototype xmlnodelist* XmlDomGetElemsByTagNS(xmlctx *xctx, xmlelemnode *elem, 
                                   oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  namespace URI to match [data encoding; {"*"} matches any]
local  (IN)  local name to match [data encoding; {"*"} matches any]
Returns (xmlnodelist *) node list of matching elements
Description Returns a list of all elements (in the document tree rooted at the root node) with a given URI and localname, in the order in which they would be encountered in a preorder traversal of the tree. If root is NULL, the entire document is searched. The tag name should be in the data encoding. The special name "*" matches all tag names; a NULL name matches nothing. Note that tag names are CASE SENSITIVE. This function is not namespace aware; the full tag names are compared. If two prefixes which map to the same URI are compared, the comparison will fail. The returned list can be freed with XmlDomFreeNodeList.

See Also XmlDomGetDocElemsByTag, XmlDomFreeNodeList

XmlDomGetEntityNotation

Name XmlDomGetEntityNotation
Interface Entity; DOM 2: Entity.notationName
Purpose Get entity's notation
Prototype oratext* XmlDomGetEntityNotation(xmlctx *xctx, xmlentnode *ent)
Arguments
xctx  (IN)  XML context
ent  (IN)  entity node
Returns (oratext *) entity's notation [data encoding; may be NULL]
Description For unparsed entities, returns the name of its notation (in the data encoding). For parsed entities and other node types, returns NULL.

See Also XmlDomGetEntityPubID, XmlDomGetEntitySysID

XmlDomGetEntityPubID

Name XmlDomGetEntityPubID
Interface Entity; DOM 2: Entity.publicId
Purpose Get entity's public ID
Prototype oratext* XmlDomGetEntityPubID(xmlctx *xctx, xmlentnode *ent)
Arguments
xctx  (IN)  XML context
ent  (IN)  entity node
Returns (oratext *) entity's public identifier [data encoding; may be NULL]
Description Returns an entity's public identifier (in the data encoding). If the node is not an entity, or has no defined public ID, returns NULL.

See Also XmlDomGetEntitySysID, XmlDomGetEntityNotation

XmlDomGetEntitySysID

Name XmlDomGetEntitySysID
Interface Entity; DOM 2: Entity.systemId
Purpose Get entity's system ID
Prototype oratext* XmlDomGetEntitySysID(xmlctx *xctx, xmlentnode *ent)
Arguments
xctx  (IN)  XML context
ent  (IN)  entity node
Returns (oratext *) entity's system identifier [data encoding; may be NULL]
Description Returns an entity's system identifier (in the data encoding). If the node is not an entity, or has no defined system ID, returns NULL.

See Also XmlDomGetEntityPubID, XmlDomGetEntityNotation

XmlDomGetEntityType

Name XmlDomGetEntityType
Interface Entity
Purpose Get entity's type
Prototype boolean XmlDomGetEntityType(xmlctx *xctx, xmlentnode *ent)
Arguments
xctx  (IN)  XML context
ent  (IN)  entity node
Returns (boolean) TRUE for general entity, FALSE for parameter entity
Description Returns a boolean for an entity describing whether it is general (TRUE) or parameter (FALSE).

See Also XmlDomGetEntityPubID, XmlDomGetEntitySysID, XmlDomGetEntityNotation

XmlDomGetFirstChild

Name XmlDomGetFirstChild
Interface Node; DOM 2: Node.getFirstChild()
Purpose Returns first child of node
Prototype xmlnode* XmlDomGetFirstChild(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnode *) first child of node
Description Returns the first child of a node, or NULL if the node has no children. Only Element, Document, DTD, and DocumentFragment nodes may have children; all other types will return NULL.

See Also XmlDomGetLastChild, XmlDomHasChildNodes, XmlDomGetChildNodes, XmlDomNumChildNodes

XmlDomGetFirstPfnsPair

Name XmlDomGetFirstPfnsPair
Interface Node
Purpose Get first prefix namespace pair
Prototype xmlpfnspair* XmlDomGetFirstPfnsPair(xmlctx *xctx, xmlnode *node, 
                                    oratext **prefix, oratext **uri)
Arguments
xctx  (IN)  XML context
node  (IN)  Node whose prefix/URI pairs are to be iterated
prefix  (OUT)  prefix of first mapping [data encoding]
uri  (OUT)  URI of first mapping [data encoding]
Returns (xmlpfnspair *) iterating object or NULL of no prefixes
Description This function is to allow implementations an opportunity to speedup the iteration of all available prefix-Uri bindings available on a given node. It returns a state structure and the prefix and URI of the first prefix-URI mapping. The state structure should be passed to XmlDomGetNextPfnsPair to fetch the remaining pairs.

XmlDomGetLastChild

Name XmlDomGetLastChild
Interface Node; DOM 2: Node.getLastChild()
Purpose Returns last child of node
Prototype xmlnode* XmlDomGetLastChild(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnode *) last child of node
Description Returns the last child of a node, or NULL if the node has no children. Only Element, Document, DTD, and DocumentFragment nodes may have children; all other types will return NULL.

See Also XmlDomGetFirstChild, XmlDomHasChildNodes, XmlDomGetChildNodes, XmlDomNumChildNodes

XmlDomGetLastError

Name XmlDomGetLastError
Interface Document
Purpose Return last error code for document
Prototype xmlerr XmlDomGetLastError(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (xmlerr) numeric error code, 0 if no error
Description Returns the error code of the last error which occured in the given document.

XmlDomGetNamedItem

Name XmlDomGetNamedItem
Interface NamedNodeMap; DOM 2: NamedNodeMap.getNamedItem()
Purpose Return named node from list
Prototype xmlnode* XmlDomGetNamedItem(xmlctx *xctx, xmlnamedmap *map, oratext *name)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
name  (IN)  name of node to retrieve [data encoding]
Returns (xmlnode *) Node with the specified name [or NULL]
Description Retrieves an item from a NamedNodeMap, specified by name (which should be in the data encoding). This is a non-namespace-aware function; it just matches (case sensitively) on the whole QName. Note this function differs from the DOM spec in that the index of the matching item is also returned.

See Also XmlDomGetNamedItemNS, XmlDomGetNodeMapItem, XmlDomGetNodeMapLength

XmlDomGetNamedItemNS

Name XmlDomGetNamedItemNS
Interface NamedNodeMap
Purpose Return named node from list (namespace aware version)
Prototype xmlnode* XmlDomGetNamedItemNS(xmlctx *xctx, xmlnamedmap *map, 
                              oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
uri  (IN)  namespace URI of node to retrieve [data encoding]
local  (IN)  local name of node to retrieve [data encoding]
Returns (xmlnode *) node with given local name and namespace URI [or NULL]
Description Retrieves an item from a NamedNodeMap, specified by URI and localname (which should be in the data encoding). Note this function differs from the DOM spec in that the index of the matching item is also returned.

See Also XmlDomGetNamedItem, XmlDomGetNodeMapItem, XmlDomGetNodeMapLength

XmlDomGetNextPfnsPair

Name XmlDomGetNextPfnsPair
Interface Node
Purpose Get subsequent prefix namespace pair
Prototype xmlpfnspair* XmlDomGetNextPfnsPair(xmlctx *xctx, xmlpfnspair *pfns, 
                                   oratext **prefix, oratext **uri)
Arguments
xctx  (IN)  XML context
pfns  (IN)  iterator object returned by XmlDomGetFirstPfnsPair
prefix  (OUT)  prefix of next mapping [data encoding]
uri  (OUT)  URI of next mapping [data encoding]
Returns (xmlpfnspair *) iterating object, NULL when no more pairs
Description This function is to allow implementations an opportunity to speedup the iteration of all available prefix-URI bindings available on a given node. Given an iterator structure from XmlDomGetFirstPfnsPair, returns the next prefix-URI mapping; repeat calls to XmlDomGetNextPfnsPair until NULL is returned.

XmlDomGetNextSibling

Name XmlDomGetNextSibling
Interface Node; DOM 2: Node.nextSibling
Purpose Return next sibling of node
Prototype xmlnode* XmlDomGetNextSibling(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnode *) node immediately following node at same level
Description Returns the node following a node at the same level in the DOM tree. That is, for each child of a parent node, the next sibling of that child is the child which comes after it. If a node is the last child of its parent, or has no parent, NULL is returned.

See Also XmlDomGetPrevSibling

XmlDomGetNodeListItem

Name XmlDomGetNodeListItem
Interface NodeList; DOM 2: NodeList.item()
Purpose Return nth node in list
Prototype xmlnode* XmlDomGetNodeListItem(xmlctx *xctx, xmlnodelist *list, ub4 index)
Arguments
xctx  (IN)  XML context
list  (IN)  node list
index  (IN)  index into list
Returns (xmlnode *) node at the nth position in node list [or NULL]
Description Return nth node in a node list. The first item is index 0.

See Also XmlDomGetNodeListLength, XmlDomFreeNodeList

XmlDomGetNodeListLength

Name XmlDomGetNodeListLength
Interface NodeList; DOM 2: NodeList.length
Purpose Return length of node list
Prototype ub4 XmlDomGetNodeListLength(xmlctx *xctx, xmlnodelist *list)
Arguments
xctx  (IN)  XML context
list  (IN)  node list
Returns (ub4) number of nodes in node list
Description Returns the number of nodes in a node list (i.e. its length). Note that nodes are referred to by index, so the range of valid indexes is 0 through length-1.

See Also XmlDomGetNodeListItem, XmlDomFreeNodeList

XmlDomGetNodeLocal

Name XmlDomGetNodeLocal
Interface Node; DOM 2: Node.localName
Purpose Get local part of node's qualified name as NULL-terminated string
Prototype oratext* XmlDomGetNodeLocal(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (oratext *) local name of node [data encoding]
Description Returns the namespace local name for a node as a NULL-terminated string. If the node's name is not fully qualified (has no prefix), then the local name is the same as the name.

A length-encoded version is available as XmlDomGetNodeLocalLen which returns the local name as a pointer and length, for use if the data is known to use XMLType backing store.

Example <pfx:foo xmlns:pfx="example_namespace"/>
XmlDomGetNodeLocal(element pfx:foo) --> "foo\0"
See Also XmlDomGetNodeLocalLen, XmlDomGetNodePrefix, XmlDomGetNodeURI

XmlDomGetNodeLocalLen

Name XmlDomGetNodeLocalLen
Interface Node
Purpose Get local part of node's qualified name as length-encoded string
Prototype oratext* XmlDomGetNodeLocalLen(xmlctx *xctx, xmlnode *node, oratext *buf, ub4 buflen, 
                               ub4 *len)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of local name [in characters]
Returns (oratext *) local name of node [data encoding]
Description Returns the namespace local name for a node as a length-encoded string. If the node's name is not fully qualified (has no prefix), then the local name is the same as the name.

A NULL-terminated version is available as XmlDomGetNodeLocal which returns the local name as NULL-terminated string. If the backing store is known to be XMLType, then the node's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

Example <pfx:foo xmlns:pfx="example_namespace"/>
XmlDomGetNodeLocalLen(element pfx:foo) --> ("foo", 3)
See Also XmlDomGetNodeLocal, XmlDomGetNodePrefix, XmlDomGetNodeURILen

XmlDomGetNodeMapItem

Name XmlDomGetNodeMapItem
Interface NamedNodeMap; DOM 2: NamedNodeMap.item()
Purpose Return nth node in list
Prototype xmlnode* XmlDomGetNodeMapItem(xmlctx *xctx, xmlnamedmap *map, ub4 index)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
index  (IN)  index into this map, starts from 0
Returns (xmlnode *) node at the nth position in the map (or NULL)
Description Retrieves an item from a NamedNodeMap, specified by name (which should be in the data encoding). This is a non-namespace-aware function; it just matches (case sensitively) on the whole QName. Note this function differs from the DOM spec in that the index of the matching item is also returned. Named "item" in W3C spec.

See Also XmlDomGetNamedItem, XmlDomSetNamedItem, XmlDomRemoveNamedItem, XmlDomGetNodeMapLength

XmlDomGetNodeMapLength

Name XmlDomGetNodeMapLength
Interface NamedNodeMap; DOM 2: NamedNodeMap.length
Purpose Return length of named node map
Prototype ub4 XmlDomGetNodeMapLength(xmlctx *xctx, xmlnamedmap *map)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
Returns (ub4) number of nodes in NamedNodeMap
Description Returns the number of nodes in a NamedNodeMap (the length). Note that nodes are referred to by index, and the range of valid indexes is 0 through length-1.

See Also XmlDomGetNodeMapItem, XmlDomGetNamedItem

XmlDomGetNodeName

Name XmlDomGetNodeName
Interface Node; DOM 2: Node.getNodeName()
Purpose Get node's name as NULL-terminated string
Prototype oratext* XmlDomGetNodeName(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (oratext *) name of node [data encoding]
Description Returns the (fully-qualified) name of a node (in the data encoding) as a NULL-terminated string, for example "bar\0" or "foo:bar\0".

Note that some node types have fixed names: "#text", "#cdata-section", "#comment", "#document", "#document-fragment".

A node's name cannot be changed once it is created, so there is no matching SetNodeName function.

A length-based version is available as XmlDomGetNodeNameLen which returns the node name as a pointer and length, for use if the data is known to use XMLType backing store.

See Also XmlDomGetNodeNameLen

XmlDomGetNodeNameLen

Name XmlDomGetNodeNameLen
Interface Node
Purpose Get node's name as length-encoded string
Prototype oratext* XmlDomGetNodeNameLen(xmlctx *xctx, xmlnode *node, oratext *buf, ub4 buflen, 
                              ub4 *len)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of name [in characters]
Returns (oratext *) name of node, with length of name set in 'len'
Description Returns the (fully-qualified) name of a node (in the data encoding) as a length-encoded string, for example "bar", 3 or "foo:bar", 7.

Note that some node types have fixed names: "#text", "#cdata-section", "#comment", "#document", "#document-fragment".

A node's name cannot be changed once it is created, so there is no matching SetNodeName function.

A NULL-terminated version is available as XmlDomGetNodeName which returns the node name as NULL-terminated string. If the backing store is known to be XMLType, then the node's name will be stored internally as length-encoded. Using the length-encoded Get functions will avoid having to copy and NULL-terminate the name.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

See Also XmlDomGetNodeName

XmlDomGetNodePrefix

Name XmlDomGetNodePrefix
Interface Node; DOM 2: Node.prefix
Purpose Return namespace prefix of node
Prototype oratext* XmlDomGetNodePrefix(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (oratext *) namespace prefix of node [data encoding; may be NULL]
Description Returns the namespace prefix for a node (as a NULL-terminated string). If the node's name is not fully qualified (has no prefix), NULL is returned.

Example <pfx:foo xmlns:pfx="example_namespace"/>
XmlDomGetNodePrefix(element pfx:foo) --> "pfx"

XmlDomGetNodeType

Name XmlDomGetNodeType
Interface Node; DOM 2: Node.getNodeType()
Purpose Get node's numeric type code
Prototype xmlnodetype XmlDomGetNodeType(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnodetype) numeric type-code of the node
Description Returns the type code of a node. The type names and numeric values match the DOM specification:

ELEMENT_NODE=1, ATTRIBUTE_NODE=2, TEXT_NODE=3, CDATA_SECTION_NODE=4, ENTITY_REFERENCE_NODE=5, ENTITY_NODE=6, PROCESSING_INSTRUCTION_NODE=7, COMMENT_NODE=8, DOCUMENT_NODE=9, DOCUMENT_TYPE_NODE=10, DOCUMENT_FRAGMENT_NODE=11, NOTATION_NODE=12

Additional Oracle extension node types are as follows:

ELEMENT_DECL_NODE, ATTR_DECL_NODE, CP_ELEMENT_NODE, CP_CHOICE_NODE, CP_SEQUENCE_NODE, CP_PCDATA_NODE, CP_STAR_NODE, CP_PLUS_NODE, CP_OPT_NODE

XmlDomGetNodeURI

Name XmlDomGetNodeURI
Interface Node; DOM 2: Node.namespaceURI
Purpose Return namespace URI of node as a NULL-terminated string
Prototype oratext* XmlDomGetNodeURI(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (oratext *) namespace URI of node [data encoding; may be NULL]
Description Returns the namespace URI for a node (in the data encoding) as a NULL-terminated string. If the node's name is not qualified (does not contain a namespace prefix), it will have the default namespace in effect when the node was created (which may be NULL).

A length-encoded version is available as XmlDomGetNodeURILen which returns the URI as a pointer and length, for use if the data is known to use XMLType backing store.

Example <pfx:foo xmlns:pfx="example_namespace"/>
XmlDomGetNodeURI(element pfx:foo) --> "example_namespace\0"
See Also XmlDomGetNodeURILen, XmlDomGetNodePrefix, XmlDomGetNodeLocal

XmlDomGetNodeURILen

Name XmlDomGetNodeURILen
Interface Node
Purpose Return namespace URI of node as length-encoded string
Prototype oratext* XmlDomGetNodeURILen(xmlctx *xctx, xmlnode *node, oratext *buf, ub4 buflen, 
                             ub4 *len)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of URI [in characters]
Returns (oratext *) namespace URI of node [data encoding; may be NULL]
Description Returns the namespace URI for a node (in the data encoding) as length-encoded string. If the node's name is not qualified (does not contain a namespace prefix), it will have the default namespace in effect when the node was created (which may be NULL).

A NULL-terminated version is available as XmlDomGetNodeURI which returns the URI value as NULL-terminated string. If the backing store is known to be XMLType, then the node's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

Example <pfx:foo xmlns:pfx="example_namespace"/>
XmlDomGetNodeURILen(element pfx:foo) --> ("example_namespace", 17)
See Also XmlDomGetNodeURI, XmlDomGetNodePrefix, XmlDomGetNodeLocal

XmlDomGetNodeValue

Name XmlDomGetNodeValue
Interface Node; DOM 2: Node.getNodeValue()
Purpose Get node's value as NULL-terminated string
Prototype oratext* XmlDomGetNodeValue(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (oratext *) value of node
Description Returns the "value" (associated character data) for a node as a NULL-terminated string. Character and general entities will have been replaced. Only Attr, CDATA, Comment, PI and Text nodes have values, all other node types have NULL value.

A length-encoded version is available as XmlDomGetNodeValueLen which returns the node value as a pointer and length, for use if the data is known to use XMLType backing store.

Example "<foo>data</foo>"
XmlDomGetNodeValue(node foo) --> NULL
XmlDomGetNodeValue(foo's first child, a TEXT node) --> "data\0"
See Also XmlDomSetNodeValue, XmlDomGetNodeValueLen

XmlDomGetNodeValueLen

Name XmlDomGetNodeValueLen
Interface Node
Purpose Get node value as length-encoded string
Prototype oratext* XmlDomGetNodeValueLen(xmlctx *xctx, xmlnode *node, oratext *buf, ub4 buflen, 
                               ub4 *len)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
buf  (IN)  input buffer [optional]
buflen  (IN)  input buffer length [optional]
len  (OUT)  length of value [in bytes]
Returns (oratext *) value of node
Description Returns the "value" (associated character data) for a node as a length-encoded string. Character and general entities will have been replaced. Only Attr, CDATA, Comment, PI and Text nodes have values, all other node types have NULL value.

A NULL-terminated version is available as XmlDomGetNodeValue which returns the node value as NULL-terminated string. If the backing store is known to be XMLType, then the node's data will be stored internally as length-encoded. Using the length-based Get functions will avoid having to copy and NULL-terminate the data.

If both the input buffer is non-NULL and the input buffer length is non-zero, then the value will be stored in the input buffer. Else, the implementation will return its own buffer.

If the actual length is greater than buflen, then a truncated value will be copied into the buffer and len will return the actual length.

Example "<foo>data</foo>"
XmlDomGetNodeValue(node foo) --> NULL
XmlDomGetNodeValue(foo's first child) --> 
"data", 4
See Also XmlDomSetNodeValueLen, XmlDomGetNodeValue

XmlDomGetNotationPubID

Name XmlDomGetNotationPubID
Interface Notation; DOM 2: Notation.publicId
Purpose Get notation's public ID
Prototype oratext* XmlDomGetNotationPubID(xmlctx *xctx, xmlnotenode *note)
Arguments
xctx  (IN)  XML context
note  (IN)  notation node
Returns (oratext *) notation's public identifier [data encoding; may be NULL]
Description Return a notation's public identifier (in the data encoding). If the node is not a notation, or has no defined public ID, returns NULL.

See Also XmlDomGetNotationSysID

XmlDomGetNotationSysID

Name XmlDomGetNotationSysID
Interface Notation; DOM 2: Notation.systemId
Purpose Get notation's system ID
Prototype oratext* XmlDomGetNotationSysID(xmlctx *xctx, xmlnotenode *note)
Arguments
xctx  (IN)  XML context
note  (IN)  notation node
Returns (oratext *) notation's system identifier [data encoding; may be NULL]
Description Return a notation's system identifier (in the data encoding). If the node is not a notation, or has no defined system ID, returns NULL.

See Also XmlDomGetNotationPubID

XmlDomGetOwnerDocument

Name XmlDomGetOwnerDocument
Interface Node; DOM 2: Node.ownerDocument
Purpose Get the owner document of node
Prototype xmldocnode* XmlDomGetOwnerDocument(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmldocnode *) document node is in
Description Returns the Document node associated with a node. Each node may belong to only one document, or may not be associated with any document at all (e.g. immediately after XmlDomCreateElem, etc). The "owning" document [node] is returned, or NULL for an orphan node.

XmlDomGetOwnerElem

Name XmlDomGetOwnerElem
Interface Attr; DOM 2: Attr.ownerElement
Purpose Return an attribute's owning element
Prototype xmlelemnode* XmlDomGetOwnerElem(xmlctx *xctx, xmlattrnode *attr)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
Returns (xmlelemnode *) attribute's element node [or NULL]
Description Returns the Element node associated with an attribute. Each attr either belongs to an element (one and only one), or is detached and not yet part of the DOM tree. In the former case, the element node is returned; if the attr is unassigned, NULL is returned.

See Also XmlDomGetOwnerDocument

XmlDomGetPIData

Name XmlDomGetPIData
Interface ProcessingInstruction; DOM 2: ProcessingInstruction.data
Purpose Get processing instruction's data
Prototype oratext* XmlDomGetPIData(xmlctx *xctx, xmlpinode *pi)
Arguments
xctx  (IN)  XML context
pi  (IN)  processing instruction node
Returns (oratext *) processing instruction's data [data encoding]
Description Returns the content (data) of a processing instruction (in the data encoding). If the node is not a PI, returns NULL. The content is the part from the first non-whitespace character after the target until the ending "?>".

Example <?rating extra saucy?>
XmlDomGetPIData --> "extra saucy"
See Also XmlDomGetPITarget, XmlDomSetPIData

XmlDomGetPITarget

Name XmlDomGetPITarget
Interface ProcessingInstruction; DOM 2: ProcessingInstruction.target
Purpose Get PI's target
Prototype oratext* XmlDomGetPITarget(xmlctx *xctx, xmlpinode *pi)
Arguments
xctx  (IN)  XML context
pi  (IN)  processing instruction node
Returns (oratext *) processing instruction's target [data encoding]
Description Returns a processing instruction's target string. If the node is not a PI, returns NULL. The target is the first token following the markup that begins the PI. All PIs must have a target, though the data part is optional.

Example <?rating extra saucy?>
XmlDomGetPITarget --> "rating"
See Also XmlDomGetPIData, XmlDomSetPIData

XmlDomGetParentNode

Name XmlDomGetParentNode
Interface Node; DOM 2: Node.getParentNode()
Purpose Get parent node
Prototype xmlnode* XmlDomGetParentNode(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnode *) parent of node
Description Returns a node's parent node. All nodes types except Attr, Document, DocumentFragment, Entity, and Notation may have a parent (these five exceptions always have a NULL parent). If a node has just been created but not yet added to the DOM tree, or if it has been removed from the DOM tree, its parent is also NULL.

XmlDomGetPrevSibling

Name XmlDomGetPrevSibling
Interface Node; DOM 2: Node.previousSibling
Purpose Return previous sibling of node
Prototype xmlnode* XmlDomGetPrevSibling(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlnode *) node immediately preceding node at same level
Description Returns the node preceding a node at the same level in the DOM tree. That is, for each child of a parent node, the previous sibling of that child is the child which came before it. If a node is the first child of its parent, or has no parent, NULL is returned.

See Also XmlDomGetNextSibling

XmlDomGetSchema

Name XmlDomGetSchema
Interface Document
Purpose Returns URI of schema associated with document
Prototype oratext* XmlDomGetSchema(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (oratext *) Schema URI or NULL
Description Returns URI of schema associated with document, if there is one, else returns NULL. The XmlLoadDom functions take a schema location hint (URI); the schema is used for efficient layout of XMLType data. If a schema was provided at load time, this function returns TRUE.

See Also XmlDomIsSchemaBased, XmlLoadDom

XmlDomGetSourceEntity

Name XmlDomGetSourceEntity
Interface Node
Purpose Return the entity node if the input file is an external entity
Prototype xmlentnode* XmlDomGetSourceEntity(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (xmlentnode *) entity node if the input is from an external entity
Description Returns the extern entity node whose inclusion caused the creation of the given node.

XmlDomGetSourceLine

Name XmlDomGetSourceLine
Interface Node; DOM 2: DOMLocator.getLineNumber()
Purpose Return source line# of node
Prototype ub4 XmlDomGetSourceLine(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (ub4) line number of node in original input source
Description Returns the line# in the original source where the node started. The first line in every input is line #1.

XmlDomGetSourceLocation

Name XmlDomGetSourceLocation
Interface Node
Purpose Return source location (path, URI, etc) of node
Prototype oratext* XmlDomGetSourceLocation(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (oratext *) full path of input source [in compiler encoding]
Description Return source location (path, URI, etc) of node. Note this will be in the compiler encoding, not the data encoding!

XmlDomGetTag

Name XmlDomGetTag
Interface Element; DOM 2: Element.tagName
Purpose Return an element node's tagname
Prototype oratext* XmlDomGetTag(xmlctx *xctx, xmlelemnode *elem)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
Returns (oratext *) element's name [data encoding]
Description Returns the tagName of a node, which is the same as its name. DOM 1.0 says "...even though there is a generic nodeName attribute on the Node interface, there is still a tagName attribute on the Element interface; these two attributes must contain the same value, but the Working Group considers it worthwhile to support both, given the different constituencies the DOM API must satisfy."

See Also XmlDomGetNodeName

XmlDomHasAttr

Name XmlDomHasAttr
Interface Element; DOM 2: Element.hasAttribute()
Purpose Does named attribute exist?
Prototype boolean XmlDomHasAttr(xmlctx *xctx, xmlelemnode *elem, oratext *name)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  attribute's name [data encoding]
Returns (boolean) TRUE if element has attribute with given name
Description Determines if an element has a attribute with the given name. Returns TRUE if so, FALSE if not.

See Also XmlDomHasAttrNS

XmlDomHasAttrNS

Name XmlDomHasAttrNS
Interface Element; DOM 2 Element.hasAttributeNS()
Purpose Does named attribute exist? (namespace aware version)
Prototype boolean XmlDomHasAttrNS(xmlctx *xctx, xmlelemnode *elem, oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  attribute's namespace URI [data encoding]
local  (IN)  attribute's local name [data encoding]
Returns (boolean) TRUE if element has attribute with given URI/localname
Description Determines if an element has an attribute with the given URI and localname. Returns TRUE if so, FALSE if not.

See Also XmlDomHasAttr

XmlDomHasAttrs

Name XmlDomHasAttrs
Interface Node
Purpose Test if element has attributes
Prototype boolean XmlDomHasAttrs(xmlctx *xctx, xmlelemnode *elem)
Arguments
xctx  (IN)  XML context
elem  (IN)  XML element node
Returns (boolean) TRUE if element has attributes
Description Test if an element has attributes. Returns TRUE if any attributes of any sort are defined (namespace or regular).

XmlDomHasChildNodes

Name XmlDomHasChildNodes
Interface Node; DOM 2: Node.hasChildNodes()
Purpose Test if node has children
Prototype boolean XmlDomHasChildNodes(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (boolean) TRUE if the node has any children
Description Test if a node has children. Only Element, Document, DTD, and DocumentFragment nodes may have children. Note that just because XmlDomGetChildNodes returns a list does not mean the node actually has children, since the list may be empty, so a non-NULL return from XmlDomGetChildNodes should not be used as a test.

XmlDomImportNode

Name XmlDomImportNode
Interface Document; DOM 2: Document.importNode()
Purpose Import a node from another DOM
Prototype xmlnode* XmlDomImportNode(xmlctx *xctx, xmldocnode *doc, 
                          xmlctx *nctx, xmlnode *node, boolean deep)
Arguments
xctx  (IN)  XML document context
doc  (IN)  XML document [node]
nctx  (IN)  XML context of imported node
node  (IN)  node to import
deep  (IN)  recursively import subtree?
Returns (xmlnode *) newly imported node (in this Document).
Description Imports a node from one Document to another. The new node is an orphan and has no parent; it must be added to the DOM tree with XmlDomAppendChild, etc. The original node is not modified in any way or removed from its document; instead, a new node is created with copies of all the original node's QName, prefix, namespace URI, and local name.

As with XmlDomCloneNode, the deep controls whether the children of the node are recursively imported. If FALSE, only the node itself is imported, and it will have no children. If TRUE, all descendents of the node will be imported as well, and an entire new subtree created.

Document and DocumentType nodes cannot be imported. Imported attributes will have their specified flags set to TRUE. Elements will have only their specified attributes imported; non-specified (default) attributes are omitted. New default attributes (for the destination document) are then added.

See Also XmlDomCloneNode

XmlDomInsertBefore

Name XmlDomInsertBefore
Interface Node; DOM 2: Node.insertBefore()
Purpose Insert new child into node's list of children
Prototype xmlnode* XmlDomInsertBefore(xmlctx *xctx, xmlnode *parent, 
                            xmlnode *newChild, xmlnode *refChild)
Arguments
xctx  (IN)  XML context
parent  (IN)  parent to receive new child
newChild  (IN)  node to insert
refChild  (IN)  reference node to insert before
Returns (xmlnode *) node being inserted
Description Inserts the node newChild before the existing child node refChild in the parent node. If refChild is NULL, appends to parent's children as per XmlDomAppendChild; otherwise it must be a child of the given parent. If newChild is a DocumentFragment, all of its children are inserted (in the same order) before refChild; the DocumentFragment node itself is not. If newChild is already in the DOM tree, it is first removed from its current position.

See Also XmlDomAppendChild, XmlDomReplaceChild, XmlDomRemoveChild

XmlDomInsertData

Name XmlDomInsertData
Interface CharacterData; DOM 2: CharacterData.insertData()
Purpose Insert string into node's current data
Prototype void XmlDomInsertData(xmlctx *xctx, xmlnode *node, ub4 offset, 
                      oratext *arg, oratext **old)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [Text, Comment, or CDATA]
offset  (IN)  character offset at which to insert
arg  (IN)  data to insert [data encoding]
old  (OUT)  previous data for node [data encoding]
Returns (void)
Description Insert a string into a CharacterData node's data at the specified position. If the node is not text, comment or CDATAS, or if the data to be inserted is NULL, or the offset is outside the original data, does nothing. The inserted data must be in the data encoding. It will not be verified, converted, or checked. If bad data is appended, bad things will happen-- GIGO! The offset is specified as characters, not bytes. The offset is zero-based, so inserting at offset zero prepends the data.

The new node data will be allocated and managed by DOM, but if the previous node value was allocated and managed by the user, they are responsible for freeing it (which is why it's returned).

Example Given a node with data "abcdefgh"
InsertData(offset=0, arg="FOO") --> "FOOabcdefgh"
InsertData(offset=5, arg="*") --> "abcde*fgh"
See Also XmlDomGetCharData, XmlDomAppendData, XmlDomDeleteData, XmlDomReplaceData, XmlDomSplitText

XmlDomIsSchemaBased

Name XmlDomIsSchemaBased
Interface Document
Purpose Indicate whether a schema is associated with a document
Prototype boolean XmlDomIsSchemaBased(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (boolean) TRUE if there is a schema associated with the document
Description Returns flag saying whether there is a schema associated with this document. The XmlLoadDom functions take a schema location hint (URI); the schema is used for efficient layout of XMLType data. If a schema was provided at load time, this function returns TRUE.

See Also XmlDomGetSchema, XmlLoadDom

XmlDomNormalize

Name XmlDomNormalize
Interface Node; DOM 2: Element.normalize()
Purpose "Normalize" a node, that is, merge adjacent text nodes
Prototype void XmlDomNormalize(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (void)
Description "Normalizes" the subtree rooted at an element, i.e. merges adjacent Text nodes children of elements. Note that adjacent Text nodes will never be created during a normal parse, only after manipulation of the document with DOM calls.

Example <a>"XXX" "YYY"<b>"111" "222"</b></a>
normalize(node a) -->
<a>"XXXYYY"<b>"111222"</b></a>

XmlDomNumAttrs

Name XmlDomNumAttrs
Interface Node
Purpose Return number of attributes of element
Prototype ub4 XmlDomNumAttrs(xmlctx *xctx, xmlelemnode *elem)
Arguments
xctx  (IN)  XML context
elem  (IN)  XML element node
Returns (ub4) number of attributes of node
Description Returns the number of attributes of an element. Note that just because a list is returned by XmlDomGetAttrs does not mean it contains any attributes; it may be an empty list with zero length.

XmlDomNumChildNodes

Name XmlDomNumChildNodes
Interface Node
Purpose Return number of children of node
Prototype ub4 XmlDomNumChildNodes(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
Returns (ub4) number of children of node
Description Returns the number of children of a node. Only Element, Document, DTD, and DocumentFragment nodes may have children, all other types return 0. Note that just because XmlDomGetChildNodes returns a list does not mean that it contains any children; it may be an empty list with zero length.

XmlDomPrefixToURI

Name XmlDomPrefixToURI
Interface Node; DOM 3: Node.lookupNamespacePrefix()
Purpose Get namespace URI for prefix
Prototype oratext* XmlDomPrefixToURI(xmlctx *xctx, xmlnode *node, oratext *prefix)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
prefix  (IN)  prefix to map
Returns (oratext *) URI for prefix [data encoding; NULL if no match]
Description Given a namespace prefix and a node, returns the namespace URI mapped to that prefix. If the given node doesn't have a matching prefix, its parent is tried, then its parent, and so on, all the way to the root node. If the prefix is undefined, NULL is returned.

XmlDomRemoveAttr

Name XmlDomRemoveAttr
Interface Element; DOM 2: Element.removeAttribute()
Purpose Remove attribute with specified name
Prototype void XmlDomRemoveAttr(xmlctx *xctx, xmlelemnode *elem, oratext *name)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  attribute's name [data encoding]
Returns (void)
Description Removes an attribute (specified by name). If the removed attribute has a default value it is immediately re-created with that default. Note that the attribute is removed from the element's list of attributes, but the attribute node itself is not destroyed.

See Also XmlDomRemoveAttrNS, XmlDomRemoveAttrNode

XmlDomRemoveAttrNS

Name XmlDomRemoveAttrNS
Interface Element; DOM 2: Element.removeAttributeNS()
Purpose Remove attribute with specified URI and local name
Prototype void XmlDomRemoveAttrNS(xmlctx *xctx, xmlelemnode *elem, oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  attribute's namespace URI
local  (IN)  attribute's local name
Returns (void)
Description Removes an attribute (specified by URI and localname). If the removed attribute has a default value it is immediately re-created with that default. Note that the attribute is removed from the element's list of attributes, but the attribute node itself is not destroyed.

See Also XmlDomRemoveAttr, XmlDomRemoveAttrNode

XmlDomRemoveAttrNode

Name XmlDomRemoveAttrNode
Interface Element; DOM 2: Element.removeAttributeNode()
Purpose Remove attribute node
Prototype xmlattrnode* XmlDomRemoveAttrNode(xmlctx *xctx, xmlelemnode *elem, xmlattrnode *oldAttr)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
newAttr  (IN)  attribute node to add
Returns (xmlattrnode *) replaced attribute node [or NULL]
Description Removes an attribute from an element. If the attribute has a default value, it is immediately re-created with that value (Specified set to FALSE). Returns the removed attribute on success, else NULL.

See Also XmlDomRemoveAttr

XmlDomRemoveChild

Name XmlDomRemoveChild
Interface Node; DOM 2: Node.removeChild()
Purpose Remove an existing child node
Prototype xmlnode* XmlDomRemoveChild(xmlctx *xctx, xmlnode *oldChild)
Arguments
xctx  (IN)  XML context
oldChild  (IN)  node to remove
Returns (xmlnode *) node removed
Description Removes a node from its parent's list of children and returns it. The node is orphaned; its parent will be NULL after removal.

See Also XmlDomAppendChild, XmlDomInsertBefore, XmlDomReplaceChild

XmlDomRemoveNamedItem

Name XmlDomRemoveNamedItem
Interface NamedNodeMap; DOM 2: NamedNodeMap.removeNamedItem()
Purpose Remove node from named node map
Prototype xmlnode* XmlDomRemoveNamedItem(xmlctx *xctx, xmlnamedmap *map, oratext *name)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
name  (IN)  name of node to remove [data encoding]
Returns (xmlnode *) node removed from this map
Description Removes a node from a NamedNodeMap, specified by name. This is a non-namespace-aware function; it just matches (case sensitively) on the whole QName. If the removed node is an attribute with default value (not specified), it is immediately replaced. The removed node is returned; if no removal took place, NULL is returned.

See Also XmlDomRemoveNamedItemNS, XmlDomGetNamedItem, XmlDomGetNamedItemNS, XmlDomSetNamedItem, XmlDomSetNamedItemNS

XmlDomRemoveNamedItemNS

Name XmlDomRemoveNamedItemNS
Interface NamedNodeMap; DOM 2: NamedNodeMap.removeNamedItemNS()
Purpose Remove node from named node map (namespace aware version)
Prototype xmlnode* XmlDomRemoveNamedItemNS(xmlctx *xctx, xmlnamedmap *map, 
                                 oratext *uri, oratext *local)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
uri  (IN)  namespace URI of node to remove [data encoding]
local  (IN)  local name of node to remove [data encoding]
Returns (xmlnode *) node removed from this map
Description Removes a node from a NamedNodeMap, specified by URI and localname. If the removed node is an attribute with default value (not specified), it is immediately replaced. The removed node is returned; if no removal took place, NULL is returned.

See Also XmlDomRemoveNamedItem, XmlDomGetNamedItem, XmlDomGetNamedItemNS, XmlDomSetNamedItem, XmlDomSetNamedItemNS

XmlDomReplaceChild

Name XmlDomReplaceChild
Interface Node; DOM 2: Node.replaceChild()
Purpose Replace an existing child of a node
Prototype xmlnode* XmlDomReplaceChild(xmlctx *xctx, xmlnode *newChild, xmlnode *oldChild)
Arguments
xctx  (IN)  XML context
newChild  (IN)  new node being substituted
oldChild  (OUT)  old node being replaced
Returns (xmlnode *) node replaced
Description Replaces the child node oldChild with the new node newChild in oldChild's parent, and returns oldChild (which is now orphaned, with a NULL parent). If newChild is a DocumentFragment, all of its children are inserted in place of oldChild; the DocumentFragment node itself is not. If newChild is already in the DOM tree, it is first removed from its current position.

See Also XmlDomAppendChild, XmlDomInsertBefore, XmlDomRemoveChild

XmlDomReplaceData

Name XmlDomReplaceData
Interface CharacterData; DOM 2: CharacterData.replaceData()
Purpose Replace part of node's data
Prototype void XmlDomReplaceData(xmlctx *xctx, xmlnode *node, ub4 offset, 
                       ub4 count, oratext *arg, oratext **old)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [text, comment, or CDATA]
offset  (IN)  character offset from which to start replacing
count  (IN)  number of characters to replace
arg  (IN)  replacement substring [data encoding]
out  (OUT)  previous data for node [data encoding]
Returns (void)
Description Replaces a range of characters in a CharacterData node's data with a new string. If the node is not text, comment or CDATA, or if the offset is outside of the original data, or if the replacement string is NULL, does nothing. If the count is zero, acts just as XmlDomInsertData. The offset is zero-based, so offset zero refers to the start of the data. The replacement data must be in the data encoding. It will not be verified, converted, or checked. If bad data is set, bad things will happen-- GIGO! The offset and count are both in characters, not bytes. If the sum of offset and count exceeds length, then all characters to the end of the data are replaced.

The new node data will be allocated and managed by DOM, but if the previous node value was allocated and managed by the user, they are responsible for freeing it (which is why it's returned).

Example Given a node with data "abcdefgh",
XmlDomReplaceData(offset=0, count=1, arg="FOO") --> "FOObcdefgh"
XmlDomRreplaceData(offset=2, count=2, arg="*") --> "ab*efgh"
XmlDomRreplaceData(offset=5, count=5, arg="*") --> "abcde*"
See Also XmlDomGetCharData, XmlDomAppendData, XmlDomInsertData, XmlDomDeleteData, XmlDomSplitText

XmlDomSaveString

Name XmlDomSaveString
Interface Document
Purpose Saves a string permanently in a document's memory pool
Prototype oratext* XmlDomSaveString(xmlctx *xctx, xmldocnode *doc, oratext *str)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document
str  (IN)  string to save [data encoding; single- or multi-byte only]
Returns (oratext *) saved copy of string
Description Copies the given string into the document's memory pool, so that it persists for the life of the document. The individual string WILL NOT BE FREEABLE, and the storage will be returned only when the entire document is freed. Works on single-byte or multi-byte encodings; for Unicode strings, use XmlDomSaveString2

See Also XmlDomSaveString2, XmlFreeDocument

XmlDomSaveString2

Name XmlDomSaveString2
Interface Document
Purpose Saves a Unicode string permanently in a document's memory pool
Prototype ub2* XmlDomSaveString2(xmlctx *xctx, xmldocnode *doc, ub2 *ustr)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document
ustr  (IN)  string to save [data encoding; Unicode only]
Returns (ub2 *) saved copy of string
Description Copies the given string into the document's memory pool, so that it persists for the life of the document. The individual string will not be freeable, and the storage will be returned only when the entire document is free. Works on Unicode strings only; for single-byte or multi-byte strings, use XmlDomSaveString

See Also XmlDomSaveString, XmlFreeDocument

XmlDomSetAttr

Name XmlDomSetAttr
Interface Element; DOM 2: Element.setAttribute()
Purpose Set new attribute for element
Prototype void XmlDomSetAttr(xmlctx *xctx, xmlelemnode *elem, oratext *name, oratext *value)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
name  (IN)  attribute's name [data encoding]
value  (IN)  attribute's value [data encoding]
Returns (void)
Description Creates a new attribute for an element with the given name and value (which should be in the data encoding). If the named attribute already exists, its value is simply replaced. The name and value are not verified, converted, or checked. If bad data is set, bad things may happen-- GIGO! The value is not parsed, so entity references will not be expanded. The attribute's Specified flag will be set.

See Also XmlDomSetAttrNS, XmlDomCreateAttr, XmlDomSetAttrValue, XmlDomRemoveAttr

XmlDomSetAttrNS

Name XmlDomSetAttrNS
Interface Element; DOM 2: Element.setAttributeNS()
Purpose Set new attribute for element (namespace aware version)
Prototype void XmlDomSetAttrNS(xmlctx *xctx, xmlelemnode *elem, oratext *uri, 
                     oratext *qname, oratext *value)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
uri  (IN)  attribute's namespace URI [data encoding]
qname  (IN)  attribute's qualified name [data encoding]
value  (IN)  attribute's value [data encoding]
Returns (void)
Description Creates a new attribute for an element with the given URI, localname and value (which should be in the data encoding). If the named attribute already exists, its value is simply replaced. The name and value are not verified, converted, or checked. If bad data is set, bad things will happen-- GIGO!

The value is not parsed, so entity references will not be expanded.

The attribute's specified flag will be set.

See Also XmlDomSetAttr, XmlDomCreateAttr, XmlDomSetAttrValue, XmlDomRemoveAttr

XmlDomSetAttrNode

Name XmlDomSetAttrNode
Interface Element; DOM 2: Element.setAttributeNode()
Purpose Set attribute node
Prototype xmlattrnode* XmlDomSetAttrNode(xmlctx *xctx, xmlelemnode *elem, xmlattrnode *newAttr)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
newAttr  (IN)  attribute node to add
Returns (xmlattrnode *) replaced attribute node (or NULL)
Description Adds a new attribute to an element. If an attribute with the given name already exists, it is replaced and the old attribute returned through oldNode. If the attribute is new, it is added to the element's list and oldNode set to NULL.

See Also XmlDomSetAttrNodeNS, XmlDomCreateAttr, XmlDomSetAttrValue

XmlDomSetAttrNodeNS

Name XmlDomSetAttrNodeNS
Interface Element; DOM 2: Element.setAttributeNodeNS()
Purpose Set attribute node (namespace aware version)
Prototype xmlattrnode* XmlDomSetAttrNodeNS(xmlctx *xctx, xmlelemnode *elem, xmlattrnode *newAttr)
Arguments
xctx  (IN)  XML context
elem  (IN)  element node
newAttr  (IN)  attribute node to add
Returns (xmlattrnode *) replaced attribute node [or NULL]
Description Adds a new attribute to an element. If an attribute with newNode's URI and localname already exists, it is replaced and the old attribute returned through oldNode. If the attribute is new, it is added to the element's list and oldNode set to NULL.

See Also XmlDomSetAttrNode, XmlDomCreateAttr, XmlDomSetAttrValue

XmlDomSetAttrValue

Name XmlDomSetAttrValue
Interface Attr; DOM 2: Attr.value
Purpose Set an attribute's value
Prototype void XmlDomSetAttrValue(xmlctx *xctx, xmlattrnode *attr, oratext *value)
Arguments
xctx  (IN)  XML context
attr  (IN)  attribute node
value  (IN)  new value of attribute [data encoding]
Returns (void)
Description Sets the given attribute's value to data. If the node is not an attribute, does nothing. Note that the new value must be in the data encoding! It is not verified, converted, or checked. If bad data is set for the attribute, bad things will happen-- GIGO! The attribute's specified flag will be TRUE after setting a new value.

See Also XmlDomGetAttrValue

XmlDomSetBaseURI

Name XmlDomSetBaseURI
Interface Document; DOM 3: Document.setBaseURI()
Purpose Sets base URI for document
Prototype xmlerr XmlDomSetBaseURI(xmlctx *xctx, xmldocnode *doc, oratext *uri)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
uri  (IN)  base URI to set [data encoding]
Returns (xmlerr) XML error code
Description Only documents that were loaded from a URI will automatically have a base URI; documents loaded from other sources (stdin, buffer, etc) will not naturally have a base URI, so this API is used to set a base URI, for the purposes of relative URI resolution in includes. The base URI should be in the data encoding, and a copy will be made.

Example A document is loaded with XmlLoadDomStdio from stdin; that
document as a DOCTYPE declaration, which is always a URI.
The DTD's URI is relative, i.e. "subdir/junk.dtd".  Where
is the DTD to be found?  Its URI is resolved against the
parent's URI, but the parent doesn't have a URI in this
case, so no resolution takes place, and "subdir/junk.dtd"
is tried directly, which may or may not work depending on
the working directory.  To make this work always, set the
base URI of the top-level document to an absolute path,
for example to "/root/dir1/dir2/topdoc.html"; then the URI
resolution of the included DTD would produce
"/root/dir1/dir2/subdir/junk.dtd" every time.
See Also XmlDomGetBaseURI

XmlDomSetCharData

Name XmlDomSetCharData
Interface CharacterData; DOM 2: CharacterData.data
Purpose Set data for node
Prototype void XmlDomSetCharData(xmlctx *xctx, xmlnode *node, oratext *data)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [text, comment, or CDATA]
data  (IN)  new data for node
Returns (void)
Description Sets data for a CharacterData node (type text, comment or CDATA), replacing the old data. For other node types, does nothing. The new data is not verified, converted, or checked-- it should be in the data encoding. If bad data is set, bad things will happen-- GIGO!

See Also XmlDomGetCharData

XmlDomSetDTD

Name XmlDomSetDTD
Interface Document
Purpose Sets DTD (Document Type Definition) for document
Prototype xmlerr XmlDomSetDTD(xmlctx *xctx, xmldocnode *doc, xmldtdnode *dtdnode)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
dtdnode  (IN)  Document Type to set [node]
Returns (xmlerr) numeric error code, 0 on success
Description Sets the DTD for document. Note this call may only be used for a blank document, BEFORE any parsing has taken place. A single DTD can be set for multiple documents, so when a document with a set DTD is freed, the set DTD is NOT also freed.

See Also XmlDomGetDTD, XmlDomGetDTDName, XmlDomGetDTDEntities, XmlDomGetDTDNotations

XmlDomSetDefaultNS

Name XmlDomSetDefaultNS
Interface Node
Purpose Set default namespace for node
Prototype void XmlDomSetDefaultNS(xmlctx *xctx, xmlnode *node, oratext *defns)
Arguments
xctx  (IN)  XML context
node  (IN)  element/attribute DOM node
defns  (IN)  new default namespace for node
Returns (void)
Description Set the default namespace for a node

XmlDomSetDocOrder

Name XmlDomSetDocOrder
Interface Document
Purpose Set document order for all nodes
Prototype ub4 XmlDomSetDocOrder(xmlctx *xctx, xmldocnode *doc, ub4 start_id)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
start_id  (IN)  starting ID#
Returns (ub4) highest ordinal assigned
Description Sets the document order for each node in the current document. Must be called once on the final document before XSLT processing can occur. Note this is called automatically by the XSLT processor, so ordinarily the user need not make this call.

See Also XmlDomGetDocOrder, XmlDomCompareDocOrder

XmlDomSetNamedItem

Name XmlDomSetNamedItem
Interface NamedNodeMap; DOM 2: NamedNodeMap.setNamedItem()
Purpose Set node in named node list
Prototype xmlnode* XmlDomSetNamedItem(xmlctx *xctx, xmlnamedmap *map, xmlnode *newNode)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
newNode  (IN)  new node to store in map
Returns (xmlnode *) the replaced node (or NULL)
Description Adds a new node to a NamedNodeMap. If a node already exists with the given name, replaces the old node and returns it. If no such named node exists, adds the new node to the map and sets old to NULL. This is a non-namespace-aware function; it just matches (case sensitively) on the whole QName. Since some node types have fixed names (Text, Comment, etc), trying to set another of the same type will always cause replacement.

See Also XmlDomSetNamedItemNS, XmlDomGetNamedItem, XmlDomGetNamedItemNS, XmlDomGetNodeMapItem, XmlDomGetNodeMapLength

XmlDomSetNamedItemNS

Name XmlDomSetNamedItemNS
Interface NamedNodeMap; DOM 2: NamedNodeMap.setNamedItemNS()
Purpose Set node in named node list (namespace aware version)
Prototype xmlnode* XmlDomSetNamedItemNS(xmlctx *xctx, xmlnamedmap *map, xmlnode *newNode)
Arguments
xctx  (IN)  XML context
map  (IN)  NamedNodeMap
newNode  (IN)  new node to store in map
Returns (xmlnode *) replaced Node [or NULL]
Description Adds a new node to a NamedNodeMap. If a node already exists with the given URI and localname, replaces the old node and returns it. If no such named node exists, adds the new node to the map and sets old to NULL. Since some node types have fixed names (Text, Comment, etc), trying to set another of the same type will always cause replacement.

See Also XmlDomSetNamedItem, XmlDomGetNamedItem, XmlDomGetNamedItemNS, XmlDomGetNodeMapItem, XmlDomGetNodeMapLength

XmlDomSetNodePrefix

Name XmlDomSetNodePrefix
Interface Node
Purpose Set namespace prefix of node
Prototype void XmlDomSetNodePrefix(xmlctx *xctx, xmlnode *node, oratext *prefix)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
prefix  (IN)  new namespace prefix
Returns (void)
Description Sets the namespace prefix of node (as NULL-terminated string). Does not verify the prefix is defined! Just causes a new QName to be formed from the new prefix and the old local name; the new QName will be under DOM control and should not be managed by the user.

XmlDomSetNodeValue

Name XmlDomSetNodeValue
Interface Node; DOM 2: Node.setNodeValue()
Purpose Set node value
Prototype xmlerr XmlDomSetNodeValue(xmlctx *xctx, xmlnode *node, oratext *value)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
value  (IN)  node's new value [data encoding; user control]
Returns (xmlerr) numeric error code, 0 on success
Description Sets a node's value (character data) as a NULL-terminated string. Does not allow setting the value to NULL. Only Attr, CDATA, Comment, PI and Text nodes have values; trying to set the value of another type of node is a no-op. The new value must be in the data encoding! It is not verified, converted, or checked. If bad data is set for a node, bad things will happen-- GIGO!

The value is NOT copied, its pointer is just stored. The user is responsible for persistence and freeing of that data.

See Also XmlDomGetNodeValue, XmlDomSetNodeValueLen

XmlDomSetNodeValueLen

Name XmlDomSetNodeValueLen
Interface Node
Purpose Set node value as length-encoded string
Prototype xmlerr XmlDomSetNodeValueLen(xmlctx *xctx, xmlnode *node, oratext *value, ub4 len)
Arguments
xctx  (IN)  XML context
node  (IN)  XML node
value  (IN)  new value for node
len  (IN)  length of value [in bytes]
Returns (xmlerr) numeric error code, 0 on success
Description Sets the "value" (associated character data) for a node as a length-encoded string.

A NULL-terminated version is available as XmlDomSetNodeValue which takes the node value as a NULL-terminated string. If the backing store is known to be XMLType, then the node's data will be stored internally as length-encoded. Using the length-based Set functions will avoid having to copy and NULL-terminate the data.

Example "<foo>data</foo>"
XmlDomSetNodeValue(foo's text node, "z", 1)
"<foo>z</foo>"
See Also XmlDomSetNodeValueLen, XmlDomSetNodeValue

XmlDomSetPIData

Name XmlDomSetPIData
Interface ProcessingInstruction
Purpose Set processing instruction's data
Prototype void XmlDomSetPIData(xmlctx *xctx, xmlpinode *pi, oratext *data)
Arguments
xctx  (IN)  XML context
pi  (IN)  processing instruction node
data  (IN)  processing instruction's new data [data encoding]
Returns (void)
Description Set's a Processing Instruction's (PI) data (content), which must be in the data encoding. It is not permitted to set the data to NULL. If the node is not a PI, does nothing. The new data is not verified, converted, or checked. If bad data is set, bad things will happen-- GIGO!

See Also XmlDomGetPITarget, XmlDomGetPIData

XmlDomSplitText

Name XmlDomSplitText
Interface Text; DOM 2: Text.splitText()
Purpose Split text node into two
Prototype xmltextnode* XmlDomSplitText(xmlctx *xctx, xmltextnode *textnode, ub4 offset)
Arguments
xctx  (IN)  XML context
textnode  (IN)  text node
offset  (IN)  character offset at which to split, starting from 0.
Returns (xmltextnode *) new text node
Description Splits a single text node into two text nodes; the original data is split between them. If the given node is not type text, or the offset is outside of the original data, does nothing and returns NULL. The offset is zero-based, and is in characters, not bytes. The original node is retained, its data is just truncated. A new text node is created which contains the remainder of the original data, and is inserted as the next sibling of the original. The new text node is returned.

Example (Given a Text node with data) "abcdefgh",
XmlDomSplitText(1) --> Text("a"), Text("bcdefgh")
XmlDomSplitText(5) --> Text("abcde"), Text("fgh")
See Also XmlDomGetCharData, XmlDomAppendData, XmlDomInsertData, XmlDomDeleteData, XmlDomReplaceData

XmlDomSubstringData

Name XmlDomSubstringData
Interface CharacterData; DOM 2: CharacterData.substringData()
Purpose Return substring of node's data
Prototype oratext* XmlDomSubstringData(xmlctx *xctx, xmlnode *node, ub4 offset, ub4 count)
Arguments
xctx  (IN)  XML context
node  (IN)  CharacterData node [text, comment, or CDATA]
offset  (IN)  start offset of substring to extract
count  (IN)  number of characters to extract
Returns (oratext *) specified substring.
Description Returns a range of character data from a CharacterData node (type text, comment or CDATA). For other node types, or if count is zero, returns NULL. Since the data is in the data encoding, offset and count are in characters, not bytes. The beginning of the string is offset 0. If the sum of offset and count exceeds the length, then all characters to the end of the data are returned.

The substring is permanently allocated in the node's document's memory pool. To free the substring, use XmlDomFreeString.

Example Given a node with data "abcdefgh",
XmlDomSubstringData(offset=0, length=1) --> "a"
XmlDomSubstringData(offset=5, length=5) --> "fgh"
See Also XmlDomAppendData, XmlDomInsertData, XmlDomDeleteData, XmlDomReplaceData, XmlDomSplitText, XmlDomFreeString

XmlDomSync

Name XmlDomSync
Interface Document
Purpose Synchronizes the persistent version of a document with its DOM.
Prototype xmlerr XmlDomSync(xmlctx *xctx, xmldocnode *doc)
Arguments
xctx  (IN)  XML context
doc  (IN)  XML document [node]
Returns (xmlerr) numeric error code, 0 on success
Description Causes a modified DOM to be written back out to its original source, synchronizing the persistent store and in-memory versions.

XmlDomValidate

Name XmlDomValidate
Interface Node
Purpose Validate a node against current DTD
Prototype xmlerr XmlDomValidate(xmlctx *xctx, xmlnode *node)
Arguments
xctx  (IN)  XML context
node  (IN)  node to validate
Returns (xmlerr) error code, XMLERR_OK [0] means node is valid
Description Given a root node, validates it against the current DTD.