Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  Simple Transformations →  ST - Serialization and Deserialization →  ST - Literal Template Content →  ST - Literals XML Elements and Attributes 

ST - tt:lax, Name Comparison of Literal XML Elements

Other versions: 7.31 | 7.40 | 7.54

Syntax


 ... tt:lax="on"|"off"|"deep-on"|"deep-off" ...

Effect

During the deserialization of literal XML elements, you can use the optional attribute tt:lax to control whether the name of an element is taken into consideration.

  • If you specify tt:lax with the value #off#, the XML inbound stream must contain an element of the same name with all literal attributes attr of the same content.
  • If you specify tt:lax with the value #on#, the element in the XML inbound stream can have any name, but the expected attributes must still match.
  • You use the values #deep-on# and "deep-off# for tt:lax to set the setting #on# and #off# for all subelements of the current element; however, they can be overwritten locally there.

If you do not specify tt:lax, the setting complies with the surrounding context. By default, a template has the setting "deep-off".


Example

We have the following XML fragment:

<X my_attr="attr">abc</X>

Due to tt:lax="on", the ST program below can still deserialize this fragment despite differing element names:

<tt:transform
  xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
  <tt:template>
     <Y tt:lax="on">
       <tt:value ref="ROOT" />
     </Y>
   </tt:template>
</tt:transform>