Page 1 of 1

XML Output Stage formatting issue

Posted: Thu Mar 26, 2015 12:34 pm
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!

Posted: Thu Mar 26, 2015 1:56 pm
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

Posted: Thu Mar 26, 2015 2:13 pm
by AshishDevassy
Do you have an xsd for this output ?