Table of Contents

Search

  1. Preface
  2. XML Concepts
  3. Using XML with PowerCenter
  4. Working with XML Sources
  5. Using the XML Editor
  6. Working with XML Targets
  7. XML Source Qualifier Transformation
  8. Midstream XML Transformations
  9. Appendix A: XML Datatype Reference
  10. Appendix B: XPath Query Functions Reference

XML Guide

XML Guide

Working with Circular References

Working with Circular References

A circular relationship is a circular hierarchy relationship between two views in an XML definition or within a single view in an XML definition. For example, a complex element called Part might contain an ID, part name, and a reference to another part.
The following example shows the Part element components:
<xs:element name="Part"> <xs:complexType>    <xs:sequence>    <xs:element name="ID" type="xs:string"/>    <xs:element name="Name" type="xs:string"/>    <xs:element name="Type" type="xs:string"/>    <xs:element
ref="Part"
minOccurs="0" maxOccurs="unbounded"/>    /xs:sequence> </xs:complexType> </xs:element>
The following figure shows a circular reference in the XML Editor workspace with a complex element called Part:
The circular reference in the XML Editor workspace shows the complex element called Part and its associated ID, Name, and Type strings.
You might use the Part XML definition to read the following XML file in a session:
<Part>
<ID>1</ID>
<Name>Big Part</Name> <Type>L</Type>    
<Part>
   
<ID>1.A</ID>
   <Name>Middle Part</Name>     <Type>M</Type>       
<Part>
      
<ID>1.A.B</ID>
      <Name>Small Part</Name>      <Type>S</Type>       </Part>    </Part> </Part>
In the XML file, Part 1 contains Part 1.A, and Part 1.A contains Part 1.A.B.
The following figure shows the data and the keys that a session might generate from the XML source:
The data includes five columns and three rows. The first two columns, XPK_Part and FK_Part, represent the keys. The last three columns, ID, Name, and Type represent the strings. The ID column lists 1, 1.A, and 1.A.B.
You cannot run a session that contains a circular XML reference if the session is enabled for constraint-based loading. The session rejects all rows.

0 COMMENTS

We’d like to hear from you!