01-28-2014 10:44 AM
Hi Gurus,
I have an ST program that needs to output an XML file. I'm able to generate the file but the problem is the "Comment" lines are being removed.
<!-- This is a comment -->
How do I make the comment above appear in the downloaded XML file? I've placed the comments in the ST program but it's ignoring it as I assume it is taking it as a "Comment."
01-28-2014 11:45 AM
You can use text + character data like this:
<tt:text><![CDATA[<!-- This is a comment -->]]></tt:text>
01-28-2014 11:45 AM
You can use text + character data like this:
<tt:text><![CDATA[<!-- This is a comment -->]]></tt:text>
02-03-2014 2:14 PM
Hi, Thanks for the help. It does display.
Is there another way to do this? In a normal XML programming, the comments are shaded gray but when I downloaded my XML they are in BOLD texts. And I also could not put comments right after the <tt:template> part. The program creates Runtime error.
02-03-2014 4:13 PM
You're right: actually there's no way to escape the < > characters in simple transformations, so you should try using XSLT.
02-05-2014 8:26 AM
No way? That's unfortunate. I can't use XSLT since the ST is already in place and I just need the comments. I guess I'll live with what you suggested for the meantime. Thanks!
11-08-2023 8:22 AM
I have the same challange, I would like to pass a value from ABAP variable into the XML file as a comment value. - I don't get it, how should it work? With
<tt:text><![CDATA[<!-- This is a comment -->]]></tt:text>
it is not working for me - inside the template I get an exception, outside it does not show up in the exported file.
11-08-2023 6:58 PM
Hello alexander.kutz,
Consider starting a new question thread as you'll not get any response commenting on an inactive thread from 2014.
Regards,
Alex