Need Help with XML Output 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
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

Need Help with XML Output Stage.

Post by nag0143 »

Hi,

I am using XML Output Stage to create an XML File from a Sequential File. Here is my job design :

SequentialFile Stage ---> Copy Stage ---> XML Output Stage

I have imported the XSD to Schema Library Manager, but I am not sure how to access that Schema Definition from XML output Stage.

Meanwhile, I have created table definition from a sample XML File, and imported that into XML Output stage, I am able to create an XML output file, but its not working for Repetitive Elements. The input Sequential file has duplicate rows for Repetitve Elements, XML output stage is also creating duplicate rows.

How should I represent Repetitive Element in XML Output Stage ?
Please advise me.
Thanks!
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

The xsd is only used with the Hierarchical Stage.....

So let's focus on the xmlOutput Stage.

Look carefully at the metadata on your input link....and scroll far to the right to also view the "xpath" that is in the Description.

In a simple example, departments with employees, you might see something like:

depName /departments/department/depName/text()
empNo /departments/department/emps/empNo/text()
name /departments/department/emps/name/text()
phone /departments/department/emps/phone/text()

where empNo is also checked as the "key" on your input link.

Assuming that you are bringing in multiple unique rows for empNo, many listed under each department, the "key" is what will generate the "emps" repeating node when you choose "Aggregate" as the option on the output link details tabs.

Ernie
Ernie Ostic

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