blob: cf226690c17c0e7e79cdfa1c98bde02dd9ac1c3c [file] [log] [blame]
banspc3cdcb92022-03-09 03:25:32 +01001<?xml version="1.0" encoding="utf-8"?>
2<grammar xmlns="http://relaxng.org/ns/structure/1.0"
3 datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
4 ns="http://www.tei-c.org/ns/1.0">
5
6<!-- The FSR schema was ripped off of a TEI customization, described by the comments below, so it is in no way normative.
7 Piotr, 16-jan-2012 -->
8
9 <!--
10Schema generated from ODD source 2012-01-16T11:55:34Z.
11Edition: 2.0.0 Last updated on 16th December 2011.
12Edition Location: http://www.tei-c.org/Vault/P5/2.0.0/
13
14--><!--This template file is freely available and you are hereby
15 authorised to copy, modify, and redistribute it in any way without
16 further reference or permissions.When making such modifications, you are strongly recommended to
17 change the present text to include an accurate statement of the
18 licencing conditions applicable to your modified text.-->
19
20 <define name="data.numeric">
21 <choice>
22 <data type="double"/>
23 <data type="token">
24 <param name="pattern">(\-?[\d]+/\-?[\d]+)</param>
25 </data>
26 <data type="decimal"/>
27 </choice>
28 </define>
29 <define name="data.truthValue">
30 <data type="boolean"/>
31 </define>
32 <define name="data.language">
33 <data type="language"/>
34 </define>
35 <define name="data.pointer">
36 <data type="anyURI"/>
37 </define>
38 <define name="data.word">
39 <data type="token">
40 <param name="pattern">(\p{L}|\p{N}|\p{P}|\p{S})+</param>
41 </data>
42 </define>
43 <define name="data.name">
44 <data type="Name"/>
45 </define>
46 <define name="data.enumerated">
47 <ref name="data.name"/>
48 </define>
49 <define name="att.global.attributes">
50 <ref name="att.global.attribute.xmlid"/>
51 <ref name="att.global.attribute.n"/>
52 <ref name="att.global.attribute.xmllang"/>
53 <ref name="att.global.attribute.rendition"/>
54 </define>
55 <define name="att.global.attribute.xmlid">
56 <optional>
57 <attribute name="xml:id">
58 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(identifier) provides a unique identifier for the element bearing the attribute.</a:documentation>
59 <data type="ID"/>
60 </attribute>
61 </optional>
62 </define>
63 <define name="att.global.attribute.n">
64 <optional>
65 <attribute name="n">
66 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(number) gives a number (or other label) for an element, which is not necessarily unique within
67 the document.</a:documentation>
68 <list>
69 <ref name="data.word"/>
70 <zeroOrMore>
71 <ref name="data.word"/>
72 </zeroOrMore>
73 </list>
74 </attribute>
75 </optional>
76 </define>
77 <define name="att.global.attribute.xmllang">
78 <optional>
79 <attribute name="xml:lang">
80 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(language) indicates the language of the element content using a tag generated
81 according to BCP 47
82 </a:documentation>
83 <ref name="data.language"/>
84 </attribute>
85 </optional>
86 </define>
87 <define name="att.global.attribute.rendition">
88 <optional>
89 <attribute name="rendition">
90 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">points to a description of the rendering or presentation used for this element in the
91 source text.</a:documentation>
92 <list>
93 <ref name="data.pointer"/>
94 <zeroOrMore>
95 <ref name="data.pointer"/>
96 </zeroOrMore>
97 </list>
98 </attribute>
99 </optional>
100 </define>
101
102 <define name="model.featureVal.complex">
103 <choice>
104 <ref name="fs"/>
105 <ref name="vColl"/>
106 <ref name="vNot"/>
107 <ref name="vMerge"/>
108 </choice>
109 </define>
110 <define name="model.featureVal.complex_alternation">
111 <choice>
112 <ref name="fs"/>
113 <ref name="vColl"/>
114 <ref name="vNot"/>
115 <ref name="vMerge"/>
116 </choice>
117 </define>
118 <define name="model.featureVal.complex_sequence">
119 <ref name="fs"/>
120 <ref name="vColl"/>
121 <ref name="vNot"/>
122 <ref name="vMerge"/>
123 </define>
124 <define name="model.featureVal.complex_sequenceOptional">
125 <optional>
126 <ref name="fs"/>
127 </optional>
128 <optional>
129 <ref name="vColl"/>
130 </optional>
131 <optional>
132 <ref name="vNot"/>
133 </optional>
134 <optional>
135 <ref name="vMerge"/>
136 </optional>
137 </define>
138 <define name="model.featureVal.complex_sequenceOptionalRepeatable">
139 <zeroOrMore>
140 <ref name="fs"/>
141 </zeroOrMore>
142 <zeroOrMore>
143 <ref name="vColl"/>
144 </zeroOrMore>
145 <zeroOrMore>
146 <ref name="vNot"/>
147 </zeroOrMore>
148 <zeroOrMore>
149 <ref name="vMerge"/>
150 </zeroOrMore>
151 </define>
152 <define name="model.featureVal.complex_sequenceRepeatable">
153 <oneOrMore>
154 <ref name="fs"/>
155 </oneOrMore>
156 <oneOrMore>
157 <ref name="vColl"/>
158 </oneOrMore>
159 <oneOrMore>
160 <ref name="vNot"/>
161 </oneOrMore>
162 <oneOrMore>
163 <ref name="vMerge"/>
164 </oneOrMore>
165 </define>
166 <define name="model.featureVal.single">
167 <choice>
168 <ref name="binary"/>
169 <ref name="symbol"/>
170 <ref name="numeric"/>
171 <ref name="string"/>
172 <ref name="vLabel"/>
173 <ref name="default"/>
174 <ref name="vAlt"/>
175 </choice>
176 </define>
177 <define name="model.featureVal.single_alternation">
178 <choice>
179 <ref name="binary"/>
180 <ref name="symbol"/>
181 <ref name="numeric"/>
182 <ref name="string"/>
183 <ref name="vLabel"/>
184 <ref name="default"/>
185 <ref name="vAlt"/>
186 </choice>
187 </define>
188 <define name="model.featureVal.single_sequence">
189 <ref name="binary"/>
190 <ref name="symbol"/>
191 <ref name="numeric"/>
192 <ref name="string"/>
193 <ref name="vLabel"/>
194 <ref name="default"/>
195 <ref name="vAlt"/>
196 </define>
197 <define name="model.featureVal.single_sequenceOptional">
198 <optional>
199 <ref name="binary"/>
200 </optional>
201 <optional>
202 <ref name="symbol"/>
203 </optional>
204 <optional>
205 <ref name="numeric"/>
206 </optional>
207 <optional>
208 <ref name="string"/>
209 </optional>
210 <optional>
211 <ref name="vLabel"/>
212 </optional>
213 <optional>
214 <ref name="default"/>
215 </optional>
216 <optional>
217 <ref name="vAlt"/>
218 </optional>
219 </define>
220 <define name="model.featureVal.single_sequenceOptionalRepeatable">
221 <zeroOrMore>
222 <ref name="binary"/>
223 </zeroOrMore>
224 <zeroOrMore>
225 <ref name="symbol"/>
226 </zeroOrMore>
227 <zeroOrMore>
228 <ref name="numeric"/>
229 </zeroOrMore>
230 <zeroOrMore>
231 <ref name="string"/>
232 </zeroOrMore>
233 <zeroOrMore>
234 <ref name="vLabel"/>
235 </zeroOrMore>
236 <zeroOrMore>
237 <ref name="default"/>
238 </zeroOrMore>
239 <zeroOrMore>
240 <ref name="vAlt"/>
241 </zeroOrMore>
242 </define>
243 <define name="model.featureVal.single_sequenceRepeatable">
244 <oneOrMore>
245 <ref name="binary"/>
246 </oneOrMore>
247 <oneOrMore>
248 <ref name="symbol"/>
249 </oneOrMore>
250 <oneOrMore>
251 <ref name="numeric"/>
252 </oneOrMore>
253 <oneOrMore>
254 <ref name="string"/>
255 </oneOrMore>
256 <oneOrMore>
257 <ref name="vLabel"/>
258 </oneOrMore>
259 <oneOrMore>
260 <ref name="default"/>
261 </oneOrMore>
262 <oneOrMore>
263 <ref name="vAlt"/>
264 </oneOrMore>
265 </define>
266
267
268
269
270
271
272 <define name="vRange">
273 <element name="vRange">
274 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(value range) defines the range of allowed values for a feature, in the form of
275an fs, vAlt, or primitive value;
276for the value of an f to be valid, it must be
277subsumed by the specified range; if the f
278contains multiple values (as sanctioned by the org attribute),
279then each value must be subsumed by the vRange. [18.11. ]</a:documentation>
280 <ref name="model.featureVal"/>
281 <ref name="att.global.attributes"/>
282 <empty/>
283 </element>
284 </define>
285 <define name="vDefault">
286 <element name="vDefault">
287 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(value default) declares the default value to be supplied when a feature structure
288does not contain an instance of f for this name; if
289unconditional, it is specified as one (or, depending on the value of
290the org attribute of the enclosing fDecl) more
291fs elements or primitive values;
292if conditional, it is specified as
293one or more if elements; if no default is specified, or no
294condition matches, the value none is assumed. [18.11. ]</a:documentation>
295 <choice>
296 <oneOrMore>
297 <ref name="model.featureVal"/>
298 </oneOrMore>
299 <oneOrMore>
300 <ref name="if"/>
301 </oneOrMore>
302 </choice>
303 <ref name="att.global.attributes"/>
304 <empty/>
305 </element>
306 </define>
307 <define name="if">
308 <element name="if">
309 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">defines a conditional default value for a feature; the condition
310is specified as a feature structure, and is met if it
311subsumes the feature structure in the text for which a
312default value is sought. [18.11. ]</a:documentation>
313 <group>
314 <choice>
315 <ref name="fs"/>
316 <ref name="f"/>
317 </choice>
318 <ref name="then"/>
319 <group>
320 <ref name="model.featureVal"/>
321 </group>
322 </group>
323 <ref name="att.global.attributes"/>
324 <empty/>
325 </element>
326 </define>
327 <define name="then">
328 <element name="then">
329 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">separates the condition from the default in an if, or
330the antecedent and the consequent in a cond element. [18.11. ]</a:documentation>
331 <empty/>
332 <ref name="att.global.attributes"/>
333 <empty/>
334 </element>
335 </define>
336 <define name="fsConstraints">
337 <element name="fsConstraints">
338 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(feature-structure constraints) specifies constraints on the content of valid feature
339structures. [18.11. ]</a:documentation>
340 <zeroOrMore>
341 <choice>
342 <ref name="cond"/>
343 <ref name="bicond"/>
344 </choice>
345 </zeroOrMore>
346 <ref name="att.global.attributes"/>
347 <empty/>
348 </element>
349 </define>
350 <define name="cond">
351 <element name="cond">
352 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(conditional feature-structure constraint) defines a conditional feature-structure constraint; the consequent
353and the antecedent are specified as feature structures or
354feature-structure collections; the constraint is satisfied if both the
355antecedent and the consequent subsume a given feature
356structure, or if the antecedent does not. [18.11. ]</a:documentation>
357 <group>
358 <choice>
359 <ref name="fs"/>
360 <ref name="f"/>
361 </choice>
362 <ref name="then"/>
363 <choice>
364 <ref name="fs"/>
365 <ref name="f"/>
366 </choice>
367 </group>
368 <ref name="att.global.attributes"/>
369 <empty/>
370 </element>
371 </define>
372 <define name="bicond">
373 <element name="bicond">
374 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(bi-conditional feature-structure constraint) defines a biconditional feature-structure constraint; both
375consequent and antecedent are specified as feature structures or groups
376of feature structures; the constraint is satisfied if both
377subsume a given feature structure, or if both do not. [18.11. ]</a:documentation>
378 <group>
379 <choice>
380 <ref name="fs"/>
381 <ref name="f"/>
382 </choice>
383 <ref name="iff"/>
384 <choice>
385 <ref name="fs"/>
386 <ref name="f"/>
387 </choice>
388 </group>
389 <ref name="att.global.attributes"/>
390 <empty/>
391 </element>
392 </define>
393 <define name="iff">
394 <element name="iff">
395 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(if and only if) separates the condition from the consequence in a bicond
396element. [18.11. ]</a:documentation>
397 <empty/>
398 <ref name="att.global.attributes"/>
399 <empty/>
400 </element>
401 </define>
402
403
404 <define name="binary">
405 <element name="binary">
406 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(binary value) represents the value part of a feature-value specification which can contain either
407 of exactly two possible values. [18.2. ]</a:documentation>
408 <empty/>
409 <ref name="att.global.attributes"/>
410 <attribute name="value">
411 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">supplies a binary value.</a:documentation>
412 <ref name="data.truthValue"/>
413 </attribute>
414 <empty/>
415 </element>
416 </define>
417 <define name="symbol">
418 <element name="symbol">
419 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(symbolic value) represents the value part of a feature-value specification
420 which contains one of a finite list of symbols. [18.3. ]</a:documentation>
421 <empty/>
422 <ref name="att.global.attributes"/>
423 <attribute name="value">
424 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">supplies the symbolic value for the feature, one of a finite list that
425may be specified in a feature declaration.</a:documentation>
426 <ref name="data.word"/>
427 </attribute>
428 <empty/>
429 </element>
430 </define>
431 <define name="numeric">
432 <element name="numeric">
433 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(numeric value) represents the value part of a feature-value specification
434 which contains a numeric value or range. [18.3. ]</a:documentation>
435 <empty/>
436 <ref name="att.global.attributes"/>
437 <attribute name="value">
438 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">supplies a lower bound for the numeric value represented,
439 and also (if max is not supplied) its upper bound.</a:documentation>
440 <ref name="data.numeric"/>
441 </attribute>
442 <optional>
443 <attribute name="max">
444 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">supplies an upper bound for the numeric value represented.</a:documentation>
445 <ref name="data.numeric"/>
446 </attribute>
447 </optional>
448 <optional>
449 <attribute name="trunc">
450 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">specifies whether the value represented should be
451 truncated to give an integer value.</a:documentation>
452 <ref name="data.truthValue"/>
453 </attribute>
454 </optional>
455 <empty/>
456 </element>
457 </define>
458 <define name="string">
459 <element name="string">
460 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(string value) represents the value part of a feature-value specification
461 which contains a string. [18.3. ]</a:documentation>
462 <text/>
463 <ref name="att.global.attributes"/>
464 <empty/>
465 </element>
466 </define>
467 <define name="vLabel">
468 <element name="vLabel">
469 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(value label) represents the value part of a feature-value specification
470 which appears at more than one point in a feature structure.</a:documentation>
471 <optional>
472 <ref name="model.featureVal"/>
473 </optional>
474 <ref name="att.global.attributes"/>
475 <attribute name="name">
476 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">supplies a name for the sharing point.</a:documentation>
477 <ref name="data.word"/>
478 </attribute>
479 <empty/>
480 </element>
481 </define>
482 <define name="vColl">
483 <element name="vColl">
484 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(collection of values) represents the value part of a feature-value specification
485 which contains multiple values organized as a set, bag, or list.</a:documentation>
486 <group>
487 <zeroOrMore>
488 <choice>
489 <ref name="fs"/>
490 <ref name="model.featureVal.single"/>
491 </choice>
492 </zeroOrMore>
493 </group>
494 <ref name="att.global.attributes"/>
495 <optional>
496 <attribute name="org">
497 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(organization) indicates organization of given value or values as set, bag or list.</a:documentation>
498 <choice>
499 <value>set</value>
500 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates that the given values are organized as a set.
501 </a:documentation>
502 <value>bag</value>
503 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates that the given values are organized as a
504bag (multiset).
505 </a:documentation>
506 <value>list</value>
507 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates that the given values are organized as a
508list.</a:documentation>
509 </choice>
510 </attribute>
511 </optional>
512 <empty/>
513 </element>
514 </define>
515 <define name="default">
516 <element name="default">
517 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(default feature value) represents the value part of a feature-value specification
518 which contains a defaulted value. [18.9. ]</a:documentation>
519 <empty/>
520 <ref name="att.global.attributes"/>
521 <empty/>
522 </element>
523 </define>
524 <define name="vAlt">
525 <element name="vAlt">
526 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(value alternation) represents the value part of a feature-value specification
527 which contains a set of values, only one of which can be valid. [18.8.1. ]</a:documentation>
528 <group>
529 <group>
530 <ref name="model.featureVal"/>
531 </group>
532 <oneOrMore>
533 <ref name="model.featureVal"/>
534 </oneOrMore>
535 </group>
536 <ref name="att.global.attributes"/>
537 <empty/>
538 </element>
539 </define>
540 <define name="vNot">
541 <element name="vNot">
542 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(value negation) represents a feature value which is the negation of its content. [18.8.2. ]</a:documentation>
543 <group>
544 <ref name="model.featureVal"/>
545 </group>
546 <ref name="att.global.attributes"/>
547 <empty/>
548 </element>
549 </define>
550 <define name="vMerge">
551 <element name="vMerge">
552 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(merged collection of values) represents a feature value which is the result of merging
553 together the feature values contained by its children, using the organization
554 specified by the org attribute. [18.8.3. ]</a:documentation>
555 <oneOrMore>
556 <ref name="model.featureVal"/>
557 </oneOrMore>
558 <ref name="att.global.attributes"/>
559 <optional>
560 <attribute name="org">
561 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates the organization of the resulting merged values as set, bag or list.</a:documentation>
562 <choice>
563 <value>set</value>
564 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates that the resulting values are organized as a set.</a:documentation>
565 <value>bag</value>
566 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates that the resulting values are organized as a bag (multiset).
567 </a:documentation>
568 <value>list</value>
569 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">indicates that the resulting values are organized as a list.</a:documentation>
570 </choice>
571 </attribute>
572 </optional>
573 <empty/>
574 </element>
575 </define>
576
577 <define name="fs">
578 <element name="fs">
579 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(feature structure) represents a feature structure, that is, a
580 collection of feature-value pairs organized as a
581 structural unit. [18.2. ]</a:documentation>
582 <zeroOrMore>
583 <ref name="f"/>
584 </zeroOrMore>
585 <ref name="att.global.attributes"/>
586 <optional>
587 <attribute name="type">
588 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">specifies the type of the feature structure.</a:documentation>
589 <ref name="data.enumerated"/>
590 </attribute>
591 </optional>
592 <optional>
593 <attribute name="feats">
594 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(features) references the feature-value specifications making up this feature structure.</a:documentation>
595 <list>
596 <ref name="data.pointer"/>
597 <zeroOrMore>
598 <ref name="data.pointer"/>
599 </zeroOrMore>
600 </list>
601 </attribute>
602 </optional>
603 </element>
604 </define>
605 <define name="f">
606 <element name="f">
607 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(feature) represents a feature value specification, that
608 is, the association of a name with a value of any of several different types. [18.2. ]</a:documentation>
609 <zeroOrMore>
610 <choice>
611 <text/>
612 <ref name="model.featureVal"/>
613 </choice>
614 </zeroOrMore>
615
616 <pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="f-constraint-fValConstraints">
617 <rule xmlns:rng="http://relaxng.org/ns/structure/1.0" context="tei:fVal">
618 <assert test="not(tei:* and text)"> A feature value cannot
619 contain both text and element content</assert>
620 </rule>
621 </pattern>
622 <pattern xmlns="http://purl.oclc.org/dsdl/schematron" id="f-constraint-fValConstraints">
623 <rule xmlns:rng="http://relaxng.org/ns/structure/1.0" context="tei:fVal">
624 <report test="count(tei:*)&gt;1"> A feature value can contain
625 only one child element</report>
626 </rule>
627 </pattern>
628
629 <ref name="att.global.attributes"/>
630 <attribute name="name">
631 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">provides a name for the feature.</a:documentation>
632 <ref name="data.name"/>
633 </attribute>
634 <optional>
635 <attribute name="fVal">
636 <a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">(feature value) references any element which can be used to represent the
637 value of a feature.</a:documentation>
638 <ref name="data.pointer"/>
639 </attribute>
640 </optional>
641 <empty/>
642 </element>
643 </define>
644 <define name="model.featureVal">
645 <choice>
646 <ref name="model.featureVal.complex"/>
647 <ref name="model.featureVal.single"/>
648 </choice>
649 </define>
650</grammar>