relaton-w3c 1.0.0 → 1.0.1

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