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

Importing Metadata from an XML File

Importing Metadata from an XML File

In an XML file, a pair of tags marks the beginning and end of each data element. These tags are the basis for the metadata that PowerCenter extracts from the XML file. If you import an XML file without an associated DTD or XML schema, the Designer reads the XML tags to determine the elements, their possible occurrences, and their position in the hierarchy. The Designer checks the data within the element tags and assigns a datatype depending on the data representation. You can change the datatypes for these elements in the XML definition.
The following figure shows a sample XML file:
The root element is Employees. Employee is a multiple occurring element. The Employee element contains the LastName, FirstName, and Address. The Employee element also contains the multiple-occurring elements: Phone and Email.
The Designer determines a schema structure from the XML data.
The following figure shows the default XML source definition with separate views for the root element and the multiple-occurring elements:
The Employees_File default XML source definition has two columns: Name and Datatype. Name lists the root element and its data. Datatype lists multiple-occurring elements.
When you import an XML file, you do not need all of the XML data to create an XML definition. You need enough data to accurately show the hierarchy of the XML file.
The Designer can create an XML definition from an XML file that references a DTD file or XML schema. If an XML file has a reference to a DTD or an XML schema on another node, the node that hosts the PowerCenter Client must have access to the node where the schema resides so the Designer can read the schema. The XML file contains a universal resource identifier (URI) which is the address of the DTD or an XML schema.

0 COMMENTS

We’d like to hear from you!