So I have this problem handling an XML file in my SAP ABAP-based software, with a Simple Transformation.
The file I receive have normally no empty tags like <test></test>
, but can happen sometimes that I receive some self closing tag like <test/>
.
This is an example of what I thought to use now. The first condition handles if the ref('test') is blank by skipping it. The second one takes the values if we have one.
<tt:cond check="initial(ref('test'))">
<tt:skip count="*" name="test"/>
</tt:cond>
<tt:cond check="not-initial(ref('test'))">
<test tt:value-ref="test"/>
</tt:cond>
The idea is: if we have this tag <test/>
we need to skip it, otherwise we need to assign the data. Now this is working for the first case, because it takes no data, but not for the second because it does not take the data.
Thanks in advanсe.