Page 1 of 1

Dynamic XSD

Posted: Thu Jul 25, 2013 5:55 pm
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.

Posted: Fri Jul 26, 2013 3:28 am
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.

Posted: Fri Jul 26, 2013 4:27 am
by ray.wurlod
That's an intriguing solution, Arun. Are you able to provide a concrete example?

Posted: Fri Jul 26, 2013 12:05 pm
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.