relaton-oasis 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1238 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ instantiations of this grammar may replace leaf strings
4
+ with more elaborated types; e.g. title (text) replaced with
5
+ title-main, title-intro, title-part; type replaced with
6
+ enum.
7
+
8
+ some renaming at leaf nodes is permissible
9
+
10
+ obligations can change both from optional to mandatory,
11
+ and from mandatory to optional; optional elements may
12
+ be omitted; freely positioned alternatives may be replaced
13
+ with strict ordering
14
+
15
+ DO NOT introduce a namespace here. We do not want a distinct namespace
16
+ for these elements, and a distinct namespace for any grammar inheriting
17
+ these elements; we just want one namespace for any child grammars
18
+ of this.
19
+ -->
20
+ <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
+ <!--
22
+ https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
23
+ iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
24
+ Somewhat dumbed down for XSD regex:
25
+ -->
26
+ <define name="ISO8601DateTime">
27
+ <data type="string">
28
+ <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+)?)?((:?)[0-5]\d([.,]\d+)?)?([zZ]|([\+\-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?</param>
29
+ </data>
30
+ </define>
31
+ <define name="ISO8601Date">
32
+ <data type="string">
33
+ <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
34
+ </data>
35
+ </define>
36
+ <start>
37
+ <ref name="bibitem"/>
38
+ </start>
39
+ <define name="status">
40
+ <element name="status">
41
+ <ref name="stage"/>
42
+ <optional>
43
+ <ref name="substage"/>
44
+ </optional>
45
+ <optional>
46
+ <ref name="iteration"/>
47
+ </optional>
48
+ </element>
49
+ </define>
50
+ <define name="stage">
51
+ <element name="stage">
52
+ <optional>
53
+ <attribute name="abbreviation"/>
54
+ </optional>
55
+ <text/>
56
+ </element>
57
+ </define>
58
+ <define name="substage">
59
+ <element name="substage">
60
+ <optional>
61
+ <attribute name="abbreviation"/>
62
+ </optional>
63
+ <text/>
64
+ </element>
65
+ </define>
66
+ <define name="iteration">
67
+ <element name="iteration">
68
+ <text/>
69
+ </element>
70
+ </define>
71
+ <define name="language">
72
+ <element name="language">
73
+ <text/>
74
+ </element>
75
+ </define>
76
+ <define name="script">
77
+ <a:documentation>ISO-639</a:documentation>
78
+ <element name="script">
79
+ <text/>
80
+ </element>
81
+ </define>
82
+ <define name="edition">
83
+ <a:documentation>ISO-15924: Latn</a:documentation>
84
+ <element name="edition">
85
+ <optional>
86
+ <attribute name="number"/>
87
+ </optional>
88
+ <text/>
89
+ </element>
90
+ </define>
91
+ <define name="LocalizedString1">
92
+ <optional>
93
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
94
+ <attribute name="language"/>
95
+ </optional>
96
+ <optional>
97
+ <attribute name="script"/>
98
+ </optional>
99
+ <text/>
100
+ </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
111
+ <!--
112
+ Unlike UML, change type to format: type is overloaded
113
+ Would be need if plain were default value and could omit the attribute
114
+ Added LocalizedStringOrXsAny
115
+ -->
116
+ <define name="FormattedString">
117
+ <optional>
118
+ <!-- attribute format { ( "plain" | "html" | "docbook" | "tei" | "asciidoc" | "markdown" ) }?, -->
119
+ <attribute name="format">
120
+ <choice>
121
+ <value>text/plain</value>
122
+ <value>text/html</value>
123
+ <value>application/docbook+xml</value>
124
+ <value>application/tei+xml</value>
125
+ <value>text/x-asciidoc</value>
126
+ <value>text/markdown</value>
127
+ <value>application/x-metanorma+xml</value>
128
+ <text/>
129
+ </choice>
130
+ </attribute>
131
+ </optional>
132
+ <ref name="LocalizedStringOrXsAny"/>
133
+ </define>
134
+ <define name="LocalizedStringOrXsAny1">
135
+ <optional>
136
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
137
+ <attribute name="language"/>
138
+ </optional>
139
+ <optional>
140
+ <attribute name="script"/>
141
+ </optional>
142
+ <oneOrMore>
143
+ <choice>
144
+ <text/>
145
+ <ref name="AnyElement"/>
146
+ </choice>
147
+ </oneOrMore>
148
+ </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
159
+ <define name="contributor">
160
+ <element name="contributor">
161
+ <zeroOrMore>
162
+ <ref name="role"/>
163
+ </zeroOrMore>
164
+ <ref name="ContributorInfo"/>
165
+ </element>
166
+ </define>
167
+ <define name="role">
168
+ <element name="role">
169
+ <optional>
170
+ <attribute name="type">
171
+ <choice>
172
+ <value>author</value>
173
+ <value>performer</value>
174
+ <value>publisher</value>
175
+ <value>editor</value>
176
+ <value>adapter</value>
177
+ <value>translator</value>
178
+ <value>distributor</value>
179
+ </choice>
180
+ </attribute>
181
+ </optional>
182
+ <zeroOrMore>
183
+ <ref name="roledescription"/>
184
+ </zeroOrMore>
185
+ </element>
186
+ </define>
187
+ <define name="ContributorInfo">
188
+ <choice>
189
+ <ref name="person"/>
190
+ <ref name="organization"/>
191
+ </choice>
192
+ </define>
193
+ <define name="roledescription">
194
+ <element name="description">
195
+ <ref name="FormattedString"/>
196
+ </element>
197
+ </define>
198
+ <define name="person">
199
+ <element name="person">
200
+ <optional>
201
+ <ref name="fullname"/>
202
+ </optional>
203
+ <zeroOrMore>
204
+ <ref name="affiliation"/>
205
+ </zeroOrMore>
206
+ <zeroOrMore>
207
+ <ref name="person-identifier"/>
208
+ </zeroOrMore>
209
+ <zeroOrMore>
210
+ <ref name="contact"/>
211
+ </zeroOrMore>
212
+ </element>
213
+ </define>
214
+ <define name="fullname">
215
+ <element name="name">
216
+ <ref name="FullNameType"/>
217
+ </element>
218
+ </define>
219
+ <define name="FullNameType">
220
+ <choice>
221
+ <group>
222
+ <zeroOrMore>
223
+ <ref name="prefix"/>
224
+ </zeroOrMore>
225
+ <zeroOrMore>
226
+ <ref name="forename"/>
227
+ </zeroOrMore>
228
+ <zeroOrMore>
229
+ <ref name="initial"/>
230
+ </zeroOrMore>
231
+ <ref name="surname"/>
232
+ <zeroOrMore>
233
+ <ref name="addition"/>
234
+ </zeroOrMore>
235
+ </group>
236
+ <ref name="completeName"/>
237
+ </choice>
238
+ <zeroOrMore>
239
+ <ref name="biblionote"/>
240
+ </zeroOrMore>
241
+ <zeroOrMore>
242
+ <ref name="variantname"/>
243
+ </zeroOrMore>
244
+ </define>
245
+ <define name="prefix">
246
+ <element name="prefix">
247
+ <ref name="LocalizedString"/>
248
+ </element>
249
+ </define>
250
+ <define name="initial">
251
+ <element name="initial">
252
+ <ref name="LocalizedString"/>
253
+ </element>
254
+ </define>
255
+ <define name="addition">
256
+ <element name="addition">
257
+ <ref name="LocalizedString"/>
258
+ </element>
259
+ </define>
260
+ <define name="surname">
261
+ <element name="surname">
262
+ <ref name="LocalizedString"/>
263
+ </element>
264
+ </define>
265
+ <define name="forename">
266
+ <element name="forename">
267
+ <ref name="LocalizedString"/>
268
+ </element>
269
+ </define>
270
+ <define name="completeName">
271
+ <element name="completename">
272
+ <ref name="LocalizedString"/>
273
+ </element>
274
+ </define>
275
+ <define name="variantname">
276
+ <element name="variant">
277
+ <attribute name="type"/>
278
+ <ref name="FullNameType"/>
279
+ </element>
280
+ </define>
281
+ <define name="affiliation">
282
+ <element name="affiliation">
283
+ <optional>
284
+ <ref name="affiliationname"/>
285
+ </optional>
286
+ <zeroOrMore>
287
+ <ref name="affiliationdescription"/>
288
+ </zeroOrMore>
289
+ <ref name="organization"/>
290
+ </element>
291
+ </define>
292
+ <define name="affiliationname">
293
+ <element name="name">
294
+ <ref name="LocalizedString"/>
295
+ </element>
296
+ </define>
297
+ <define name="affiliationdescription">
298
+ <element name="description">
299
+ <ref name="FormattedString"/>
300
+ </element>
301
+ </define>
302
+ <define name="organization">
303
+ <element name="organization">
304
+ <oneOrMore>
305
+ <ref name="orgname"/>
306
+ </oneOrMore>
307
+ <zeroOrMore>
308
+ <ref name="subdivision"/>
309
+ </zeroOrMore>
310
+ <optional>
311
+ <ref name="abbreviation"/>
312
+ </optional>
313
+ <zeroOrMore>
314
+ <ref name="uri"/>
315
+ </zeroOrMore>
316
+ <zeroOrMore>
317
+ <ref name="org-identifier"/>
318
+ </zeroOrMore>
319
+ <zeroOrMore>
320
+ <ref name="contact"/>
321
+ </zeroOrMore>
322
+ </element>
323
+ </define>
324
+ <define name="orgname">
325
+ <element name="name">
326
+ <choice>
327
+ <ref name="LocalizedString"/>
328
+ <ref name="NameWithVariants"/>
329
+ </choice>
330
+ </element>
331
+ </define>
332
+ <define name="subdivision">
333
+ <element name="subdivision">
334
+ <choice>
335
+ <ref name="LocalizedString"/>
336
+ <ref name="NameWithVariants"/>
337
+ </choice>
338
+ </element>
339
+ </define>
340
+ <define name="NameWithVariants">
341
+ <element name="primary">
342
+ <ref name="LocalizedString"/>
343
+ </element>
344
+ <zeroOrMore>
345
+ <element name="variant">
346
+ <ref name="NameWithVariants1"/>
347
+ </element>
348
+ </zeroOrMore>
349
+ </define>
350
+ <define name="NameWithVariants1">
351
+ <attribute name="type"/>
352
+ <element name="primary">
353
+ <ref name="LocalizedString"/>
354
+ </element>
355
+ <zeroOrMore>
356
+ <element name="variant">
357
+ <ref name="NameWithVariants1"/>
358
+ </element>
359
+ </zeroOrMore>
360
+ </define>
361
+ <define name="abbreviation">
362
+ <element name="abbreviation">
363
+ <ref name="LocalizedString"/>
364
+ </element>
365
+ </define>
366
+ <define name="uri">
367
+ <element name="uri">
368
+ <optional>
369
+ <attribute name="type"/>
370
+ </optional>
371
+ <data type="anyURI"/>
372
+ </element>
373
+ </define>
374
+ <!-- TODO may change -->
375
+ <define name="contact">
376
+ <choice>
377
+ <ref name="address"/>
378
+ <ref name="phone"/>
379
+ <ref name="email"/>
380
+ <ref name="uri"/>
381
+ </choice>
382
+ </define>
383
+ <define name="phone">
384
+ <element name="phone">
385
+ <optional>
386
+ <attribute name="type"/>
387
+ </optional>
388
+ <text/>
389
+ </element>
390
+ </define>
391
+ <define name="email">
392
+ <element name="email">
393
+ <text/>
394
+ </element>
395
+ </define>
396
+ <define name="address">
397
+ <element name="address">
398
+ <choice>
399
+ <!-- iso191606 TODO -->
400
+ <group>
401
+ <zeroOrMore>
402
+ <ref name="street"/>
403
+ </zeroOrMore>
404
+ <ref name="city"/>
405
+ <optional>
406
+ <ref name="state"/>
407
+ </optional>
408
+ <ref name="country"/>
409
+ <optional>
410
+ <ref name="postcode"/>
411
+ </optional>
412
+ </group>
413
+ <ref name="formattedAddress"/>
414
+ </choice>
415
+ </element>
416
+ </define>
417
+ <define name="street">
418
+ <element name="street">
419
+ <text/>
420
+ </element>
421
+ </define>
422
+ <define name="city">
423
+ <element name="city">
424
+ <text/>
425
+ </element>
426
+ </define>
427
+ <define name="state">
428
+ <element name="state">
429
+ <text/>
430
+ </element>
431
+ </define>
432
+ <define name="country">
433
+ <element name="country">
434
+ <text/>
435
+ </element>
436
+ </define>
437
+ <define name="postcode">
438
+ <element name="postcode">
439
+ <text/>
440
+ </element>
441
+ </define>
442
+ <define name="formattedAddress">
443
+ <element name="formattedAddress">
444
+ <text/>
445
+ </element>
446
+ </define>
447
+ <define name="person-identifier">
448
+ <element name="identifier">
449
+ <attribute name="type">
450
+ <choice>
451
+ <value>isni</value>
452
+ <value>orcid</value>
453
+ <value>uri</value>
454
+ </choice>
455
+ </attribute>
456
+ <text/>
457
+ </element>
458
+ </define>
459
+ <define name="org-identifier">
460
+ <element name="identifier">
461
+ <attribute name="type">
462
+ <data type="string" datatypeLibrary=""/>
463
+ </attribute>
464
+ <text/>
465
+ </element>
466
+ </define>
467
+ <define name="citation">
468
+ <element name="citation">
469
+ <ref name="CitationType"/>
470
+ </element>
471
+ </define>
472
+ <define name="CitationType">
473
+ <attribute name="bibitemid">
474
+ <data type="IDREF"/>
475
+ </attribute>
476
+ <choice>
477
+ <zeroOrMore>
478
+ <ref name="locality"/>
479
+ </zeroOrMore>
480
+ <zeroOrMore>
481
+ <ref name="localityStack"/>
482
+ </zeroOrMore>
483
+ </choice>
484
+ <optional>
485
+ <ref name="date"/>
486
+ </optional>
487
+ </define>
488
+ <define name="date">
489
+ <element name="date">
490
+ <ref name="ISO8601Date"/>
491
+ </element>
492
+ </define>
493
+ <define name="locality">
494
+ <element name="locality">
495
+ <ref name="BibItemLocality"/>
496
+ </element>
497
+ </define>
498
+ <define name="localityStack">
499
+ <element name="localityStack">
500
+ <zeroOrMore>
501
+ <ref name="locality"/>
502
+ </zeroOrMore>
503
+ </element>
504
+ </define>
505
+ <define name="sourceLocality">
506
+ <element name="sourceLocality">
507
+ <ref name="BibItemLocality"/>
508
+ </element>
509
+ </define>
510
+ <define name="sourceLocalityStack">
511
+ <element name="sourceLocalityStack">
512
+ <zeroOrMore>
513
+ <ref name="sourceLocality"/>
514
+ </zeroOrMore>
515
+ </element>
516
+ </define>
517
+ <define name="BibItemLocality">
518
+ <attribute name="type">
519
+ <ref name="LocalityType"/>
520
+ </attribute>
521
+ <optional>
522
+ <ref name="referenceFrom"/>
523
+ </optional>
524
+ <optional>
525
+ <ref name="referenceTo"/>
526
+ </optional>
527
+ </define>
528
+ <define name="LocalityType">
529
+ <data type="string">
530
+ <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
531
+ </data>
532
+ </define>
533
+ <define name="referenceFrom">
534
+ <element name="referenceFrom">
535
+ <text/>
536
+ </element>
537
+ </define>
538
+ <define name="referenceTo">
539
+ <element name="referenceTo">
540
+ <text/>
541
+ </element>
542
+ </define>
543
+ <!-- unlike UML, has id attribute; that results from including bibitem in a docmodel -->
544
+ <define name="bibitem">
545
+ <element name="bibitem">
546
+ <attribute name="id">
547
+ <data type="ID"/>
548
+ </attribute>
549
+ <ref name="BibliographicItem"/>
550
+ </element>
551
+ </define>
552
+ <define name="bibitem_no_id">
553
+ <element name="bibitem">
554
+ <ref name="BibliographicItem"/>
555
+ </element>
556
+ </define>
557
+ <define name="relaton_collection">
558
+ <element name="relaton-collection">
559
+ <optional>
560
+ <attribute name="type"/>
561
+ </optional>
562
+ <ref name="btitle"/>
563
+ <zeroOrMore>
564
+ <ref name="contributor"/>
565
+ </zeroOrMore>
566
+ <zeroOrMore>
567
+ <ref name="docrelation"/>
568
+ </zeroOrMore>
569
+ </element>
570
+ </define>
571
+ <define name="BibItemType" combine="choice">
572
+ <choice>
573
+ <value>article</value>
574
+ <value>book</value>
575
+ <value>booklet</value>
576
+ <value>manual</value>
577
+ <value>proceedings</value>
578
+ <value>presentation</value>
579
+ <value>thesis</value>
580
+ <value>techreport</value>
581
+ <value>standard</value>
582
+ <value>unpublished</value>
583
+ <value>map</value>
584
+ <value>electronic resource</value>
585
+ <value>audiovisual</value>
586
+ <value>film</value>
587
+ <value>video</value>
588
+ <value>broadcast</value>
589
+ <value>software</value>
590
+ <value>graphic_work</value>
591
+ <value>music</value>
592
+ <value>patent</value>
593
+ <value>inbook</value>
594
+ <value>incollection</value>
595
+ <value>inproceedings</value>
596
+ <value>journal</value>
597
+ <value>website</value>
598
+ <value>webresource</value>
599
+ <value>dataset</value>
600
+ <value>archival</value>
601
+ <value>social_media</value>
602
+ <value>alert</value>
603
+ <value>message</value>
604
+ <value>conversation</value>
605
+ <value>misc</value>
606
+ </choice>
607
+ </define>
608
+ <define name="BibliographicItem">
609
+ <optional>
610
+ <attribute name="type">
611
+ <ref name="BibItemType"/>
612
+ </attribute>
613
+ </optional>
614
+ <optional>
615
+ <ref name="fetched"/>
616
+ </optional>
617
+ <choice>
618
+ <oneOrMore>
619
+ <ref name="btitle"/>
620
+ </oneOrMore>
621
+ <ref name="formattedref"/>
622
+ </choice>
623
+ <zeroOrMore>
624
+ <ref name="bsource"/>
625
+ </zeroOrMore>
626
+ <zeroOrMore>
627
+ <ref name="docidentifier"/>
628
+ </zeroOrMore>
629
+ <optional>
630
+ <ref name="docnumber"/>
631
+ </optional>
632
+ <zeroOrMore>
633
+ <ref name="bdate"/>
634
+ </zeroOrMore>
635
+ <zeroOrMore>
636
+ <ref name="contributor"/>
637
+ </zeroOrMore>
638
+ <optional>
639
+ <ref name="edition"/>
640
+ </optional>
641
+ <optional>
642
+ <ref name="version"/>
643
+ </optional>
644
+ <zeroOrMore>
645
+ <ref name="biblionote"/>
646
+ </zeroOrMore>
647
+ <zeroOrMore>
648
+ <ref name="language"/>
649
+ </zeroOrMore>
650
+ <zeroOrMore>
651
+ <ref name="script"/>
652
+ </zeroOrMore>
653
+ <zeroOrMore>
654
+ <ref name="bibabstract"/>
655
+ </zeroOrMore>
656
+ <optional>
657
+ <ref name="status"/>
658
+ </optional>
659
+ <zeroOrMore>
660
+ <ref name="copyright"/>
661
+ </zeroOrMore>
662
+ <zeroOrMore>
663
+ <ref name="docrelation"/>
664
+ </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="series"/>
667
+ </zeroOrMore>
668
+ <optional>
669
+ <ref name="medium"/>
670
+ </optional>
671
+ <zeroOrMore>
672
+ <ref name="bplace"/>
673
+ </zeroOrMore>
674
+ <zeroOrMore>
675
+ <ref name="bprice"/>
676
+ </zeroOrMore>
677
+ <zeroOrMore>
678
+ <ref name="extent"/>
679
+ </zeroOrMore>
680
+ <zeroOrMore>
681
+ <ref name="accesslocation"/>
682
+ </zeroOrMore>
683
+ <zeroOrMore>
684
+ <ref name="license"/>
685
+ </zeroOrMore>
686
+ <zeroOrMore>
687
+ <ref name="bclassification"/>
688
+ </zeroOrMore>
689
+ <zeroOrMore>
690
+ <ref name="bkeyword"/>
691
+ </zeroOrMore>
692
+ <optional>
693
+ <ref name="validity"/>
694
+ </optional>
695
+ </define>
696
+ <define name="btitle">
697
+ <element name="title">
698
+ <ref name="TypedTitleString"/>
699
+ </element>
700
+ </define>
701
+ <define name="bsource">
702
+ <element name="uri">
703
+ <ref name="TypedUri"/>
704
+ </element>
705
+ </define>
706
+ <define name="formattedref">
707
+ <element name="formattedref">
708
+ <ref name="FormattedString"/>
709
+ </element>
710
+ </define>
711
+ <define name="license">
712
+ <element name="license">
713
+ <text/>
714
+ </element>
715
+ </define>
716
+ <define name="fetched">
717
+ <element name="fetched">
718
+ <ref name="ISO8601DateTime"/>
719
+ </element>
720
+ </define>
721
+ <define name="validity">
722
+ <element name="validity">
723
+ <optional>
724
+ <ref name="validityBegins"/>
725
+ </optional>
726
+ <optional>
727
+ <ref name="validityEnds"/>
728
+ </optional>
729
+ <optional>
730
+ <ref name="validityRevision"/>
731
+ </optional>
732
+ </element>
733
+ </define>
734
+ <define name="validityBegins">
735
+ <element name="validityBegins">
736
+ <ref name="ISO8601DateTime"/>
737
+ </element>
738
+ </define>
739
+ <define name="validityEnds">
740
+ <element name="validityEnds">
741
+ <ref name="ISO8601DateTime"/>
742
+ </element>
743
+ </define>
744
+ <define name="validityRevision">
745
+ <element name="revision">
746
+ <ref name="ISO8601DateTime"/>
747
+ </element>
748
+ </define>
749
+ <define name="TypedTitleString">
750
+ <optional>
751
+ <attribute name="type"/>
752
+ </optional>
753
+ <ref name="FormattedString"/>
754
+ </define>
755
+ <!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
756
+ <define name="TypedUri">
757
+ <optional>
758
+ <attribute name="type"/>
759
+ </optional>
760
+ <data type="anyURI"/>
761
+ </define>
762
+ <define name="DateType">
763
+ <optional>
764
+ <attribute name="text"/>
765
+ </optional>
766
+ <optional>
767
+ <ref name="ISO8601Date"/>
768
+ </optional>
769
+ </define>
770
+ <define name="BibliographicDateType">
771
+ <choice>
772
+ <value>published</value>
773
+ <value>accessed</value>
774
+ <value>created</value>
775
+ <value>implemented</value>
776
+ <value>obsoleted</value>
777
+ <value>confirmed</value>
778
+ <value>updated</value>
779
+ <value>issued</value>
780
+ <value>transmitted</value>
781
+ <value>copied</value>
782
+ <value>unchanged</value>
783
+ <value>circulated</value>
784
+ <value>adapted</value>
785
+ <value>vote-started</value>
786
+ <value>vote-ended</value>
787
+ <value>announced</value>
788
+ </choice>
789
+ </define>
790
+ <define name="bdate">
791
+ <element name="date">
792
+ <attribute name="type">
793
+ <choice>
794
+ <ref name="BibliographicDateType"/>
795
+ <text/>
796
+ </choice>
797
+ </attribute>
798
+ <optional>
799
+ <attribute name="text"/>
800
+ </optional>
801
+ <optional>
802
+ <choice>
803
+ <group>
804
+ <element name="from">
805
+ <ref name="ISO8601Date"/>
806
+ </element>
807
+ <optional>
808
+ <element name="to">
809
+ <ref name="ISO8601Date"/>
810
+ </element>
811
+ </optional>
812
+ </group>
813
+ <element name="on">
814
+ <ref name="ISO8601Date"/>
815
+ </element>
816
+ </choice>
817
+ </optional>
818
+ </element>
819
+ </define>
820
+ <define name="docidentifier">
821
+ <element name="docidentifier">
822
+ <optional>
823
+ <attribute name="type"/>
824
+ </optional>
825
+ <optional>
826
+ <attribute name="scope"/>
827
+ </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
833
+ <text/>
834
+ </element>
835
+ </define>
836
+ <define name="docnumber">
837
+ <element name="docnumber">
838
+ <text/>
839
+ </element>
840
+ </define>
841
+ <define name="bclassification">
842
+ <element name="classification">
843
+ <optional>
844
+ <attribute name="type"/>
845
+ </optional>
846
+ <text/>
847
+ </element>
848
+ </define>
849
+ <define name="bplace">
850
+ <element name="place">
851
+ <optional>
852
+ <attribute name="uri">
853
+ <data type="anyURI"/>
854
+ </attribute>
855
+ </optional>
856
+ <optional>
857
+ <attribute name="region"/>
858
+ </optional>
859
+ <text/>
860
+ </element>
861
+ </define>
862
+ <define name="bprice">
863
+ <element name="price">
864
+ <attribute name="currency"/>
865
+ <text/>
866
+ </element>
867
+ </define>
868
+ <define name="medium">
869
+ <element name="medium">
870
+ <optional>
871
+ <ref name="bcontent"/>
872
+ </optional>
873
+ <optional>
874
+ <ref name="genre"/>
875
+ </optional>
876
+ <optional>
877
+ <ref name="form"/>
878
+ </optional>
879
+ <optional>
880
+ <ref name="carrier"/>
881
+ </optional>
882
+ <optional>
883
+ <ref name="size"/>
884
+ </optional>
885
+ <optional>
886
+ <ref name="scale"/>
887
+ </optional>
888
+ </element>
889
+ </define>
890
+ <define name="bcontent">
891
+ <element name="content">
892
+ <text/>
893
+ </element>
894
+ </define>
895
+ <define name="genre">
896
+ <element name="genre">
897
+ <text/>
898
+ </element>
899
+ </define>
900
+ <define name="form">
901
+ <element name="form">
902
+ <text/>
903
+ </element>
904
+ </define>
905
+ <define name="carrier">
906
+ <element name="carrier">
907
+ <text/>
908
+ </element>
909
+ </define>
910
+ <define name="size">
911
+ <element name="size">
912
+ <text/>
913
+ </element>
914
+ </define>
915
+ <define name="scale">
916
+ <element name="scale">
917
+ <text/>
918
+ </element>
919
+ </define>
920
+ <define name="accesslocation">
921
+ <element name="accesslocation">
922
+ <text/>
923
+ </element>
924
+ </define>
925
+ <define name="extent">
926
+ <element name="extent">
927
+ <ref name="BibItemLocality"/>
928
+ </element>
929
+ </define>
930
+ <define name="series">
931
+ <element name="series">
932
+ <optional>
933
+ <attribute name="type">
934
+ <ref name="SeriesType"/>
935
+ </attribute>
936
+ </optional>
937
+ <choice>
938
+ <ref name="formattedref"/>
939
+ <group>
940
+ <ref name="btitle"/>
941
+ <optional>
942
+ <ref name="bplace"/>
943
+ </optional>
944
+ <optional>
945
+ <ref name="seriesorganization"/>
946
+ </optional>
947
+ <optional>
948
+ <ref name="abbreviation"/>
949
+ </optional>
950
+ <optional>
951
+ <ref name="seriesfrom"/>
952
+ </optional>
953
+ <optional>
954
+ <ref name="seriesto"/>
955
+ </optional>
956
+ <optional>
957
+ <ref name="seriesnumber"/>
958
+ </optional>
959
+ <optional>
960
+ <ref name="seriespartnumber"/>
961
+ </optional>
962
+ <optional>
963
+ <ref name="seriesrun"/>
964
+ </optional>
965
+ </group>
966
+ </choice>
967
+ </element>
968
+ </define>
969
+ <define name="SeriesType">
970
+ <choice>
971
+ <value>main</value>
972
+ <value>alt</value>
973
+ <text/>
974
+ </choice>
975
+ </define>
976
+ <define name="seriesorganization">
977
+ <element name="organization">
978
+ <text/>
979
+ </element>
980
+ </define>
981
+ <define name="seriesfrom">
982
+ <element name="from">
983
+ <ref name="ISO8601Date"/>
984
+ </element>
985
+ </define>
986
+ <define name="seriesto">
987
+ <element name="to">
988
+ <ref name="ISO8601Date"/>
989
+ </element>
990
+ </define>
991
+ <define name="seriesnumber">
992
+ <element name="number">
993
+ <text/>
994
+ </element>
995
+ </define>
996
+ <define name="seriespartnumber">
997
+ <element name="partnumber">
998
+ <text/>
999
+ </element>
1000
+ </define>
1001
+ <define name="seriesrun">
1002
+ <element name="run">
1003
+ <text/>
1004
+ </element>
1005
+ </define>
1006
+ <define name="biblionote">
1007
+ <element name="note">
1008
+ <optional>
1009
+ <attribute name="type"/>
1010
+ </optional>
1011
+ <ref name="FormattedString"/>
1012
+ </element>
1013
+ </define>
1014
+ <define name="bibabstract">
1015
+ <element name="abstract">
1016
+ <ref name="FormattedString"/>
1017
+ </element>
1018
+ </define>
1019
+ <define name="copyright">
1020
+ <element name="copyright">
1021
+ <ref name="from"/>
1022
+ <optional>
1023
+ <ref name="to"/>
1024
+ </optional>
1025
+ <oneOrMore>
1026
+ <ref name="owner"/>
1027
+ </oneOrMore>
1028
+ <optional>
1029
+ <ref name="copyright_scope"/>
1030
+ </optional>
1031
+ </element>
1032
+ </define>
1033
+ <define name="copyright_scope">
1034
+ <element name="scope">
1035
+ <text/>
1036
+ </element>
1037
+ </define>
1038
+ <define name="from">
1039
+ <element name="from">
1040
+ <data type="gYear"/>
1041
+ </element>
1042
+ </define>
1043
+ <define name="to">
1044
+ <element name="to">
1045
+ <data type="gYear"/>
1046
+ </element>
1047
+ </define>
1048
+ <define name="owner">
1049
+ <element name="owner">
1050
+ <ref name="ContributorInfo"/>
1051
+ </element>
1052
+ </define>
1053
+ <define name="DocRelationType">
1054
+ <choice>
1055
+ <value>includes</value>
1056
+ <value>includedIn</value>
1057
+ <value>hasPart</value>
1058
+ <value>partOf</value>
1059
+ <value>merges</value>
1060
+ <value>mergedInto</value>
1061
+ <value>splits</value>
1062
+ <value>splitInto</value>
1063
+ <value>instance</value>
1064
+ <value>hasInstance</value>
1065
+ <value>exemplarOf</value>
1066
+ <value>hasExemplar</value>
1067
+ <value>manifestationOf</value>
1068
+ <value>hasManifestation</value>
1069
+ <value>reproductionOf</value>
1070
+ <value>hasReproduction</value>
1071
+ <value>reprintOf</value>
1072
+ <value>hasReprint</value>
1073
+ <value>expressionOf</value>
1074
+ <value>hasExpression</value>
1075
+ <value>translatedFrom</value>
1076
+ <value>hasTranslation</value>
1077
+ <value>arrangementOf</value>
1078
+ <value>hasArrangement</value>
1079
+ <value>abridgementOf</value>
1080
+ <value>hasAbridgement</value>
1081
+ <value>annotationOf</value>
1082
+ <value>hasAnnotation</value>
1083
+ <value>draftOf</value>
1084
+ <value>hasDraft</value>
1085
+ <value>editionOf</value>
1086
+ <value>hasEdition</value>
1087
+ <value>updates</value>
1088
+ <value>updatedBy</value>
1089
+ <value>derivedFrom</value>
1090
+ <value>derives</value>
1091
+ <value>describes</value>
1092
+ <value>describedBy</value>
1093
+ <value>catalogues</value>
1094
+ <value>cataloguedBy</value>
1095
+ <value>hasSuccessor</value>
1096
+ <value>successorOf</value>
1097
+ <value>adaptedFrom</value>
1098
+ <value>hasAdaptation</value>
1099
+ <value>adoptedFrom</value>
1100
+ <value>adoptedAs</value>
1101
+ <value>reviewOf</value>
1102
+ <value>hasReview</value>
1103
+ <value>commentaryOf</value>
1104
+ <value>hasCommentary</value>
1105
+ <value>related</value>
1106
+ <value>complements</value>
1107
+ <value>complementOf</value>
1108
+ <value>obsoletes</value>
1109
+ <value>obsoletedBy</value>
1110
+ <value>cites</value>
1111
+ <value>isCitedIn</value>
1112
+ </choice>
1113
+ </define>
1114
+ <define name="docrelation">
1115
+ <element name="relation">
1116
+ <attribute name="type">
1117
+ <ref name="DocRelationType"/>
1118
+ </attribute>
1119
+ <optional>
1120
+ <element name="description">
1121
+ <ref name="FormattedString"/>
1122
+ </element>
1123
+ </optional>
1124
+ <element name="bibitem">
1125
+ <ref name="BibliographicItem"/>
1126
+ </element>
1127
+ <choice>
1128
+ <zeroOrMore>
1129
+ <ref name="locality"/>
1130
+ </zeroOrMore>
1131
+ <zeroOrMore>
1132
+ <ref name="localityStack"/>
1133
+ </zeroOrMore>
1134
+ </choice>
1135
+ <choice>
1136
+ <zeroOrMore>
1137
+ <ref name="sourceLocality"/>
1138
+ </zeroOrMore>
1139
+ <zeroOrMore>
1140
+ <ref name="sourceLocalityStack"/>
1141
+ </zeroOrMore>
1142
+ </choice>
1143
+ </element>
1144
+ </define>
1145
+ <define name="version">
1146
+ <element name="version">
1147
+ <optional>
1148
+ <ref name="revision-date"/>
1149
+ </optional>
1150
+ <zeroOrMore>
1151
+ <ref name="draft"/>
1152
+ </zeroOrMore>
1153
+ </element>
1154
+ </define>
1155
+ <define name="vedition">
1156
+ <element name="edition">
1157
+ <data type="int"/>
1158
+ </element>
1159
+ </define>
1160
+ <define name="revision-date">
1161
+ <element name="revision-date">
1162
+ <ref name="ISO8601Date"/>
1163
+ </element>
1164
+ </define>
1165
+ <define name="draft">
1166
+ <element name="draft">
1167
+ <text/>
1168
+ </element>
1169
+ </define>
1170
+ <define name="bkeyword">
1171
+ <element name="keyword">
1172
+ <choice>
1173
+ <ref name="LocalizedString"/>
1174
+ <group>
1175
+ <element name="vocab">
1176
+ <ref name="LocalizedString"/>
1177
+ </element>
1178
+ <oneOrMore>
1179
+ <ref name="vocabid"/>
1180
+ </oneOrMore>
1181
+ </group>
1182
+ <group>
1183
+ <oneOrMore>
1184
+ <element name="taxon">
1185
+ <ref name="LocalizedString"/>
1186
+ </element>
1187
+ </oneOrMore>
1188
+ <oneOrMore>
1189
+ <ref name="vocabid"/>
1190
+ </oneOrMore>
1191
+ </group>
1192
+ </choice>
1193
+ </element>
1194
+ </define>
1195
+ <define name="vocabid">
1196
+ <element name="vocabid">
1197
+ <attribute name="type"/>
1198
+ <optional>
1199
+ <attribute name="uri">
1200
+ <data type="anyURI"/>
1201
+ </attribute>
1202
+ </optional>
1203
+ <optional>
1204
+ <element name="code">
1205
+ <text/>
1206
+ </element>
1207
+ </optional>
1208
+ <optional>
1209
+ <element name="term">
1210
+ <text/>
1211
+ </element>
1212
+ </optional>
1213
+ </element>
1214
+ </define>
1215
+ <!--
1216
+ Anycontents = mixed {
1217
+ https://github.com/relaxng/jing-trang/issues/211
1218
+ https://lists.oasis-open.org/archives/office/200808/msg00024.html
1219
+ https://lists.oasis-open.org/archives/office/200808/msg00099.html
1220
+ For this to work, we will actually strip any attributes in the Anycontents before
1221
+ passing it for validation. Horrible I know, but there are no good alternatives
1222
+ that also allow us to do grammar inheritance
1223
+ (attribute * { text } | Any)*
1224
+ Any*
1225
+ }
1226
+ -->
1227
+ <define name="AnyElement">
1228
+ <element>
1229
+ <anyName/>
1230
+ <oneOrMore>
1231
+ <choice>
1232
+ <text/>
1233
+ <ref name="AnyElement"/>
1234
+ </choice>
1235
+ </oneOrMore>
1236
+ </element>
1237
+ </define>
1238
+ </grammar>