File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libxml2 / test / schemas / bug303566_1.xsd
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:37:59 2012 UTC (12 years, 5 months ago) by misho
Branches: libxml2, MAIN
CVS tags: v2_9_1p0, v2_9_1, v2_8_0p0, v2_8_0, v2_7_8, HEAD
libxml2

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:simpleType name="codeType">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="[A-Z]+"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:element name="Test">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Country"
                     maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="Country">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="City"
                     maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="code"
                     type="codeType"
                     use="required"/>
    </xsd:complexType>
    <xsd:key name="CountryDummyKey">
      <xsd:selector xpath="."/>
      <xsd:field xpath="@code"/>
    </xsd:key>
    <xsd:keyref name="PartRefCountryDummy"
      refer="CountryDummyKey">
      <xsd:selector xpath=".//Part"/>
      <xsd:field xpath="@country"/>
    </xsd:keyref>
  </xsd:element>

  <xsd:element name="City">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Part"
                     minOccurs="2"
                     maxOccurs="2"/>
      </xsd:sequence>
      <xsd:attribute name="name"
                     type="xsd:string"
                     use="required"/>
      <xsd:attribute name="code"
                     type="xsd:string"
                     use="required"/>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="Part">
    <xsd:complexType>
      <xsd:attribute name="country"
                    type="codeType"
                    use="required"/>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>