XML 스키마 문서를 작성하려면 다음을 수행하십시오.
<xs:schema targetNamespace="http://posample.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="customerinfo">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="1"></xs:element>
<xs:element name="addr" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="street" type="xs:string" minOccurs="1"></xs:element>
<xs:element name="city" type="xs:string" minOccurs="1"></xs:element>
<xs:element name="prov-state" type="xs:string" minOccurs="1"></xs:element>
<xs:element name="pcode-zip" type="xs:string" minOccurs="1"></xs:element>
</xs:sequence>
<xs:attribute name="country" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="phone" nillable="true" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" form="unqualified" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="assistant" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="phone" nillable="true" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Cid" type="xs:integer"/>
</xs:complexType>
</xs:element>
</xs:schema>
