XML Output Stage formatting issue

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

Post Reply
amit.jaiswal_ATL
Premium Member
Premium Member
Posts: 28
Joined: Thu Oct 23, 2014 1:49 pm

XML Output Stage formatting issue

Post by amit.jaiswal_ATL »

Hello All,

Below is my requirement related to inner XML block,

-<s:LineItems>
<s:Code>0000</s:Code>
-<s:Values>
<s:CodeValue>01</s:CodeValue>
</s:Values>
-<s:Values>
<s:CodeValue>02</s:CodeValue>
</s:Values>
-<s:Values>
<s:CodeValue>03</s:CodeValue>
</s:Values>
</s:LineItems>

Below is what I am getting after running my datastage job,
-<s:LineItems>
<s:Code>0000</s:Code>
-<s:Values>
<s:CodeValue>01</s:CodeValue>
<s:CodeValue>02</s:CodeValue>
<s:CodeValue>03</s:CodeValue>
</s:Values>
</s:LineItems>

I used XML Output Stage to achieve this and below are the column definitions and xpaths defined.

INPUT
SYSTEM_ID
CUST_COMPLAINT_CD XPATH ==> /s:LineItems/s:Code
REPAIR_GROUP (Key) XPATH ==> /s:LineItems/s:Values/s:CodeValue

Output mode -> User Trigger Column -> SYSTEM_ID

OUTPUT
SYSTEM_ID
XML_VALUE XPATH ==> /s:LineItems

I tried multiple options by changing key columns, etc but no luck so far. Can you please suggest changes required in my XML output stage or any alternate option to achieve this result. Please let me know if you need any additional information.

Thanks in advance!
Amit Jaiswal
Atlanta GA USA
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Many would argue that the first inner example is the incorrect one....it wastes space with extra elements and has no identifier at the first grouping. You may need to add a fake counter to force it to think a new group should be created.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
AshishDevassy
Participant
Posts: 32
Joined: Fri Nov 07, 2014 11:18 am

Post by AshishDevassy »

Do you have an xsd for this output ?
that's wierd ?
Post Reply