XML Output stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kavish_shaz
Participant
Posts: 1
Joined: Mon May 04, 2009 2:07 am
Location: India

XML Output stage

Post by kavish_shaz »

Hi all,

I have used an XML output stage to create an xml file from a sequential file.
The sample xml file that i used to import definition is
<CustomerInfo>
<CustomerID>0000000001</CustomerID>
<Contact>
<FirstName>Lee</FirstName>
<LastName>Chen</LastName>
<Email>LeeChen@gmail.com</Email>
</Contact>
</CustomerInfo>

My source file has 3 rows. When i run the job, i'm getting the xml file as below:

<?xml version="1.0" encoding="UTF-8"?>
<!--
- Generated by Ascential Software Corporation, DataStage - XMLOutput stage -
- Mon May 04 16:56:22 2009
-->
<CustomerInfo>
<CustomerID>
1
</CustomerID>
<Contact>
<FirstName>
Lee
</FirstName>
<LastName>
Chen
</LastName>
<Email>
LeeChen@gmail.com
</Email>
</Contact>
</CustomerInfo>
<CustomerInfo>
<CustomerID>
2
</CustomerID>
<Contact>
<FirstName>
Joey
</FirstName>
<LastName>
Wang
</LastName>
<Email>
JoeyWang@sina.com
</Email>
</Contact>
</CustomerInfo>
<CustomerInfo>
<CustomerID>
3
</CustomerID>
<Contact>
<FirstName>
David
</FirstName>
<LastName>
Liu
</LastName>
<Email>
DavidLiu@gmail.com
</Email>
</Contact>
</CustomerInfo>

As can be seen from above xml, each row data is being enclosed between one <CustomerInfo> tag each. Because of additional tags, it throws me an error when opening the xml file.

Can I not have all the rows enclosed in a single <CustomerInfo> tag?
Please help me in this regard.

Thank you
Kavish
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post the XPath Expressions you are using and let us know which column is marked as the Key column.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

As Craig notes, that info will be very helpful. In the meantime, you can also check to see that you are using the "aggregate" option and try making one of the lower level node elements your key (such as last name).

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply