Processing an XML

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
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Processing an XML

Post by HemaV »

I get an single xml with name tags as below:

<eList>
<eDate>
<name>AAA</name>
<value>20090613 00:00:00</value>
</eDate>
<eDate>
<name>BBB</name>
<value>20090614 00:00:00</value>
</eDate>
<eDate>
<name>CCCC</name>
<value>20090615 00:00:00</value>
</eDate>
<eDate>
<name>DDDD</name>
<value>20090616 00:00:00</value>
</eDate>
</eList>

Need to divide the above into multiple columns as below and read it as a single row:
name1=AAA
value1=20090613 00:00:00
name2=BBB
value2=20090614 00:00:00
name3=CCCC
value3=20090615 00:00:00
name4=DDDD
value4=20090616 00:00:00
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK... and what have you tried? You should have a job with a Folder stage and an XML Input stage at the very least. You should also have imported the metadata from your source xml (ideally from an xsd) so you have the appropriate XPath Expressions to use in the XML Input stage to parse this.

And if you haven't done this already, go to Kim Duke's website and download the XML Best Practices document from his Tips&Tricks section. Lots of good information there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Post by HemaV »

I have done validation part including xml stage component also. but when i read this eDate tag i m getting 2 rows and i need to merge these 2 rows into a single row for processing.
Post Reply