Canadian addresses require the name of a province, plus a postal code
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="CAN_PostalCode">
<xs:restriction base="xs:string">
<xs:pattern
value="[A-Z]{1}[0-9]{1}[A-Z]{1} [0-9]{1}[A-Z]{1}[0-9]{1}" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CAN_Address">
<xs:complexContent>
<xs:extension base="Address">
<xs:sequence>
<xs:element name="Province" type="xs:string" />
<xs:element name="PostalCode" type="CAN_PostalCode" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
File: Data.xml
<?xml version="1.0" ?>
<MailAddress xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Schema.xsd"
xsi:type="CAN_Address">
<Name>name</Name>
<Street>8185 Way</Street>
<City>Vancouver</City>
<Province>BC</Province>
<PostalCode>A1A 1A1</PostalCode>
</MailAddress>
Related examples in the same category