XML Output
Posted: Wed Feb 16, 2005 11:48 am
Hello!
I have a problem with the XML Writer in Datastage 5.x that I hope somebody can help me with. I am writing out records in an un-sorted order from a hash file to an xml file.
Each record must transformed into the following:
<instrument>
</instrument>
<ownership>
</ownership>
<underlying-stocks>
</underlying-stocks>
I have this working perfectly
except in the case where two records lie sequentially together and where the instrument details are the same
. It should write out those records like so:
<instrument>
... record 1 instrument details
</instrument>
<ownership>
... record 1 instrument ownership details
</ownership>
<underlying-stocks>
... record 1 instrument underlying-stocks details
</underlying-stocks>
<instrument>
... record 2 instrument details
</instrument>
<ownership>
... record 2 instrument ownership details
</ownership>
<underlying-stocks>
... record 2 instrument underlying-stocks details
</underlying-stocks>
However what it actually does is this:
<instrument>
... record 1 instrument details
</instrument>
<ownership>
... record 1 instrument ownership details
</ownership>
<underlying-stocks>
... record 1 instrument underlying-stocks details
</underlying-stocks>
<ownership>
... record 2 instrument ownership details
</ownership>
<underlying-stocks>
... record 2 instrument underlying-stocks details
</underlying-stocks>
I think this is because record 1 instrument details are the same as record 2 instrument details. I'm not sure how to get around this as the logic seems to be in the "black box" of the XML Writer stage.
Can anyone shed some light?
Many thanks,
Chris
I have a problem with the XML Writer in Datastage 5.x that I hope somebody can help me with. I am writing out records in an un-sorted order from a hash file to an xml file.
Each record must transformed into the following:
<instrument>
</instrument>
<ownership>
</ownership>
<underlying-stocks>
</underlying-stocks>
I have this working perfectly
![Smile :)](./images/smilies/icon_smile.gif)
![Sad :(](./images/smilies/icon_sad.gif)
<instrument>
... record 1 instrument details
</instrument>
<ownership>
... record 1 instrument ownership details
</ownership>
<underlying-stocks>
... record 1 instrument underlying-stocks details
</underlying-stocks>
<instrument>
... record 2 instrument details
</instrument>
<ownership>
... record 2 instrument ownership details
</ownership>
<underlying-stocks>
... record 2 instrument underlying-stocks details
</underlying-stocks>
However what it actually does is this:
<instrument>
... record 1 instrument details
</instrument>
<ownership>
... record 1 instrument ownership details
</ownership>
<underlying-stocks>
... record 1 instrument underlying-stocks details
</underlying-stocks>
<ownership>
... record 2 instrument ownership details
</ownership>
<underlying-stocks>
... record 2 instrument underlying-stocks details
</underlying-stocks>
I think this is because record 1 instrument details are the same as record 2 instrument details. I'm not sure how to get around this as the logic seems to be in the "black box" of the XML Writer stage.
![Question :?:](./images/smilies/icon_question.gif)
Many thanks,
Chris