XML Output stage
Posted: Mon May 11, 2009 6:19 am
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
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