summaryrefslogtreecommitdiff
path: root/tests/cxx/tree/types-only/test.xsd
blob: 9f0224013236cec35f043473d6f967badd584383 (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
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">

  <simpleType name="color-enum">
    <restriction base="token">
      <enumeration value="red"/>
      <enumeration value="green"/>
      <enumeration value="blue"/>
    </restriction>
  </simpleType>

  <simpleType name="red-blue-enum">
    <restriction base="t:color-enum">
      <enumeration value="red"/>
      <enumeration value="blue"/>
    </restriction>
  </simpleType>

  <simpleType name="long-string-union">
    <union memberTypes="long string"/>
  </simpleType>

  <simpleType name="string-list">
    <list itemType="string"/>
  </simpleType>

  <complexType name="complex-type">
    <sequence>
      <element name="a" type="string"/>
    </sequence>
    <attribute name="text" type="string" use="required"/>
    <attribute name="color" type="t:color-enum" use="required"/>
    <attribute name="ftext" type="string" fixed="foo"/>
    <attribute name="dcolor" type="t:color-enum" default="red"/>
  </complexType>

  <!-- Test that we do not perform type/element name conflict resolution
       as well as print any warnings. -->
  <element name="type" type="string"/>

  <!-- Test that we generate anonymous type for global element. -->
  <element name="anon">
    <complexType>
      <sequence>
        <element name="a" type="string"/>
      </sequence>
    </complexType>
  </element>

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

</schema>