XML output

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sanjeev_sithara
Participant
Posts: 15
Joined: Wed May 26, 2004 6:30 am

XML output

Post by sanjeev_sithara »

Hi,

We have a requirement where we have to convert values from a DB table to XML.We are able to get the XML output but the format is not as required:

O/P now:- <position>
- <bondfwd>
<Position_Name>ACGB Fwd 02-08-06 6.2500% 04-15-15</Position_Name>
<Notional>660000</Notional>
<Currancy>AUD</Currancy>
<Coupon>6</Coupon>
<Coupon_Frequency>Bimonthly</Coupon_Frequency>
<Start_Date>04-15-2002</Start_Date>
<Maturity_Date>04-15-2015</Maturity_Date>
<Market_Price>107</Market_Price>
<Settlement_date>02-08-2006</Settlement_date>
<Settlement_price>107</Settlement_price>
- <customBucketList>
- <customBucket>
<customDimensionName>Account_ID Account_Name</customDimensionName>
<customBucketValue>9369 WTC-CIF Real Asset</customBucketValue>

</customBucket>
</customBucketList>
</bondfwd>
- <bondfwd>


O/P required:
- <position>
- <bondfwd>
<Position_Name>ACGB Fwd 02-08-06 6.2500% 04-15-15</Position_Name>
<Notional>660000</Notional>
<Currancy>AUD</Currancy>
<Coupon>6</Coupon>
<Coupon_Frequency>Bimonthly</Coupon_Frequency>
<Start_Date>04-15-2002</Start_Date>
<Maturity_Date>04-15-2015</Maturity_Date>
<Market_Price>107</Market_Price>
<Settlement_date>02-08-2006</Settlement_date>
<Settlement_price>107</Settlement_price>
- <customBucketList>
- <customBucket>
<customDimensionName>Account_ID </customDimensionName>
<customBucketValue>9369 WTC</customBucketValue>
<customDimensionName>Account_Name </customDimensionName>
<customBucketValue>CIF Real Asset</customBucketValue>
</customBucket>
</customBucketList>
</bondfwd>
- <bondfwd>

DS is aggregating all the dimension names automatically.We need each dimension name and their values displayed seperately.

Kindly help.

Rgds
Sanjeev
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do you have a sample of the desired output? If not, generate one, and then import the metadata for it. Use that to drive the XPath expressions you use in the Output stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sanjeev_sithara
Participant
Posts: 15
Joined: Wed May 26, 2004 6:30 am

Post by sanjeev_sithara »

This doesn't seem to help us.

The O/P we want:

- <position>
- <bondfwd>
<Position_Name>ACGB Fwd</Position_Name>
<Notional>660000</Notional>
- <customBucketList>
- <customBucket>
<customDimensionName>Account_ID</customDimensionName>
<customBucketValue>9369</customBucketValue>
</customBucket>
- <customBucket>
<customDimensionName>Account_Name</customDimensionName>
<customBucketValue>Real Asset</customBucketValue>
</customBucket>
</customBucketList>
</bondfwd>
- <bondfwd>


While DS generats:


- <position>
- <bondfwd>
<Position_Name>ACGB Fwd </Position_Name>
<Notional>660000</Notional>
- <customBucketList>
- <customBucket>
<customDimensionName>Account_ID Account_Name</customDimensionName>
<customBucketValue>9369 Real Asset</customBucketValue>
</customBucket>
</customBucketList>
</bondfwd>
- <bondfwd>


I have defined the grammar as

Position_Name-------/position/bondfwd/Position_Name/text()
Notional------------/position/bondfwd/Notional/text()
Account_ID----------/position/bondfwd/customBucketList/customBucket/customDimensionName
Account_ID_value----/position/bondfwd/customBucketList/customBucket/customBucketValue/text()
Account_Name--------/position/bondfwd/customBucketList/customBucket/customDimensionName
Account_Name_value--/position/bondfwd/customBucketList/customBucket/customBucketValue/text()


This grammar was obtained after creating a dummy XML in the required format and then importing it thru director.

Pl. help

Thank You.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Duplicate thread, I just made the same suggestion as Craig a few seconds ago! How did you get "9369 WTC-CIF Real Asset"? This looks like a concatenation of values with a - added, do you have some type of output stylesheet applied? It seems odd it would concatenate values with - as a seperator.
bunu1977
Participant
Posts: 35
Joined: Thu Oct 16, 2003 4:46 am

hi

Post by bunu1977 »

Ignore the first comment.
Please refer the 2nd one

Dilip/Sanjeev
Post Reply