In this recipe, we will see how we can create a simple transformation comprising of literal texts and no data root. We will use the transaction XSLT_TOOL
.
We will carry out the following steps:
XSLT_TOOL
. Enter a suitable transformation name in the field provided (we give the name zst6_first
). Then, press the Create button.X0
that contains the literal elements X1
and X2
. After the addition of the lines, the code appears as shown in following screenshot:We created a simple transformation. It contains no root element, meaning that it can be passed any ABAP data object when called from an ABAP program.
When the transformation is serialized, the resulting XML code looks like the following code:
<X0> <X1> my transformation first line </X1> <X2> second line </X2> </X0>
The literal element X1
contains literal text without identification, whereas X2
contains text with identification defined within <tt:text>
and </tt:text>
.
To better understand the literal text with the identification feature, consider the following example:
We create an element X2
without identification and an element X3
with identification. Both contain blank spaces. The resulting XML string (as seen in the debugger) will be as follows:
For element X3
, the white spaces are preserved, whereas for X2
they are not.
13.58.51.228