splitting XML with multiple root level

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
Niv0599
Premium Member
Premium Member
Posts: 13
Joined: Tue Apr 10, 2012 11:47 am

splitting XML with multiple root level

Post by Niv0599 »

Hello,

Is there a way in data stage to split an XML file with multiple root level?

I have a MQ connector sending replies in XML that has multiple root level tag, as it will fail in parsing, trying to find a way to split it.

Please let me know, if it's possible.

Thanks,
Das
Datastage is the best thing that happened to ETL
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...try first concatenating another fake root around it, and then retrieve all the "root" elements as the first repeating node...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

Hmm Interesting , Can someone use an XML output stage to add the top level root once they grab it from MQ ? Assuming the xml column is tagged as data element XML
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

why bother? A transform derivation is a WHOLE lot easier.....

'<xml? version="1.0" ?><myRoot>' : myMQoutputLink.message : '</myRoot>'

done.

Ernie
Ernie Ostic

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