XML Formatting Issues

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
koolsun85
Participant
Posts: 36
Joined: Tue Jun 15, 2010 3:30 pm
Location: Tampa

XML Formatting Issues

Post by koolsun85 »

As discussed in best practices document, I am merging all the child nodes with parent node.

But, here are the issues I have.

1.I get this " <?xml version="1.0" encoding="UTF-8"?>" repeated in every field.

2. The XML Header Tag is not correct, the XML is enbedded with in XML as shown below

<?xml version="1.0" encoding="UTF-8"?><MATERIAL xmlns:defns="http://abc.com/schema/material><?xml version="1.0" encoding="UTF-8"?>


Any thoughts of what I might be missing.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... did you generate all of the 'child' bits as chunks? They shouldn't have anything header-wise before the final merge.
-craig

"You can never have too many knives" -- Logan Nine Fingers
koolsun85
Participant
Posts: 36
Joined: Tue Jun 15, 2010 3:30 pm
Location: Tampa

Post by koolsun85 »

I did exactly as defined in the document.
No chunks were selected in the XML Output stage Document Settings for all the individual stages, but at the final Output, I had it and included the needed namespace.

Lets say, here is what I did.

For all the children XMLs, the definition is
Input
/CHILD1/FIELD1/text()

Output
/


Likewise
Input
/CHILD5/FIELD1/text()

Output
/

and at the end for final XML
/PARENT/FIELD1/text()
/PARENT/FIELD2/text()
/PARENT/text() ---since this is brought in as entire child1 file onto single field.
/PARENT/text() ---since this is brought in as entire child2 file onto single field.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Check what Craig notes above....go back to all of your "upstream" xmlOutput Stage....find the "generate chunk" check box...... it looks like you are putting headers in the chunks as you create them.......

...and do some debugging...send the partial chunks to a file or peek so you can review them to be sure they are being created correctly.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
koolsun85
Participant
Posts: 36
Joined: Tue Jun 15, 2010 3:30 pm
Location: Tampa

Post by koolsun85 »

Thanks for the guidance.

I verified the individual files and they are creating the following for every sub xml file?

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

I verified everything in document setting of output tab for every sub xml stage and none of them is checked, comment, header, namespace likewise everything.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Check what Craig notes above....go back to all of your "upstream" xmlOutput Stage....find the "generate chunk" check box...... it looks like you are putting headers in the chunks as you create them.......

...and do some debugging...send the partial chunks to a file or peek so you can review them to be sure they are being created correctly.

Ernie
Ernie Ostic

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