splitting a single line xml file to n rows.

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
suneyes
Participant
Posts: 82
Joined: Mon Jul 21, 2008 8:42 am

splitting a single line xml file to n rows.

Post by suneyes »

Hi,
we have a single line xml file which needs to be split into n no of rows.
like..

for a file like this..

<?xml version="1.0" encoding="UTF-8"?><!-- BusinessObjects Data Integrator generated XML --><!-- 2008-03-27.11:39:27(388,858)[1] -->
<OUTFILE><FF_XML_0001><version>1.1</version><dataDate>2008.01.31</dataDate><extractGeneratedTime>2008.02.01 :10:11</extractGeneratedTime><portfolioName>Category AUS Trades</portfolioName>
<trades><trade><productCode><context>IFRS/product/1.0</context>


we need an out put file to be

<?xml version="1.0" encoding="UTF-8"?>

<!-- BusinessObjects Data Integrator generated XML -->
<!-- 2008-03-27.11:39:27(388,858)[1] -->

<OUTFILE>
<FF_XML_0001>
<version>1.1</version>
<dataDate>2008.01.31</dataDate>
<extractGeneratedTime>2008.02.01 06:10:11</extractGeneratedTime>
<portfolioName>Category AUS Trades</portfolioName>
<trades>
<trade>
<productCode>
<context>IFRS/product/1.0</context>


please provide me some pointers ,how it can be done using datastage..
sun
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

Hi,
For this you can use folowing stages:

Code: Select all

External Source Stages-->XML Input Stage--> Transformation.
First you have import the metadata defination using XML Table Defination.
Check in all the boxes.... :o
In the XML Input stage you have to select URL/File option in the input --XML Source tab.... :wink:

This will help you out! :wink:
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Post Reply