om.DomNode methods

Methods of the om.DomNode class.

Table 1. Object methods: Node creation
Name Description
appendChild(
   node om.DomNode )
Adds an existing node at the end of the list of children in the current node.
createChild(
   tag STRING )
  RETURNING result om.DomNode
Creates and adds an node at the end of the list of children in the current node.
insertBefore(
   new om.DomNode,
   existing om.DomNode)
Inserts an existing node before the existing node specified.
removeChild(
   node om.DomNode )
Deletes the specified child node from the current node.
replaceChild(
   new om.DomNode,
   old om.DomNode)
Replaces a node by another in the children nodes of the current node.
Table 2. Object methods: In/Out
Name Description
loadXml(
   filename STRING )
  RETURNING result om.DomNode
Load an XML file into the current node.
parse(
   string STRING )
  RETURNING result om.DomNode
Parses an XML formatted string and creates the DOM structure in the current node.
toString()
  RETURNING result STRING
Serializes the current node into an XML formatted string.
write(
   sdh om.SaxDocumentHandler )
Processes a DOM document with a SAX document handler.
writeXml(
   filename STRING )
Creates an XML file from the current DOM node.
Table 3. Object methods: Node identification
Name Description
getId()
  RETURNING result INTEGER
Returns the internal AUI tree id of a DOM node.
getTagName()
  RETURNING result STRING
Returns the XML tag name of a DOM node.
Table 4. Object methods: Attributes management
Name Description
getAttribute(
   name STRING )
  RETURNING result STRING
Returns the value of a DOM node attribute.
getAttributesCount()
  RETURNING result INTEGER
Returns the number of attributes in the DOM node.
getAttributeInteger(
   name STRING,
   def STRING )
  RETURNING result INTEGER
Returns the value of a DOM node attribute, with default integer value.
getAttributeString(
   name STRING,
   def STRING )
  RETURNING result STRING
Returns the value of a DOM node attribute, with default string value.
getAttributeName(
   index INTEGER )
  RETURNING result STRING
Returns the name of a DOM node attribute by position.
getAttributeValue(
   index INTEGER )
  RETURNING result STRING
Returns the value of a DOM node attribute by position.
setAttribute(
   name STRING,
   value STRING )
Sets the value of a DOM node attribute.
removeAttribute(
   name STRING )
  RETURNING result STRING
Delete the specified attribute from the DOM node.
Table 5. Object methods: Tree navigation
Name Description
getChildByIndex(
   index INTEGER )
  RETURNING result om.DomNode
Returns a child DOM node by position.
getChildCount()
  RETURNING result INTEGER
Returns the number of children nodes.
getFirstChild()
  RETURNING result om.DomNode
Returns the first child DOM node.
getLastChild()
  RETURNING result om.DomNode
Returns the last child DOM node.
getNext()
  RETURNING result om.DomNode
Returns the next sibling DOM node of this node.
getParent()
  RETURNING result om.DomNode
Returns the parent DOM node.
getPrevious()
  RETURNING result om.DomNode
Returns previous sibling DOM node of this node.
selectByPath(
   xpath STRING )
  RETURNING result om.NodeList
Finds descendant DOM nodes according to an XPath-like pattern.
selectByTagName(
   tagname STRING )
  RETURNING result om.NodeList
Finds descendant DOM nodes according to a tag name.