relaton-cen 1.8.pre1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1235 @@
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
+ <zeroOrMore>
213
+ <ref name="uri"/>
214
+ </zeroOrMore>
215
+ </element>
216
+ </define>
217
+ <define name="fullname">
218
+ <element name="name">
219
+ <ref name="FullNameType"/>
220
+ </element>
221
+ </define>
222
+ <define name="FullNameType">
223
+ <choice>
224
+ <group>
225
+ <zeroOrMore>
226
+ <ref name="prefix"/>
227
+ </zeroOrMore>
228
+ <zeroOrMore>
229
+ <ref name="forename"/>
230
+ </zeroOrMore>
231
+ <zeroOrMore>
232
+ <ref name="initial"/>
233
+ </zeroOrMore>
234
+ <ref name="surname"/>
235
+ <zeroOrMore>
236
+ <ref name="addition"/>
237
+ </zeroOrMore>
238
+ </group>
239
+ <ref name="completeName"/>
240
+ </choice>
241
+ <zeroOrMore>
242
+ <ref name="biblionote"/>
243
+ </zeroOrMore>
244
+ <zeroOrMore>
245
+ <ref name="variantname"/>
246
+ </zeroOrMore>
247
+ </define>
248
+ <define name="prefix">
249
+ <element name="prefix">
250
+ <ref name="LocalizedString"/>
251
+ </element>
252
+ </define>
253
+ <define name="initial">
254
+ <element name="initial">
255
+ <ref name="LocalizedString"/>
256
+ </element>
257
+ </define>
258
+ <define name="addition">
259
+ <element name="addition">
260
+ <ref name="LocalizedString"/>
261
+ </element>
262
+ </define>
263
+ <define name="surname">
264
+ <element name="surname">
265
+ <ref name="LocalizedString"/>
266
+ </element>
267
+ </define>
268
+ <define name="forename">
269
+ <element name="forename">
270
+ <ref name="LocalizedString"/>
271
+ </element>
272
+ </define>
273
+ <define name="completeName">
274
+ <element name="completename">
275
+ <ref name="LocalizedString"/>
276
+ </element>
277
+ </define>
278
+ <define name="variantname">
279
+ <element name="variant">
280
+ <attribute name="type"/>
281
+ <ref name="FullNameType"/>
282
+ </element>
283
+ </define>
284
+ <define name="affiliation">
285
+ <element name="affiliation">
286
+ <optional>
287
+ <ref name="affiliationname"/>
288
+ </optional>
289
+ <zeroOrMore>
290
+ <ref name="affiliationdescription"/>
291
+ </zeroOrMore>
292
+ <ref name="organization"/>
293
+ </element>
294
+ </define>
295
+ <define name="affiliationname">
296
+ <element name="name">
297
+ <ref name="LocalizedString"/>
298
+ </element>
299
+ </define>
300
+ <define name="affiliationdescription">
301
+ <element name="description">
302
+ <ref name="FormattedString"/>
303
+ </element>
304
+ </define>
305
+ <define name="organization">
306
+ <element name="organization">
307
+ <oneOrMore>
308
+ <ref name="orgname"/>
309
+ </oneOrMore>
310
+ <zeroOrMore>
311
+ <ref name="subdivision"/>
312
+ </zeroOrMore>
313
+ <optional>
314
+ <ref name="abbreviation"/>
315
+ </optional>
316
+ <zeroOrMore>
317
+ <ref name="uri"/>
318
+ </zeroOrMore>
319
+ <zeroOrMore>
320
+ <ref name="org-identifier"/>
321
+ </zeroOrMore>
322
+ <zeroOrMore>
323
+ <ref name="contact"/>
324
+ </zeroOrMore>
325
+ </element>
326
+ </define>
327
+ <define name="orgname">
328
+ <element name="name">
329
+ <choice>
330
+ <ref name="LocalizedString"/>
331
+ <ref name="NameWithVariants"/>
332
+ </choice>
333
+ </element>
334
+ </define>
335
+ <define name="subdivision">
336
+ <element name="subdivision">
337
+ <choice>
338
+ <ref name="LocalizedString"/>
339
+ <ref name="NameWithVariants"/>
340
+ </choice>
341
+ </element>
342
+ </define>
343
+ <define name="NameWithVariants">
344
+ <element name="primary">
345
+ <ref name="LocalizedString"/>
346
+ </element>
347
+ <zeroOrMore>
348
+ <element name="variant">
349
+ <ref name="NameWithVariants1"/>
350
+ </element>
351
+ </zeroOrMore>
352
+ </define>
353
+ <define name="NameWithVariants1">
354
+ <attribute name="type"/>
355
+ <element name="primary">
356
+ <ref name="LocalizedString"/>
357
+ </element>
358
+ <zeroOrMore>
359
+ <element name="variant">
360
+ <ref name="NameWithVariants1"/>
361
+ </element>
362
+ </zeroOrMore>
363
+ </define>
364
+ <define name="abbreviation">
365
+ <element name="abbreviation">
366
+ <ref name="LocalizedString"/>
367
+ </element>
368
+ </define>
369
+ <define name="uri">
370
+ <element name="uri">
371
+ <optional>
372
+ <attribute name="type"/>
373
+ </optional>
374
+ <data type="anyURI"/>
375
+ </element>
376
+ </define>
377
+ <!-- TODO may change -->
378
+ <define name="contact">
379
+ <choice>
380
+ <ref name="address"/>
381
+ <ref name="phone"/>
382
+ <ref name="email"/>
383
+ <ref name="uri"/>
384
+ </choice>
385
+ </define>
386
+ <define name="phone">
387
+ <element name="phone">
388
+ <optional>
389
+ <attribute name="type"/>
390
+ </optional>
391
+ <text/>
392
+ </element>
393
+ </define>
394
+ <define name="email">
395
+ <element name="email">
396
+ <text/>
397
+ </element>
398
+ </define>
399
+ <define name="address">
400
+ <element name="address">
401
+ <choice>
402
+ <!-- iso191606 TODO -->
403
+ <group>
404
+ <oneOrMore>
405
+ <ref name="street"/>
406
+ </oneOrMore>
407
+ <ref name="city"/>
408
+ <optional>
409
+ <ref name="state"/>
410
+ </optional>
411
+ <ref name="country"/>
412
+ <optional>
413
+ <ref name="postcode"/>
414
+ </optional>
415
+ </group>
416
+ <ref name="formattedAddress"/>
417
+ </choice>
418
+ </element>
419
+ </define>
420
+ <define name="street">
421
+ <element name="street">
422
+ <text/>
423
+ </element>
424
+ </define>
425
+ <define name="city">
426
+ <element name="city">
427
+ <text/>
428
+ </element>
429
+ </define>
430
+ <define name="state">
431
+ <element name="state">
432
+ <text/>
433
+ </element>
434
+ </define>
435
+ <define name="country">
436
+ <element name="country">
437
+ <text/>
438
+ </element>
439
+ </define>
440
+ <define name="postcode">
441
+ <element name="postcode">
442
+ <text/>
443
+ </element>
444
+ </define>
445
+ <define name="formattedAddress">
446
+ <element name="formattedAddress">
447
+ <text/>
448
+ </element>
449
+ </define>
450
+ <define name="person-identifier">
451
+ <element name="identifier">
452
+ <attribute name="type">
453
+ <choice>
454
+ <value>isni</value>
455
+ <value>orcid</value>
456
+ <value>uri</value>
457
+ </choice>
458
+ </attribute>
459
+ <text/>
460
+ </element>
461
+ </define>
462
+ <define name="org-identifier">
463
+ <element name="identifier">
464
+ <attribute name="type">
465
+ <data type="string" datatypeLibrary=""/>
466
+ </attribute>
467
+ <text/>
468
+ </element>
469
+ </define>
470
+ <define name="citation">
471
+ <element name="citation">
472
+ <ref name="CitationType"/>
473
+ </element>
474
+ </define>
475
+ <define name="CitationType">
476
+ <attribute name="bibitemid">
477
+ <data type="IDREF"/>
478
+ </attribute>
479
+ <choice>
480
+ <zeroOrMore>
481
+ <ref name="locality"/>
482
+ </zeroOrMore>
483
+ <zeroOrMore>
484
+ <ref name="localityStack"/>
485
+ </zeroOrMore>
486
+ </choice>
487
+ <optional>
488
+ <ref name="date"/>
489
+ </optional>
490
+ </define>
491
+ <define name="date">
492
+ <element name="date">
493
+ <ref name="ISO8601Date"/>
494
+ </element>
495
+ </define>
496
+ <define name="locality">
497
+ <element name="locality">
498
+ <ref name="BibItemLocality"/>
499
+ </element>
500
+ </define>
501
+ <define name="localityStack">
502
+ <element name="localityStack">
503
+ <zeroOrMore>
504
+ <ref name="locality"/>
505
+ </zeroOrMore>
506
+ </element>
507
+ </define>
508
+ <define name="sourceLocality">
509
+ <element name="sourceLocality">
510
+ <ref name="BibItemLocality"/>
511
+ </element>
512
+ </define>
513
+ <define name="sourceLocalityStack">
514
+ <element name="sourceLocalityStack">
515
+ <zeroOrMore>
516
+ <ref name="sourceLocality"/>
517
+ </zeroOrMore>
518
+ </element>
519
+ </define>
520
+ <define name="BibItemLocality">
521
+ <attribute name="type">
522
+ <ref name="LocalityType"/>
523
+ </attribute>
524
+ <optional>
525
+ <ref name="referenceFrom"/>
526
+ </optional>
527
+ <optional>
528
+ <ref name="referenceTo"/>
529
+ </optional>
530
+ </define>
531
+ <define name="LocalityType">
532
+ <data type="string">
533
+ <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>
534
+ </data>
535
+ </define>
536
+ <define name="referenceFrom">
537
+ <element name="referenceFrom">
538
+ <text/>
539
+ </element>
540
+ </define>
541
+ <define name="referenceTo">
542
+ <element name="referenceTo">
543
+ <text/>
544
+ </element>
545
+ </define>
546
+ <!-- unlike UML, has id attribute; that results from including bibitem in a docmodel -->
547
+ <define name="bibitem">
548
+ <element name="bibitem">
549
+ <attribute name="id">
550
+ <data type="ID"/>
551
+ </attribute>
552
+ <ref name="BibliographicItem"/>
553
+ </element>
554
+ </define>
555
+ <define name="bibitem_no_id">
556
+ <element name="bibitem">
557
+ <ref name="BibliographicItem"/>
558
+ </element>
559
+ </define>
560
+ <define name="relaton_collection">
561
+ <element name="relaton-collection">
562
+ <optional>
563
+ <attribute name="type"/>
564
+ </optional>
565
+ <ref name="btitle"/>
566
+ <zeroOrMore>
567
+ <ref name="contributor"/>
568
+ </zeroOrMore>
569
+ <zeroOrMore>
570
+ <ref name="docrelation"/>
571
+ </zeroOrMore>
572
+ </element>
573
+ </define>
574
+ <define name="BibItemType" combine="choice">
575
+ <choice>
576
+ <value>article</value>
577
+ <value>book</value>
578
+ <value>booklet</value>
579
+ <value>manual</value>
580
+ <value>proceedings</value>
581
+ <value>presentation</value>
582
+ <value>thesis</value>
583
+ <value>techreport</value>
584
+ <value>standard</value>
585
+ <value>unpublished</value>
586
+ <value>map</value>
587
+ <value>electronic resource</value>
588
+ <value>audiovisual</value>
589
+ <value>film</value>
590
+ <value>video</value>
591
+ <value>broadcast</value>
592
+ <value>software</value>
593
+ <value>graphic_work</value>
594
+ <value>music</value>
595
+ <value>patent</value>
596
+ <value>inbook</value>
597
+ <value>incollection</value>
598
+ <value>inproceedings</value>
599
+ <value>journal</value>
600
+ <value>website</value>
601
+ <value>webresource</value>
602
+ <value>dataset</value>
603
+ <value>archival</value>
604
+ <value>social_media</value>
605
+ <value>alert</value>
606
+ <value>message</value>
607
+ <value>conversation</value>
608
+ <value>misc</value>
609
+ </choice>
610
+ </define>
611
+ <define name="BibliographicItem">
612
+ <optional>
613
+ <attribute name="type">
614
+ <ref name="BibItemType"/>
615
+ </attribute>
616
+ </optional>
617
+ <optional>
618
+ <ref name="fetched"/>
619
+ </optional>
620
+ <choice>
621
+ <oneOrMore>
622
+ <ref name="btitle"/>
623
+ </oneOrMore>
624
+ <ref name="formattedref"/>
625
+ </choice>
626
+ <zeroOrMore>
627
+ <ref name="bsource"/>
628
+ </zeroOrMore>
629
+ <zeroOrMore>
630
+ <ref name="docidentifier"/>
631
+ </zeroOrMore>
632
+ <optional>
633
+ <ref name="docnumber"/>
634
+ </optional>
635
+ <zeroOrMore>
636
+ <ref name="bdate"/>
637
+ </zeroOrMore>
638
+ <zeroOrMore>
639
+ <ref name="contributor"/>
640
+ </zeroOrMore>
641
+ <optional>
642
+ <ref name="edition"/>
643
+ </optional>
644
+ <optional>
645
+ <ref name="version"/>
646
+ </optional>
647
+ <zeroOrMore>
648
+ <ref name="biblionote"/>
649
+ </zeroOrMore>
650
+ <zeroOrMore>
651
+ <ref name="language"/>
652
+ </zeroOrMore>
653
+ <zeroOrMore>
654
+ <ref name="script"/>
655
+ </zeroOrMore>
656
+ <zeroOrMore>
657
+ <ref name="bibabstract"/>
658
+ </zeroOrMore>
659
+ <optional>
660
+ <ref name="status"/>
661
+ </optional>
662
+ <zeroOrMore>
663
+ <ref name="copyright"/>
664
+ </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="docrelation"/>
667
+ </zeroOrMore>
668
+ <zeroOrMore>
669
+ <ref name="series"/>
670
+ </zeroOrMore>
671
+ <optional>
672
+ <ref name="medium"/>
673
+ </optional>
674
+ <zeroOrMore>
675
+ <ref name="bplace"/>
676
+ </zeroOrMore>
677
+ <zeroOrMore>
678
+ <ref name="bprice"/>
679
+ </zeroOrMore>
680
+ <zeroOrMore>
681
+ <ref name="extent"/>
682
+ </zeroOrMore>
683
+ <zeroOrMore>
684
+ <ref name="accesslocation"/>
685
+ </zeroOrMore>
686
+ <zeroOrMore>
687
+ <ref name="license"/>
688
+ </zeroOrMore>
689
+ <zeroOrMore>
690
+ <ref name="bclassification"/>
691
+ </zeroOrMore>
692
+ <zeroOrMore>
693
+ <ref name="bkeyword"/>
694
+ </zeroOrMore>
695
+ <optional>
696
+ <ref name="validity"/>
697
+ </optional>
698
+ </define>
699
+ <define name="btitle">
700
+ <element name="title">
701
+ <ref name="TypedTitleString"/>
702
+ </element>
703
+ </define>
704
+ <define name="bsource">
705
+ <element name="uri">
706
+ <ref name="TypedUri"/>
707
+ </element>
708
+ </define>
709
+ <define name="formattedref">
710
+ <element name="formattedref">
711
+ <ref name="FormattedString"/>
712
+ </element>
713
+ </define>
714
+ <define name="license">
715
+ <element name="license">
716
+ <text/>
717
+ </element>
718
+ </define>
719
+ <define name="fetched">
720
+ <element name="fetched">
721
+ <ref name="ISO8601DateTime"/>
722
+ </element>
723
+ </define>
724
+ <define name="validity">
725
+ <element name="validity">
726
+ <optional>
727
+ <ref name="validityBegins"/>
728
+ </optional>
729
+ <optional>
730
+ <ref name="validityEnds"/>
731
+ </optional>
732
+ <optional>
733
+ <ref name="validityRevision"/>
734
+ </optional>
735
+ </element>
736
+ </define>
737
+ <define name="validityBegins">
738
+ <element name="validityBegins">
739
+ <ref name="ISO8601DateTime"/>
740
+ </element>
741
+ </define>
742
+ <define name="validityEnds">
743
+ <element name="validityEnds">
744
+ <ref name="ISO8601DateTime"/>
745
+ </element>
746
+ </define>
747
+ <define name="validityRevision">
748
+ <element name="revision">
749
+ <ref name="ISO8601DateTime"/>
750
+ </element>
751
+ </define>
752
+ <define name="TypedTitleString">
753
+ <optional>
754
+ <attribute name="type"/>
755
+ </optional>
756
+ <ref name="FormattedString"/>
757
+ </define>
758
+ <!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
759
+ <define name="TypedUri">
760
+ <optional>
761
+ <attribute name="type"/>
762
+ </optional>
763
+ <data type="anyURI"/>
764
+ </define>
765
+ <define name="DateType">
766
+ <optional>
767
+ <attribute name="text"/>
768
+ </optional>
769
+ <optional>
770
+ <ref name="ISO8601Date"/>
771
+ </optional>
772
+ </define>
773
+ <define name="BibliographicDateType">
774
+ <choice>
775
+ <value>published</value>
776
+ <value>accessed</value>
777
+ <value>created</value>
778
+ <value>implemented</value>
779
+ <value>obsoleted</value>
780
+ <value>confirmed</value>
781
+ <value>updated</value>
782
+ <value>issued</value>
783
+ <value>transmitted</value>
784
+ <value>copied</value>
785
+ <value>unchanged</value>
786
+ <value>circulated</value>
787
+ <value>adapted</value>
788
+ <value>vote-started</value>
789
+ <value>vote-ended</value>
790
+ </choice>
791
+ </define>
792
+ <define name="bdate">
793
+ <element name="date">
794
+ <attribute name="type">
795
+ <choice>
796
+ <ref name="BibliographicDateType"/>
797
+ <text/>
798
+ </choice>
799
+ </attribute>
800
+ <optional>
801
+ <attribute name="text"/>
802
+ </optional>
803
+ <optional>
804
+ <choice>
805
+ <group>
806
+ <element name="from">
807
+ <ref name="ISO8601Date"/>
808
+ </element>
809
+ <optional>
810
+ <element name="to">
811
+ <ref name="ISO8601Date"/>
812
+ </element>
813
+ </optional>
814
+ </group>
815
+ <element name="on">
816
+ <ref name="ISO8601Date"/>
817
+ </element>
818
+ </choice>
819
+ </optional>
820
+ </element>
821
+ </define>
822
+ <define name="docidentifier">
823
+ <element name="docidentifier">
824
+ <optional>
825
+ <attribute name="type"/>
826
+ </optional>
827
+ <optional>
828
+ <attribute name="scope"/>
829
+ </optional>
830
+ <text/>
831
+ </element>
832
+ </define>
833
+ <define name="docnumber">
834
+ <element name="docnumber">
835
+ <text/>
836
+ </element>
837
+ </define>
838
+ <define name="bclassification">
839
+ <element name="classification">
840
+ <optional>
841
+ <attribute name="type"/>
842
+ </optional>
843
+ <text/>
844
+ </element>
845
+ </define>
846
+ <define name="bplace">
847
+ <element name="place">
848
+ <optional>
849
+ <attribute name="uri">
850
+ <data type="anyURI"/>
851
+ </attribute>
852
+ </optional>
853
+ <optional>
854
+ <attribute name="region"/>
855
+ </optional>
856
+ <text/>
857
+ </element>
858
+ </define>
859
+ <define name="bprice">
860
+ <element name="price">
861
+ <attribute name="currency"/>
862
+ <text/>
863
+ </element>
864
+ </define>
865
+ <define name="medium">
866
+ <element name="medium">
867
+ <optional>
868
+ <ref name="bcontent"/>
869
+ </optional>
870
+ <optional>
871
+ <ref name="genre"/>
872
+ </optional>
873
+ <optional>
874
+ <ref name="form"/>
875
+ </optional>
876
+ <optional>
877
+ <ref name="carrier"/>
878
+ </optional>
879
+ <optional>
880
+ <ref name="size"/>
881
+ </optional>
882
+ <optional>
883
+ <ref name="scale"/>
884
+ </optional>
885
+ </element>
886
+ </define>
887
+ <define name="bcontent">
888
+ <element name="content">
889
+ <text/>
890
+ </element>
891
+ </define>
892
+ <define name="genre">
893
+ <element name="genre">
894
+ <text/>
895
+ </element>
896
+ </define>
897
+ <define name="form">
898
+ <element name="form">
899
+ <text/>
900
+ </element>
901
+ </define>
902
+ <define name="carrier">
903
+ <element name="carrier">
904
+ <text/>
905
+ </element>
906
+ </define>
907
+ <define name="size">
908
+ <element name="size">
909
+ <text/>
910
+ </element>
911
+ </define>
912
+ <define name="scale">
913
+ <element name="scale">
914
+ <text/>
915
+ </element>
916
+ </define>
917
+ <define name="accesslocation">
918
+ <element name="accesslocation">
919
+ <text/>
920
+ </element>
921
+ </define>
922
+ <define name="extent">
923
+ <element name="extent">
924
+ <ref name="BibItemLocality"/>
925
+ </element>
926
+ </define>
927
+ <define name="series">
928
+ <element name="series">
929
+ <optional>
930
+ <attribute name="type">
931
+ <ref name="SeriesType"/>
932
+ </attribute>
933
+ </optional>
934
+ <choice>
935
+ <ref name="formattedref"/>
936
+ <group>
937
+ <ref name="btitle"/>
938
+ <optional>
939
+ <ref name="bplace"/>
940
+ </optional>
941
+ <optional>
942
+ <ref name="seriesorganization"/>
943
+ </optional>
944
+ <optional>
945
+ <ref name="abbreviation"/>
946
+ </optional>
947
+ <optional>
948
+ <ref name="seriesfrom"/>
949
+ </optional>
950
+ <optional>
951
+ <ref name="seriesto"/>
952
+ </optional>
953
+ <optional>
954
+ <ref name="seriesnumber"/>
955
+ </optional>
956
+ <optional>
957
+ <ref name="seriespartnumber"/>
958
+ </optional>
959
+ <optional>
960
+ <ref name="seriesrun"/>
961
+ </optional>
962
+ </group>
963
+ </choice>
964
+ </element>
965
+ </define>
966
+ <define name="SeriesType">
967
+ <choice>
968
+ <value>main</value>
969
+ <value>alt</value>
970
+ <text/>
971
+ </choice>
972
+ </define>
973
+ <define name="seriesorganization">
974
+ <element name="organization">
975
+ <text/>
976
+ </element>
977
+ </define>
978
+ <define name="seriesfrom">
979
+ <element name="from">
980
+ <ref name="ISO8601Date"/>
981
+ </element>
982
+ </define>
983
+ <define name="seriesto">
984
+ <element name="to">
985
+ <ref name="ISO8601Date"/>
986
+ </element>
987
+ </define>
988
+ <define name="seriesnumber">
989
+ <element name="number">
990
+ <text/>
991
+ </element>
992
+ </define>
993
+ <define name="seriespartnumber">
994
+ <element name="partnumber">
995
+ <text/>
996
+ </element>
997
+ </define>
998
+ <define name="seriesrun">
999
+ <element name="run">
1000
+ <text/>
1001
+ </element>
1002
+ </define>
1003
+ <define name="biblionote">
1004
+ <element name="note">
1005
+ <optional>
1006
+ <attribute name="type"/>
1007
+ </optional>
1008
+ <ref name="FormattedString"/>
1009
+ </element>
1010
+ </define>
1011
+ <define name="bibabstract">
1012
+ <element name="abstract">
1013
+ <ref name="FormattedString"/>
1014
+ </element>
1015
+ </define>
1016
+ <define name="copyright">
1017
+ <element name="copyright">
1018
+ <ref name="from"/>
1019
+ <optional>
1020
+ <ref name="to"/>
1021
+ </optional>
1022
+ <oneOrMore>
1023
+ <ref name="owner"/>
1024
+ </oneOrMore>
1025
+ <optional>
1026
+ <ref name="copyright_scope"/>
1027
+ </optional>
1028
+ </element>
1029
+ </define>
1030
+ <define name="copyright_scope">
1031
+ <element name="scope">
1032
+ <text/>
1033
+ </element>
1034
+ </define>
1035
+ <define name="from">
1036
+ <element name="from">
1037
+ <data type="gYear"/>
1038
+ </element>
1039
+ </define>
1040
+ <define name="to">
1041
+ <element name="to">
1042
+ <data type="gYear"/>
1043
+ </element>
1044
+ </define>
1045
+ <define name="owner">
1046
+ <element name="owner">
1047
+ <ref name="ContributorInfo"/>
1048
+ </element>
1049
+ </define>
1050
+ <define name="DocRelationType">
1051
+ <choice>
1052
+ <value>includes</value>
1053
+ <value>includedIn</value>
1054
+ <value>hasPart</value>
1055
+ <value>partOf</value>
1056
+ <value>merges</value>
1057
+ <value>mergedInto</value>
1058
+ <value>splits</value>
1059
+ <value>splitInto</value>
1060
+ <value>instance</value>
1061
+ <value>hasInstance</value>
1062
+ <value>exemplarOf</value>
1063
+ <value>hasExemplar</value>
1064
+ <value>manifestationOf</value>
1065
+ <value>hasManifestation</value>
1066
+ <value>reproductionOf</value>
1067
+ <value>hasReproduction</value>
1068
+ <value>reprintOf</value>
1069
+ <value>hasReprint</value>
1070
+ <value>expressionOf</value>
1071
+ <value>hasExpression</value>
1072
+ <value>translatedFrom</value>
1073
+ <value>hasTranslation</value>
1074
+ <value>arrangementOf</value>
1075
+ <value>hasArrangement</value>
1076
+ <value>abridgementOf</value>
1077
+ <value>hasAbridgement</value>
1078
+ <value>annotationOf</value>
1079
+ <value>hasAnnotation</value>
1080
+ <value>draftOf</value>
1081
+ <value>hasDraft</value>
1082
+ <value>editionOf</value>
1083
+ <value>hasEdition</value>
1084
+ <value>updates</value>
1085
+ <value>updatedBy</value>
1086
+ <value>derivedFrom</value>
1087
+ <value>derives</value>
1088
+ <value>describes</value>
1089
+ <value>describedBy</value>
1090
+ <value>catalogues</value>
1091
+ <value>cataloguedBy</value>
1092
+ <value>hasSuccessor</value>
1093
+ <value>successorOf</value>
1094
+ <value>adaptedFrom</value>
1095
+ <value>hasAdaptation</value>
1096
+ <value>adoptedFrom</value>
1097
+ <value>adoptedAs</value>
1098
+ <value>reviewOf</value>
1099
+ <value>hasReview</value>
1100
+ <value>commentaryOf</value>
1101
+ <value>hasCommentary</value>
1102
+ <value>related</value>
1103
+ <value>complements</value>
1104
+ <value>complementOf</value>
1105
+ <value>obsoletes</value>
1106
+ <value>obsoletedBy</value>
1107
+ <value>cites</value>
1108
+ <value>isCitedIn</value>
1109
+ </choice>
1110
+ </define>
1111
+ <define name="docrelation">
1112
+ <element name="relation">
1113
+ <attribute name="type">
1114
+ <ref name="DocRelationType"/>
1115
+ </attribute>
1116
+ <optional>
1117
+ <element name="description">
1118
+ <ref name="FormattedString"/>
1119
+ </element>
1120
+ </optional>
1121
+ <element name="bibitem">
1122
+ <ref name="BibliographicItem"/>
1123
+ </element>
1124
+ <choice>
1125
+ <zeroOrMore>
1126
+ <ref name="locality"/>
1127
+ </zeroOrMore>
1128
+ <zeroOrMore>
1129
+ <ref name="localityStack"/>
1130
+ </zeroOrMore>
1131
+ </choice>
1132
+ <choice>
1133
+ <zeroOrMore>
1134
+ <ref name="sourceLocality"/>
1135
+ </zeroOrMore>
1136
+ <zeroOrMore>
1137
+ <ref name="sourceLocalityStack"/>
1138
+ </zeroOrMore>
1139
+ </choice>
1140
+ </element>
1141
+ </define>
1142
+ <define name="version">
1143
+ <element name="version">
1144
+ <optional>
1145
+ <ref name="revision-date"/>
1146
+ </optional>
1147
+ <zeroOrMore>
1148
+ <ref name="draft"/>
1149
+ </zeroOrMore>
1150
+ </element>
1151
+ </define>
1152
+ <define name="vedition">
1153
+ <element name="edition">
1154
+ <data type="int"/>
1155
+ </element>
1156
+ </define>
1157
+ <define name="revision-date">
1158
+ <element name="revision-date">
1159
+ <ref name="ISO8601Date"/>
1160
+ </element>
1161
+ </define>
1162
+ <define name="draft">
1163
+ <element name="draft">
1164
+ <text/>
1165
+ </element>
1166
+ </define>
1167
+ <define name="bkeyword">
1168
+ <element name="keyword">
1169
+ <choice>
1170
+ <ref name="LocalizedString"/>
1171
+ <group>
1172
+ <element name="vocab">
1173
+ <ref name="LocalizedString"/>
1174
+ </element>
1175
+ <oneOrMore>
1176
+ <ref name="vocabid"/>
1177
+ </oneOrMore>
1178
+ </group>
1179
+ <group>
1180
+ <oneOrMore>
1181
+ <element name="taxon">
1182
+ <ref name="LocalizedString"/>
1183
+ </element>
1184
+ </oneOrMore>
1185
+ <oneOrMore>
1186
+ <ref name="vocabid"/>
1187
+ </oneOrMore>
1188
+ </group>
1189
+ </choice>
1190
+ </element>
1191
+ </define>
1192
+ <define name="vocabid">
1193
+ <element name="vocabid">
1194
+ <attribute name="type"/>
1195
+ <optional>
1196
+ <attribute name="uri">
1197
+ <data type="anyURI"/>
1198
+ </attribute>
1199
+ </optional>
1200
+ <optional>
1201
+ <element name="code">
1202
+ <text/>
1203
+ </element>
1204
+ </optional>
1205
+ <optional>
1206
+ <element name="term">
1207
+ <text/>
1208
+ </element>
1209
+ </optional>
1210
+ </element>
1211
+ </define>
1212
+ <!--
1213
+ Anycontents = mixed {
1214
+ https://github.com/relaxng/jing-trang/issues/211
1215
+ https://lists.oasis-open.org/archives/office/200808/msg00024.html
1216
+ https://lists.oasis-open.org/archives/office/200808/msg00099.html
1217
+ For this to work, we will actually strip any attributes in the Anycontents before
1218
+ passing it for validation. Horrible I know, but there are no good alternatives
1219
+ that also allow us to do grammar inheritance
1220
+ (attribute * { text } | Any)*
1221
+ Any*
1222
+ }
1223
+ -->
1224
+ <define name="AnyElement">
1225
+ <element>
1226
+ <anyName/>
1227
+ <oneOrMore>
1228
+ <choice>
1229
+ <text/>
1230
+ <ref name="AnyElement"/>
1231
+ </choice>
1232
+ </oneOrMore>
1233
+ </element>
1234
+ </define>
1235
+ </grammar>