om.DomNode.getAttribute

Returns the value of a DOM node attribute.

Syntax

getAttribute(
   name STRING )
  RETURNING result STRING
  1. name is the name of the attribute.

Usage

The getAttribute() method returns the value of the attribute passed as parameter, as defined in the current node.

DOM node attribute names are case-sensitive.

If the attribute does not exist for this node type, or if the attribute is not set, the method returns NULL.

For character nodes (created for example with the createChars() of a DomDocument object), you can get the text value by passing the @chars attribute name to the method.

Example

DEFINE node om.DomNode
...
DISPLAY node.getAttribute("color")