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

Importing Metadata from an XML Schema

Importing Metadata from an XML Schema

A schema file defines the structure of elements and attributes in an XML file. A schema file contains descriptions of the type of elements and attributes in the file. When you import an XML schema, the Designer determines the data type, precision, and cardinality of the elements. You cannot change an element definition in PowerCenter if the element definition comes from a schema.
When you import metadata from an XML schema, the .xsd file can contain import or include statements that reference other .xsd files. When you import a schema that includes other schemas, the other schemas must not reference the same namespace.
Example:
<IMPORT schemaLocation="../../../administration/process/bo/LocationTextBO.xsd" namespace="http://EnterpriseLibrary/com/acs/enterprise/common/program/administration/process/bo"> <IMPORT schemaLocation="../../../administration/process/bo/LineOfBusinessBO.xsd" namespace="http://EnterpriseLibrary/com/acs/enterprise/common/program/administration/process/bo"> <IMPORT schemaLocation="../../../administration/process/bo/ClaimExceptionBO.xsd" namespace="http://EnterpriseLibrary/com/acs/enterprise/common/program/administration/process/bo">
You can replace multiple "import schemalocation" statements with one statement:
<xsd:import schemalocation="imported.xsd" namespace=" http://EnterpriseLibrary/com/acs/enterprise/common/program/administration/process/bo"/>
The imported.xsd file includes the other XSD files using the following syntax:
<xsd:schema targetNamespace="http://EnterpriseLibrary/com/acs/enterprise/common/program/administration/process/bo" elementFormDefault="qualified" > <xsd:include schemaLocation=" LocationTextBO.xsd" /> <xsd:include schemaLocation=" LineOfBusinessBO.xsd" /> <xsd:include schemaLocation=" ClaimExceptionBO.xsd" /> </xsd:schema>
For more information, see Knowledge Base article 158334.
Each simple type definition in an XML schema is a restriction of another simple type definition in the schema Atomic data types, such as Boolean, string, or integer, restrict the anySimpleType datatype. When you define a simple data type in an XML schema, you derive a new datatype from an existing data type. For example, you can derive a restricted integer type that holds only numbers from 1 to 20. The base type is integer.
When you derive a complex data type from another data type, you create a new datatype that contains the elements of the base type. You can add new elements to the derived type or create restrictions on the inherited elements. The Designer creates views for derived types without duplicating the columns that represent inherited components. This reduces metadata and decreases the size of the XML definition in the repository.
The following image shows a schema with simple and complex derived types:
The MailAddress element is an Address type which is a complex type. A derived type, CAN_Address, inherits the Name, City, and Street from the Address type, and extends Address by adding a Province and PostalCode. PostalCode is a simple type called CAN_PostalCode.
When you import an XML schema, every simple type or attribute in a complex type can become a column in an XML definition. Complex types become views.
The following figure shows an XML definition from the schema if you import the schema with the default options:
The XML definition includes the properties Name and Datatype. The Name property lists the address metadata and the Datatype property lists the multiple-occurring elements, such as xsd:integer, xsd:string, and CAN_PostalCode.
The CAN_Address view contains the elements that are unique for its type. The root element is MailAddress. The Address type contains Name, Street, and City. The CAN_Address has a foreign key to Address. CAN_Address includes Province and PostalCode.
The view does not contain the Name, Street, and City that it inherits from MailAddress.

0 COMMENTS

We’d like to hear from you!