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.