NOTE: The RXS_DOM* APIs were created to allow for a different approach to parsing XML documents. Depending on the complexity of your XML and what data elements you are parsing, the RXS_DOM* APIs can make the syntax for parsing simpler. The simpler syntax comes with a cost because the entire XML document is parsed and stored in memory so you can access any element data at any time (think of it as being able to “CHAIN” to the XML structure - random access). Performance for smaller XML files is comparable for the two XML parsers within RPG-XML Suite, but the larger the XML file the bigger the divide. For example, a large 4MB XML file will take 200 seconds with the event based parser and 600 seconds with the DOM parser. So make sure to factor that into your decision on whether to use the RXS_DOM* APIs to parse or the event based parser.

Call this subprocedure prior to calling RXS_DOMBuild(), to specify options to be used by the DOM Parser.

The options are as follows:

Introduced in v2.4. If specified, the DOM Parser will ignore whitespace-only elements. (The default behavior is to process whitespace-only elements.) Using this option can improve performance significantly in very large XML documents where many empty elements exist.
If specified, the DOM Parser will ignore case-differences.
If specified, the DOM Parser will not trim leading and trailing blanks from XML element values (by default, leading and trailing blanks are trimmed from XML element values).
If specified, denotes to the DOM Parser that the XML contains mixed content. Note that if the XML contains mixed content and DOM_MIXED is not specified, incorrect results may be returned from subsequent DOM-related procedures. Note also that specifying DOM_MIXED may result in RXS_DOMBuild taking longer than if DOM_MIXED is not specified.
If specified, an alternate search criteria will be used by the DOM Parser during the data search/replace phase. This value may be specified to improve performance when parsing very large XML documents. Whether it improves the performance depends on the XML element value data, and so there is no guarantee that specifying it will improve parsing performance.

This API can be called with multiple options added together, e.g.:


Subprocedure Prototype

D RXS_DOMsetOpt   pr

Used to set options to control DOM parsing. This API can be called with multiple options added together to act as one parameter.


D   pOpt                        10i 0 const

An integer which consists of a sum of the various available options.

Valid Values:

  • DOM_IGNWS (ignore whitespace-only elements)
  • DOM_IGNCASE (ignore case-differences)
  • DOM_NOTRIM (will not trim leading and training blanks from XML element values)
  • DOM_MIXED (denotes to the DOM parser that the XML contains mixed content)
  • DOM_ALTSEARCH (alternate search criteria will be used by the DOM parser during the data search/replace stage)
  • DOM_NOIGNWS (deprecated)