Below is the posting from cmuller.
Pipe any non repeating data to a hashed file stage, using serialno for the key. Then pipe repeating tags to the an xmloutput stage, and then to another hashed file stage to which you will write the repeating tags as xml chunks and use the serialno as key. It may look like this
SerialNo:1
TotalPayment: <Subtotal>124</Subtotal><Balance>1234</Balance> <Subtotal>156</Subtotal><Balance>1978</Balance> <Subtotal>678</Subtotal><Balance>9999</Balance> <Subtotal>563</Subtotal><Balance>4444</Balance>
Then you can join both hashed files using the second as a lookup and pipe it all to an xmloutput stage.
****
I am using the above logic (posted by cmuller) in my jobs and I am getting the output in the above format. Could some one tell how to change it to the below format.
TotalPayment: <Subtotal>124</Subtotal><Balance>1234</Balance> <Subtotal>156</Subtotal><Balance>1978</Balance> <Subtotal>678</Subtotal></Balance>
Please look at the last record. In summary I need to produce a closing tag (</Balance>) if there is no Balance value for the SubTotal.
Thanks
Netboyks.
XML output with just a closing tag -- Urgent.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Call me crazy but this looks like invalid XML, how can you have a closing </BALANCE> tag when you don't have an opening <BALANCE> tag?
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn