1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="unqualified" xmlns:foo="http://anothernamespace.com" > |
---|
3 | |
---|
4 | <xs:import namespace="http://www.secondSchema" schemaLocation="SecondSchema.xsd" /> |
---|
5 | |
---|
6 | |
---|
7 | <xs:element name="root" type="rootType" /> |
---|
8 | |
---|
9 | <xs:complexType name="rootType" > |
---|
10 | <xs:sequence> |
---|
11 | <xs:element name="attrTest" type="attrTestType" /> |
---|
12 | <xs:element name="eleTest" type="eleTestType" /> |
---|
13 | <xs:element name="simpleDerTest" type="simpleDerTestType" /> |
---|
14 | <xs:element name="complexTest" type="complexTestType" /> |
---|
15 | <xs:element name="complexDerTest" type="complexDerTestType" /> |
---|
16 | <xs:element name="unionTest" type="unionTest" /> |
---|
17 | <xs:element name="anonymousTest" > |
---|
18 | <xs:complexType> |
---|
19 | <xs:sequence> |
---|
20 | <xs:element name="quantity"> |
---|
21 | <xs:simpleType> |
---|
22 | <xs:restriction base="xs:positiveInteger"> |
---|
23 | <xs:maxExclusive value="100"/> |
---|
24 | </xs:restriction> |
---|
25 | </xs:simpleType> |
---|
26 | </xs:element> |
---|
27 | <xs:element name='size'> |
---|
28 | <xs:simpleType> |
---|
29 | <xs:union> |
---|
30 | <xs:simpleType> |
---|
31 | <xs:restriction base='xs:integer'/> |
---|
32 | </xs:simpleType> |
---|
33 | <xs:simpleType> |
---|
34 | <xs:restriction base='xs:string'/> |
---|
35 | </xs:simpleType> |
---|
36 | </xs:union> |
---|
37 | </xs:simpleType> |
---|
38 | </xs:element> |
---|
39 | <xs:element ref="anonElement" /> |
---|
40 | </xs:sequence> |
---|
41 | <xs:attribute name="partNum" > |
---|
42 | <xs:simpleType> |
---|
43 | <xs:restriction base="xs:positiveInteger"> |
---|
44 | <xs:maxExclusive value="100"/> |
---|
45 | </xs:restriction> |
---|
46 | </xs:simpleType> |
---|
47 | </xs:attribute> |
---|
48 | </xs:complexType> |
---|
49 | </xs:element> |
---|
50 | <xs:element name="xsiTypeTest" type="xsiTypeTestType" /> |
---|
51 | <xs:element name="anyTestPartial" type="anyTestPartialType" /> |
---|
52 | <xs:element name="anyTest" type="anyTestType" /> |
---|
53 | <xs:element name="anyTestAttr1" type="anyTestAttr1Type" /> |
---|
54 | <xs:element name="anyTestAttr2" type="anyTestAttr2Type" /> |
---|
55 | <xs:element name="anyTestMissing" type="anyTestType" /> |
---|
56 | <xs:element name="invalidTest" type="invalidTestType" /> |
---|
57 | </xs:sequence> |
---|
58 | </xs:complexType> |
---|
59 | |
---|
60 | <xs:complexType name="anyTestPartialType" > |
---|
61 | <xs:sequence > |
---|
62 | <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> |
---|
63 | <xs:any namespace="http://www.w3.org/1999/xhtml" processContents="lax" /> |
---|
64 | <xs:any namespace="http://www.secondSchema" processContents="lax" /> |
---|
65 | </xs:sequence> |
---|
66 | <xs:anyAttribute namespace="http://www.w3.org/1999/xhtml" processContents="skip" /> |
---|
67 | </xs:complexType> |
---|
68 | |
---|
69 | <xs:complexType name="anyTestType" > |
---|
70 | <xs:sequence > |
---|
71 | <xs:any namespace="http://www.secondSchema" processContents="lax"/> |
---|
72 | <xs:any namespace="http://www.secondSchema" processContents="strict"/> |
---|
73 | <xs:any namespace="http://www.secondSchema" processContents="strict"/> |
---|
74 | </xs:sequence> |
---|
75 | <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> |
---|
76 | </xs:complexType> |
---|
77 | |
---|
78 | <xs:complexType name="anyTestAttr1Type" > |
---|
79 | <xs:anyAttribute namespace="http://www.secondSchema" processContents="strict" /> |
---|
80 | </xs:complexType> |
---|
81 | |
---|
82 | <xs:complexType name="anyTestAttr2Type" > |
---|
83 | <xs:anyAttribute namespace="http://www.secondSchema" processContents="lax" /> |
---|
84 | </xs:complexType> |
---|
85 | |
---|
86 | <xs:complexType name="invalidTestType" > |
---|
87 | <xs:sequence > |
---|
88 | <xs:element name="simple" type="stringDerivedType" /> |
---|
89 | <xs:element name="complex" type="baseComplex" /> |
---|
90 | <xs:element name="number" type="base" /> |
---|
91 | <xs:element name="complexXsi" type="baseComplex" /> |
---|
92 | <xs:element name="unionTest" type="uType" /> |
---|
93 | <xs:element name="invalidAttrTest" type="attrOnlyType" /> |
---|
94 | <xs:element name="missingAttrTest" type="attrOnlyType" /> |
---|
95 | <xs:element name="prohibitedAttrTest" type="prohibitedAttrType" /> |
---|
96 | </xs:sequence> |
---|
97 | <xs:attribute name="simple" type="stringDerivedType" /> |
---|
98 | </xs:complexType> |
---|
99 | |
---|
100 | |
---|
101 | <xs:complexType name="prohibitedAttrType" > |
---|
102 | <xs:attribute name="attr" type="stringDerivedType" use="prohibited" /> |
---|
103 | </xs:complexType> |
---|
104 | |
---|
105 | <xs:complexType name="attrOnlyType" > |
---|
106 | <xs:attribute name="attr" type="stringDerivedType" use="required" /> |
---|
107 | </xs:complexType> |
---|
108 | |
---|
109 | <xs:simpleType name="uType" > |
---|
110 | <xs:union memberTypes="stringDerivedType" /> |
---|
111 | </xs:simpleType> |
---|
112 | |
---|
113 | |
---|
114 | <xs:complexType name="xsiTypeTestType" > |
---|
115 | <xs:sequence> |
---|
116 | <xs:element name="number" type="base" maxOccurs="3"/> |
---|
117 | <xs:element name="complexXsi" type="baseComplex" maxOccurs="3"/> |
---|
118 | </xs:sequence> |
---|
119 | </xs:complexType> |
---|
120 | |
---|
121 | |
---|
122 | <xs:complexType name="baseComplex" > |
---|
123 | <xs:sequence> |
---|
124 | <xs:element name="a" type="xs:string" /> |
---|
125 | </xs:sequence> |
---|
126 | </xs:complexType> |
---|
127 | |
---|
128 | <xs:complexType name="level1Complex" > |
---|
129 | <xs:complexContent > |
---|
130 | <xs:extension base="baseComplex" > |
---|
131 | <xs:sequence> |
---|
132 | <xs:element name="b" type="xs:string"/> |
---|
133 | </xs:sequence> |
---|
134 | </xs:extension> |
---|
135 | </xs:complexContent> |
---|
136 | </xs:complexType> |
---|
137 | |
---|
138 | <xs:complexType name="level2Complex" > |
---|
139 | <xs:complexContent > |
---|
140 | <xs:extension base="level1Complex" > |
---|
141 | <xs:sequence> |
---|
142 | <xs:element name="c" type="xs:string"/> |
---|
143 | </xs:sequence> |
---|
144 | </xs:extension> |
---|
145 | </xs:complexContent> |
---|
146 | </xs:complexType> |
---|
147 | |
---|
148 | |
---|
149 | <xs:simpleType name="base" > |
---|
150 | <xs:restriction base="xs:decimal" > |
---|
151 | <xs:maxExclusive value="100"/> |
---|
152 | </xs:restriction> |
---|
153 | </xs:simpleType> |
---|
154 | |
---|
155 | <xs:simpleType name="level1" > |
---|
156 | <xs:restriction base="base" > |
---|
157 | <xs:maxExclusive value="75"/> |
---|
158 | </xs:restriction> |
---|
159 | </xs:simpleType> |
---|
160 | |
---|
161 | <xs:simpleType name="level2" > |
---|
162 | <xs:restriction base="level1" > |
---|
163 | <xs:maxExclusive value="50"/> |
---|
164 | </xs:restriction> |
---|
165 | </xs:simpleType> |
---|
166 | |
---|
167 | |
---|
168 | <xs:element name="anonElement" > |
---|
169 | <xs:simpleType > |
---|
170 | <xs:restriction base="xs:decimal" > |
---|
171 | <xs:maxExclusive value="100"/> |
---|
172 | </xs:restriction> |
---|
173 | </xs:simpleType> |
---|
174 | </xs:element> |
---|
175 | |
---|
176 | <xs:complexType name="eleTestType" > |
---|
177 | <xs:sequence > |
---|
178 | <xs:element name="level1string" type="xs:string" /> |
---|
179 | <xs:element name="level1boolean" type="xs:boolean" /> |
---|
180 | <xs:element name="level1decimal" type="xs:decimal" /> |
---|
181 | <xs:element name="level1float" type="xs:float" /> |
---|
182 | <xs:element name="level1double" type="xs:double" /> |
---|
183 | <xs:element name="level1duration" type="xs:duration" /> |
---|
184 | <xs:element name="level1dateTime" type="xs:dateTime" /> |
---|
185 | <xs:element name="level1time" type="xs:time" /> |
---|
186 | <xs:element name="level1date" type="xs:date" /> |
---|
187 | <xs:element name="level1gYearMonth" type="xs:gYearMonth" /> |
---|
188 | <xs:element name="level1gYear" type="xs:gYear" /> |
---|
189 | <xs:element name="level1gMonthDay" type="xs:gMonthDay" /> |
---|
190 | <xs:element name="level1gDay" type="xs:gDay" /> |
---|
191 | <xs:element name="level1gMonth" type="xs:gMonth" /> |
---|
192 | <xs:element name="level1hexBinary" type="xs:hexBinary" /> |
---|
193 | <xs:element name="level1base64Binary" type="xs:base64Binary" /> |
---|
194 | <xs:element name="level1anyURI" type="xs:anyURI" /> |
---|
195 | <xs:element name="level1QName" type="xs:QName" /> |
---|
196 | <xs:element name="level1normalizedString" type="xs:normalizedString" /> |
---|
197 | <xs:element name="level1token" type="xs:token" /> |
---|
198 | <xs:element name="level1language" type="xs:language" /> |
---|
199 | <xs:element name="level1NMTOKEN" type="xs:NMTOKEN" /> |
---|
200 | <xs:element name="level1NMTOKENS" type="xs:NMTOKENS" /> |
---|
201 | <xs:element name="level1Name" type="xs:Name" /> |
---|
202 | <xs:element name="level1NCName" type="xs:NCName" /> |
---|
203 | <xs:element name="level1integer" type="xs:integer" /> |
---|
204 | <xs:element name="level1nonPositiveInteger" type="xs:nonPositiveInteger" /> |
---|
205 | <xs:element name="level1negativeInteger" type="xs:negativeInteger" /> |
---|
206 | <xs:element name="level1long" type="xs:long" /> |
---|
207 | <xs:element name="level1int" type="xs:int" /> |
---|
208 | <xs:element name="level1short" type="xs:short" /> |
---|
209 | <xs:element name="level1byte" type="xs:byte" /> |
---|
210 | <xs:element name="level1nonNegativeInteger" type="xs:nonNegativeInteger" /> |
---|
211 | <xs:element name="level1unsignedLong" type="xs:unsignedLong" /> |
---|
212 | <xs:element name="level1unsignedInt" type="xs:unsignedInt" /> |
---|
213 | <xs:element name="level1unsignedShort" type="xs:unsignedShort" /> |
---|
214 | <xs:element name="level1unsignedByte" type="xs:unsignedByte" /> |
---|
215 | <xs:element name="level1positiveInteger" type="xs:positiveInteger" /> |
---|
216 | <xs:element name="level1anyType" type="xs:anyType" /> |
---|
217 | </xs:sequence> |
---|
218 | </xs:complexType> |
---|
219 | |
---|
220 | <xs:complexType name="attrTestType" > |
---|
221 | <xs:attribute name="anySimpleType" type="xs:anySimpleType" /> |
---|
222 | <xs:attribute name="string" type="xs:string" /> |
---|
223 | <xs:attribute name="boolean" type="xs:boolean" /> |
---|
224 | <xs:attribute name="decimal" type="xs:decimal" /> |
---|
225 | <xs:attribute name="float" type="xs:float" /> |
---|
226 | <xs:attribute name="double" type="xs:double" /> |
---|
227 | <xs:attribute name="duration" type="xs:duration" /> |
---|
228 | <xs:attribute name="dateTime" type="xs:dateTime" /> |
---|
229 | <xs:attribute name="time" type="xs:time" /> |
---|
230 | <xs:attribute name="date" type="xs:date" /> |
---|
231 | <xs:attribute name="gYearMonth" type="xs:gYearMonth" /> |
---|
232 | <xs:attribute name="gYear" type="xs:gYear" /> |
---|
233 | <xs:attribute name="gMonthDay" type="xs:gMonthDay" /> |
---|
234 | <xs:attribute name="gDay" type="xs:gDay" /> |
---|
235 | <xs:attribute name="gMonth" type="xs:gMonth" /> |
---|
236 | <xs:attribute name="hexBinary" type="xs:hexBinary" /> |
---|
237 | <xs:attribute name="base64Binary" type="xs:base64Binary" /> |
---|
238 | <xs:attribute name="anyURI" type="xs:anyURI" /> |
---|
239 | <xs:attribute name="QName" type="xs:QName" /> |
---|
240 | <xs:attribute name="normalizedString" type="xs:normalizedString" /> |
---|
241 | <xs:attribute name="token" type="xs:token" /> |
---|
242 | <xs:attribute name="language" type="xs:language" /> |
---|
243 | <xs:attribute name="NMTOKEN" type="xs:NMTOKEN" /> |
---|
244 | <xs:attribute name="NMTOKENS" type="xs:NMTOKENS" /> |
---|
245 | <xs:attribute name="Name" type="xs:Name" /> |
---|
246 | <xs:attribute name="NCName" type="xs:NCName" /> |
---|
247 | <xs:attribute name="ID" type="xs:ID" /> |
---|
248 | <xs:attribute name="IDREF" type="xs:IDREF" /> |
---|
249 | <xs:attribute name="IDREFS" type="xs:IDREFS" /> |
---|
250 | <xs:attribute name="integer" type="xs:integer" /> |
---|
251 | <xs:attribute name="nonPositiveInteger" type="xs:nonPositiveInteger" /> |
---|
252 | <xs:attribute name="negativeInteger" type="xs:negativeInteger" /> |
---|
253 | <xs:attribute name="long" type="xs:long" /> |
---|
254 | <xs:attribute name="int" type="xs:int" /> |
---|
255 | <xs:attribute name="short" type="xs:short" /> |
---|
256 | <xs:attribute name="byte" type="xs:byte" /> |
---|
257 | <xs:attribute name="nonNegativeInteger" type="xs:nonNegativeInteger" /> |
---|
258 | <xs:attribute name="unsignedLong" type="xs:unsignedLong" /> |
---|
259 | <xs:attribute name="unsignedInt" type="xs:unsignedInt" /> |
---|
260 | <xs:attribute name="unsignedShort" type="xs:unsignedShort" /> |
---|
261 | <xs:attribute name="unsignedByte" type="xs:unsignedByte" /> |
---|
262 | <xs:attribute name="positiveInteger" type="xs:positiveInteger" /> |
---|
263 | <xs:attribute name="defaultString" type="xs:string" default="hello" /> |
---|
264 | <xs:attribute name="defaultInt" type="xs:integer" default="12" /> |
---|
265 | </xs:complexType> |
---|
266 | |
---|
267 | <xs:complexType name="simpleDerTestType" > |
---|
268 | <xs:sequence> |
---|
269 | <xs:element name="decimalDerived" type="decimalDerivedType" /> |
---|
270 | <xs:element name="stringDerived" type="stringDerivedType" /> |
---|
271 | </xs:sequence> |
---|
272 | <xs:attribute name="decimalDerived" type="decimalDerivedType" /> |
---|
273 | <xs:attribute name="stringDerived" type="stringDerivedType" /> |
---|
274 | </xs:complexType> |
---|
275 | |
---|
276 | <xs:simpleType name="stringDerivedType" > |
---|
277 | <xs:restriction base="xs:string" > |
---|
278 | <xs:pattern value="hello"/> |
---|
279 | </xs:restriction> |
---|
280 | </xs:simpleType> |
---|
281 | |
---|
282 | <xs:simpleType name="decimalDerivedType" > |
---|
283 | <xs:restriction base="xs:decimal" > |
---|
284 | <xs:maxExclusive value="100"/> |
---|
285 | </xs:restriction> |
---|
286 | </xs:simpleType> |
---|
287 | |
---|
288 | <xs:complexType name="complexTestType" > |
---|
289 | <xs:sequence> |
---|
290 | <xs:element name="a" type="xs:string"/> |
---|
291 | <xs:element name="b" type="stringDerivedType"/> |
---|
292 | <xs:element name="c" type="decimalDerivedType"/> |
---|
293 | </xs:sequence> |
---|
294 | <xs:attribute name="a" type="xs:string" /> |
---|
295 | <xs:attribute name="b" type="stringDerivedType" /> |
---|
296 | <xs:attribute name="c" type="decimalDerivedType" /> |
---|
297 | </xs:complexType> |
---|
298 | |
---|
299 | <xs:complexType name="complexDerTestType" > |
---|
300 | <xs:complexContent > |
---|
301 | <xs:extension base="complexTestType" > |
---|
302 | <xs:sequence> |
---|
303 | <xs:element name="d" type="xs:string"/> |
---|
304 | </xs:sequence> |
---|
305 | </xs:extension> |
---|
306 | </xs:complexContent> |
---|
307 | </xs:complexType> |
---|
308 | |
---|
309 | <xs:simpleType name="unionTestType" > |
---|
310 | <xs:union memberTypes="decimalDerivedType stringDerivedType xs:decimal xs:string" /> |
---|
311 | </xs:simpleType> |
---|
312 | |
---|
313 | |
---|
314 | <xs:complexType name="unionTest" > |
---|
315 | <xs:sequence > |
---|
316 | <xs:element name="testEle" maxOccurs="4" type="unionTestType" /> |
---|
317 | <xs:element name="testEle2" maxOccurs="4" > |
---|
318 | <xs:complexType > |
---|
319 | <xs:attribute name="testAttr" type="unionTestType" /> |
---|
320 | <xs:attribute name="testAttr2" type="unionTestType" /> |
---|
321 | </xs:complexType> |
---|
322 | </xs:element> |
---|
323 | </xs:sequence> |
---|
324 | </xs:complexType> |
---|
325 | |
---|
326 | <xs:complexType name="unionTest2" > |
---|
327 | <xs:sequence > |
---|
328 | <xs:element name="testEle" maxOccurs="4" > |
---|
329 | <xs:complexType > |
---|
330 | <xs:simpleContent > |
---|
331 | <xs:extension base="unionTestType" > |
---|
332 | <xs:attribute name="testAttr" type="unionTestType" /> |
---|
333 | </xs:extension > |
---|
334 | </xs:simpleContent> |
---|
335 | </xs:complexType> |
---|
336 | </xs:element> |
---|
337 | </xs:sequence> |
---|
338 | </xs:complexType> |
---|
339 | |
---|
340 | <xs:complexType name="testtype2" > |
---|
341 | <xs:sequence> |
---|
342 | <xs:element name="poo" type="xs:string"/> |
---|
343 | </xs:sequence> |
---|
344 | <xs:attribute name="a" type="xs:IDREF" /> |
---|
345 | <xs:attribute name="b" type="xs:ID" /> |
---|
346 | <xs:attribute name="c" type="xs:string" /> |
---|
347 | |
---|
348 | </xs:complexType> |
---|
349 | |
---|
350 | </xs:schema> |
---|