I have a request to generate XML file with ALL values wrapped in a CDATA block.
The current XML generator does have an option to use CDATA, but per documentation, it only inserts CDATA wrapper “when necessary”. Apparently using some logic searching for certain characters, or XML/HTML markup tags within the value (that would/should be escaped).
Is there a way to do this, or do I have to create a feature request?
Note: I know it’s not mandatory for each tag value per XML specs. Not my request to have it everywhere
Welcome to the community
It would need a feature request but to be honest I am not sure what you are actually trying to do, Could you share some example data that would help show what you are trying to do?
Hi, thx for the reply. It’s exactly what is in the title, ie.:
<address><![CDATA[North 12, Alabama, NY]]></address>
<profile><![CDATA[<p>A very good person, has a <strong>dog</strong> and only drinks beer.</p>]]></profile>
As I noted, I do know that the only value that really requires CDATA wrapper is the profile tag content in this case. But the recipient of the XML requested explicitly that all values need to be wrapped
I guess it could be manually processed/replaced somehow, but the functionality is already implemented, it just tries to be (understandably) smart and wrap only things that do require wrapping.
Is it clearer now?
That is a lot clearer thanks, So the quick version is it looks like the package we use uses the cdata option when it needs to escape any characters.
I have swapped this over to a feature request so we can track the votes for future development.
Thanks @Jon let’s see if and when it lands