Page 1 of 1

XML Stage - Hierarchy

Posted: Thu Mar 10, 2016 1:15 pm
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

Posted: Thu Mar 10, 2016 4:05 pm
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

Posted: Mon Mar 14, 2016 9:38 am
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.

Posted: Mon Mar 14, 2016 1:26 pm
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

Posted: Tue Mar 15, 2016 5:58 am
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.