|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
WTX: XML to Fixed length conversion |
« View previous topic :: View next topic » |
Author |
Message
|
dilep |
Posted: Sun Oct 05, 2008 8:02 pm Post subject: WTX: XML to Fixed length conversion |
|
|
Apprentice
Joined: 27 Nov 2006 Posts: 40
|
Hi,
I am trying to Tranfer an XML message to Fixed length. using Websphere Transformation Extender
The XML file look like this
<?xml version="1.0"?>
<ipo:purchaseOrders xmlns:ipo="http://www.example.com/IPO">
<order orderDate="2008-10-05">
<PONumber>12345</PONumber>
<items>
<item partNum="A104912">
<productName>Dress</productName>
<quantity>500</quantity>
<USPrice>65.99</USPrice>
</item>
<item partNum="Y329481">
<productName>Pants</productName>
<quantity>10000</quantity>
<USPrice>32.5</USPrice>
</item>
</items>
</order>
<order orderDate="2008-10-05">
<PONumber>14478</PONumber>
<items>
<item partNum="Y938XY1">
<productName>Pants</productName>
<quantity>275</quantity>
<USPrice>32.5</USPrice>
</item>
</items>
</order>
</ipo:purchaseOrders>
The Fixed length output should like this,
PONumber ProductName PartNum Quantity USPrice
PONumber ProductName PartNum Quantity USPrice
PONumber ProductName PartNum Quantity USPrice
But there is a problem in Transformation of PO Number, Because the PO number is common for two items in the above XML . How the PONumber is define in Typee Tree.?
Can anyone help me to solve this problem. Any document available?
Thanks |
|
Back to top |
|
 |
Subha |
Posted: Mon Oct 06, 2008 12:47 am Post subject: WTX: XML to Fixed length conversion |
|
|
Apprentice
Joined: 14 Nov 2006 Posts: 33 Location: Toronto
|
With the help of xml schema given for the input xml you can create a type tree. So it is going to have multiple order elements and within which it will have multiple Item element.
Create a functional map for the Records in the output file. The arguments for the functional map would be order element and items element so that it will be called for all possible combination of order and items of your input xml message.
Hope this helps. _________________ Subh |
|
Back to top |
|
 |
dilep |
Posted: Mon Oct 06, 2008 5:36 am Post subject: |
|
|
Apprentice
Joined: 27 Nov 2006 Posts: 40
|
I defined the Fixed length like this
File (Group element) contains PRS (Group element)
- PRS
PRS (Group element) Range (1:s)
- PONumber (item element) Range(1:s)
- Records (Group Element) Range (s)
Record (Group element)
- Quantity (Item element)
- PartNum (Item element)
- Product Name(Item Element)
- USPrice(Item Element)
The output file is comming wrong
The OutPut File is coming like this:
12345 500 Dress 065.99A104912
10000 Pants 032.50Y329481
14478 275 Pants 032.50Y938XY1
500 Suit 200.70A194C10
The Expected Output File like this:
12345 500 Dress 065.99A104912
12345 10000 Pants 032.50Y329481
14478 275 Pants 032.50Y938XY1
14478 500 Suit 200.70A194C10 |
|
Back to top |
|
 |
Subha |
Posted: Mon Oct 06, 2008 10:59 pm Post subject: WTX: XML to Fixed length conversion |
|
|
Apprentice
Joined: 14 Nov 2006 Posts: 33 Location: Toronto
|
The fixed length file definition should be like this,
Group - File - has Record(1-s) as components
Group - Record - has PO#,Qty,PartNum,ProdName,Price as components - Set the terminator to <CR><LF>
PO#,ProdName,PartNum,Qty,Price are Items defined
It is because you have created PO# as a separate field , you are not getting expected result.
I hope the above definition works. _________________ Subh |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|