Show TOC

Syntax documentationWriting Variables to XML Locate this document in the navigation structure

The command tt:write enables you to write the value of a variable or a parameter to the target XML document:

Syntax Syntax

  1. <tt:write var="variable" [map="mapping_list"] 
  2.                          [length|minLength=″length″]
                             [validation] />
End of the code.

You use variable to specify the variable to be written or a parameter. The same applies to the attributes map, length, and minLength and to validation as to the statement tt:value. The variable must represent an elementary value.

Serialization

The value of the variable (the parameter) is inserted into the XML document at the position of the command (if applicable, after the mapping_list). The corresponding mapping rules apply, depending on the type of the variable (of the parameter).

Deserialization

The tt:write command is ignored in deserializations.

Example

Serializing the start value of a variable.

Syntax Syntax

  1. <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  2.   <tt:variable name="VARI" val="333" />
  3.   <tt:template>
  4.     <X>
  5.       <tt:write var="VARI"/>
  6.     </X>
  7.   </tt:template>
  8. </tt:transform>
End of the code.

The result of the serialization is:

<X>333</X>