Page 1 of 1

XML Output stage

Posted: Thu Jul 16, 2009 3:16 am
by bikan
Hi All,

I have a source metadata as
customerid,customername,add1,add2,cost1,cost2
and i have 2 occurence of add1,add2 and cost1,cost2 in my source data file.
My data file is like
101,john,abc street,cde street,abd street,dgf street,30,35,60,70

I want output XML file as
<ExternalXML>
<customerid>101</customerid>
<customername>john</customername>
<address>
<add1>abc street</add1>
<add2>cde street</add2>
</address>
<address>
<add1>abd street</add1>
<add2>dgf street</add2>
</address>
<cost>
<cost1>60</cost1>
<cost2>70</cost2>
</cost>
<cost>
<cost1>30</cost1>
<cost2>35</cost2>
</cost>
</ExternalXML>

I have got reply from ernie saying that i need to use PIVOT stage.
Pivot stage worked for address occurence and i got 2 records out of 1 in source.
but when i tried with two fields having 2 occurences then i got ambiguity in the data with PIVOT stage and output was not correct.

Please tell me what i need to do.

Thanks in advance for your help.

Murari