Information icon IBM InfoSphere DataStage and InfoSphere QualityStage, Version 8.5
space Feedback

Controlling the repetition of nested elements

In a given XML hierarchy, nested elements may repeat. The following example contains a list of cities in which a customer operates.

<directory>
   <customer name="Acme">
      <city>Boston</city>
      <city>Chicago</city>
      <city>New York</city>

On the input link, city values map to the hierarchy using the following XPath expression:

/directory/customer/city/text()

To enable the <city> element to repeat within the <customer> node, you need to define this XPath expression as the repetition path. To do this, identify the associated input column as the key.

Repetition applies to each node beneath the root element. Therefore, the <customer> element can also repeat. The final output typically depends on the repetition path and the order of the input rows. Two repetition paths can produce the same results.


PDFThis topic is also in the IBM InfoSphere DataStage XML Pack Guide.

Update timestamp Last updated: 2010-09-30