XSD :

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" elementFormDefault="qualified">
<xsd:simpleType name="employee">
    <xsd:restriction base="xsd:string">    
    </xsd:restriction>
  </xsd:simpleType>
 <xsd:simpleType name="member">
     <xsd:restriction base="xsd:string">
    </xsd:restriction>
  </xsd:simpleType>
<xsd:element name="person">
  <xsd:complexType>
    <xsd:choice minOccurs="2" maxOccurs="2">
      <xsd:element name="employee" type="employee"/>
      <xsd:element name="member" type="member"/>
    </xsd:choice>
  </xsd:complexType>
</xsd:element>
</xsd:schema>
View Code

相关文章: