Ansicht
Dokumentation

ABENABAP_XSLT_ID - ABAP XSLT ID

ABENABAP_XSLT_ID - ABAP XSLT ID

rdisp/max_wprun_time - Maximum work process run time   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

- Identity Transformation

Under the name ID, SAP provides an identity transformation that is specially handled by the runtime framework depending on the source and target:

  • An identity transformation from XML to XML produces a result that is a normalized copy of the source document in which the attributes of an element are sorted alphabetically.
  • An identity transformation from ABAP to XML produces the canonical XML representation (asXML) of the ABAP data (explicit serialization).
  • An identity transformation from XML to ABAP transforms a canonical XML representation to ABAP data (explicit deserialization).
  • In the case of an identity transformation with JSON data as an XML source or an JSON writer as an XML target, a special type of handling is performed for JSON.

In each transformation from XML, the identity transformation validates the outbound data. If an XML element has multiple identically named attributes, only one of these is respected, which is given the value of the last identically named attribute (see example program DEMO_XML_ATTRIBUTES). The identity transformation implicitly uses canonical XML formats for all transformations apart from XML to XML to transform non-XML data (ABAP, JSON) into XML format. The identity transformation is used internally for this purpose and can also be called explicitly if the formats it creates are sufficient or are to be analyzed.

Notes

  • The identity transformation ID is not completely symmetrical. When text strings that contain only blanks are serialized, a node with the same number of blanks is created. When nodes that contain only spaces (such as blanks or line breaks) are deserialized, however, an empty text is created.
  • The identity transformation ID exists as an XSLT program in the repository, but this program is not always executed. When the identity transformation ID is called, an optimized ID engine of the runtime framework might be called, depending on the source and target. This ID engine creates the result described above.
  • If the predefined identity transformation ID is copied to a different XSLT program, the target program cannot be used to the same extent, since in this case no internal special handling takes place. A non-optimized copy of ID is executed in accordance with its source code as an XSL transformation on a DOM from the iXML library. More specifically, JSON data is not handled in the same way as with ID and usually raises an exception.
  • If the identity transformation ID is used, the way element names are written in XML or object names written in JSON cannot be modified. If XML data or JSON data is to be deserialized to ABAP data, however, the names of the corresponding elements or objects must be in uppercase letters. If this is not the case in the source data, either transformations must be created, or the data must be modified in advance. The executable example Transformation of XML Element Names demonstrates how to modify XML data and the example JSON, Transform Names demonstrates this for JSON data.

Identity Transformation to the asXML Format






General Data in Customer Master   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 4281 Date: 20240426 Time: 092522     sap01-206 ( 88 ms )