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

Example

Example

The following example shows how to limit data to specific types in a type relationship. The example uses the PartInvoice view and the AddressType view.
The following XML file contains invoice data that includes the BillToAddress and ShipToAddress:
<xsd:complexType name="AddressType"> <?xml version="1.0" encoding="utf-8"?> <Invoices xmlns="http://www.PartInvoice.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.PartInvoice.org Part.xsd"> <PartInvoice InvoiceNum="185" DateShipped="2005-01-01"> <PartOrder>   <PartID>HLG100</PartID>    <PartName>Halogen Bulb</PartName>   <Quantity>2</Quantity>    <UnitPrice>35</UnitPrice> </PartOrder> <BillToAddress>   <Street>2100 Seaport Blvd</Street>    <City>Redwood City</City>    <State>CA</State>   <Zip>94063</Zip>    <Country>USA</Country> </BillToAddress> <ShipToAddress xsi:type="USAddressType">    <Street>3350 W Bayshore Rd</Street>    <City>Palo Alto</City>    <State>CA</State>    <Zip>97890</Zip>    <Country>USA</Country>    <PostalCode>97890</PostalCode> </ShipToAddress> </PartInvoice> </Invoices>
When you run a session, the Integration Service generates an X_par_AddressType row for each AddressType.
The following figure shows the BillToAddress and ShipToAddress rows that the Integration Service generates by default:
The data shows the generated rows for BillToAddress and ShipToAddress. The Type Relationship Row box above the data is not selected.
To generate AddressType rows related to the PartInvoice view, set the Type Relationship Row Option for the PartInvoice view.
The following figure shows the BillToAddress row that the Type Relationship Row Option generates:
The data shows the generated BillToAddress values.
It does not generate a row for ShipToAddress because ShipToAddress is not in the type relationship.

0 COMMENTS

We’d like to hear from you!