XML Write Header and Footer - CData

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kaasko
Participant
Posts: 2
Joined: Thu Jan 10, 2013 6:53 am

XML Write Header and Footer - CData

Post by kaasko »

Hi All,

I'm trying to write an XML using DS and ive managed to create all the repeated elements using key and trigger columns;Special thanks to Ernie on his posts about xml. Now i need to add header and footer outside of the element tag and these should have free form text that is of CDATA. (ex: <Header>
<![CDATA[ message ]]>
</Header>

I've found a post that tells me use hash files and a lookup to use, however as I'm using 11.5 is there an alternative to this?


Also, how do we get this free form text tag <![CDATA[ message ]] using Datastage xsd. I've changed the datatype to char and dataelement type as xml but not able to achieve this

For every column description, my fields have /root/<elementtagname>/<columnname>/text() -- So, for achieving CDATA , is there any specific datatype that I need to use or somefeature that I'm missing

Thanks in advance


kaasko
Regards


THE KAASKO!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: XML Write Header and Footer - CData

Post by chulett »

kaasko wrote:I've found a post that tells me use hash files and a lookup to use, however as I'm using 11.5 is there an alternative to this?
Welcome!

What you found was (I assume) a very old post but your issue isn't the version as it's still a perfectly valid solution. Instead, it was for Server jobs and (again, I assume) you are only looking for a Parallel solution. Ernie is still The Man when it comes to XML discussions here, hopefully he'll be able to pop in and help out. I'm sure someone will. I never had a chance to use the new PX XML stages before I moved on, so can't help there. :(
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Thank you for the kind words. Glad these resources have been helpful. I havent done cdata stuff in awhile, but recall researching this in depth and concluding that it cant be done with the hierarchical stage.....needing still the xmlOutput Stage....which, for subtle reasons like this, is still fully supported.

Also, if you dont have high volumes, use Server. It is far superior to EE for handling low volume xml because it loves variable text, which is what all xml essentially is.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... and when he says "high volumes" he means HIGH volumes. We worked with pretty dang huge volumes of XML data back in the day using Server jobs for consumption by various search engines. Ah, those were the days when Server jobs weren't... pariah. :cry:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kaasko
Participant
Posts: 2
Joined: Thu Jan 10, 2013 6:53 am

Post by kaasko »

Thankyou so much for the inputs and for the welcome(i've only been a stalker in this forum for years and has been my first post officially :P).. and haha I do miss those server job days. But unfortunately I'm dealing with banks data :shock: :shock: and yes HIGH VOLUMES.

I've managed to hardcode the ''CDATA xyzzz " as string thru transformer and in xml output stage - i've defined this column as xml element . And the entire string is adjusted to ---[[CDATA ]] --- with the blue tags as required.

Now , I've an another issue with the tags - i've non repetive columns in my output records - and each run is appending all the tags(including parent tags and child) multiple times as many as the records are there. Is there a way where I can group the child tags into one parent tag.


Cheers
kaasko
Regards


THE KAASKO!
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

I can imagine some possibilities, but there is too much room for interpretation. Can you describe the issue in a bit more detail? ...perhaps outline some of the resulting xml you are seeing and what you "want" to see?

Thanks.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply