relaton-iec 0.10.0 → 1.0.0

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