Ansicht
Dokumentation

ABENABAP_SXML_LIB_RENDER - ABAP SXML LIB RENDER

ABENABAP_SXML_LIB_RENDER - ABAP SXML LIB RENDER

General Material Data   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

- Rendering

To create XML data using sXML Library, the content is passed to an XML writer. A writer of this type is validating, which means that invalid actions, such as attempts to add an attribute to a value node, raise an exception. An XML writer creates the XML data as a hierarchical tree-like structure where each token is represented by a node that can be assigned uniquely to a parent node (see W3C Information Set). An XML writer can be used to write the data in exactly the same way is read by an XML reader.

The classes and interfaces of the sXML Library that are available for rendering XML data are organized so that there are separate XML writer classes for different requirements. These classes inherit from the abstract superclass CL_SXML_WRITER. The abstract superclass contains implementations of functions required by all writers and includes the interface IF_SXML_WRITER, which contains the components shared by all writers. This interface enables all writers to be accessed in the same way. If special components need to be accessed that are not declared in the interface, a downcast must be used on the corresponding class.

The specialized writer classes are:

Writers in this class render XML data to a byte string.
Writers in this class render XML data to an internal table with a flat byte-like line type.
Writers in this class render XML data to a file on the host computer of the current .
Writers in this class render XML data to an ICF HTTP client.
Writers of this class render the data to XOP format.

Each of these classes has a specific factory method CREATE for creating appropriate writers. Apart from an XOP writer, the required format and the required character format of the data can be passed to each writer. The standard format is XML 1.0 format in the UTF-8 character format. The XOP writer supports the XOP format only. Instructions on standardization and handling empty elements can be passed to the factory method if the format is suitable.

The methods of the interface IF_SXML_WRITER enable serial rendering of XML data. There are two basic ways to do this:

A writer cannot be used more than once for the same XML data or for other data. The write position of a writer is updated during rendering using its methods. The actions allowed by a writer depend on the current write position. For writers that do not write to external repositories, the written XML can be read using the method GET_OUTPUT.

Notes

  • In a suitable write position, an XML writer from the sXML Library can be used as an XML target of the statement CALL TRANSFORMATION. The output of the transformation is inserted into the output of the writer and its write position moved accordingly.
  • The writers in the sXML Library do not currently support XML comments, CDATA sections, or processor instructions.
  • If rendering produces content of elements or attributes, the characters , >, &, ", and ' are transformed automatically into the associated XML notation.

Transformation to XML Writers






CPI1466 during Backup   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 5661 Date: 20240425 Time: 123255     sap01-206 ( 130 ms )