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

Relative Cardinality

Relative Cardinality

Relative cardinality is the relationship of an element to another element in the XML hierarchy. An element can have a one-to-one, one-to-many, or many-to-many relationship to another element in the hierarchy.
An element has a one-to-one relationship with another element if every occurrence of one element can have one occurrence of the other element. For example, an employee element can have one social security number element. Employee and social security number have a one-to-one relationship.
An element has a one-to-many relationship with another element if every occurrence of one element can have multiple occurrences of another element. For example, an employee element can have multiple email addresses. Employee and email address have a one-to-many relationship.
An element has a many-to-many relationship with another element if an XML file can have multiple occurrences of both elements. For example, an employee might have multiple email addresses and multiple street addresses. Email address and street address have a many-to-many relationship.
The following figure shows the relative cardinality between elements in a sample XML file:
The one-to-many relationship occurs between SNAME, ADDRESS, and CITY. The many-to-many relationship occurs between STATE and YTDSALES. The one-to-one relationship occurs between PNAME and PPRICE.
  1. One-to-many relationship. For every occurrence of SNAME, there can be many occurrences of ADDRESS and, therefore, many occurrences of CITY.
  2. Many-to-many relationship. For every occurrence of STATE, there can be multiple occurrences of YTDSALES. For every occurrence of YTDSALES, there can be many occurrences of STATE.
  3. One-to-one relationship. For every occurrence of PNAME, there is one occurrence of PPRICE.

0 COMMENTS

We’d like to hear from you!