File: Schema.xsd
<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="Address">
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Street" type="xs:string" minOccurs="1"
maxOccurs="3" />
<xs:element name="City" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="MailAddress" type="Address" />
<xs:element name="BillAddress" type="Address" />
<xs:simpleType name="USPS_StateCode">
<xs:restriction base="xs:string">
<xs:enumeration value="AL" /><!-- Alabama -->
<xs:enumeration value="AK" /><!-- Alaska -->
<xs:enumeration value="WY" /><!-- Wyoming -->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="USPS_ZIP">
<xs:restriction base="xs:integer">
<xs:minInclusive value="01000" />
<xs:maxInclusive value="99999" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="USA_Address">
<xs:complexContent>
<xs:extension base="Address">
<xs:sequence>
<xs:element name="State" type="USPS_StateCode" />
<xs:element name="ZIP" type="USPS_ZIP" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
File: Address.xsml
<?xml version="1.0" ?>
<MailAddress xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Schema.xsd"
xsi:type="USA_Address">
<Name>name</Name>
<Street>123 St.</Street>
<City>LA</City>
<State>AL</State>
<ZIP>11111</ZIP>
</MailAddress>
|