RXS_DOMGetData()

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 after a call to RXS_DOMBuild() to retrieve the value of an XML element or attribute.

Note: Only the first parameter (pXPath1) is required. If more than one parameter is specified, the following rules apply:

  • If the last XPath parameter specified includes an attribute, it must be the last parameter.
  • If the last XPath parameter specified does NOT include an attribute AND it is the last parameter, the DOM Parser will assume that the first instance of that XPath is intended.

Subprocedure Prototype

D RXS_DOMGetData  pr                  like(RXS_XmlData)

Retrieves data elements from a specific XPath. Returns the contents of the element specified and parsed out of the provided XML. If the last XPath parameter includes an attribute, it must be the last parameter. If the last XPath parameter does not include an attribute and it is the last parameter, the DOM parser will assume that the first instance of that XPath is intended.

D  pXPath1                            const like(RXS_XPath)

Required

An XPath segment value.

D  pInstance1                   10i 0 const options(*nopass)

Required

An integer indicating the instance of the specified XPath segment.

D  pXPath2                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance2                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath3                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance3                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath4                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance4                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath5                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance5                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath6                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance6                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath7                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance7                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath8                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance8                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath9                            const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance9                   10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath10                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance10                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath11                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance11                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath12                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance12                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath13                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance13                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath14                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance14                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath15                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance15                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath16                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance16                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath17                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance17                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath18                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance18                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath19                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance19                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.

D  pXPath20                           const like(RXS_XPath)
D                                           options(*nopass)

An XPath segment value.

D  pInstance20                  10i 0 const options(*nopass)

An integer indicating the instance of the specified XPath segment.