Ansicht
Dokumentation
ABENABAP_IXML_LIB_PARSE_DOM - ABAP IXML LIB PARSE DOM
BAL Application Log Documentation Fill RESBD Structure from EBP Component StructureThis documentation is copyright by SAP AG.
- Complete Parse to DOM
To parse XML data to a DOM representation in a single action, a parser created for this purpose is used as follows:
DATA(rc) = parser->parse( ).
Here, parser is a reference variable that points to the parser. The parser checks whether the XML data of the input stream istream is correct and creates a DOM representation of this file in the memory. The return value of the method PARSE has the type i and uses values to provide the result that match the following constants from the type pool IXML:
- ixml_mr_parser_ok
- The parsed XML data does not have any errors. Parsing was successful and all XML data is available in the saved XML document.
- ixml_mr_parser_error
- The parsed XML data has errors. Although the parser created a valid DOM from the XML file with the errors, it does not usually contain all the XML data. These errors can be analyzed.
- ixml_mr_parser_fatal_error
- The XML data could not be parsed at all. This error does not usually occur anymore.
If the parsing is successful, the XML document document linked with the parser can be used to access the DOM stored in the memory.
Notes
- If an XML element has multiple attributes with the same name, only one of these attributes is passed to DOM, which is given the value of the last identically named attribute (see example program DEMO_XML_ATTRIBUTES).
- An alternative for complete parsing of XML data to the DOM representation is to call the identity transformation ID with CALL TRANSFORMATION. See the executable example DOM Representation. No streams and factories need to be created explicitly here.
Example
Creates a parser for an input stream for a text string and parses it to an XML document.
ABAP Short Reference TXBHW - Original Tax Base Amount in Local Currency
This documentation is copyright by SAP AG.
Length: 2810 Date: 20240328 Time: 233627 sap01-206 ( 48 ms )