Page 1 of 1

Unable to proces XML file in XML Stage from Multiple XSDs

Posted: Sun Jul 06, 2014 2:07 am
by partha.natta
Hi All,
I need to process some XML files having the same metadata definitions. There are three XSDs were used to define the metadata of these XML files. The Reconciliation.xsd is the main XSD from where I am able to read most of the fields coming in XML file. But the main XSD is having include statement for other two reference XSDs which are AcctDemoRec.xsd and Fstype.xsd
From AcctDemoRec.xsd I need to take three fields in my target and these fields are optional and in case of some specific type of transaction these three fields will get populate in the XML files under the parent root called <Demo>.

I have imported all these three XSDs by Schema Library Manager and checked for the validation which
Showing no issues.

Most of my source fields are coming under one parent root called <Transrec> and I have selected that root in XML Document root and was able to process the XML files which are not having Demo section.

But when the Demo section is present in the file my job is getting aborted as it not able to identify that particular section.

Could you help me how can I resolve this issue?

Posted: Sun Jul 06, 2014 7:22 am
by chulett
I've found the easiest way to deal with include files in XML and DataStage is to actually include them in the base xsd. Copy the main xsd to a new name and then in an editor replace each "include" statement with the contents of that xsd, then import the metadata from the combo xsd and use that in your job.

Perhaps the new XML assembly has a way to handle that but I found this works rather painlessly.

Posted: Tue Jul 08, 2014 8:00 am
by eostic
Is element <demo> truly in your tree? Can you design steps in the assembly for it?

How is it aborting? Maybe it has nothing to do with <demo> element itself, but perhaps something in the contents of <demo>.

Be sure also to set your validation in the xml parser step to minimal.

Ernie