iTP Active Transaction Pages (iTP ATP) Programmer's Guide

XML for ATP Add-On Module
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
5-48
XMLDOMElement Object
XMLDOMElement Object
XMLDOMElement objects are among the most common objects in the XML document
tree. Element nodes can have attributes associated with them. The attributes are not
defined as child nodes of an element and are not considered to be part of the document
tree. Accordingly, the XMLDOMElement object provides methods to make it easier to
manage attributes, including methods to associate an attribute with an element and
retrieve an attribute object and the attribute value by name.
In XML, where an attribute value may contain entity references, an XMLDOMAttribute
Object should be retrieved to examine the possibly fairly complex subtree representing
the attribute value.
Table 5-14
specifies the common properties of the XMLDOMElement object.
Table 5-15
specifies the common methods of the XMLDOMElement object.
Properties
tagName
Contains the element name (the name that appears within the tag). For example, in
<customer ID=”ABC12345”>, the tagName has the value “customer”. Note that this
is case-preserving in XML, as are all of the operations of the DOM.
Table 5-14. XMLDOMElement Object Properties
Property Description
tagName Contains the element name (the name that appears within the
tag).
Table 5-15. XMLDOMElement Object Methods
Method Description
getAttribute Retrieves an attribute value by name.
getAttributeNode Retrieves an attribute node by name.
getElementsByTagName Returns an XMLDOMNodeList of all descendant elements
with a given tag name, in the order in which they would be
encountered in a preorder traversal of the XMLDOMElement
tree.
normalize
Normalizes all descendant elements; combines two or more
adjacent text nodes into one unified text node.
removeAttribute
Removes an attribute by name.
removeAttributeNode Removes the specified attribute node.
setAttribute Adds a new attribute.
setAttributeNode Adds a new attribute.