Page 1 of 1

XML ![CDATA question

Posted: Mon Oct 01, 2007 11:14 am
by battaliou
We have a requirement to output XML in character only format as opposed to HTML markup e.g.

1) <legal_name>G&M NV</legal_name> instead of
2) <legal_name>G&M NV</legal_name>

Our intention is to use a CDATA marked section to display the text verbatim. So the output looks something like:
3) <legal_name><![CDATA[G&M NV]]></legal_name>

Question is, how do I generate 3) above?

P.S. We are currently using <?xml version="1.0" encoding="UTF-8"?>

Posted: Mon Oct 01, 2007 11:44 am
by chulett
Not sure about #3 but to get #1 rather than #2, set the 'Data Element' for that field to XML, it won't do the substitution then.

Posted: Tue Oct 02, 2007 2:40 am
by battaliou
Nice one Craig, in one foul swoop, you've established yourself as the XML guru. I initialised the data element to XML and simply surrounded the output value in the transformer with the necessary strings i.e.

'<![CDATA[' : in.legal_name : ']]>'

Thanks for the reply.