aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx/tree/order/test.xsd
blob: c30c027b294efef9dbe7f1571cebda8946727e83 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">

  <!-- Test 1: general, with non-ordered intermediate. -->

  <complexType name="t1_base">
    <choice minOccurs="0" maxOccurs="unbounded">
      <element name="a" type="string"/>
      <element name="b" type="string"/>
    </choice>
  </complexType>

  <complexType name="t1_interm">
    <complexContent>
      <extension base="t:t1_base">
        <sequence>
          <element name="c" type="string" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <complexType name="t1_derived">
    <complexContent>
      <extension base="t:t1_interm">
        <choice minOccurs="0" maxOccurs="unbounded">
          <element name="d" type="string"/>
          <any namespace="##other" processContents="lax"/>
        </choice>
      </extension>
    </complexContent>
  </complexType>

  <!-- Test 2: empty base. -->

  <complexType name="t2_base"/>

  <complexType name="t2_derived">
    <complexContent>
      <extension base="t:t2_base">
        <choice minOccurs="0" maxOccurs="unbounded">
          <element name="a" type="string"/>
          <element name="b" type="string"/>
        </choice>
      </extension>
    </complexContent>
  </complexType>

  <!-- Test 3: element cardinalities. -->

  <complexType name="t3_type">
    <sequence>
      <element name="a" type="string"/>
      <element name="b" type="string" minOccurs="0"/>
      <element name="c" type="string" maxOccurs="unbounded"/>
    </sequence>
  </complexType>


  <!-- Test 4: mixed content, general. -->

  <complexType name="t4_base" mixed="true">
    <choice minOccurs="0" maxOccurs="unbounded">
      <element name="a" type="string"/>
      <element name="b" type="string"/>
    </choice>
  </complexType>

  <complexType name="t4_derived">
    <complexContent mixed="true">
      <extension base="t:t4_base">
        <choice minOccurs="0" maxOccurs="unbounded">
          <element name="c" type="string"/>
          <any namespace="##other" processContents="lax"/>
        </choice>
      </extension>
    </complexContent>
  </complexType>

  <!-- Test 5: mixed content, empty base. -->

  <complexType name="t5_base" mixed="true"/>

  <complexType name="t5_derived">
    <complexContent mixed="true">
      <extension base="t:t5_base">
        <choice minOccurs="0" maxOccurs="unbounded">
          <element name="a" type="string"/>
          <element name="b" type="string"/>
        </choice>
      </extension>
    </complexContent>
  </complexType>

  <!-- Test 6: mixed content, empty base and derived. -->

  <complexType name="t6_base" mixed="true"/>

  <complexType name="t6_derived">
    <complexContent mixed="true">
      <extension base="t:t6_base"/>
    </complexContent>
  </complexType>

  <!-- Test 7: mixed content wildcard only. -->

  <complexType name="t7_type" mixed="true">
    <sequence>
      <any namespace="##other" processContents="lax" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <!-- Root -->

  <complexType name="root">
    <sequence>
      <element name="t1" type="t:t1_derived" maxOccurs="unbounded"/>
      <element name="t2" type="t:t2_derived" maxOccurs="unbounded"/>
      <element name="t3" type="t:t3_type" maxOccurs="unbounded"/>
      <element name="t4" type="t:t4_derived" maxOccurs="unbounded"/>
      <element name="t5a" type="t:t5_base" maxOccurs="unbounded"/>
      <element name="t5b" type="t:t5_derived" maxOccurs="unbounded"/>
      <element name="t6" type="t:t6_derived" maxOccurs="unbounded"/>
      <element name="t7" type="t:t7_type" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

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

</schema>