XML Input 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
ajmore
Participant
Posts: 22
Joined: Fri Aug 25, 2006 5:25 am

XML Input Stage

Post by ajmore »

Hi,
I am using xml source file in which entity
ZARTICLE has following derivation and description respectively

ZCOMMIT01.ZCOMMIT01.ZARTICLE
/ZCOMMIT01/IDOC/Z1COMMDET/ZARTICLE/text()

Assuming my XML tag input is as follows,

<ZARTICLE>ABCDEF<\ZARTICLE>

In target i want
<COL1>ABC<\COL1>
<COL2>DEF<\COL2>

I am trying to do this in XML input stage derivation only while extracting, as below
COL1
ZCOMMIT01.ZCOMMIT01.ZARTICLE[1,3]
/ZCOMMIT01/IDOC/Z1COMMDET/ZARTICLE/text()

COL2
ZCOMMIT01.ZCOMMIT01.ZARTICLE[4,6]
/ZCOMMIT01/IDOC/Z1COMMDET/ZARTICLE/text()

I am not sure if it can be done in XML input stage only,if not then i have to use transformer stage after extracting ZARTICLE and split it there.

Please let me know best possible way.

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

Post by chulett »

You are reading XML? Writing XML? Both? :?

Regardless, that 'split' will need to happen either in a Transformer or in a custom XSLT in an XML stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajmore
Participant
Posts: 22
Joined: Fri Aug 25, 2006 5:25 am

Post by ajmore »

Sorry for confusion caused chulett :oops:

Below job design may make my point clear

Row gen(with Zero rows) --->Transformer (1 column Filepath containing file location and name) ----> XML input (1 Column having Concatenated data ZARTICLE) ----> Dataset ( 2 columns Col1 and Col2 having ZARTICLE data splited).

What i am able to get from your reply is that i need to add another transformer after XML input stage. :(

Please suggest.

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

Post by chulett »

If you are writing XML to your dataset, then you need to be using the XML Output stage. And no, you need to split the field before you generate the XML.
-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 »

...bottom line ...don't try to do such transformations inside of XML stages...that's what the Transformer is for. Putting it inside of XML may be necessary for advanced techiques and purposes, but it should be the exception only...

Ernie
Ernie Ostic

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