|
1 <?xml version="1.0"?> |
|
2 <!-- |
|
3 Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
|
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 |
|
6 This code is free software; you can redistribute it and/or modify it |
|
7 under the terms of the GNU General Public License version 2 only, as |
|
8 published by the Free Software Foundation. Oracle designates this |
|
9 particular file as subject to the "Classpath" exception as provided |
|
10 by Oracle in the LICENSE file that accompanied this code. |
|
11 |
|
12 This code is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 version 2 for more details (a copy is included in the LICENSE file that |
|
16 accompanied this code). |
|
17 |
|
18 You should have received a copy of the GNU General Public License version |
|
19 2 along with this work; if not, write to the Free Software Foundation, |
|
20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
21 |
|
22 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
23 or visit www.oracle.com if you need additional information or have any |
|
24 questions. |
|
25 --> |
|
26 |
|
27 <grammar xmlns="http://relaxng.org/ns/structure/1.0" |
|
28 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" |
|
29 ns="http://www.w3.org/2001/XMLSchema" |
|
30 xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
31 xmlns:doc="http://www.jenitennison.com/doc" |
|
32 xmlns:txw="http://java.sun.com/txw"> |
|
33 |
|
34 <doc:p> |
|
35 RELAX NG schema for XML Schema by <doc:link |
|
36 href="mailto:mail@jenitennison.com">Jeni Tennison</doc:link>. Based on |
|
37 <doc:link href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">XML |
|
38 Schema Part I: Structures Recommendation</doc:link> and <doc:link |
|
39 href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/">XML Schema Part |
|
40 II: Datatypes</doc:link>. |
|
41 </doc:p> |
|
42 <doc:changes date="2001-11-24"> |
|
43 <doc:p> |
|
44 Amended to comply with 10 August 2001 Tutorial. |
|
45 </doc:p> |
|
46 <doc:change>Removed key attributes.</doc:change> |
|
47 <doc:change>Replaced not element with except elements.</doc:change> |
|
48 <doc:change> |
|
49 Replaced multiple consecutive optional attributes to use the |
|
50 zeroOrMore/choice pattern. |
|
51 </doc:change> |
|
52 <doc:change> |
|
53 Removed interleave elements inside list elements (which are no longer |
|
54 permitted). |
|
55 </doc:change> |
|
56 </doc:changes> |
|
57 |
|
58 <define name="openAttrs" txw:mode="inherit"> |
|
59 <doc:p> |
|
60 This allows any number of attributes that are not in the XML Schema |
|
61 namespace or are in no namespace. This is somewhat more complicated than |
|
62 the XML Schema anyAttribute equivalent. |
|
63 </doc:p> |
|
64 <!-- KK don't care --> |
|
65 <empty/> |
|
66 <!--zeroOrMore> |
|
67 <attribute> |
|
68 <anyName> |
|
69 <except> |
|
70 <nsName /> |
|
71 <nsName ns="" /> |
|
72 <name>xml:lang</name> |
|
73 </except> |
|
74 </anyName> |
|
75 <text /> |
|
76 </attribute> |
|
77 </zeroOrMore--> |
|
78 </define> |
|
79 |
|
80 <define name="annotated" txw:mode="inherit"> |
|
81 <doc:p> |
|
82 This allows any number of attributes that are not in the XML Schema |
|
83 namespace or are in no namespace, an optional id attribute of type ID, |
|
84 and an optional annotation element. This is used as the basis for many |
|
85 element content models. |
|
86 </doc:p> |
|
87 <ref name="openAttrs" /> |
|
88 <optional> |
|
89 <attribute name="id"> |
|
90 <data type="ID" /> |
|
91 </attribute> |
|
92 </optional> |
|
93 <optional> |
|
94 <ref name="annotation" /> |
|
95 </optional> |
|
96 </define> |
|
97 |
|
98 <define name="schemaTop" txw:mode="inline"> |
|
99 <doc:p> |
|
100 This gives the content model of the top level of the schema. |
|
101 </doc:p> |
|
102 <choice> |
|
103 <ref name="redefinable" /> |
|
104 <ref name="topLevelElement" /> |
|
105 <ref name="topLevelAttribute" /> |
|
106 <!--ref name="notation" /--> |
|
107 </choice> |
|
108 </define> |
|
109 |
|
110 <define name="redefinable" txw:mode="inline"> |
|
111 <doc:p> |
|
112 This gives the components that can be redefined within the redefine |
|
113 element. They also occur at the top level of the schema. |
|
114 </doc:p> |
|
115 <choice> |
|
116 <ref name="simpleTypeHost" /> |
|
117 <ref name="complexTypeHost" /> |
|
118 <!--ref name="namedGroup" /> |
|
119 <ref name="namedAttributeGroup" /--> |
|
120 </choice> |
|
121 </define> |
|
122 |
|
123 <define name="formChoice"> |
|
124 <doc:p> |
|
125 This gives the values for the various form attributes: |
|
126 elementFormDefault and attributeFormDefault on the schema element, and |
|
127 the form attributes on the element and attribute elements. |
|
128 </doc:p> |
|
129 <choice> |
|
130 <value>qualified</value> |
|
131 <value>unqualified</value> |
|
132 </choice> |
|
133 </define> |
|
134 |
|
135 <!-- KK: merge the two --> |
|
136 <define name="reducedDerivationControl"> |
|
137 <doc:p> |
|
138 This gives the values that can be taken in the lists used to control |
|
139 derivation by extension or restriction (this is 'reduced' derivation |
|
140 because some derivation can involve substitution). This RELAX NG schema, |
|
141 like the XML Schema Recommendation here, allows the keywords 'extension' and |
|
142 'restriction' to be repeated any number of times. |
|
143 </doc:p> |
|
144 <list> |
|
145 <oneOrMore> |
|
146 <choice> |
|
147 <value>extension</value> |
|
148 <value>restriction</value> |
|
149 </choice> |
|
150 </oneOrMore> |
|
151 </list> |
|
152 </define> |
|
153 |
|
154 <define name="derivationSet"> |
|
155 <doc:p> |
|
156 This specifies the possible values for attributes that control derivation. |
|
157 </doc:p> |
|
158 <choice> |
|
159 <value>#all</value> |
|
160 <ref name="reducedDerivationControl" /> |
|
161 </choice> |
|
162 </define> |
|
163 |
|
164 <start> |
|
165 <doc:p> |
|
166 This is the beginning point for the schema, and defines the schema |
|
167 element. |
|
168 </doc:p> |
|
169 <element name="schema" |
|
170 doc:href="http://www.w3.org/TR/xmlschema-1/#element-schema"> |
|
171 <ref name="openAttrs" /> |
|
172 <zeroOrMore> |
|
173 <choice> |
|
174 <attribute name="version"> |
|
175 <data type="token" /> |
|
176 </attribute> |
|
177 <attribute name="finalDefault"> |
|
178 <ref name="derivationSet" /> |
|
179 </attribute> |
|
180 <attribute name="blockDefault"> |
|
181 <ref name="blockSet" /> |
|
182 </attribute> |
|
183 <attribute name="attributeFormDefault"> |
|
184 <ref name="formChoice" /> |
|
185 </attribute> |
|
186 <attribute name="elementFormDefault"> |
|
187 <ref name="formChoice" /> |
|
188 </attribute> |
|
189 <attribute name="id"> |
|
190 <data type="ID" /> |
|
191 </attribute> |
|
192 <attribute name="xml:lang"> |
|
193 <data type="language" /> |
|
194 </attribute> |
|
195 <attribute name="targetNamespace"> |
|
196 <data type="anyURI" /> |
|
197 </attribute> |
|
198 </choice> |
|
199 </zeroOrMore> |
|
200 <zeroOrMore> |
|
201 <choice> |
|
202 <!--ref name="include" /--> |
|
203 <ref name="import" /> |
|
204 <!--ref name="redefine" /--> |
|
205 <ref name="annotation" /> |
|
206 </choice> |
|
207 </zeroOrMore> |
|
208 <zeroOrMore> |
|
209 <choice> |
|
210 <ref name="schemaTop" /> |
|
211 <ref name="annotation" /> |
|
212 </choice> |
|
213 </zeroOrMore> |
|
214 </element> |
|
215 </start> |
|
216 |
|
217 <define name="allNNI"> |
|
218 <doc:p> |
|
219 This gives the value type for the maxOccurs attribute, which may be a |
|
220 non-negative number or the keyword 'unbounded'. |
|
221 </doc:p> |
|
222 <choice> |
|
223 <data type="nonNegativeInteger" /> |
|
224 <value type="token">unbounded</value> |
|
225 </choice> |
|
226 </define> |
|
227 |
|
228 <define name="occurs" txw:mode="inherit"> |
|
229 <doc:p> |
|
230 This specifies the occurs attributes, minOccurs and maxOccurs, as they |
|
231 are normally used. |
|
232 </doc:p> |
|
233 <zeroOrMore> |
|
234 <choice> |
|
235 <attribute name="minOccurs"> |
|
236 <data type="nonNegativeInteger" /> |
|
237 </attribute> |
|
238 <attribute name="maxOccurs"> |
|
239 <ref name="allNNI" /> |
|
240 </attribute> |
|
241 </choice> |
|
242 </zeroOrMore> |
|
243 </define> |
|
244 |
|
245 <define name="typeDefParticle" txw:mode="inline"> |
|
246 <doc:p> |
|
247 This gives the possible content of complex types. |
|
248 </doc:p> |
|
249 <choice> |
|
250 <!--ref name="groupRef" /--> |
|
251 <ref name="all" /> |
|
252 <ref name="choice" /> |
|
253 <ref name="sequence" /> |
|
254 </choice> |
|
255 </define> |
|
256 |
|
257 <define name="nestedParticle" txw:mode="inline"> |
|
258 <doc:p> |
|
259 This gives the particles that can make up a model group. |
|
260 </doc:p> |
|
261 <choice> |
|
262 <ref name="localElement" /> |
|
263 <!--ref name="groupRef" /--> |
|
264 <ref name="choice" /> |
|
265 <ref name="sequence" /> |
|
266 <ref name="any" /> |
|
267 </choice> |
|
268 </define> |
|
269 |
|
270 <define name="fixedOrDefault" txw:mode="inline"> |
|
271 <doc:p> |
|
272 This specifies the relationship between fixed and default attributes on |
|
273 element and attribute elements - if one is present, then the other cannot |
|
274 be. This is a constraint that cannot be specified using XML Schema. |
|
275 </doc:p> |
|
276 <choice> |
|
277 <empty /> |
|
278 <attribute name="fixed" /> |
|
279 <attribute name="default" /> |
|
280 </choice> |
|
281 </define> |
|
282 |
|
283 <define name="attributeType" txw:mode="inherit"> |
|
284 <doc:p> |
|
285 This specifies the relationship between the type attribute and the |
|
286 simpleType element child of attribute elements - if one is present, then |
|
287 the other cannot be, although it is possible for neither to be allowed. |
|
288 </doc:p> |
|
289 <choice> |
|
290 <empty /> |
|
291 <attribute name="type"> |
|
292 <data type="QName" /> |
|
293 </attribute> |
|
294 <ref name="simpleTypeHost" /> |
|
295 </choice> |
|
296 </define> |
|
297 |
|
298 <define name="localAttribute"> |
|
299 <doc:p> |
|
300 This describes attribute elements when used in a local context. They |
|
301 have an optional use attribute, possibly a fixed or default attribute, |
|
302 and then can either have a ref attribute (referring to a top-level |
|
303 attribute) or a name attribute with an optional form attribute and |
|
304 specifying an attribute type. |
|
305 </doc:p> |
|
306 <element name="attribute" |
|
307 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute"> |
|
308 <ref name="annotated" /> |
|
309 <optional> |
|
310 <attribute name="use"> |
|
311 <choice> |
|
312 <value type="token">optional</value> |
|
313 <value type="token">prohibited</value> |
|
314 <value type="token">required</value> |
|
315 </choice> |
|
316 </attribute> |
|
317 </optional> |
|
318 <ref name="fixedOrDefault" /> |
|
319 <choice> |
|
320 <attribute name="ref"> |
|
321 <data type="QName" /> |
|
322 </attribute> |
|
323 <group> |
|
324 <attribute name="name"> |
|
325 <data type="NCName" /> |
|
326 </attribute> |
|
327 <optional> |
|
328 <attribute name="form"> |
|
329 <ref name="formChoice" /> |
|
330 </attribute> |
|
331 </optional> |
|
332 <ref name="attributeType" /> |
|
333 </group> |
|
334 </choice> |
|
335 </element> |
|
336 </define> |
|
337 |
|
338 <define name="topLevelAttribute"> |
|
339 <doc:p> |
|
340 This describes attribute elements when used at the top level of the |
|
341 schema. They must have a name, may have a fixed or default attribute, |
|
342 and specify their type through a type attribute or child simpleType |
|
343 element. The name attribute of each attribute element that appears at |
|
344 the top level of the schema is unique. |
|
345 </doc:p> |
|
346 <element name="attribute" |
|
347 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attribute"> |
|
348 <ref name="annotated" /> |
|
349 <attribute name="name"> |
|
350 <data type="NCName" /> |
|
351 </attribute> |
|
352 <ref name="fixedOrDefault" /> |
|
353 <ref name="attributeType" /> |
|
354 </element> |
|
355 </define> |
|
356 |
|
357 <define name="attrDecls" txw:mode="inherit"> |
|
358 <doc:p> |
|
359 This gives the model group for specifying the attributes in a complex |
|
360 type, an extension or restriction. |
|
361 </doc:p> |
|
362 <zeroOrMore> |
|
363 <choice> |
|
364 <ref name="localAttribute" /> |
|
365 <!--ref name="attributeGroupRef" /--> |
|
366 </choice> |
|
367 </zeroOrMore> |
|
368 <optional> |
|
369 <ref name="anyAttribute" /> |
|
370 </optional> |
|
371 </define> |
|
372 |
|
373 <define name="anyAttribute"> |
|
374 <doc:p> |
|
375 This specifies the anyAttribute wildcard. |
|
376 </doc:p> |
|
377 <element name="anyAttribute" |
|
378 doc:href="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"> |
|
379 <ref name="wildcard" /> |
|
380 </element> |
|
381 </define> |
|
382 |
|
383 <define name="complexTypeModel" txw:mode="inherit"> |
|
384 <doc:p> |
|
385 This specifies the content of a complexType element. As children, it can |
|
386 have a simpleContent, a complexContent or a model group. Only if it has |
|
387 one of the latter two, may it have a mixed attribute. This latter |
|
388 constraint is something that cannot be specified in XML Schema. |
|
389 </doc:p> |
|
390 <choice> |
|
391 <ref name="simpleContent" /> |
|
392 <group> |
|
393 <optional> |
|
394 <attribute name="mixed"> |
|
395 <data type="boolean" /> |
|
396 </attribute> |
|
397 </optional> |
|
398 <choice> |
|
399 <ref name="complexContent" /> |
|
400 <group> |
|
401 <optional> |
|
402 <ref name="typeDefParticle" /> |
|
403 </optional> |
|
404 <ref name="attrDecls" /> |
|
405 </group> |
|
406 </choice> |
|
407 </group> |
|
408 </choice> |
|
409 </define> |
|
410 |
|
411 <define name="complexTypeHost" txw:mode="inherit"> |
|
412 <ref name="typeHost" /> |
|
413 <ref name="complexType" /> |
|
414 </define> |
|
415 |
|
416 <define name="typeHost" txw:mode="inherit"><empty/><empty/></define> |
|
417 |
|
418 <define name="complexType" txw:mode="inherit"> |
|
419 <element name="complexType" |
|
420 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexType"> |
|
421 <doc:p> |
|
422 This specifies the basic content of a complexType element. |
|
423 </doc:p> |
|
424 <ref name="annotated" /> |
|
425 <ref name="complexTypeModel" /> |
|
426 <optional> |
|
427 <attribute name="name"> |
|
428 <data type="NCName" /> |
|
429 </attribute> |
|
430 </optional> |
|
431 <zeroOrMore> |
|
432 <choice> |
|
433 <attribute name="abstract"> |
|
434 <data type="boolean" /> |
|
435 </attribute> |
|
436 <attribute name="block"> |
|
437 <ref name="derivationSet" /> |
|
438 </attribute> |
|
439 <attribute name="final"> |
|
440 <ref name="derivationSet" /> |
|
441 </attribute> |
|
442 </choice> |
|
443 </zeroOrMore> |
|
444 </element> |
|
445 </define> |
|
446 |
|
447 <define name="complexRestriction"> |
|
448 <doc:p> |
|
449 This describes a restriction element within a complexContent element |
|
450 (i.e. one that restricts a complex type). It has a base attribute, may |
|
451 contain a model group and may contain attribute declarations of various |
|
452 sorts. |
|
453 </doc:p> |
|
454 <element name="restriction" |
|
455 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::restriction"> |
|
456 <ref name="annotated" /> |
|
457 <attribute name="base"> |
|
458 <data type="QName" /> |
|
459 </attribute> |
|
460 <optional> |
|
461 <ref name="typeDefParticle" /> |
|
462 </optional> |
|
463 <ref name="attrDecls" /> |
|
464 </element> |
|
465 </define> |
|
466 |
|
467 <define name="extensionType"> |
|
468 <doc:p> |
|
469 This specifies the basic model for an extension element: adding a |
|
470 required base attribute to the model used for most components. |
|
471 </doc:p> |
|
472 <ref name="annotated" /> |
|
473 <attribute name="base"> |
|
474 <data type="QName" /> |
|
475 </attribute> |
|
476 </define> |
|
477 |
|
478 <define name="complexExtension"> |
|
479 <doc:p> |
|
480 This describes an extension element within a complexContent element |
|
481 (i.e. one that restricts a complex type). It may contain a model group |
|
482 and may contain attribute declarations of various sorts. |
|
483 </doc:p> |
|
484 <element name="extension" |
|
485 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent::extension"> |
|
486 <ref name="extensionType" /> |
|
487 <optional> |
|
488 <ref name="typeDefParticle" /> |
|
489 </optional> |
|
490 <ref name="attrDecls" /> |
|
491 </element> |
|
492 </define> |
|
493 |
|
494 <define name="complexContent"> |
|
495 <doc:p> |
|
496 This describes a complexContent element. It may have a mixed attribute, |
|
497 and either a restriction or extension element as content. |
|
498 </doc:p> |
|
499 <element name="complexContent" |
|
500 doc:href="http://www.w3.org/TR/xmlschema-1/#element-complexContent"> |
|
501 <ref name="annotated" /> |
|
502 <optional> |
|
503 <attribute name="mixed"> |
|
504 <data type="boolean" /> |
|
505 </attribute> |
|
506 </optional> |
|
507 <choice> |
|
508 <ref name="complexRestriction" /> |
|
509 <ref name="complexExtension" /> |
|
510 </choice> |
|
511 </element> |
|
512 </define> |
|
513 |
|
514 <define name="simpleRestriction"> |
|
515 <doc:p> |
|
516 This describes a restriction element that appears within a simpleContent |
|
517 or simpleType element (i.e. one that restricts a simple type). Its |
|
518 content follows the simple restriction model that is detailed below, and |
|
519 may include attribute declarations. |
|
520 </doc:p> |
|
521 <element name="restriction" |
|
522 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::restriction"> |
|
523 <ref name="annotated" /> |
|
524 <ref name="simpleRestrictionModel" /> |
|
525 <ref name="attrDecls" /> |
|
526 </element> |
|
527 </define> |
|
528 |
|
529 <define name="simpleExtension"> |
|
530 <doc:p> |
|
531 This describes an extension element that appears within a simpleContent |
|
532 element (i.e. one that extends a simple type). Like other extensions, it |
|
533 has a base type, but it can only be used to add attributes. |
|
534 </doc:p> |
|
535 <element name="extension" |
|
536 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent::extension"> |
|
537 <ref name="extensionType" /> |
|
538 <ref name="attrDecls" /> |
|
539 </element> |
|
540 </define> |
|
541 |
|
542 <define name="simpleContent"> |
|
543 <doc:p> |
|
544 This describes a simpleContent element, whose content can either hold a |
|
545 restriction or extension element. |
|
546 </doc:p> |
|
547 <element name="simpleContent" |
|
548 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"> |
|
549 <ref name="annotated" /> |
|
550 <choice> |
|
551 <ref name="simpleRestriction" /> |
|
552 <ref name="simpleExtension" /> |
|
553 </choice> |
|
554 </element> |
|
555 </define> |
|
556 |
|
557 <define name="blockSet"> |
|
558 <doc:p> |
|
559 This gives the possible values for block attributes on element elements, |
|
560 which includes substitution amongst the list of possible values. This |
|
561 RELAX NG schema, like the XML Schema Recommendation, allows each of the |
|
562 keywords 'extension', 'restriction' and 'substitution' to occur more than |
|
563 once within the list. |
|
564 </doc:p> |
|
565 <choice> |
|
566 <value type="token">#all</value> |
|
567 <list> |
|
568 <oneOrMore> |
|
569 <choice> |
|
570 <value>extension</value> |
|
571 <value>restriction</value> |
|
572 <value>substitution</value> |
|
573 </choice> |
|
574 </oneOrMore> |
|
575 </list> |
|
576 </choice> |
|
577 </define> |
|
578 |
|
579 <define name="element" txw:mode="inherit"> |
|
580 <doc:p> |
|
581 This describes the basic content model of an element element. It is |
|
582 annotated, may have a fixed or default attribute, and may have nillable |
|
583 and/or block attributes. Its type may be specified through a type |
|
584 attribute, a local simple type or a local complex type - the choice |
|
585 between these methods is something that cannot be indicated with XML |
|
586 Schema. This content is optionally followed by some identify constraints. |
|
587 </doc:p> |
|
588 <ref name="annotated" /> |
|
589 <ref name="fixedOrDefault" /> |
|
590 <zeroOrMore> |
|
591 <choice> |
|
592 <attribute name="nillable"> |
|
593 <data type="boolean" /> |
|
594 </attribute> |
|
595 <attribute name="block"> |
|
596 <ref name="blockSet" /> |
|
597 </attribute> |
|
598 </choice> |
|
599 </zeroOrMore> |
|
600 <choice> |
|
601 <empty /> |
|
602 <attribute name="type"> |
|
603 <data type="QName" /> |
|
604 </attribute> |
|
605 <ref name="simpleTypeHost" /> |
|
606 <ref name="complexTypeHost" /> |
|
607 </choice> |
|
608 <!--zeroOrMore> |
|
609 <ref name="identityConstraint" /> |
|
610 </zeroOrMore--> |
|
611 </define> |
|
612 |
|
613 <define name="topLevelElement"> |
|
614 <doc:p> |
|
615 This describes an element element that appears at the top level of the |
|
616 schema. On top of the basic content for an element element, it has to |
|
617 have a name, which is a unique identifier in the element symbol space. It |
|
618 may have substitutionGroup, abstract and/or final attributes. |
|
619 </doc:p> |
|
620 <element name="element" |
|
621 doc:href="http://www.w3.org/TR/xmlschema-1/#element-element"> |
|
622 <ref name="element" /> |
|
623 <attribute name="name"> |
|
624 <data type="NCName" /> |
|
625 </attribute> |
|
626 <zeroOrMore> |
|
627 <choice> |
|
628 <attribute name="substitutionGroup"> |
|
629 <data type="QName" /> |
|
630 </attribute> |
|
631 <attribute name="abstract"> |
|
632 <data type="boolean" /> |
|
633 </attribute> |
|
634 <attribute name="final"> |
|
635 <ref name="derivationSet" /> |
|
636 </attribute> |
|
637 </choice> |
|
638 </zeroOrMore> |
|
639 </element> |
|
640 </define> |
|
641 |
|
642 <define name="localElement"> |
|
643 <doc:p> |
|
644 This describes an element element that appears locally, within a |
|
645 complexType or group element. It may have minOccurs and/or maxOccurs |
|
646 attributes. If it has a ref attribute, then that's all it can |
|
647 have. Otherwise, it must have a name and specifies its type in the same |
|
648 way as the basic element content model described above. It may in this |
|
649 case also have a form element. These constraints on local elements |
|
650 cannot be described within XML Schema. |
|
651 </doc:p> |
|
652 <element name="element" |
|
653 doc:href="http://www.w3.org/TR/xmlschema-1/#element-element"> |
|
654 <ref name="occurs" /> |
|
655 <choice> |
|
656 <attribute name="ref"> |
|
657 <data type="QName" /> |
|
658 </attribute> |
|
659 <group> |
|
660 <ref name="element" /> |
|
661 <attribute name="name"> |
|
662 <data type="NCName" /> |
|
663 </attribute> |
|
664 <optional> |
|
665 <attribute name="form"> |
|
666 <ref name="formChoice" /> |
|
667 </attribute> |
|
668 </optional> |
|
669 </group> |
|
670 </choice> |
|
671 </element> |
|
672 </define> |
|
673 |
|
674 <!--define name="namedGroup"> |
|
675 <doc:p> |
|
676 This describes an group element that appears at the top level of the |
|
677 schema. It must have a name attribute, and must have one of an all, |
|
678 choice or sequence element child. |
|
679 </doc:p> |
|
680 <element name="group" |
|
681 doc:href="http://www.w3.org/TR/xmlschema-1/#element-group"> |
|
682 <ref name="annotated" /> |
|
683 <attribute name="name"> |
|
684 <data type="NCName" /> |
|
685 </attribute> |
|
686 <choice> |
|
687 <element name="all"> |
|
688 <ref name="simpleExplicitGroup" /> <!- - RS - relaxed all content model - -> |
|
689 </element> |
|
690 <element name="choice"> |
|
691 <ref name="simpleExplicitGroup" /> |
|
692 </element> |
|
693 <element name="sequence"> |
|
694 <ref name="simpleExplicitGroup" /> |
|
695 </element> |
|
696 </choice> |
|
697 </element> |
|
698 </define--> |
|
699 |
|
700 <!--define name="groupRef"> |
|
701 <doc:p> |
|
702 This describes group element that occurs locally, referring to a |
|
703 top-level named group. It may have occurrence attributes, and must have |
|
704 a ref attribute. |
|
705 </doc:p> |
|
706 <element name="group" |
|
707 doc:href="http://www.w3.org/TR/xmlschema-1/#element-group"> |
|
708 <ref name="annotated" /> |
|
709 <ref name="occurs" /> |
|
710 <attribute name="ref"> |
|
711 <data type="QName" /> |
|
712 </attribute> |
|
713 </element> |
|
714 </define--> |
|
715 |
|
716 <define name="explicitGroup" txw:mode="inherit"> |
|
717 <doc:p> |
|
718 This gives the content of a model group (not a group element) in the |
|
719 normal run of things. It has occurrence attributes and any number of |
|
720 particles within it. |
|
721 </doc:p> |
|
722 <ref name="annotated" /> |
|
723 <ref name="occurs" /> |
|
724 <zeroOrMore> |
|
725 <ref name="nestedParticle" /> |
|
726 </zeroOrMore> |
|
727 </define> |
|
728 |
|
729 <define name="simpleExplicitGroup"> |
|
730 <doc:p> |
|
731 This gives the content of a model group (not a group element) within a |
|
732 named group - it differs from the above in that it doesn't have any |
|
733 occurrence attributes. |
|
734 </doc:p> |
|
735 <ref name="annotated" /> |
|
736 <zeroOrMore> |
|
737 <ref name="nestedParticle" /> |
|
738 </zeroOrMore> |
|
739 </define> |
|
740 |
|
741 <define name="all"> |
|
742 <doc:p> |
|
743 This describes an all element that appears outside a named group (i.e. as |
|
744 the content of a complexType element). It has the standard model for an |
|
745 all element, but adds minOccurs and maxOccurs attributes which can only |
|
746 take certain values. |
|
747 </doc:p> |
|
748 <element name="all" |
|
749 doc:href="http://www.w3.org/TR/xmlschema-1/#element-all"> |
|
750 <ref name="explicitGroup" /> |
|
751 </element> |
|
752 </define> |
|
753 |
|
754 <define name="choice"> |
|
755 <doc:p> |
|
756 This describes a choice element that appears outside a named group. |
|
757 </doc:p> |
|
758 <element name="choice" |
|
759 doc:href="http://www.w3.org/TR/xmlschema-1/#element-choice"> |
|
760 <ref name="explicitGroup" /> |
|
761 </element> |
|
762 </define> |
|
763 |
|
764 <define name="sequence"> |
|
765 <doc:p> |
|
766 This describes a sequence element that appears outside a named group. |
|
767 </doc:p> |
|
768 <element name="sequence" |
|
769 doc:href="http://www.w3.org/TR/xmlschema-1/#element-sequence"> |
|
770 <ref name="explicitGroup" /> |
|
771 </element> |
|
772 </define> |
|
773 |
|
774 <define name="wildcard" txw:mode="inherit"> |
|
775 <doc:p> |
|
776 This describes a wildcard element (i.e. any or anyAttribute). The |
|
777 namespace attribute can take a list URIs interspersed with the keywords |
|
778 '##targetNamespace' and/or '##local'. This RELAX NG schema, like the XML |
|
779 Schema Recommendation, allows the keywords to be specified more than once |
|
780 each within the list, if they're given. This model also specifies the |
|
781 processContents attribute. |
|
782 </doc:p> |
|
783 <ref name="annotated" /> |
|
784 <zeroOrMore> |
|
785 <choice> |
|
786 <attribute name="namespace"> |
|
787 <choice> |
|
788 <value type="token">##any</value> |
|
789 <value type="token">##other</value> |
|
790 <list> |
|
791 <zeroOrMore> |
|
792 <choice> |
|
793 <data type="anyURI" /> |
|
794 <value>##targetNamespace</value> |
|
795 <value>##local</value> |
|
796 </choice> |
|
797 </zeroOrMore> |
|
798 </list> |
|
799 </choice> |
|
800 </attribute> |
|
801 <attribute name="processContents"> |
|
802 <choice> |
|
803 <value type="token">lax</value> |
|
804 <value type="token">skip</value> |
|
805 <value type="token">strict</value> |
|
806 </choice> |
|
807 </attribute> |
|
808 </choice> |
|
809 </zeroOrMore> |
|
810 </define> |
|
811 |
|
812 <define name="any"> |
|
813 <doc:p> |
|
814 This describes an any element as a wildcard. |
|
815 </doc:p> |
|
816 <element name="any" |
|
817 doc:href="http://www.w3.org/TR/xmlschema-1/#element-any"> |
|
818 <ref name="wildcard" /> |
|
819 <ref name="occurs" /> |
|
820 </element> |
|
821 </define> |
|
822 |
|
823 <!--define name="namedAttributeGroup"> |
|
824 <doc:p> |
|
825 This describes an attributeGroup element as it appears at the top level |
|
826 of the schema. It must have a name attribute, and then contains |
|
827 attribute declarations. |
|
828 </doc:p> |
|
829 <element name="attributeGroup" |
|
830 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"> |
|
831 <ref name="annotated" /> |
|
832 <attribute name="name"> |
|
833 <data type="NCName" /> |
|
834 </attribute> |
|
835 <ref name="attrDecls" /> |
|
836 </element> |
|
837 </define--> |
|
838 |
|
839 <!--define name="attributeGroupRef"> |
|
840 <doc:p> |
|
841 This describes an attributeGroup element as it appears within a complex |
|
842 type. It must have a ref attribute. |
|
843 </doc:p> |
|
844 <element name="attributeGroup" |
|
845 doc:href="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"> |
|
846 <ref name="annotated" /> |
|
847 <attribute name="ref"> |
|
848 <data type="QName" /> |
|
849 </attribute> |
|
850 </element> |
|
851 </define--> |
|
852 |
|
853 <!--define name="include"> |
|
854 <doc:p> |
|
855 This describes an include element, which must have a schemaLocation |
|
856 attribute. |
|
857 </doc:p> |
|
858 <element name="include" |
|
859 doc:href="http://www.w3.org/TR/xmlschema-1/#element-include"> |
|
860 <ref name="annotated" /> |
|
861 <attribute name="schemaLocation"> |
|
862 <data type="anyURI" /> |
|
863 </attribute> |
|
864 </element> |
|
865 </define--> |
|
866 |
|
867 <!--define name="redefine"> |
|
868 <doc:p> |
|
869 This describes a redefine element, which must have a schemaLocation |
|
870 attribute and can then contain any mix of annotations and redefinable |
|
871 components. |
|
872 </doc:p> |
|
873 <element name="redefine" |
|
874 doc:href="http://www.w3.org/TR/xmlschema-1/#element-redefine"> |
|
875 <ref name="openAttrs" /> |
|
876 <optional> |
|
877 <attribute name="id"> |
|
878 <data type="ID" /> |
|
879 </attribute> |
|
880 </optional> |
|
881 <attribute name="schemaLocation"> |
|
882 <data type="anyURI" /> |
|
883 </attribute> |
|
884 <zeroOrMore> |
|
885 <choice> |
|
886 <ref name="annotation" /> |
|
887 <ref name="redefinable" /> |
|
888 </choice> |
|
889 </zeroOrMore> |
|
890 </element> |
|
891 </define--> |
|
892 |
|
893 <define name="import"> |
|
894 <doc:p> |
|
895 This describes an import element that's used when its parent schema |
|
896 element specifies a targetNamespace. In these cases, the namespace |
|
897 attribute on the import element is optional. |
|
898 </doc:p> |
|
899 <element name="import" |
|
900 doc:href="http://www.w3.org/TR/xmlschema-1/#element-import"> |
|
901 <ref name="annotated" /> |
|
902 <optional> |
|
903 <attribute name="schemaLocation"> |
|
904 <data type="anyURI" /> |
|
905 </attribute> |
|
906 </optional> |
|
907 <optional> |
|
908 <attribute name="namespace"> |
|
909 <data type="anyURI" /> |
|
910 </attribute> |
|
911 </optional> |
|
912 </element> |
|
913 </define> |
|
914 |
|
915 <!--define name="selector"> |
|
916 <doc:p> |
|
917 This describes a selector element. The xpath attribute is a simplified |
|
918 XPath - the regular expression given here is the one from the XML Schema |
|
919 for XML Schema. |
|
920 </doc:p> |
|
921 <element name="selector" |
|
922 doc:href="http://www.w3.org/TR/xmlschema-1/#element-selector"> |
|
923 <ref name="annotated" /> |
|
924 <attribute name="xpath"> |
|
925 <data type="token"> |
|
926 <param name="pattern">(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*</param> |
|
927 </data> |
|
928 </attribute> |
|
929 </element> |
|
930 </define> |
|
931 |
|
932 <define name="field"> |
|
933 <doc:p> |
|
934 This describes a field element. The xpath attribute is a simplified |
|
935 XPath - the regular expression given here is the one from the XML Schema |
|
936 for XML Schema. |
|
937 </doc:p> |
|
938 <element name="field" |
|
939 doc:href="http://www.w3.org/TR/xmlschema-1/#element-field"> |
|
940 <ref name="annotated" /> |
|
941 <attribute name="xpath"> |
|
942 <data type="token"> |
|
943 <param name="pattern">(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*</param> |
|
944 </data> |
|
945 </attribute> |
|
946 </element> |
|
947 </define> |
|
948 |
|
949 <define name="keybase" txw:mode="inherit"> |
|
950 <doc:p> |
|
951 This gives the basic content for identity constraints - a name attribute |
|
952 that uniquely identifies the identity constraint, a selector element and |
|
953 one or more field elements. |
|
954 </doc:p> |
|
955 <ref name="annotated" /> |
|
956 <attribute name="name"> |
|
957 <data type="NCName" /> |
|
958 </attribute> |
|
959 <ref name="selector" /> |
|
960 <oneOrMore> |
|
961 <ref name="field" /> |
|
962 </oneOrMore> |
|
963 </define> |
|
964 |
|
965 <define name="identityConstraint" txw:mode="inline"> |
|
966 <doc:p> |
|
967 This gives a model group for the three identity constraint elements, used |
|
968 within the content of element elements. |
|
969 </doc:p> |
|
970 <choice> |
|
971 <ref name="unique" /> |
|
972 <ref name="key" /> |
|
973 <ref name="keyref" /> |
|
974 </choice> |
|
975 </define> |
|
976 |
|
977 <define name="unique"> |
|
978 <doc:p> |
|
979 This describes a unique element. |
|
980 </doc:p> |
|
981 <element name="unique" |
|
982 doc:href="http://www.w3.org/TR/xmlschema-1/#element-unique"> |
|
983 <ref name="keybase" /> |
|
984 </element> |
|
985 </define> |
|
986 |
|
987 <define name="key"> |
|
988 <doc:p> |
|
989 This describes a key element. |
|
990 </doc:p> |
|
991 <element name="key" |
|
992 doc:href="http://www.w3.org/TR/xmlschema-1/#element-key"> |
|
993 <ref name="keybase" /> |
|
994 </element> |
|
995 </define> |
|
996 |
|
997 <define name="keyref"> |
|
998 <doc:p> |
|
999 This describes a keyref element. |
|
1000 </doc:p> |
|
1001 <element name="keyref" |
|
1002 doc:href="http://www.w3.org/TR/xmlschema-1/#element-keyref"> |
|
1003 <ref name="keybase" /> |
|
1004 <attribute name="refer"> |
|
1005 <data type="QName" /> |
|
1006 </attribute> |
|
1007 </element> |
|
1008 </define--> |
|
1009 |
|
1010 <!--define name="notation"> |
|
1011 <doc:p> |
|
1012 This describes a notation element. The names of notation elements are |
|
1013 unique in the notation symbol space. The public attribute is required, |
|
1014 and the system attribute is optional. |
|
1015 </doc:p> |
|
1016 <element name="notation" |
|
1017 doc:href="http://www.w3.org/TR/xmlschema-1/#element-notation"> |
|
1018 <ref name="annotated" /> |
|
1019 <attribute name="name"> |
|
1020 <data type="NCName" /> |
|
1021 </attribute> |
|
1022 <attribute name="public"> |
|
1023 <data type="token" /> |
|
1024 </attribute> |
|
1025 <optional> |
|
1026 <attribute name="system"> |
|
1027 <data type="anyURI" /> |
|
1028 </attribute> |
|
1029 </optional> |
|
1030 </element> |
|
1031 </define--> |
|
1032 |
|
1033 <define name="appinfoContent"> |
|
1034 <doc:p> |
|
1035 This is designed to describe the content of the appinfo elements in the |
|
1036 schema. At the moment this allows any mixed content without validation. |
|
1037 Note that this is fairly complex compared to the XML Schema equivalent, |
|
1038 which would be a single any element. |
|
1039 </doc:p> |
|
1040 <ref name="anyContent" /> |
|
1041 </define> |
|
1042 |
|
1043 <define name="anyContent"> |
|
1044 <empty/> <!-- KK don't care --> |
|
1045 <!--mixed> |
|
1046 <zeroOrMore> |
|
1047 <element> |
|
1048 <anyName /> |
|
1049 <zeroOrMore> |
|
1050 <attribute> |
|
1051 <anyName /> |
|
1052 </attribute> |
|
1053 </zeroOrMore> |
|
1054 <ref name="anyContent" /> |
|
1055 <empty /> |
|
1056 </element> |
|
1057 </zeroOrMore> |
|
1058 </mixed--> |
|
1059 </define> |
|
1060 |
|
1061 <define name="appinfo"> |
|
1062 <doc:p> |
|
1063 This describes an appinfo element. It has an optional source attribute |
|
1064 and can currently contain anything at all. |
|
1065 </doc:p> |
|
1066 <element name="appinfo" |
|
1067 doc:href="http://www.w3.org/TR/xmlschema-1/#element-appinfo"> |
|
1068 <optional> |
|
1069 <attribute name="source"> |
|
1070 <data type="anyURI" /> |
|
1071 </attribute> |
|
1072 </optional> |
|
1073 <ref name="appinfoContent" /> |
|
1074 </element> |
|
1075 </define> |
|
1076 |
|
1077 <define name="documentationContent"> |
|
1078 <doc:p> |
|
1079 This is designed to describe the content of the documentation elements in |
|
1080 the schema. At the moment this allows any mixed content without |
|
1081 validation. Note that this is fairly complex compared to the XML Schema |
|
1082 equivalent, which would be a single any element. |
|
1083 </doc:p> |
|
1084 <ref name="anyContent" /> |
|
1085 </define> |
|
1086 |
|
1087 <define name="documentation"> |
|
1088 <doc:p> |
|
1089 This describes a documentation element. It has optional source |
|
1090 and xml:lang attributes and can currently contain anything at all. |
|
1091 </doc:p> |
|
1092 <element name="documentation" |
|
1093 doc:href="http://www.w3.org/TR/xmlschema-1/#element-documentation"> |
|
1094 <zeroOrMore> |
|
1095 <choice> |
|
1096 <attribute name="source"> |
|
1097 <data type="anyURI" /> |
|
1098 </attribute> |
|
1099 <attribute name="xml:lang"> |
|
1100 <data type="language" /> |
|
1101 </attribute> |
|
1102 </choice> |
|
1103 </zeroOrMore> |
|
1104 <ref name="documentationContent" /> |
|
1105 </element> |
|
1106 </define> |
|
1107 |
|
1108 <define name="annotation"> |
|
1109 <doc:p> |
|
1110 This describes an annotation element. It can have any attributes, may |
|
1111 have an id attribute, and contains any number of documentation or appinfo |
|
1112 elements. |
|
1113 </doc:p> |
|
1114 <element name="annotation" |
|
1115 doc:href="http://www.w3.org/TR/xmlschema-1/#element-annotation"> |
|
1116 <ref name="openAttrs" /> |
|
1117 <optional> |
|
1118 <attribute name="id"> |
|
1119 <data type="ID" /> |
|
1120 </attribute> |
|
1121 </optional> |
|
1122 <zeroOrMore> |
|
1123 <choice> |
|
1124 <ref name="documentation" /> |
|
1125 <ref name="appinfo" /> |
|
1126 </choice> |
|
1127 </zeroOrMore> |
|
1128 </element> |
|
1129 </define> |
|
1130 |
|
1131 <define name="simpleDerivation" txw:mode="inline"> |
|
1132 <doc:p> |
|
1133 This gives the various types of derivation of simple types. |
|
1134 </doc:p> |
|
1135 <choice> |
|
1136 <ref name="simpleRestriction" /> |
|
1137 <ref name="list" /> |
|
1138 <ref name="union" /> |
|
1139 </choice> |
|
1140 </define> |
|
1141 |
|
1142 <define name="simpleDerivationSet"> |
|
1143 <doc:p> |
|
1144 This specifies the values of the final attribute for simple types. This |
|
1145 RELAX NG schema for XML Schema, like the XML Schema Recommendation, allows |
|
1146 the keywords 'list', 'union' and 'restriction' to appear more than once |
|
1147 within the list. |
|
1148 </doc:p> |
|
1149 <choice> |
|
1150 <value type="token">#all</value> |
|
1151 <list> |
|
1152 <zeroOrMore> |
|
1153 <choice> |
|
1154 <value>list</value> |
|
1155 <value>union</value> |
|
1156 <value>restriction</value> |
|
1157 </choice> |
|
1158 </zeroOrMore> |
|
1159 </list> |
|
1160 </choice> |
|
1161 </define> |
|
1162 |
|
1163 <define name="simpleTypeHost" txw:mode="inherit"> |
|
1164 <ref name="typeHost" /> |
|
1165 <ref name="simpleType" /> |
|
1166 </define> |
|
1167 |
|
1168 <define name="simpleType" txw:mode="inherit"> |
|
1169 <doc:p> |
|
1170 This gives the basic content of a simple type. |
|
1171 </doc:p> |
|
1172 <element name="simpleType" |
|
1173 doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleType"> |
|
1174 <ref name="annotated" /> |
|
1175 <ref name="simpleDerivation" /> |
|
1176 <optional> |
|
1177 <attribute name="name"> |
|
1178 <data type="NCName" /> |
|
1179 </attribute> |
|
1180 </optional> |
|
1181 <optional> |
|
1182 <attribute name="final"> |
|
1183 <ref name="simpleDerivationSet" /> |
|
1184 </attribute> |
|
1185 </optional> |
|
1186 </element> |
|
1187 </define> |
|
1188 |
|
1189 <!--define name="rangeFacets" txw:mode="inherit"> |
|
1190 <doc:p> |
|
1191 This describes the relationship between the various range facets. Only |
|
1192 one of minExclusive and minInclusive can be present, and only one of |
|
1193 maxExclusive and maxInclusive can be present. This is a constraint that |
|
1194 can't easily be expressed using XML Schema. This RELAX NG schema |
|
1195 for XML Schema is a little more restrictive than the XML Schema |
|
1196 Recommendation in that it also forces there to be a maximum of one of |
|
1197 each of these types of facets. |
|
1198 </doc:p> |
|
1199 <interleave> |
|
1200 <optional> |
|
1201 <choice> |
|
1202 <ref name="minExclusive" /> |
|
1203 <ref name="minInclusive" /> |
|
1204 </choice> |
|
1205 </optional> |
|
1206 <optional> |
|
1207 <choice> |
|
1208 <ref name="maxExclusive" /> |
|
1209 <ref name="maxInclusive" /> |
|
1210 </choice> |
|
1211 </optional> |
|
1212 </interleave> |
|
1213 </define> |
|
1214 |
|
1215 <define name="digitFacets" txw:mode="inherit"> |
|
1216 <doc:p> |
|
1217 This specifies optional totalDigits and fractionDigits elements. This |
|
1218 RELAX NG schema for XML Schema is a little more restrictive than the XML |
|
1219 Schema Recommendation in that it also forces there to be a maximum of one |
|
1220 of each of these types of facets. |
|
1221 </doc:p> |
|
1222 <optional> |
|
1223 <ref name="totalDigits" /> |
|
1224 </optional> |
|
1225 <optional> |
|
1226 <ref name="fractionDigits" /> |
|
1227 </optional> |
|
1228 </define> |
|
1229 |
|
1230 <define name="lengthFacets" txw:mode="inherit"> |
|
1231 <doc:p> |
|
1232 This specifies optional length, minLength and maxLength elements. This |
|
1233 RELAX NG schema for XML Schema is a little more restrictive than the XML |
|
1234 Schema Recommendation in that it also forces there to be a maximum of one |
|
1235 of each of these types of facets, and says that if a length element is |
|
1236 given, then neither minLength nor maxLength should be present. |
|
1237 </doc:p> |
|
1238 <choice> |
|
1239 <ref name="length" /> |
|
1240 <interleave> |
|
1241 <optional> |
|
1242 <ref name="minLength" /> |
|
1243 </optional> |
|
1244 <optional> |
|
1245 <ref name="maxLength" /> |
|
1246 </optional> |
|
1247 </interleave> |
|
1248 </choice> |
|
1249 </define> |
|
1250 |
|
1251 <define name="commonFacets" txw:mode="inherit"> |
|
1252 <doc:p> |
|
1253 This specifies zero or more enumeration or pattern elements and an |
|
1254 optional whiteSpace element. This RELAX NG schema for XML Schema is a |
|
1255 little more restrictive than the XML Schema Recommendation in that it |
|
1256 also forces there to be a maximum of one whiteSpace element within the |
|
1257 facets. Note that the whiteSpace facet is constrained to have a value of |
|
1258 'collapse'. |
|
1259 </doc:p> |
|
1260 <zeroOrMore> |
|
1261 <ref name="enumeration" /> |
|
1262 </zeroOrMore> |
|
1263 <optional> |
|
1264 <ref name="whiteSpaceCollapse" /> |
|
1265 </optional> |
|
1266 <zeroOrMore> |
|
1267 <ref name="pattern" /> |
|
1268 </zeroOrMore> |
|
1269 </define--> |
|
1270 |
|
1271 <define name="simpleRestrictionModel"> |
|
1272 <doc:p> |
|
1273 This specifies the types of facets that are valid in restrictions on the |
|
1274 built-in data types. This can only perform rudimentary checking, but |
|
1275 should be enough in most circumstances. Note that for xs:anySimpleType |
|
1276 and xs:string, the whiteSpace facet can take any value, for |
|
1277 xs:normalizedString it can be 'replace' or 'collapse', and for all other |
|
1278 built-in types it has to be 'collapse'. |
|
1279 </doc:p> |
|
1280 <choice> |
|
1281 <attribute name="base"> |
|
1282 <data type="QName" /> |
|
1283 </attribute> |
|
1284 <ref name="simpleTypeHost" /> |
|
1285 </choice> |
|
1286 <interleave> |
|
1287 <!--ref name="rangeFacets" /> |
|
1288 <ref name="digitFacets" /> |
|
1289 <ref name="lengthFacets" /> |
|
1290 <optional> |
|
1291 <ref name="whiteSpace" /> |
|
1292 </optional--> |
|
1293 <zeroOrMore> |
|
1294 <ref name="enumeration" /> |
|
1295 </zeroOrMore> |
|
1296 <!--zeroOrMore> |
|
1297 <ref name="pattern" /> |
|
1298 </zeroOrMore--> |
|
1299 </interleave> |
|
1300 </define> |
|
1301 |
|
1302 <define name="list"> |
|
1303 <doc:p> |
|
1304 This describes a list element. It can either specify a local simple type |
|
1305 or have a itemType attribute. This constraint cannot be expressed in XML |
|
1306 Schema. |
|
1307 </doc:p> |
|
1308 <element name="list" |
|
1309 doc:href="http://www.w3.org/TR/xmlschema-1/#element-list"> |
|
1310 <ref name="annotated" /> |
|
1311 <choice> |
|
1312 <ref name="simpleTypeHost" /> |
|
1313 <attribute name="itemType"> |
|
1314 <data type="QName" /> |
|
1315 </attribute> |
|
1316 </choice> |
|
1317 </element> |
|
1318 </define> |
|
1319 |
|
1320 <define name="union"> |
|
1321 <doc:p> |
|
1322 This describes a union element. If the memberTypes attribute is missing |
|
1323 or empty, then it must contain one or more simpleType elements; if |
|
1324 it's present, then it can contain simpleType elements or list simple |
|
1325 types in the memberTypes attribute. This constraint cannot be expressed |
|
1326 in XML Schema. |
|
1327 </doc:p> |
|
1328 <element name="union" |
|
1329 doc:href="http://www.w3.org/TR/xmlschema-1/#element-union"> |
|
1330 <ref name="annotated" /> |
|
1331 <choice> |
|
1332 <group> |
|
1333 <attribute name="memberTypes"> |
|
1334 <list> |
|
1335 <oneOrMore> |
|
1336 <data type="QName" /> |
|
1337 </oneOrMore> |
|
1338 </list> |
|
1339 </attribute> |
|
1340 <zeroOrMore> |
|
1341 <ref name="simpleTypeHost" /> |
|
1342 </zeroOrMore> |
|
1343 </group> |
|
1344 <group> |
|
1345 <optional> |
|
1346 <attribute name="memberTypes"> |
|
1347 <empty /> |
|
1348 </attribute> |
|
1349 </optional> |
|
1350 <oneOrMore> |
|
1351 <ref name="simpleTypeHost" /> |
|
1352 </oneOrMore> |
|
1353 </group> |
|
1354 </choice> |
|
1355 </element> |
|
1356 </define> |
|
1357 |
|
1358 <define name="facet" txw:mode="inherit"> |
|
1359 <doc:p> |
|
1360 This is the basic content of a facet. It has an optional fixed attribute. |
|
1361 </doc:p> |
|
1362 <ref name="annotated" /> |
|
1363 <optional> |
|
1364 <attribute name="fixed"> |
|
1365 <data type="boolean" /> |
|
1366 </attribute> |
|
1367 </optional> |
|
1368 </define> |
|
1369 |
|
1370 <define name="noFixedFacet" txw:mode="inherit"> |
|
1371 <doc:p> |
|
1372 This is the content of a facet that cannot be fixed (enumeration or |
|
1373 pattern). It has a value attribute that can take any kind of value. |
|
1374 </doc:p> |
|
1375 <ref name="annotated" /> |
|
1376 <attribute name="value" /> |
|
1377 </define> |
|
1378 |
|
1379 <!--define name="rangeFacet"> |
|
1380 <doc:p> |
|
1381 This is the content of a range facet. The value must be one of the data |
|
1382 types shown (as these are the only types of data that accept ranges). I |
|
1383 haven't gone so far as to indicate the data type of the value |
|
1384 attribute of a range facet according to the base type as this would be |
|
1385 very complicated (although it would be possible in RELAX NG). |
|
1386 </doc:p> |
|
1387 <ref name="facet" /> |
|
1388 <attribute name="value"> |
|
1389 <choice> |
|
1390 <data type="decimal" /> |
|
1391 <data type="float" /> |
|
1392 <data type="double" /> |
|
1393 <data type="duration" /> |
|
1394 <data type="dateTime" /> |
|
1395 <data type="time" /> |
|
1396 <data type="date" /> |
|
1397 <data type="gYearMonth" /> |
|
1398 <data type="gYear" /> |
|
1399 <data type="gMonthDay" /> |
|
1400 <data type="gMonth" /> |
|
1401 <data type="gDay" /> |
|
1402 </choice> |
|
1403 </attribute> |
|
1404 </define> |
|
1405 |
|
1406 <define name="minExclusive"> |
|
1407 <doc:p> |
|
1408 This describes a minExclusive element. |
|
1409 </doc:p> |
|
1410 <element name="minExclusive" |
|
1411 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minExclusive"> |
|
1412 <ref name="rangeFacet" /> |
|
1413 </element> |
|
1414 </define> |
|
1415 |
|
1416 <define name="minInclusive"> |
|
1417 <doc:p> |
|
1418 This describes a minInclusive element. |
|
1419 </doc:p> |
|
1420 <element name="minInclusive" |
|
1421 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minInclusive"> |
|
1422 <ref name="rangeFacet" /> |
|
1423 </element> |
|
1424 </define> |
|
1425 |
|
1426 <define name="maxExclusive"> |
|
1427 <doc:p> |
|
1428 This describes a maxExclusive element. |
|
1429 </doc:p> |
|
1430 <element name="maxExclusive" |
|
1431 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxExclusive"> |
|
1432 <ref name="rangeFacet" /> |
|
1433 </element> |
|
1434 </define> |
|
1435 |
|
1436 <define name="maxInclusive"> |
|
1437 <doc:p> |
|
1438 This describes a maxInclusive element. |
|
1439 </doc:p> |
|
1440 <element name="maxInclusive" |
|
1441 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxInclusive"> |
|
1442 <ref name="rangeFacet" /> |
|
1443 </element> |
|
1444 </define> |
|
1445 |
|
1446 <define name="numFacet"> |
|
1447 <doc:p> |
|
1448 This is the content of a numerical facet. |
|
1449 </doc:p> |
|
1450 <ref name="facet" /> |
|
1451 <attribute name="value"> |
|
1452 <data type="nonNegativeInteger" /> |
|
1453 </attribute> |
|
1454 </define> |
|
1455 |
|
1456 <define name="totalDigits"> |
|
1457 <doc:p> |
|
1458 This describes a totalDigits element. The value attribute must take a |
|
1459 positive integer. |
|
1460 </doc:p> |
|
1461 <element name="totalDigits" |
|
1462 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-totalDigits"> |
|
1463 <ref name="facet" /> |
|
1464 <attribute name="value"> |
|
1465 <data type="positiveInteger" /> |
|
1466 </attribute> |
|
1467 </element> |
|
1468 </define> |
|
1469 |
|
1470 <define name="fractionDigits"> |
|
1471 <doc:p> |
|
1472 This describes a fractionDigits element. |
|
1473 </doc:p> |
|
1474 <element name="fractionDigits" |
|
1475 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-fractionDigits"> |
|
1476 <ref name="numFacet" /> |
|
1477 </element> |
|
1478 </define> |
|
1479 |
|
1480 <define name="length"> |
|
1481 <doc:p> |
|
1482 This describes a length element. |
|
1483 </doc:p> |
|
1484 <element name="length" |
|
1485 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-length"> |
|
1486 <ref name="numFacet" /> |
|
1487 </element> |
|
1488 </define> |
|
1489 |
|
1490 <define name="minLength"> |
|
1491 <doc:p> |
|
1492 This describes a minLength element. |
|
1493 </doc:p> |
|
1494 <element name="minLength" |
|
1495 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minLength"> |
|
1496 <ref name="numFacet" /> |
|
1497 </element> |
|
1498 </define> |
|
1499 |
|
1500 <define name="maxLength"> |
|
1501 <doc:p> |
|
1502 This describes a maxLength element. |
|
1503 </doc:p> |
|
1504 <element name="maxLength" |
|
1505 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxLength"> |
|
1506 <ref name="numFacet" /> |
|
1507 </element> |
|
1508 </define--> |
|
1509 |
|
1510 <define name="enumeration"> |
|
1511 <doc:p> |
|
1512 This describes an enumeration element. |
|
1513 </doc:p> |
|
1514 <element name="enumeration" |
|
1515 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-enumeration"> |
|
1516 <ref name="noFixedFacet" /> |
|
1517 </element> |
|
1518 </define> |
|
1519 |
|
1520 <!--define name="whiteSpace"> |
|
1521 <doc:p> |
|
1522 This describes a whiteSpace element that can take any of the permitted |
|
1523 values. |
|
1524 </doc:p> |
|
1525 <element name="whiteSpace" |
|
1526 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace"> |
|
1527 <ref name="facet" /> |
|
1528 <attribute name="value"> |
|
1529 <choice> |
|
1530 <value type="token">preserve</value> |
|
1531 <value type="token">replace</value> |
|
1532 <value type="token">collapse</value> |
|
1533 </choice> |
|
1534 </attribute> |
|
1535 </element> |
|
1536 </define> |
|
1537 |
|
1538 <define name="whiteSpaceReplaceOrCollapse"> |
|
1539 <doc:p> |
|
1540 This describes a whiteSpace element that can only take the values |
|
1541 'replace' or 'collapse'. |
|
1542 </doc:p> |
|
1543 <element name="whiteSpace" |
|
1544 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace"> |
|
1545 <ref name="facet" /> |
|
1546 <attribute name="value"> |
|
1547 <choice> |
|
1548 <value type="token">replace</value> |
|
1549 <value type="token">collapse</value> |
|
1550 </choice> |
|
1551 </attribute> |
|
1552 </element> |
|
1553 </define> |
|
1554 |
|
1555 <define name="whiteSpaceCollapse"> |
|
1556 <doc:p> |
|
1557 This describes a whiteSpace element that can only take the value |
|
1558 'collapse'. |
|
1559 </doc:p> |
|
1560 <element name="whiteSpace" |
|
1561 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace"> |
|
1562 <ref name="facet" /> |
|
1563 <attribute name="value"> |
|
1564 <value type="token">collapse</value> |
|
1565 </attribute> |
|
1566 </element> |
|
1567 </define> |
|
1568 |
|
1569 <define name="pattern"> |
|
1570 <doc:p> |
|
1571 This describes a pattern element. |
|
1572 </doc:p> |
|
1573 <element name="pattern" |
|
1574 doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-pattern"> |
|
1575 <ref name="noFixedFacet" /> |
|
1576 </element> |
|
1577 </define--> |
|
1578 |
|
1579 </grammar> |