Show TOC

Syntax documentationControlling the Name Comparison of Literal XML Elements Locate this document in the navigation structure

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. After tt:lax, you can enter the following values for lax_flag:

... on|off|deep-on|deep-off ...

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, deep-off is set for a template.

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:

Syntax Syntax

  1. <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  2. <tt:root name="ROOT"/>
  3.   <tt:template>
  4.      <Y tt:lax="on">
  5.        <tt:value ref="ROOT"/>
  6.      </Y>
  7.    </tt:template>
  8. </tt:transform>
End of the code.