XML transformation help needed
Posted: Thu Jul 12, 2012 6:33 am
Hi,
I have a requirement where I need to convert flat files to XML files. I am able to do it. Problem arrived when the customer changed the XML format. I need to trnaform it now as per the requirement.
The input looks like :
UPC-NUMBER | WMITEMNUMBER | DESCRIPTION | ATS| TROUBLE| RECEIPT-IN-PROGRESS| OIP |EIP |WIP |FACILITYID |QTY_ON_HAND |CREATE_DATE_TIME|DCID|COUNTRYCODE|ORGANIZATIONCODE|PRODUCTCLASS
0072228635653|0000003021995|BF SPORT NURS |123|0|0|0|0|0|5868|123|12/22/2011.10.00|6279|US|XYZ|auction
0001467100043|0000003016219|SN CNVRT STRPLES|28|0|0|1|0|0|5868|29|12/22/2011.10.00|6279|US|XYZ|auction
Previous output :
<Items ReasonText="20111222102212" ShipNode="5868"
YantraMessageGroupID="5868.20111222102212.303919.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Interface_IMS_InventorySupplyUpdate_eDC_Integration_Snapshot.xsd">`
<Item InventoryOrganizationCode="XYZ" ItemID="0000003021995"
ProductClass="auction">
<Supplies>
<Supply ATS="123" EIP="0.0" OIP="0.0" QTY_ON_HAND="212" RECEIPTIN-PROGRESS="0.0" TROUBLE="0.0" WIP="0.0" />
</Supplies>
</Item>
</Items>
Now the requirement is :
<Items ReasonText="20111222102212" ShipNode="5868"
YantraMessageGroupID="5868.20111222102212.303919.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Interface_IMS_InventorySupplyUpdate_eDC_Integration_Snapshot.xsd">
<Item InventoryOrganizationCode="XYZ" ItemID="3021995"
ProductClass="AUCTION">
<Supplies>
<Supply SupplyType="ATS" Quantity="123" />
<Supply SupplyType="EIP" Quantity="0.0" />
<Supply SupplyType="OIP" Quantity="0.0" />
<Supply SupplyType="RIP" Quantity="123" />
<Supply SupplyType="TRBL" Quantity="0.0" />
<Supply SupplyType="WIP" Quantity="0.0" />
</Supplies>
</Item>
</Items>
I am stuck with this format change. Do I need to go with XML transformer here ? I am generating XML based on a trigger column and have to pass it to a message queue.
I have a requirement where I need to convert flat files to XML files. I am able to do it. Problem arrived when the customer changed the XML format. I need to trnaform it now as per the requirement.
The input looks like :
UPC-NUMBER | WMITEMNUMBER | DESCRIPTION | ATS| TROUBLE| RECEIPT-IN-PROGRESS| OIP |EIP |WIP |FACILITYID |QTY_ON_HAND |CREATE_DATE_TIME|DCID|COUNTRYCODE|ORGANIZATIONCODE|PRODUCTCLASS
0072228635653|0000003021995|BF SPORT NURS |123|0|0|0|0|0|5868|123|12/22/2011.10.00|6279|US|XYZ|auction
0001467100043|0000003016219|SN CNVRT STRPLES|28|0|0|1|0|0|5868|29|12/22/2011.10.00|6279|US|XYZ|auction
Previous output :
<Items ReasonText="20111222102212" ShipNode="5868"
YantraMessageGroupID="5868.20111222102212.303919.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Interface_IMS_InventorySupplyUpdate_eDC_Integration_Snapshot.xsd">`
<Item InventoryOrganizationCode="XYZ" ItemID="0000003021995"
ProductClass="auction">
<Supplies>
<Supply ATS="123" EIP="0.0" OIP="0.0" QTY_ON_HAND="212" RECEIPTIN-PROGRESS="0.0" TROUBLE="0.0" WIP="0.0" />
</Supplies>
</Item>
</Items>
Now the requirement is :
<Items ReasonText="20111222102212" ShipNode="5868"
YantraMessageGroupID="5868.20111222102212.303919.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Interface_IMS_InventorySupplyUpdate_eDC_Integration_Snapshot.xsd">
<Item InventoryOrganizationCode="XYZ" ItemID="3021995"
ProductClass="AUCTION">
<Supplies>
<Supply SupplyType="ATS" Quantity="123" />
<Supply SupplyType="EIP" Quantity="0.0" />
<Supply SupplyType="OIP" Quantity="0.0" />
<Supply SupplyType="RIP" Quantity="123" />
<Supply SupplyType="TRBL" Quantity="0.0" />
<Supply SupplyType="WIP" Quantity="0.0" />
</Supplies>
</Item>
</Items>
I am stuck with this format change. Do I need to go with XML transformer here ? I am generating XML based on a trigger column and have to pass it to a message queue.