XML Stage - Hierarchy

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

XML Stage - Hierarchy

Post by Raftsman »

Is there a way to for the XML Stage to create the parent and child hierarchy. Currently the XSD provides the metadata from Root node down through the lower level nodes. The problem is, when we parse the data, there is no Referential Integrity tying the root node to the lower level nodes. From reading, some products including DB2 Xquery, create these references as the data is parsed.

Does the XML Stage have this capability?

Before we move on and try another Cots product, I thought I would inquiry with the group.

Thanks in advance
Jim Stewart
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Can you be more explicit? The Hierarchical Stage will retrieve as deep a node as you want, treating its repeating elements as individual rows, and on those rows, can also retrieve any parent (grand parent, great grandparent, etc.) information that in the same path.... not sure of your exact question.

Thanks.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

In a nutshell, we are trying to parse out XML into a normalized model. Because the XML does not contain sequence keys, we have no way of tying the parent to the children. We could have root nodes with multiple duplicate children, who's children could have the same information at a lower level.

Other Cots packages can parse this data and add unique keys to keep this information tied tightly together.

I was wondering if the Datastage has the ability to assign unique key that would be used in the normalized model.
Jim Stewart
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

There may be a way, but I dont know of any way to do it in a single assembly.

The simplest thing to do is to have multiple instances of the stage.....with a Transformer in between.....

Map your first top level nested node to the output link, and "carry" the content beneath it by using the "chunk" feature when you select the root at the xml parser step (right click on the content below the mapping node). .....

in the transformer, create your counter..........

....in the next instance of the stage, parse just that chunk.......and maybe chunk a smaller subset beneath that.......

etc, etc...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

Thanks, we had already discussed this scenario but due to the time and memory each XML stage take to use, it did not meet our requirement.

Again thanks for the input and I will close this post.
Jim Stewart
Post Reply