Reading XML files - Repetition elements
Moderators: chulett, rschirm, roy
Reading XML files - Repetition elements
Can anyone explain what the following error means:
Error: No repetition element specified for link datastage
and perhaps provide an example of a repetition element (occurs) and how to interpret it in the xml input stage design?
Thanks
Error: No repetition element specified for link datastage
and perhaps provide an example of a repetition element (occurs) and how to interpret it in the xml input stage design?
Thanks
I try to describe it as "one of the elements at the lowest level node you are interested in retrieving." You can pick any of them.... but it should be a column defined by an element at the lowest level repeating group --- the repeating node for which you want "n" rows to be returned.
The reason you want it at the "lowest level you are interested in" will become more clear once you have a situation where the node may not actually exist (imagine a purchase order with no line items, and the repeating element in the metadata is the line item number). Then the "Repeating Element Required" setting comes into play. If you have it checked, then the repeating element has to be in the current node being retrieved or you won't receive the parent or grandparent nodes. If you have it un-checked, then everything at the level of the "repeating element" will be returned with nulls.
Ernie
The reason you want it at the "lowest level you are interested in" will become more clear once you have a situation where the node may not actually exist (imagine a purchase order with no line items, and the repeating element in the metadata is the line item number). Then the "Repeating Element Required" setting comes into play. If you have it checked, then the repeating element has to be in the current node being retrieved or you won't receive the parent or grandparent nodes. If you have it un-checked, then everything at the level of the "repeating element" will be returned with nulls.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Thanks Ernie,
I have checked the "Repeating Element required" in the transformation settings of the output tab. What I am trying to figure out is the Yes/No option in the Columns tab for the Key value of the element listed.
Here is an example:
The source is <QVResponse><Response><Error><ErrorCode>value</ErrorCode></Error></Response></QVResponse>
where the Error node is unbounded. Similarly there are other lower level nodes below QVResponse along a different path where one of the nodes is also unbounded.
How do I translate this information to selecting the above Yes/No option? I have set some of the column names to Yes based on what understanding I have, and it now gives me an error "The link contains more than one repetition rule"
Thanks
I have checked the "Repeating Element required" in the transformation settings of the output tab. What I am trying to figure out is the Yes/No option in the Columns tab for the Key value of the element listed.
Here is an example:
The source is <QVResponse><Response><Error><ErrorCode>value</ErrorCode></Error></Response></QVResponse>
where the Error node is unbounded. Similarly there are other lower level nodes below QVResponse along a different path where one of the nodes is also unbounded.
How do I translate this information to selecting the above Yes/No option? I have set some of the column names to Yes based on what understanding I have, and it now gives me an error "The link contains more than one repetition rule"
Thanks
ah. Next lesson. DataStage is normalizing your xml into rows and columns... for each set of nodes that is "along a different path" (nested deeply is fine), you will be using a separate Link...each with its own set of elements/columns and particular "lowest level node that you are interested in".......
For any given document, as you are moving it (typically) into a rdbms, you may have many many links....depending on how many normalized relationships you are trying to extract.
Ernie
For any given document, as you are moving it (typically) into a rdbms, you may have many many links....depending on how many normalized relationships you are trying to extract.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
I get it. Right now, I have an external source stage -----> xml stage-----> peek stage. This was set up for purposes of experimentation.
What I would need is an external source stage---->copy stage with several output links, each to an xml input stage, and each of these xml input stages having an output link to an ODBC stage. Each of these ODBC stages and the corresponding setting in the output/columns tab of the xml input stage would reference a single normalized relationship that I am trying to extract.
Correct?
Thanks
What I would need is an external source stage---->copy stage with several output links, each to an xml input stage, and each of these xml input stages having an output link to an ODBC stage. Each of these ODBC stages and the corresponding setting in the output/columns tab of the xml input stage would reference a single normalized relationship that I am trying to extract.
Correct?
Thanks
-
- Charter Member
- Posts: 166
- Joined: Wed Mar 16, 2005 6:52 am
- Location: Mumbai, India
If i remember correctly, You could cascade Multiple XML stages also
Something like this:
Prev name stands for the previously extracted name information in XMl Stage 1
Based on the number of repeating elements you have, you can use the first stage to extract XML chunks for that repeating element with some of the higher level columns and send each chunk/extracted column down a separate link where a downstream XML Input stage processes the specific chunk.
I've done this around a year ago so may not have described this accurately.
Something like this:
Code: Select all
<Cust>
<Name>
</Name>
<AddressList>
<Address>
Address1
</Address>
</AddressList>
<PhoneList>
<Phone>
Phone1
</Phone>
</PhoneList>
</Cust>
Code: Select all
external source stage -----> xml stage1---(Get Name/AddressChunk) -----> xml stage(Get Address+Prev name)-----> peek stage
|
(Get Name/PhoneChunk)
|
-----> xml stage(Get Phone+Prev name)-----> peek stage
Based on the number of repeating elements you have, you can use the first stage to extract XML chunks for that repeating element with some of the higher level columns and send each chunk/extracted column down a separate link where a downstream XML Input stage processes the specific chunk.
I've done this around a year ago so may not have described this accurately.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
You have the right idea....but you can put all the output links on a single XMLInput Stage.......so you don't need the copy....
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>