Dynamic XSD

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
U
Participant
Posts: 230
Joined: Tue Apr 17, 2007 8:23 pm
Location: Singapore

Dynamic XSD

Post by U »

We are in the process of developing a generic mechanism for transferring XML files from and to different clients. The content of the XML documents is very similar in all cases, but there may be slight differences (additional elements, rather than changed elements).

Is there any way to handle dynamic XSD in DataStage? That is, can we create generic jobs in which the XSD is provided dynamically, for example as a parameter or as a file reference?

My first impression is that the answer will be "no", since the assembly must be done at design time. But I would like to know whether dynamic XSD might be used, perhaps in conjunction with Runtime Column Propagation, to achieve a truly generic solution.

My alternative, since there is not a large number of clients, is to create one job per client and use a sequence to select which job to execute based on the client ID (provided as a parameter).

Thank you for your time.
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

If your XMLs will differ only with the number of columns, I believe you dont have to worry about it. You can code your job with the maximum available columns and select "replace empty with NULL", you should be good to go.

If you have different XML structures, where your X-Path will differ from file to file and you want to develop a generic job for that, you can parameterize the X-Path expressions in your XML stage.

I'm not so sure how it will work in a parallel job though. I have developed a dynamic server job, with XML as target with different structures. I was surprised to see the results when I was experimenting it for the first time by parameterizing the X-Path in the XML-OUTPUT stage. It works as fine as hardcoding the X-Path. I believe it to work in the same way with a parallel job.
Arun
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's an intriguing solution, Arun. Are you able to provide a concrete example?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

Thanks Ray. I did develop the job, and it was working good. But had to do a lot of setup for passing values to those parameters.
Arun
Post Reply