Forum Discussion
bgoodkinTCF
7 months agoNew Contributor II
Still looking for an answer here, although I found a workaround.
In my generator, I want to pass my input document wrapped in a CDATA tag because my InputDocument is an externally-provided XML containing its own XML declaration and I want to preserve it as-is.
Example "InputObject":
<?xml version="1.0" encoding="UTF-8"?><root>MyInputObject</root>
Input (from my XML Generator):
<InputDocument><![CDATA[$InputObject]]></InputDocument>
Output:
<InputDocument><?xml version="1.0" encoding="UTF-8"?><root>MyInputObject</root></InputDocument>
The only workaround I've found is to put the following in my XML Generator, then use .replace() in a Mapper:
Input:
<InputDocument>_INPUTDOCUMENTPLACEHOLDER_</InputDocument>
Replace:
$xml.replace("_INPUTDOCUMENTPLACEHOLDER_","<![CDATA["+$original.InputObject+"]]>")
Output:
<InputDocument><![CDATA[<?xml version="1.0" encoding="UTF-8"?><root>MyInputObject</root>]]></InputDocument>