Literal Text
Each piece of content of a template that is not an element (which means that it is not positioned between < >), is literal text. This includes line breaks and blanks that are combined under the term whitespace. In ST programs, literal text can also be identified using the ST command tt:text.
Literal Text Not Flagged
...>text<...
Literal Text Flagged
...><tt:text>text</tt:text><...
The difference between these variants is that an unflagged text text is ignored during serialization and deserialization if it contains nothing but whitespace. A flagged text is never ignored.
If a literal text is not ignored, then all its characters are written to the target XML document. This includes any whitespace. No characters are written if a text is ignored.
The literal text of the XML source document is compared character by character (including blanks and line breaks) to the ST program and consumed. This means that at every position in the inbound stream at which there is literal text, the same text must appear in the ST program and must also be considered there.
Use literal texts with other characters (except whitespace) sparingly; always identify them with tt:text and do not extend them over multiple lines because line breaks and indents are potential sources of error during deserialization. Use unflagged texts only to format the ST program with line breaks and blanks (indents). To avoid problems during deserialization of literal texts, you can skip them using tt:skip.
The ST program below contains four elements X1 to X4with literal text.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:template>
<X0>
<X1> a b c </X1>
<X2><tt:text> d e f </tt:text></X2>
<X3>
</X3>
<X4><tt:text>
</tt:text></X4>
</X0>
</tt:template>
</tt:transform>
The result of a serialization is as follows, where the blanks in X3 are ignored:
<X0><X1> a b c </X1><X2> c d e </X2><X3/><X4> </X4></X0>
This XML document can itself be deserialized again by the above ST program. The ST program below triggers the exception CX_ST_MATCH_ELEMENT, because no blanks exist in the ST program for the blanks in the inbound stream within X4, due to the missing flagging with tt:text.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:template>
<X0>
<X1>a b c</X1>
<X2><tt:text>d e f</tt:text></X2>
<X3>
</X3>
<X4>
</X4>
</X0>
</tt:template>
</tt:transform>
The ST program below cannot deserialize the XML document either, because it expects line breaks in X1 and more blanks due to the indent.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:template>
<X0>
<X1>
a b c
</X1>
<X2><tt:text>d e f</tt:text></X2>
<X3>
</X3>
<X4>
</X4>
</X0>
</tt:template>
</tt:transform>
The ST program below can deserialize the XML document; all elements are skipped using tt:skip.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:template>
<X0>
<X1><tt:skip /></X1>
<X2><tt:skip /></X2>
<X3><tt:skip /></X3>
<X4><tt:skip /></X4>
</X0>
</tt:template>
</tt:transform>