relaton-etsi 1.17.0

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