summaryrefslogtreecommitdiff
path: root/tests/schema/anonymous/test.xsd
blob: cba3300287da57c90b4e2893ee3562a2686d8b28 (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
131
132
133
134
135
136
137
138
139
140
141
142
143
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd"
	    xmlns:test="http://www.codesynthesis.com/xmlns/test"
            targetNamespace="http://www.codesynthesis.com/xmlns/test">

 <!-- Test 'type' name escaping. -->
 <xsd:element name="type">
   <xsd:complexType>
     <xsd:sequence>
       <xsd:element name="name" type="xsd:string"/>
     </xsd:sequence>
   </xsd:complexType>
 </xsd:element>



 <!-- Anonymous type via global element. -->
 <xsd:element name="global_element">
   <xsd:complexType>
     <xsd:sequence>
       <xsd:element name="name" type="xsd:string"/>
     </xsd:sequence>
   </xsd:complexType>
 </xsd:element>



 <!-- Anonymous type via global attribute. -->
 <xsd:attribute name="global_attribute">
   <xsd:simpleType>
     <xsd:restriction base="xsd:string"/>
   </xsd:simpleType>
 </xsd:attribute>



 <!-- Anonymous type via local element. -->
 <xsd:complexType name="local_element_type">
   <xsd:sequence>
     <xsd:element name="local_element">
       <xsd:complexType>
         <xsd:sequence>
           <xsd:element name="name" type="xsd:string"/>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:element>
   </xsd:sequence>
 </xsd:complexType>



 <!-- Anonymous type via local attribute. -->
 <xsd:complexType name="local_attribute_type">
   <xsd:attribute name="local_attribute">
     <xsd:simpleType>
       <xsd:restriction base="xsd:string"/>
     </xsd:simpleType>
   </xsd:attribute>
 </xsd:complexType>

<!--

  Various weird anonymous type combinations (some of them are fruits of a
  really sick imagination).

-->

  <xsd:element name="tasks">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="test:periodicTask"/>
        <xsd:element ref="test:braindamageTask"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="periodicTask">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="test:tasks"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="braindamageTask">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="test:tasks"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>


  <xsd:complexType name="PropertySeq">
    <xsd:sequence>
      <xsd:element name="propery">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="name" type="xsd:string"/>
            <xsd:element name="value">
	      <xsd:complexType>
	        <xsd:sequence>
		  <xsd:element name="typecode">
                    <xsd:simpleType>
                      <xsd:restriction base="xsd:NCName">
                        <xsd:enumeration value="string"/>
                        <xsd:enumeration value="integer"/>
                      </xsd:restriction>
                    </xsd:simpleType>
		  </xsd:element>
	          <xsd:element name="content" type="xsd:string"/>
		</xsd:sequence>
              </xsd:complexType>
	    </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>


  <xsd:element name="periods">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="period" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>


  <xsd:element name="typecode">
    <xsd:simpleType>
      <xsd:restriction base="xsd:NCName">
        <xsd:enumeration value="string"/>
        <xsd:enumeration value="integer"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:element>


</xsd:schema>