SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ABAP and XML → Class Libraries for XML → sXML Library → sXML Library - Render →sXML Library - Object-Oriented Rendering
Just as in token-based rendering, object-oriented rendering creates an XML writer. The nodes are not written, however, using a separate method for each node type, but using a single method, WRITE_NODE. This method is associated with a node object with the required node type using its input parameters and a corresponding node is appended to the current writer position.
Procedure (Principles)
As in token-based rendering, the XML writer is created using the factory method CREATE of the class in question, for example:
Before the node object is written, it can be created using one of the dedicated methods of the interface IF_SXML_READER, such as NEW_OPEN_ELEMENT, NEW_CLOSE_ELEMENT, and NEW_VALUE or it can be taken from another source, such as an object-oriented read, for example:
The node object of an opened element has methods that can be used to insert XML attributes.
Example
See Object-Oriented Rendering.
Methods for Object-Oriented Rendering
The following methods of the interface IF_SXML_WRITER are designed specially for object-oriented rendering:
The values are written as in token-based rendering.
Notes
Examples