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
just4geeks
Premium Member
Posts: 644 Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA
Post
by just4geeks » Thu Mar 07, 2013 3:29 pm
Just wondering if someone can help me with this.
I have this in a flat file.
Code: Select all
020902,020902001,1200110100Z001
020902,020902001,1200110100Z002
The XML schema is this,
Code: Select all
/ORG/CLASS/ITEM/text()
/ORG/PROG/ITEM/text()
/ORG/LINE/LINECODE/ID/text()
Expected output:
Code: Select all
<ORG>
<CLASS>
<ITEM>020902</ITEM>
</CLASS>
<PROG>
<ITEM>020902001</ITEM>
</PROG>
<LINE>
<LINECODE IdentificationSystem="VA">
<ID>1200110100Z001</ID>
</LINECODE>
</LINE>
<LINE>
<LINECODE IdentificationSystem="VA">
<ID>1200110100Z002</ID>
</LINECODE>
</LINE>
</ORG>
But what I get is, this. The ORG tags are repeating. How do I make it not repeat for every new /ORG/LINE/LINECODE/ID.
Code: Select all
<ORG>
<CLASS>
<ITEM>020902</ITEM>
</CLASS>
<PROG>
<ITEM>020902001</ITEM>
</PROG>
<LINE>
<LINECODE IdentificationSystem="VA">
<ID>1200110100Z001</ID>
</LINECODE>
</LINE>
</ORG>
<ORG>
<CLASS>
<ITEM>020902</ITEM>
</CLASS>
<PROG>
<ITEM>020902001</ITEM>
</PROG>
<LINE>
<LINECODE IdentificationSystem="VA">
<ID>1200110100Z002</ID>
</LINECODE>
</LINE>
</ORG>
Any ideas are welcome.
Attitude is everything....
rameshrr3
Premium Member
Posts: 609 Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN
Post
by rameshrr3 » Thu Mar 07, 2013 4:56 pm
Which column[Xpath] have you tagged as the key column of XML output stage ? It should be the ID tag
prasannakumarkk
Participant
Posts: 117 Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India
Post
by prasannakumarkk » Thu Mar 07, 2013 11:48 pm
What is the option you have checked?
1) Aggregate rows
2) Single Row
3) Key column
Thanks,
Prasanna
just4geeks
Premium Member
Posts: 644 Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA
Post
by just4geeks » Fri Mar 08, 2013 7:05 am
rameshrr3 wrote: Which column[Xpath] have you tagged as the key column of XML output stage ? It should be the ID tag
When I set the ID tag as the key, it appears to work fine until I have two instances of /ORG/PROG/ITEM/text()
Code: Select all
020902,[b]020902001[/b],1200110100Z001
020902,[b]020902002[/b],1200110100Z002
This is the output I get,
<ORG>
<CLASS>
<ITEM>020902</ITEM>
</CLASS>
<PROG>
<ITEM>020902001</ITEM>
</PROG>
<LINE>
<LINECODE IdentificationSystem="VA">
<ID>1200110100Z001</ID>
<ID>1200110100Z002</ID>
</LINECODE>
</LINE>
</ORG>
<ORG>
<CLASS>
<ITEM>020902</ITEM>
</CLASS>
<PROG>
<ITEM>020902002</ITEM>
</PROG>
<LINE>
<LINECODE IdentificationSystem="VA">
<ID>1200110100Z001</ID>
<ID>1200110100Z002</ID>
</LINECODE>
</LINE>
</ORG>
Last edited by
just4geeks on Fri Mar 08, 2013 7:12 am, edited 1 time in total.
Attitude is everything....
just4geeks
Premium Member
Posts: 644 Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA
Post
by just4geeks » Fri Mar 08, 2013 7:05 am
prasannakumarkk wrote: What is the option you have checked?
1) Aggregate rows
2) Single Row
3) Key column
Aggregate rows.
Attitude is everything....
eostic
Premium Member
Posts: 3838 Joined: Mon Oct 17, 2005 9:34 am
Post
by eostic » Mon Mar 11, 2013 6:36 am
It's not exactly clear to me what you "want" to get, or what the exact issue is. Can you provide a bit more detail and explanation?
Thanks.
Ernie
just4geeks
Premium Member
Posts: 644 Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA
Post
by just4geeks » Mon Mar 11, 2013 7:32 am
eostic wrote: Can you provide a bit more detail and explanation?
Hi Ernie, I agree I wasn't elaborate on my question. Fortunately, this question isn't relevant anymore due to job design changes and I have been confronted with another similar yet perplexing XML problem. I will be posting the question in a new thread.
Update:
The new thread is here
viewtopic.php?p=437969
Attitude is everything....