Preserve CDATA value In tag

Hello,
How can I add <![CDATA[ value ]]> Inside script tags?
I try to add it as value but it gets converted in html escapes.
I checked many related topics from forum but what should be done In case I want it this way only?

For an example:
Output:
<script>&lt;![CDATA[def rec = rec.archived = false]]&gt;</script>

Expected Output:
<script><![CDATA[def rec = rec.archived = false]]></script>

You cannot. Why would you want that?

CDATA and entity escaping (i.e. &lt;) are equivalent from the XML point of view. As you consume the XML file it should not matter if either was used to create it.

2 Likes