om.XmlReader.getAttributes

Builds an attribute list for the current processed element.

Syntax

getAttributes()
  RETURNING result om.SaxAttributes

Usage

Use the getAttributes() method create a list of attributes as a om.SaxAttributes object, from the current processed element, in the StartElement or EndElement event context.

Declare a variable with the om.SaxAttributes type to reference the attribute list.

Note that once created with the getAttributes() method, the om.SaxAttributes object is automatically updated based on the element currently processed by the om.XmlReader.

DEFINE r om.XmlReader,
       e STRING, i INT
       a om.SaxAttributes
   ...
   LET e = r.read()
   WHILE e IS NOT NULL
     CASE e 
       ...
       WHEN "StartElement"
         LET a = r.getAttributes()
         FOR i=1 to a.getLength()
             ...