Handling dynamic XML

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
durgaps
Participant
Posts: 74
Joined: Sat Jul 08, 2006 4:09 am
Location: Melbourne, Australia
Contact:

Handling dynamic XML

Post by durgaps »

My input to the DS job is an XML file which has the following structure. 'value' are the tags. 'optional' indicates the tag might be present or may not be present.
value
value optional
value
value optional
value
value
value optional
value

The optional tags may be present or may not be present.Is there any option how I can handle this scenario in the XMLIn stage or any other way?

Thanks,
Durga Prasad
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your example doesn't mean much of anything. Post the actual xml if you want to give us an idea what you are dealing with. And optional elements shouldn't be a big deal. Have you tried importing the metadata for this file from an .xsd and parsing it in a job yet?
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Agree with Craig...it's hard to tell without more details. However, if the tags are "optional," don't worry about it, provided you have them available to you in an xsd and can define them in the DataStage meta data....if they don't appear, you'll get NULLs or blanks. What I wonder about your question though, is whether the names of the elements themselves are dynamic? If that's the case, it's a poor XML design, and you will have difficulty with ANY tool.....

Ernie
Post Reply