Writing Variables to XML
The command tt:write enables you to write the value of a variable or a parameter to the target XML document:
<tt:write
var="variable"
[map="mapping_list"]
[length|minLength=″length″]
/>
Use variable to specify the variable to be written or a parameter. For the attributes map, length; and minLength, the same applies as with the tt:value statement. The variable must represent an elementary value.
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). Appropriate mapping rules apply, depending on the type of the variable (of the parameter).
The tt:write command has no effect during deserialization.
Serializing the start value of a variable.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:variable name="VARI" val="333" />
<tt:template>
<X>
<tt:write var="VARI"/>
</X>
</tt:template>
</tt:transform>
The result of the serialization is:
<X>333</X>