Hi
Scenario: I am generating a XML chunk as below
My job looks like this...
DS
|
\|/
transformer
|
\|/
XMLputput1
|
Lookup --->XMLputput3
/|\
|
transformer
/|\
|
XMLoutput2
/|\
|
DS
XMloutput 1: header XML
XMLoutput 2: Chunk XML generation
XMLoutput :Final XML generation
<Order> <LineItem> <a> <b> <c> </LineItem>
<LineItem> <a> <b> <c> </LineItem>
<LineItem> <a> <b> <c> </LineItem>
<Order>
After this chunk is generated, in the same job I want the output as below
<LineItem> <a> <b> <c> </LineItem>
<LineItem> <a> <b> <c> </LineItem>
<LineItem> <a> <b> <c> </LineItem>
In the Xmloutput2 I generate the chunk as above. ( I should have Order element as I need to group the LineItems based on trigger set in XML)
But in final XML generation I should not have Order element.
I hope I made my point clear. Is it possible?
Sorry I have no idea of drawing job diagram in this DSxchange post.
Regards
XML parsing...removal of parent element
Moderators: chulett, rschirm, roy
XML parsing...removal of parent element
Last edited by ag_ram on Wed Jan 02, 2008 3:31 pm, edited 1 time in total.
Not sure where/how you are creating the lineitem chunk....if it's as purely relational as it looks, I'd just create it earlier, from whatever the row source is....but your other option is to send the whole XML to another XMLInput Stage, with a single column, key=yes, and Description attribute of /Order/LineItem/ ...you will get as many rows as there are line item elements...then use any manner of DataStage techniques to push them together again..... of course it might be simpler to just pull the column using /Order/ and then pass the string thru a transformer that zaps out <order> and </order> using one of the string functions.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>