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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What have you tried? Do you have any XSD that describes the structure of your XML? If so, load that into the XML stage and the remainder becomes reasonably straightforward; you will have three outputs, and you will use the Composer to specify what goes where.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

You have several options. As Ray notes, the Hierarchical Stage is one possibility. This requires that you have an xsd. That xsd (schema file) will describe the "lists" that you have that generate the multiple rows as you have indicated. Import the xsd via the Library Manager and you will then see how to pick up this column and have it parsed.

Another way, if you have just a sample xml, is to send the column into the xmlInput Stage. This is an effective way when the xml content is fairly small (less than 100meg) and you don't have an xsd.

Assuming that attributes and addresses are at the same level (both equal children of person), then you would have one output link for each node. Start with addresses...and be sure you can retrieve all the rows for addresses. Then create a new Job and see/learn how to get all the attributes.... when you are comfortable with it, put both output links in the same Stage and Job.

Start by importing your xml via import...table definitions....xml table definitions and identify, for initial testing, just the person, and then the innermost "T" marked elements or orange attributes of your address node....the doc should help you from there, and do LOTS of searches thru the forum here. There are many threads on using the xml capabilities.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I for one would also be curious how much experience you have working with XML - regardless of tool. And is the XML you have stashed in your database field a complete, well-formed XML file or is it just a snippet with the elements you've posted?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply