Data Transformation Engine Type Tree Importers Reference Guide

Chapter 2 - Using the Importer Wizard XML Schema Importer
Type Tree Importers Reference Guide
45
XML Schema Example
The following example shows the correlation between the contents of a typical
XML schema and the type tree that is automatically generated by the XML Schema
Importer wizard.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="Address">
<xs:sequence>
<xs:element name="Street" type="xs:string"/>
<xs:element name="Apartment" type="xs:string" minOccurs="0"/>
<xs:element name="City" type="xs:string"/>
<xs:element name="ZIP">
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:totalDigits value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="State">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AL"/>
<xs:enumeration value="AR"/>
<xs:enumeration value="FL"/>
<xs:enumeration value="GA"/>
<xs:enumeration value="LA"/>
<xs:enumeration value="MS"/>
<xs:enumeration value="NC"/>
<xs:enumeration value="SC"/>
<xs:enumeration value="TN"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="Person">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Address" type="Address"/>
</xs:sequence>
<xs:attribute name="Title" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>