The XmlReader class

The om.XmlReader class provides methods to read and process a file written in XML format.

The processing of the XML file is streamed-data based; the file is loaded and processed sequentially with events. To process XML element attributes, an om.XmlReader object must cooperate with a om.SaxAttributes object. The XmlReader class can only read from a file. To write to a file, use the om.XmlWriter class.

Steps to use a XML reader:
  1. Declare a variable with the om.XmlReader type.
  2. Create the reader object with the createFileReader() method and assign the reference to the variable.
  3. Process SAX events in a WHILE loop, by reading document fragments with the read() method.
  4. Inside the loop, depending on the SAX event, process element attributes with getAttributes() or get the element data with the getCharacters() methods.