relaton-3gpp 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1236 @@
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
+ <value>announced</value>
791
+ </choice>
792
+ </define>
793
+ <define name="bdate">
794
+ <element name="date">
795
+ <attribute name="type">
796
+ <choice>
797
+ <ref name="BibliographicDateType"/>
798
+ <text/>
799
+ </choice>
800
+ </attribute>
801
+ <optional>
802
+ <attribute name="text"/>
803
+ </optional>
804
+ <optional>
805
+ <choice>
806
+ <group>
807
+ <element name="from">
808
+ <ref name="ISO8601Date"/>
809
+ </element>
810
+ <optional>
811
+ <element name="to">
812
+ <ref name="ISO8601Date"/>
813
+ </element>
814
+ </optional>
815
+ </group>
816
+ <element name="on">
817
+ <ref name="ISO8601Date"/>
818
+ </element>
819
+ </choice>
820
+ </optional>
821
+ </element>
822
+ </define>
823
+ <define name="docidentifier">
824
+ <element name="docidentifier">
825
+ <optional>
826
+ <attribute name="type"/>
827
+ </optional>
828
+ <optional>
829
+ <attribute name="scope"/>
830
+ </optional>
831
+ <text/>
832
+ </element>
833
+ </define>
834
+ <define name="docnumber">
835
+ <element name="docnumber">
836
+ <text/>
837
+ </element>
838
+ </define>
839
+ <define name="bclassification">
840
+ <element name="classification">
841
+ <optional>
842
+ <attribute name="type"/>
843
+ </optional>
844
+ <text/>
845
+ </element>
846
+ </define>
847
+ <define name="bplace">
848
+ <element name="place">
849
+ <optional>
850
+ <attribute name="uri">
851
+ <data type="anyURI"/>
852
+ </attribute>
853
+ </optional>
854
+ <optional>
855
+ <attribute name="region"/>
856
+ </optional>
857
+ <text/>
858
+ </element>
859
+ </define>
860
+ <define name="bprice">
861
+ <element name="price">
862
+ <attribute name="currency"/>
863
+ <text/>
864
+ </element>
865
+ </define>
866
+ <define name="medium">
867
+ <element name="medium">
868
+ <optional>
869
+ <ref name="bcontent"/>
870
+ </optional>
871
+ <optional>
872
+ <ref name="genre"/>
873
+ </optional>
874
+ <optional>
875
+ <ref name="form"/>
876
+ </optional>
877
+ <optional>
878
+ <ref name="carrier"/>
879
+ </optional>
880
+ <optional>
881
+ <ref name="size"/>
882
+ </optional>
883
+ <optional>
884
+ <ref name="scale"/>
885
+ </optional>
886
+ </element>
887
+ </define>
888
+ <define name="bcontent">
889
+ <element name="content">
890
+ <text/>
891
+ </element>
892
+ </define>
893
+ <define name="genre">
894
+ <element name="genre">
895
+ <text/>
896
+ </element>
897
+ </define>
898
+ <define name="form">
899
+ <element name="form">
900
+ <text/>
901
+ </element>
902
+ </define>
903
+ <define name="carrier">
904
+ <element name="carrier">
905
+ <text/>
906
+ </element>
907
+ </define>
908
+ <define name="size">
909
+ <element name="size">
910
+ <text/>
911
+ </element>
912
+ </define>
913
+ <define name="scale">
914
+ <element name="scale">
915
+ <text/>
916
+ </element>
917
+ </define>
918
+ <define name="accesslocation">
919
+ <element name="accesslocation">
920
+ <text/>
921
+ </element>
922
+ </define>
923
+ <define name="extent">
924
+ <element name="extent">
925
+ <ref name="BibItemLocality"/>
926
+ </element>
927
+ </define>
928
+ <define name="series">
929
+ <element name="series">
930
+ <optional>
931
+ <attribute name="type">
932
+ <ref name="SeriesType"/>
933
+ </attribute>
934
+ </optional>
935
+ <choice>
936
+ <ref name="formattedref"/>
937
+ <group>
938
+ <ref name="btitle"/>
939
+ <optional>
940
+ <ref name="bplace"/>
941
+ </optional>
942
+ <optional>
943
+ <ref name="seriesorganization"/>
944
+ </optional>
945
+ <optional>
946
+ <ref name="abbreviation"/>
947
+ </optional>
948
+ <optional>
949
+ <ref name="seriesfrom"/>
950
+ </optional>
951
+ <optional>
952
+ <ref name="seriesto"/>
953
+ </optional>
954
+ <optional>
955
+ <ref name="seriesnumber"/>
956
+ </optional>
957
+ <optional>
958
+ <ref name="seriespartnumber"/>
959
+ </optional>
960
+ <optional>
961
+ <ref name="seriesrun"/>
962
+ </optional>
963
+ </group>
964
+ </choice>
965
+ </element>
966
+ </define>
967
+ <define name="SeriesType">
968
+ <choice>
969
+ <value>main</value>
970
+ <value>alt</value>
971
+ <text/>
972
+ </choice>
973
+ </define>
974
+ <define name="seriesorganization">
975
+ <element name="organization">
976
+ <text/>
977
+ </element>
978
+ </define>
979
+ <define name="seriesfrom">
980
+ <element name="from">
981
+ <ref name="ISO8601Date"/>
982
+ </element>
983
+ </define>
984
+ <define name="seriesto">
985
+ <element name="to">
986
+ <ref name="ISO8601Date"/>
987
+ </element>
988
+ </define>
989
+ <define name="seriesnumber">
990
+ <element name="number">
991
+ <text/>
992
+ </element>
993
+ </define>
994
+ <define name="seriespartnumber">
995
+ <element name="partnumber">
996
+ <text/>
997
+ </element>
998
+ </define>
999
+ <define name="seriesrun">
1000
+ <element name="run">
1001
+ <text/>
1002
+ </element>
1003
+ </define>
1004
+ <define name="biblionote">
1005
+ <element name="note">
1006
+ <optional>
1007
+ <attribute name="type"/>
1008
+ </optional>
1009
+ <ref name="FormattedString"/>
1010
+ </element>
1011
+ </define>
1012
+ <define name="bibabstract">
1013
+ <element name="abstract">
1014
+ <ref name="FormattedString"/>
1015
+ </element>
1016
+ </define>
1017
+ <define name="copyright">
1018
+ <element name="copyright">
1019
+ <ref name="from"/>
1020
+ <optional>
1021
+ <ref name="to"/>
1022
+ </optional>
1023
+ <oneOrMore>
1024
+ <ref name="owner"/>
1025
+ </oneOrMore>
1026
+ <optional>
1027
+ <ref name="copyright_scope"/>
1028
+ </optional>
1029
+ </element>
1030
+ </define>
1031
+ <define name="copyright_scope">
1032
+ <element name="scope">
1033
+ <text/>
1034
+ </element>
1035
+ </define>
1036
+ <define name="from">
1037
+ <element name="from">
1038
+ <data type="gYear"/>
1039
+ </element>
1040
+ </define>
1041
+ <define name="to">
1042
+ <element name="to">
1043
+ <data type="gYear"/>
1044
+ </element>
1045
+ </define>
1046
+ <define name="owner">
1047
+ <element name="owner">
1048
+ <ref name="ContributorInfo"/>
1049
+ </element>
1050
+ </define>
1051
+ <define name="DocRelationType">
1052
+ <choice>
1053
+ <value>includes</value>
1054
+ <value>includedIn</value>
1055
+ <value>hasPart</value>
1056
+ <value>partOf</value>
1057
+ <value>merges</value>
1058
+ <value>mergedInto</value>
1059
+ <value>splits</value>
1060
+ <value>splitInto</value>
1061
+ <value>instance</value>
1062
+ <value>hasInstance</value>
1063
+ <value>exemplarOf</value>
1064
+ <value>hasExemplar</value>
1065
+ <value>manifestationOf</value>
1066
+ <value>hasManifestation</value>
1067
+ <value>reproductionOf</value>
1068
+ <value>hasReproduction</value>
1069
+ <value>reprintOf</value>
1070
+ <value>hasReprint</value>
1071
+ <value>expressionOf</value>
1072
+ <value>hasExpression</value>
1073
+ <value>translatedFrom</value>
1074
+ <value>hasTranslation</value>
1075
+ <value>arrangementOf</value>
1076
+ <value>hasArrangement</value>
1077
+ <value>abridgementOf</value>
1078
+ <value>hasAbridgement</value>
1079
+ <value>annotationOf</value>
1080
+ <value>hasAnnotation</value>
1081
+ <value>draftOf</value>
1082
+ <value>hasDraft</value>
1083
+ <value>editionOf</value>
1084
+ <value>hasEdition</value>
1085
+ <value>updates</value>
1086
+ <value>updatedBy</value>
1087
+ <value>derivedFrom</value>
1088
+ <value>derives</value>
1089
+ <value>describes</value>
1090
+ <value>describedBy</value>
1091
+ <value>catalogues</value>
1092
+ <value>cataloguedBy</value>
1093
+ <value>hasSuccessor</value>
1094
+ <value>successorOf</value>
1095
+ <value>adaptedFrom</value>
1096
+ <value>hasAdaptation</value>
1097
+ <value>adoptedFrom</value>
1098
+ <value>adoptedAs</value>
1099
+ <value>reviewOf</value>
1100
+ <value>hasReview</value>
1101
+ <value>commentaryOf</value>
1102
+ <value>hasCommentary</value>
1103
+ <value>related</value>
1104
+ <value>complements</value>
1105
+ <value>complementOf</value>
1106
+ <value>obsoletes</value>
1107
+ <value>obsoletedBy</value>
1108
+ <value>cites</value>
1109
+ <value>isCitedIn</value>
1110
+ </choice>
1111
+ </define>
1112
+ <define name="docrelation">
1113
+ <element name="relation">
1114
+ <attribute name="type">
1115
+ <ref name="DocRelationType"/>
1116
+ </attribute>
1117
+ <optional>
1118
+ <element name="description">
1119
+ <ref name="FormattedString"/>
1120
+ </element>
1121
+ </optional>
1122
+ <element name="bibitem">
1123
+ <ref name="BibliographicItem"/>
1124
+ </element>
1125
+ <choice>
1126
+ <zeroOrMore>
1127
+ <ref name="locality"/>
1128
+ </zeroOrMore>
1129
+ <zeroOrMore>
1130
+ <ref name="localityStack"/>
1131
+ </zeroOrMore>
1132
+ </choice>
1133
+ <choice>
1134
+ <zeroOrMore>
1135
+ <ref name="sourceLocality"/>
1136
+ </zeroOrMore>
1137
+ <zeroOrMore>
1138
+ <ref name="sourceLocalityStack"/>
1139
+ </zeroOrMore>
1140
+ </choice>
1141
+ </element>
1142
+ </define>
1143
+ <define name="version">
1144
+ <element name="version">
1145
+ <optional>
1146
+ <ref name="revision-date"/>
1147
+ </optional>
1148
+ <zeroOrMore>
1149
+ <ref name="draft"/>
1150
+ </zeroOrMore>
1151
+ </element>
1152
+ </define>
1153
+ <define name="vedition">
1154
+ <element name="edition">
1155
+ <data type="int"/>
1156
+ </element>
1157
+ </define>
1158
+ <define name="revision-date">
1159
+ <element name="revision-date">
1160
+ <ref name="ISO8601Date"/>
1161
+ </element>
1162
+ </define>
1163
+ <define name="draft">
1164
+ <element name="draft">
1165
+ <text/>
1166
+ </element>
1167
+ </define>
1168
+ <define name="bkeyword">
1169
+ <element name="keyword">
1170
+ <choice>
1171
+ <ref name="LocalizedString"/>
1172
+ <group>
1173
+ <element name="vocab">
1174
+ <ref name="LocalizedString"/>
1175
+ </element>
1176
+ <oneOrMore>
1177
+ <ref name="vocabid"/>
1178
+ </oneOrMore>
1179
+ </group>
1180
+ <group>
1181
+ <oneOrMore>
1182
+ <element name="taxon">
1183
+ <ref name="LocalizedString"/>
1184
+ </element>
1185
+ </oneOrMore>
1186
+ <oneOrMore>
1187
+ <ref name="vocabid"/>
1188
+ </oneOrMore>
1189
+ </group>
1190
+ </choice>
1191
+ </element>
1192
+ </define>
1193
+ <define name="vocabid">
1194
+ <element name="vocabid">
1195
+ <attribute name="type"/>
1196
+ <optional>
1197
+ <attribute name="uri">
1198
+ <data type="anyURI"/>
1199
+ </attribute>
1200
+ </optional>
1201
+ <optional>
1202
+ <element name="code">
1203
+ <text/>
1204
+ </element>
1205
+ </optional>
1206
+ <optional>
1207
+ <element name="term">
1208
+ <text/>
1209
+ </element>
1210
+ </optional>
1211
+ </element>
1212
+ </define>
1213
+ <!--
1214
+ Anycontents = mixed {
1215
+ https://github.com/relaxng/jing-trang/issues/211
1216
+ https://lists.oasis-open.org/archives/office/200808/msg00024.html
1217
+ https://lists.oasis-open.org/archives/office/200808/msg00099.html
1218
+ For this to work, we will actually strip any attributes in the Anycontents before
1219
+ passing it for validation. Horrible I know, but there are no good alternatives
1220
+ that also allow us to do grammar inheritance
1221
+ (attribute * { text } | Any)*
1222
+ Any*
1223
+ }
1224
+ -->
1225
+ <define name="AnyElement">
1226
+ <element>
1227
+ <anyName/>
1228
+ <oneOrMore>
1229
+ <choice>
1230
+ <text/>
1231
+ <ref name="AnyElement"/>
1232
+ </choice>
1233
+ </oneOrMore>
1234
+ </element>
1235
+ </define>
1236
+ </grammar>