SAP ABAP SXML LIB RENDER TOKEN
Get Example source ABAP code based on a different SAP table
ABAP_SXML - Token-Based Rendering
In token-based rendering, each node is written to the XML data using a method. Each node type has its own method. If a node can have specific values, the respective method has appropriate input parameters. The methods must be called in such a way that valid XML is created. XML attributes can be added to an element directly after it has been opened.
Basic Approach
An XML writer is created using the factory method
encoding = ... ).>
Here, the static type of the reference variables is the type of the class itself, since more class-specific methods exist than in readers. The interface
Once the writer is created, nodes can be written. The order of the nodes is important, for example:
writer->write_attribute( ... ).
writer->write_value( ... ).
writer->close_element( ).>
Once a complete valid record of XML data has been written, the data can be read if the correct writers are being used, for example:
Since the method is a class-specific method, a downcast is required if an interface reference variable is used.
ABAP_EXAMPLE_ABEXA
ABAP_EXAMPLE_END
Methods for Token-Based Rendering
The following methods are declared in the interface
If text-like data is written, this data is converted automatically from the current system code page to the representation of the XML data, which is determined by the chosen
ABAP_EXAMPLE_ABEXA
ABAP_EXAMPLE_END