XML ![CDATA question

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

XML ![CDATA question

Post 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"?>
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post 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.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
Post Reply