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. XML Datatype Reference
  10. XPath Query Functions Reference

XML Guide

XML Guide

Understanding View Rows

Understanding View Rows

To extract data from an XML document, you specify the rows to generate, the columns of data to include, and when to generate the rows. When you define a view in the XML Editor, you create the view row, an element or a global complex type that the Integration Service requires to generate a row of data.
The Integration Service uses a view row to determine when to read and write data for an XML view. You can set a view row at any single or multiple-occurring element. Once you set the view row, every element you add to the view has a one-to-one correspondence with the view row.
For example, the Employees view contains elements Employee, Name, Firstname, and Lastname. When you set the view row to Employee, the Integration Service extracts data using the following algorithm:
For every (Employees/Employee) extract ./Name/Firstname/Lastname
An Employees XML schema might contain the following elements:
EMPLOYEES     EMPLOYEE+         ADDRESS+         NAME            FIRSTNAME             LASTNAME         EMAIL+
Employee, Address, and Email are multiple-occurring elements. You can create a view that contains the following elements:
EMPLOYEE     ADDRESS     NAME
If you set the view row as Address, the Integration Service extracts a Name for every Employee/Address in the XML data. You cannot add Email to this view because you would create a many-to-many relationship between Address and Email.
You can add a pivoted multiple-occurring column to the view. A view row can contain the pivoted column.
For example, you can add one instance of Email as a pivoted column to the Employee view. The view would contain the following elements:
EMPLOYEE     ADDRESS     NAME     EMAIL[1]
The view might have the view row,
EMPLOYEE/ADDRESS/EMAIL[1]
. The Integration Service extracts data for the first instance of Employee/Address/Email.

0 COMMENTS

We’d like to hear from you!