aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx/hybrid/enumeration/test.xsd
blob: 782c707a987c7b93cd7e7072f3059209899ccd8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">

  <simpleType name="base">
    <restriction base="string"/>
  </simpleType>

  <simpleType name="simple">
    <restriction base="string">
      <enumeration value="a"/>
      <enumeration value="b"/>
      <enumeration value="c"/>
    </restriction>
  </simpleType>

  <simpleType name="derived">
    <restriction base="t:base">
      <enumeration value="a"/>
      <enumeration value="b"/>
      <enumeration value="c"/>
    </restriction>
  </simpleType>

  <simpleType name="interm">
    <restriction base="t:simple"/>
  </simpleType>

  <simpleType name="final">
    <restriction base="t:interm">
      <enumeration value="a"/>
      <enumeration value="c"/>
    </restriction>
  </simpleType>

  <complexType name="complex">
    <simpleContent>
      <extension base="t:final">
        <attribute name="x" type="string"/>
      </extension>
    </simpleContent>
  </complexType>

  <!-- Variable-length (custom data) -->

  <simpleType name="simple-cd">
    <restriction base="string">
      <enumeration value="a"/>
      <enumeration value="b"/>
      <enumeration value="c"/>
    </restriction>
  </simpleType>

  <!-- fixed base, variable derived -->
  <simpleType name="fbvd">
    <restriction base="t:simple">
      <enumeration value="a"/>
      <enumeration value="c"/>
    </restriction>
  </simpleType>

  <!-- variable base, variable derived -->
  <simpleType name="vbvd">
    <restriction base="t:simple-cd">
      <enumeration value="a"/>
      <enumeration value="c"/>
    </restriction>
  </simpleType>


  <complexType name="type">
    <sequence>
      <element name="simple" type="t:simple" maxOccurs="unbounded"/>
      <element name="derived" type="t:derived" maxOccurs="unbounded"/>
      <element name="final" type="t:final" maxOccurs="unbounded"/>
      <element name="complex" type="t:complex" maxOccurs="unbounded"/>

      <element name="simple-cd" type="t:simple-cd" maxOccurs="unbounded"/>
      <element name="fbvd" type="t:fbvd" maxOccurs="unbounded"/>
      <element name="vbvd" type="t:vbvd" maxOccurs="unbounded"/>
    </sequence>
    <attribute name="x" type="t:simple" default="a"/>
    <attribute name="y" type="t:final" default="c"/>
    <attribute name="z" type="t:simple-cd" default="b"/>
  </complexType>

  <element name="root" type="t:type"/>

</schema>