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="GBR_Postcode">
<xs:restriction base="xs:string">
<xs:pattern
value="(([A-Z]{2}[0-9]{2})|([A-Z]{2}[0-9][A-Z])
|([A-Z][0-9]{2})) ([0-9][A-Z]{2})" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="GBR_Address">
<xs:complexContent>
<xs:extension base="Address">
<xs:sequence>
<xs:element name="County" type="xs:string"
minOccurs="0" />
<xs:element name="Postcode" type="GBR_Postcode" />
</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="GBR_Address">
<Name>name</Name>
<Street>street</Street>
<Street>1102 Road</Street>
<City>city</City>
<Postcode>B27 6BH</Postcode>
</MailAddress>
|