metanorma-un 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/macos.yml +39 -0
  3. data/.github/workflows/ubuntu.yml +39 -0
  4. data/.github/workflows/windows.yml +42 -0
  5. data/.gitignore +1 -0
  6. data/.hound.yml +3 -0
  7. data/.rubocop.yml +10 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +11 -0
  10. data/LICENSE +25 -0
  11. data/README.adoc +141 -0
  12. data/Rakefile +6 -0
  13. data/bin/console +14 -0
  14. data/bin/rspec +17 -0
  15. data/bin/setup +8 -0
  16. data/lib/asciidoctor/un.rb +7 -0
  17. data/lib/asciidoctor/un/basicdoc.rng +1059 -0
  18. data/lib/asciidoctor/un/biblio.rng +1142 -0
  19. data/lib/asciidoctor/un/boilerplate.xml +57 -0
  20. data/lib/asciidoctor/un/converter.rb +209 -0
  21. data/lib/asciidoctor/un/isodoc.rng +1028 -0
  22. data/lib/asciidoctor/un/reqt.rng +171 -0
  23. data/lib/asciidoctor/un/un.rng +242 -0
  24. data/lib/asciidoctor/un/validate.rb +22 -0
  25. data/lib/isodoc/un.rb +10 -0
  26. data/lib/isodoc/un/base_convert.rb +227 -0
  27. data/lib/isodoc/un/html/header.html +225 -0
  28. data/lib/isodoc/un/html/html_unece_intro.html +15 -0
  29. data/lib/isodoc/un/html/html_unece_plenary_titlepage.html +100 -0
  30. data/lib/isodoc/un/html/html_unece_titlepage.html +81 -0
  31. data/lib/isodoc/un/html/htmlstyle.scss +1174 -0
  32. data/lib/isodoc/un/html/logo.jpg +0 -0
  33. data/lib/isodoc/un/html/scripts.html +84 -0
  34. data/lib/isodoc/un/html/scripts.pdf.html +72 -0
  35. data/lib/isodoc/un/html/unece.scss +801 -0
  36. data/lib/isodoc/un/html/word_unece_intro.html +15 -0
  37. data/lib/isodoc/un/html/word_unece_plenary_titlepage.html +160 -0
  38. data/lib/isodoc/un/html/word_unece_titlepage.html +30 -0
  39. data/lib/isodoc/un/html/wordstyle.scss +1141 -0
  40. data/lib/isodoc/un/html_convert.rb +121 -0
  41. data/lib/isodoc/un/metadata.rb +115 -0
  42. data/lib/isodoc/un/pdf_convert.rb +133 -0
  43. data/lib/isodoc/un/word_convert.rb +180 -0
  44. data/lib/metanorma-un.rb +8 -0
  45. data/lib/metanorma/un.rb +12 -0
  46. data/lib/metanorma/un/UN_emblem_blue.svg +193 -0
  47. data/lib/metanorma/un/input.rb +18 -0
  48. data/lib/metanorma/un/processor.rb +43 -0
  49. data/lib/metanorma/un/version.rb +5 -0
  50. data/metanorma-unece.gemspec +48 -0
  51. metadata +334 -0
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ require "asciidoctor/un/converter"
2
+
3
+ module Asciidoctor
4
+ module UN
5
+
6
+ end
7
+ end
@@ -0,0 +1,1059 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <include href="biblio.rng">
4
+ <start>
5
+ <ref name="document"/>
6
+ </start>
7
+ </include>
8
+ <define name="document">
9
+ <element name="document">
10
+ <optional>
11
+ <attribute name="identifier"/>
12
+ </optional>
13
+ <ref name="bibdata"/>
14
+ <ref name="sections"/>
15
+ <zeroOrMore>
16
+ <ref name="references"/>
17
+ </zeroOrMore>
18
+ </element>
19
+ </define>
20
+ <define name="bibdata">
21
+ <element name="bibdata">
22
+ <ref name="BibData"/>
23
+ </element>
24
+ </define>
25
+ <define name="sections">
26
+ <element name="sections">
27
+ <oneOrMore>
28
+ <ref name="section"/>
29
+ </oneOrMore>
30
+ </element>
31
+ </define>
32
+ <define name="section">
33
+ <element name="section">
34
+ <ref name="Basic-Section"/>
35
+ <zeroOrMore>
36
+ <ref name="section"/>
37
+ </zeroOrMore>
38
+ </element>
39
+ </define>
40
+ <define name="Basic-Section">
41
+ <optional>
42
+ <attribute name="id">
43
+ <data type="ID"/>
44
+ </attribute>
45
+ </optional>
46
+ <optional>
47
+ <attribute name="language"/>
48
+ </optional>
49
+ <optional>
50
+ <attribute name="script"/>
51
+ </optional>
52
+ <optional>
53
+ <ref name="section-title"/>
54
+ </optional>
55
+ <zeroOrMore>
56
+ <ref name="BasicBlock"/>
57
+ </zeroOrMore>
58
+ </define>
59
+ <define name="references">
60
+ <element name="references">
61
+ <optional>
62
+ <attribute name="id">
63
+ <data type="ID"/>
64
+ </attribute>
65
+ </optional>
66
+ <optional>
67
+ <ref name="section-title"/>
68
+ </optional>
69
+ <zeroOrMore>
70
+ <ref name="BasicBlock"/>
71
+ </zeroOrMore>
72
+ <zeroOrMore>
73
+ <ref name="bibitem"/>
74
+ </zeroOrMore>
75
+ </element>
76
+ </define>
77
+ <define name="section-title">
78
+ <element name="title">
79
+ <zeroOrMore>
80
+ <ref name="TextElement"/>
81
+ </zeroOrMore>
82
+ </element>
83
+ </define>
84
+ <define name="BasicBlock">
85
+ <choice>
86
+ <ref name="paragraph-with-footnote"/>
87
+ <ref name="table"/>
88
+ <ref name="formula"/>
89
+ <ref name="admonition"/>
90
+ <ref name="ol"/>
91
+ <ref name="ul"/>
92
+ <ref name="dl"/>
93
+ <ref name="figure"/>
94
+ <ref name="quote"/>
95
+ <ref name="sourcecode"/>
96
+ <ref name="example"/>
97
+ <ref name="review"/>
98
+ <ref name="pre"/>
99
+ <ref name="note"/>
100
+ <ref name="pagebreak"/>
101
+ <ref name="hr"/>
102
+ <ref name="bookmark"/>
103
+ </choice>
104
+ </define>
105
+ <define name="paragraph">
106
+ <element name="p">
107
+ <ref name="ParagraphType"/>
108
+ </element>
109
+ </define>
110
+ <define name="Alignments">
111
+ <choice>
112
+ <value>left</value>
113
+ <value>right</value>
114
+ <value>center</value>
115
+ <value>justified</value>
116
+ </choice>
117
+ </define>
118
+ <define name="ParagraphType">
119
+ <attribute name="id">
120
+ <data type="ID"/>
121
+ </attribute>
122
+ <optional>
123
+ <attribute name="align">
124
+ <ref name="Alignments"/>
125
+ </attribute>
126
+ </optional>
127
+ <zeroOrMore>
128
+ <ref name="TextElement"/>
129
+ </zeroOrMore>
130
+ <zeroOrMore>
131
+ <ref name="note"/>
132
+ </zeroOrMore>
133
+ </define>
134
+ <define name="paragraph-with-footnote">
135
+ <element name="p">
136
+ <attribute name="id">
137
+ <data type="ID"/>
138
+ </attribute>
139
+ <optional>
140
+ <attribute name="align">
141
+ <ref name="Alignments"/>
142
+ </attribute>
143
+ </optional>
144
+ <zeroOrMore>
145
+ <choice>
146
+ <ref name="TextElement"/>
147
+ <ref name="fn"/>
148
+ </choice>
149
+ </zeroOrMore>
150
+ <zeroOrMore>
151
+ <ref name="note"/>
152
+ </zeroOrMore>
153
+ </element>
154
+ </define>
155
+ <define name="note">
156
+ <element name="note">
157
+ <attribute name="id">
158
+ <data type="ID"/>
159
+ </attribute>
160
+ <oneOrMore>
161
+ <ref name="paragraph"/>
162
+ </oneOrMore>
163
+ </element>
164
+ </define>
165
+ <define name="review">
166
+ <element name="review">
167
+ <attribute name="id">
168
+ <data type="ID"/>
169
+ </attribute>
170
+ <attribute name="reviewer"/>
171
+ <optional>
172
+ <attribute name="date">
173
+ <data type="dateTime"/>
174
+ </attribute>
175
+ </optional>
176
+ <attribute name="from">
177
+ <data type="IDREF"/>
178
+ </attribute>
179
+ <optional>
180
+ <attribute name="to">
181
+ <data type="IDREF"/>
182
+ </attribute>
183
+ </optional>
184
+ <oneOrMore>
185
+ <ref name="paragraph"/>
186
+ </oneOrMore>
187
+ </element>
188
+ </define>
189
+ <define name="formula">
190
+ <element name="formula">
191
+ <attribute name="id">
192
+ <data type="ID"/>
193
+ </attribute>
194
+ <optional>
195
+ <attribute name="unnumbered">
196
+ <data type="boolean"/>
197
+ </attribute>
198
+ </optional>
199
+ <optional>
200
+ <attribute name="subsequence"/>
201
+ </optional>
202
+ <optional>
203
+ <attribute name="inequality">
204
+ <data type="boolean"/>
205
+ </attribute>
206
+ </optional>
207
+ <ref name="stem"/>
208
+ <optional>
209
+ <ref name="dl"/>
210
+ </optional>
211
+ <zeroOrMore>
212
+ <ref name="note"/>
213
+ </zeroOrMore>
214
+ </element>
215
+ </define>
216
+ <define name="quote">
217
+ <element name="quote">
218
+ <attribute name="id">
219
+ <data type="ID"/>
220
+ </attribute>
221
+ <optional>
222
+ <attribute name="alignment">
223
+ <ref name="Alignments"/>
224
+ </attribute>
225
+ </optional>
226
+ <optional>
227
+ <ref name="quote-source"/>
228
+ </optional>
229
+ <optional>
230
+ <ref name="quote-author"/>
231
+ </optional>
232
+ <oneOrMore>
233
+ <ref name="paragraph-with-footnote"/>
234
+ </oneOrMore>
235
+ <zeroOrMore>
236
+ <ref name="note"/>
237
+ </zeroOrMore>
238
+ </element>
239
+ </define>
240
+ <define name="quote-source">
241
+ <element name="source">
242
+ <ref name="erefType"/>
243
+ </element>
244
+ </define>
245
+ <define name="quote-author">
246
+ <element name="author">
247
+ <text/>
248
+ </element>
249
+ </define>
250
+ <define name="sourcecode">
251
+ <element name="sourcecode">
252
+ <attribute name="id">
253
+ <data type="ID"/>
254
+ </attribute>
255
+ <optional>
256
+ <attribute name="unnumbered">
257
+ <data type="boolean"/>
258
+ </attribute>
259
+ </optional>
260
+ <optional>
261
+ <attribute name="subsequence"/>
262
+ </optional>
263
+ <optional>
264
+ <attribute name="lang"/>
265
+ </optional>
266
+ <optional>
267
+ <ref name="tname"/>
268
+ </optional>
269
+ <oneOrMore>
270
+ <choice>
271
+ <text/>
272
+ <ref name="callout"/>
273
+ </choice>
274
+ </oneOrMore>
275
+ <zeroOrMore>
276
+ <ref name="annotation"/>
277
+ </zeroOrMore>
278
+ <zeroOrMore>
279
+ <ref name="note"/>
280
+ </zeroOrMore>
281
+ </element>
282
+ </define>
283
+ <define name="pre">
284
+ <element name="pre">
285
+ <attribute name="id">
286
+ <data type="ID"/>
287
+ </attribute>
288
+ <optional>
289
+ <attribute name="alt"/>
290
+ </optional>
291
+ <optional>
292
+ <ref name="tname"/>
293
+ </optional>
294
+ <text/>
295
+ <zeroOrMore>
296
+ <ref name="note"/>
297
+ </zeroOrMore>
298
+ </element>
299
+ </define>
300
+ <define name="table">
301
+ <element name="table">
302
+ <attribute name="id">
303
+ <data type="ID"/>
304
+ </attribute>
305
+ <optional>
306
+ <attribute name="unnumbered">
307
+ <data type="boolean"/>
308
+ </attribute>
309
+ </optional>
310
+ <optional>
311
+ <attribute name="subsequence"/>
312
+ </optional>
313
+ <optional>
314
+ <attribute name="alt"/>
315
+ </optional>
316
+ <optional>
317
+ <attribute name="summary"/>
318
+ </optional>
319
+ <optional>
320
+ <attribute name="uri">
321
+ <data type="anyURI"/>
322
+ </attribute>
323
+ </optional>
324
+ <optional>
325
+ <ref name="tname"/>
326
+ </optional>
327
+ <optional>
328
+ <ref name="thead"/>
329
+ </optional>
330
+ <ref name="tbody"/>
331
+ <optional>
332
+ <ref name="tfoot"/>
333
+ </optional>
334
+ <zeroOrMore>
335
+ <ref name="table-note"/>
336
+ </zeroOrMore>
337
+ <optional>
338
+ <ref name="dl"/>
339
+ </optional>
340
+ </element>
341
+ </define>
342
+ <define name="tname">
343
+ <element name="name">
344
+ <oneOrMore>
345
+ <choice>
346
+ <ref name="PureTextElement"/>
347
+ <ref name="eref"/>
348
+ <ref name="stem"/>
349
+ <ref name="keyword"/>
350
+ <ref name="xref"/>
351
+ <ref name="hyperlink"/>
352
+ </choice>
353
+ </oneOrMore>
354
+ </element>
355
+ </define>
356
+ <define name="thead">
357
+ <element name="thead">
358
+ <ref name="tr"/>
359
+ </element>
360
+ </define>
361
+ <define name="tfoot">
362
+ <element name="tfoot">
363
+ <ref name="tr"/>
364
+ </element>
365
+ </define>
366
+ <define name="tbody">
367
+ <element name="tbody">
368
+ <oneOrMore>
369
+ <ref name="tr"/>
370
+ </oneOrMore>
371
+ </element>
372
+ </define>
373
+ <define name="table-note">
374
+ <element name="note">
375
+ <ref name="paragraph"/>
376
+ </element>
377
+ </define>
378
+ <define name="tr">
379
+ <element name="tr">
380
+ <oneOrMore>
381
+ <choice>
382
+ <ref name="td"/>
383
+ <ref name="th"/>
384
+ </choice>
385
+ </oneOrMore>
386
+ </element>
387
+ </define>
388
+ <define name="td">
389
+ <element name="td">
390
+ <optional>
391
+ <attribute name="colspan"/>
392
+ </optional>
393
+ <optional>
394
+ <attribute name="rowspan"/>
395
+ </optional>
396
+ <optional>
397
+ <attribute name="align">
398
+ <choice>
399
+ <value>left</value>
400
+ <value>right</value>
401
+ <value>center</value>
402
+ </choice>
403
+ </attribute>
404
+ </optional>
405
+ <choice>
406
+ <zeroOrMore>
407
+ <ref name="TextElement"/>
408
+ </zeroOrMore>
409
+ <oneOrMore>
410
+ <ref name="paragraph-with-footnote"/>
411
+ </oneOrMore>
412
+ </choice>
413
+ </element>
414
+ </define>
415
+ <define name="th">
416
+ <element name="th">
417
+ <optional>
418
+ <attribute name="colspan"/>
419
+ </optional>
420
+ <optional>
421
+ <attribute name="rowspan"/>
422
+ </optional>
423
+ <optional>
424
+ <attribute name="align">
425
+ <choice>
426
+ <value>left</value>
427
+ <value>right</value>
428
+ <value>center</value>
429
+ </choice>
430
+ </attribute>
431
+ </optional>
432
+ <choice>
433
+ <zeroOrMore>
434
+ <ref name="TextElement"/>
435
+ </zeroOrMore>
436
+ <oneOrMore>
437
+ <ref name="paragraph-with-footnote"/>
438
+ </oneOrMore>
439
+ </choice>
440
+ </element>
441
+ </define>
442
+ <define name="example">
443
+ <element name="example">
444
+ <attribute name="id">
445
+ <data type="ID"/>
446
+ </attribute>
447
+ <optional>
448
+ <attribute name="unnumbered">
449
+ <data type="boolean"/>
450
+ </attribute>
451
+ </optional>
452
+ <optional>
453
+ <attribute name="subsequence"/>
454
+ </optional>
455
+ <optional>
456
+ <ref name="tname"/>
457
+ </optional>
458
+ <oneOrMore>
459
+ <choice>
460
+ <ref name="formula"/>
461
+ <ref name="ul"/>
462
+ <ref name="ol"/>
463
+ <ref name="dl"/>
464
+ <ref name="quote"/>
465
+ <ref name="sourcecode"/>
466
+ <ref name="paragraph-with-footnote"/>
467
+ </choice>
468
+ </oneOrMore>
469
+ <zeroOrMore>
470
+ <ref name="note"/>
471
+ </zeroOrMore>
472
+ </element>
473
+ </define>
474
+ <define name="admonition">
475
+ <element name="admonition">
476
+ <attribute name="type">
477
+ <ref name="AdmonitionType"/>
478
+ </attribute>
479
+ <optional>
480
+ <attribute name="class"/>
481
+ </optional>
482
+ <attribute name="id">
483
+ <data type="ID"/>
484
+ </attribute>
485
+ <optional>
486
+ <attribute name="uri">
487
+ <data type="anyURI"/>
488
+ </attribute>
489
+ </optional>
490
+ <optional>
491
+ <ref name="tname"/>
492
+ </optional>
493
+ <zeroOrMore>
494
+ <ref name="paragraph-with-footnote"/>
495
+ </zeroOrMore>
496
+ <zeroOrMore>
497
+ <ref name="note"/>
498
+ </zeroOrMore>
499
+ </element>
500
+ </define>
501
+ <define name="AdmonitionType">
502
+ <choice>
503
+ <value>warning</value>
504
+ <value>note</value>
505
+ <value>tip</value>
506
+ <value>important</value>
507
+ <value>caution</value>
508
+ <value>statement</value>
509
+ </choice>
510
+ </define>
511
+ <define name="figure">
512
+ <element name="figure">
513
+ <attribute name="id">
514
+ <data type="ID"/>
515
+ </attribute>
516
+ <optional>
517
+ <attribute name="unnumbered">
518
+ <data type="boolean"/>
519
+ </attribute>
520
+ </optional>
521
+ <optional>
522
+ <attribute name="subsequence"/>
523
+ </optional>
524
+ <optional>
525
+ <attribute name="class"/>
526
+ </optional>
527
+ <optional>
528
+ <ref name="source"/>
529
+ </optional>
530
+ <optional>
531
+ <ref name="tname"/>
532
+ </optional>
533
+ <choice>
534
+ <ref name="image"/>
535
+ <ref name="video"/>
536
+ <ref name="audio"/>
537
+ <ref name="pre"/>
538
+ <oneOrMore>
539
+ <ref name="paragraph-with-footnote"/>
540
+ </oneOrMore>
541
+ <zeroOrMore>
542
+ <ref name="figure"/>
543
+ </zeroOrMore>
544
+ </choice>
545
+ <zeroOrMore>
546
+ <ref name="fn"/>
547
+ </zeroOrMore>
548
+ <optional>
549
+ <ref name="dl"/>
550
+ </optional>
551
+ <zeroOrMore>
552
+ <ref name="note"/>
553
+ </zeroOrMore>
554
+ </element>
555
+ </define>
556
+ <define name="TextElement">
557
+ <choice>
558
+ <text/>
559
+ <ref name="em"/>
560
+ <ref name="eref"/>
561
+ <ref name="strong"/>
562
+ <ref name="stem"/>
563
+ <ref name="sub"/>
564
+ <ref name="sup"/>
565
+ <ref name="tt"/>
566
+ <ref name="underline"/>
567
+ <ref name="keyword"/>
568
+ <ref name="ruby"/>
569
+ <ref name="strike"/>
570
+ <ref name="smallcap"/>
571
+ <ref name="xref"/>
572
+ <ref name="br"/>
573
+ <ref name="hyperlink"/>
574
+ <ref name="hr"/>
575
+ <ref name="pagebreak"/>
576
+ <ref name="bookmark"/>
577
+ <ref name="image"/>
578
+ <ref name="index"/>
579
+ </choice>
580
+ </define>
581
+ <define name="PureTextElement">
582
+ <choice>
583
+ <text/>
584
+ <ref name="em"/>
585
+ <ref name="strong"/>
586
+ <ref name="sub"/>
587
+ <ref name="sup"/>
588
+ <ref name="tt"/>
589
+ <ref name="underline"/>
590
+ <ref name="strike"/>
591
+ <ref name="smallcap"/>
592
+ <ref name="br"/>
593
+ </choice>
594
+ </define>
595
+ <define name="source">
596
+ <element name="source">
597
+ <ref name="TypedUri"/>
598
+ </element>
599
+ </define>
600
+ <define name="em">
601
+ <element name="em">
602
+ <zeroOrMore>
603
+ <choice>
604
+ <ref name="PureTextElement"/>
605
+ <ref name="stem"/>
606
+ </choice>
607
+ </zeroOrMore>
608
+ </element>
609
+ </define>
610
+ <define name="strong">
611
+ <element name="strong">
612
+ <zeroOrMore>
613
+ <choice>
614
+ <ref name="PureTextElement"/>
615
+ <ref name="stem"/>
616
+ </choice>
617
+ </zeroOrMore>
618
+ </element>
619
+ </define>
620
+ <define name="tt">
621
+ <element name="tt">
622
+ <zeroOrMore>
623
+ <ref name="PureTextElement"/>
624
+ </zeroOrMore>
625
+ </element>
626
+ </define>
627
+ <define name="keyword">
628
+ <element name="keyword">
629
+ <zeroOrMore>
630
+ <ref name="PureTextElement"/>
631
+ </zeroOrMore>
632
+ </element>
633
+ </define>
634
+ <define name="sub">
635
+ <element name="sub">
636
+ <zeroOrMore>
637
+ <ref name="PureTextElement"/>
638
+ </zeroOrMore>
639
+ </element>
640
+ </define>
641
+ <define name="sup">
642
+ <element name="sup">
643
+ <zeroOrMore>
644
+ <ref name="PureTextElement"/>
645
+ </zeroOrMore>
646
+ </element>
647
+ </define>
648
+ <define name="strike">
649
+ <element name="strike">
650
+ <zeroOrMore>
651
+ <ref name="PureTextElement"/>
652
+ </zeroOrMore>
653
+ </element>
654
+ </define>
655
+ <define name="underline">
656
+ <element name="underline">
657
+ <zeroOrMore>
658
+ <ref name="PureTextElement"/>
659
+ </zeroOrMore>
660
+ </element>
661
+ </define>
662
+ <define name="smallcap">
663
+ <element name="smallcap">
664
+ <zeroOrMore>
665
+ <ref name="PureTextElement"/>
666
+ </zeroOrMore>
667
+ </element>
668
+ </define>
669
+ <define name="ruby">
670
+ <element name="ruby">
671
+ <zeroOrMore>
672
+ <choice>
673
+ <ref name="PureTextElement"/>
674
+ <ref name="rp"/>
675
+ <ref name="rt"/>
676
+ </choice>
677
+ </zeroOrMore>
678
+ </element>
679
+ </define>
680
+ <define name="rp">
681
+ <element name="rp">
682
+ <zeroOrMore>
683
+ <ref name="PureTextElement"/>
684
+ </zeroOrMore>
685
+ </element>
686
+ </define>
687
+ <define name="rt">
688
+ <element name="rt">
689
+ <zeroOrMore>
690
+ <ref name="PureTextElement"/>
691
+ </zeroOrMore>
692
+ </element>
693
+ </define>
694
+ <define name="br">
695
+ <element name="br">
696
+ <empty/>
697
+ </element>
698
+ </define>
699
+ <define name="hr">
700
+ <element name="hr">
701
+ <empty/>
702
+ </element>
703
+ </define>
704
+ <define name="pagebreak">
705
+ <element name="pagebreak">
706
+ <empty/>
707
+ </element>
708
+ </define>
709
+ <define name="index">
710
+ <element name="index">
711
+ <attribute name="primary"/>
712
+ <optional>
713
+ <attribute name="secondary"/>
714
+ </optional>
715
+ <optional>
716
+ <attribute name="tertiary"/>
717
+ </optional>
718
+ </element>
719
+ </define>
720
+ <!-- bare ID element, used for referencing arbitrary spans of text -->
721
+ <define name="bookmark">
722
+ <element name="bookmark">
723
+ <attribute name="id">
724
+ <data type="ID"/>
725
+ </attribute>
726
+ <empty/>
727
+ </element>
728
+ </define>
729
+ <define name="ReferenceFormat">
730
+ <choice>
731
+ <value>external</value>
732
+ <value>inline</value>
733
+ <value>footnote</value>
734
+ <value>callout</value>
735
+ </choice>
736
+ </define>
737
+ <define name="eref">
738
+ <element name="eref">
739
+ <ref name="erefType"/>
740
+ </element>
741
+ </define>
742
+ <define name="erefType">
743
+ <optional>
744
+ <attribute name="normative">
745
+ <data type="boolean"/>
746
+ </attribute>
747
+ </optional>
748
+ <attribute name="citeas"/>
749
+ <attribute name="type">
750
+ <ref name="ReferenceFormat"/>
751
+ </attribute>
752
+ <optional>
753
+ <attribute name="alt"/>
754
+ </optional>
755
+ <ref name="CitationType"/>
756
+ <text/>
757
+ </define>
758
+ <define name="hyperlink">
759
+ <element name="link">
760
+ <attribute name="target">
761
+ <data type="anyURI"/>
762
+ </attribute>
763
+ <attribute name="type">
764
+ <ref name="ReferenceFormat"/>
765
+ </attribute>
766
+ <optional>
767
+ <attribute name="alt"/>
768
+ </optional>
769
+ <text/>
770
+ </element>
771
+ </define>
772
+ <define name="xref">
773
+ <element name="xref">
774
+ <attribute name="target">
775
+ <data type="IDREF"/>
776
+ </attribute>
777
+ <attribute name="type">
778
+ <ref name="ReferenceFormat"/>
779
+ </attribute>
780
+ <optional>
781
+ <attribute name="alt"/>
782
+ </optional>
783
+ <text/>
784
+ </element>
785
+ </define>
786
+ <define name="fn">
787
+ <element name="fn">
788
+ <attribute name="reference"/>
789
+ <oneOrMore>
790
+ <ref name="paragraph"/>
791
+ </oneOrMore>
792
+ </element>
793
+ </define>
794
+ <!--
795
+ This is xref with fixed @type="footnote", and @target built in as paragraph+
796
+ @reference replaces ReferenceElement/text
797
+ so <fn reference="2"><p>This is a footnote</p></fn>
798
+ corresponds to
799
+ <eref type="footnote" target="fn2">2</xref> <p id="fn2">This is a footnote</p>
800
+ -->
801
+ <define name="callout">
802
+ <element name="callout">
803
+ <attribute name="target">
804
+ <data type="IDREF"/>
805
+ </attribute>
806
+ <text/>
807
+ </element>
808
+ </define>
809
+ <!--
810
+ This is xref with fixed @type="callout"; the target by convention is in an annotation in the same source code snippet
811
+ so <callout target="xyz">1</callout>
812
+ corresponds to <xref type="callout" target="xyz">1</xref>
813
+ -->
814
+ <define name="image">
815
+ <element name="image">
816
+ <attribute name="id">
817
+ <data type="ID"/>
818
+ </attribute>
819
+ <attribute name="src">
820
+ <data type="anyURI"/>
821
+ </attribute>
822
+ <attribute name="mimetype"/>
823
+ <optional>
824
+ <attribute name="filename"/>
825
+ </optional>
826
+ <optional>
827
+ <attribute name="width">
828
+ <choice>
829
+ <data type="int"/>
830
+ <value>auto</value>
831
+ </choice>
832
+ </attribute>
833
+ </optional>
834
+ <optional>
835
+ <attribute name="height">
836
+ <choice>
837
+ <data type="int"/>
838
+ <value>auto</value>
839
+ </choice>
840
+ </attribute>
841
+ </optional>
842
+ <optional>
843
+ <attribute name="alt"/>
844
+ </optional>
845
+ <optional>
846
+ <attribute name="title"/>
847
+ </optional>
848
+ <optional>
849
+ <attribute name="longdesc">
850
+ <data type="anyURI"/>
851
+ </attribute>
852
+ </optional>
853
+ </element>
854
+ </define>
855
+ <define name="video">
856
+ <element name="video">
857
+ <attribute name="id">
858
+ <data type="ID"/>
859
+ </attribute>
860
+ <attribute name="src">
861
+ <data type="anyURI"/>
862
+ </attribute>
863
+ <attribute name="mimetype"/>
864
+ <optional>
865
+ <attribute name="filename"/>
866
+ </optional>
867
+ <optional>
868
+ <attribute name="width">
869
+ <choice>
870
+ <data type="int"/>
871
+ <value>auto</value>
872
+ </choice>
873
+ </attribute>
874
+ </optional>
875
+ <optional>
876
+ <attribute name="height">
877
+ <choice>
878
+ <data type="int"/>
879
+ <value>auto</value>
880
+ </choice>
881
+ </attribute>
882
+ </optional>
883
+ <optional>
884
+ <attribute name="alt"/>
885
+ </optional>
886
+ <optional>
887
+ <attribute name="title"/>
888
+ </optional>
889
+ <optional>
890
+ <attribute name="longdesc">
891
+ <data type="anyURI"/>
892
+ </attribute>
893
+ </optional>
894
+ <zeroOrMore>
895
+ <ref name="altsource"/>
896
+ </zeroOrMore>
897
+ </element>
898
+ </define>
899
+ <define name="audio">
900
+ <element name="audio">
901
+ <attribute name="id">
902
+ <data type="ID"/>
903
+ </attribute>
904
+ <attribute name="src">
905
+ <data type="anyURI"/>
906
+ </attribute>
907
+ <attribute name="mimetype"/>
908
+ <optional>
909
+ <attribute name="filename"/>
910
+ </optional>
911
+ <optional>
912
+ <attribute name="alt"/>
913
+ </optional>
914
+ <optional>
915
+ <attribute name="title"/>
916
+ </optional>
917
+ <optional>
918
+ <attribute name="longdesc">
919
+ <data type="anyURI"/>
920
+ </attribute>
921
+ </optional>
922
+ <zeroOrMore>
923
+ <ref name="altsource"/>
924
+ </zeroOrMore>
925
+ </element>
926
+ </define>
927
+ <define name="altsource">
928
+ <element name="altsource">
929
+ <attribute name="src">
930
+ <data type="anyURI"/>
931
+ </attribute>
932
+ <attribute name="mimetype"/>
933
+ <optional>
934
+ <attribute name="filename"/>
935
+ </optional>
936
+ </element>
937
+ </define>
938
+ <define name="stem">
939
+ <element name="stem">
940
+ <attribute name="type">
941
+ <choice>
942
+ <value>MathML</value>
943
+ <value>AsciiMath</value>
944
+ </choice>
945
+ </attribute>
946
+ <oneOrMore>
947
+ <choice>
948
+ <text/>
949
+ <ref name="AnyElement"/>
950
+ </choice>
951
+ </oneOrMore>
952
+ </element>
953
+ </define>
954
+ <define name="annotation">
955
+ <element name="annotation">
956
+ <attribute name="id">
957
+ <data type="ID"/>
958
+ </attribute>
959
+ <ref name="paragraph"/>
960
+ </element>
961
+ </define>
962
+ <define name="ul">
963
+ <element name="ul">
964
+ <attribute name="id">
965
+ <data type="ID"/>
966
+ </attribute>
967
+ <oneOrMore>
968
+ <ref name="li"/>
969
+ </oneOrMore>
970
+ <zeroOrMore>
971
+ <ref name="note"/>
972
+ </zeroOrMore>
973
+ </element>
974
+ </define>
975
+ <define name="li">
976
+ <element name="li">
977
+ <optional>
978
+ <attribute name="id">
979
+ <data type="ID"/>
980
+ </attribute>
981
+ </optional>
982
+ <oneOrMore>
983
+ <ref name="paragraph-with-footnote"/>
984
+ </oneOrMore>
985
+ </element>
986
+ </define>
987
+ <define name="ol">
988
+ <element name="ol">
989
+ <attribute name="id">
990
+ <data type="ID"/>
991
+ </attribute>
992
+ <attribute name="type">
993
+ <choice>
994
+ <value>roman</value>
995
+ <value>alphabet</value>
996
+ <value>arabic</value>
997
+ <value>roman_upper</value>
998
+ <value>alphabet_upper</value>
999
+ </choice>
1000
+ </attribute>
1001
+ <oneOrMore>
1002
+ <ref name="li"/>
1003
+ </oneOrMore>
1004
+ <zeroOrMore>
1005
+ <ref name="note"/>
1006
+ </zeroOrMore>
1007
+ </element>
1008
+ </define>
1009
+ <define name="dl">
1010
+ <element name="dl">
1011
+ <attribute name="id">
1012
+ <data type="ID"/>
1013
+ </attribute>
1014
+ <oneOrMore>
1015
+ <ref name="dt"/>
1016
+ <ref name="dd"/>
1017
+ </oneOrMore>
1018
+ <zeroOrMore>
1019
+ <ref name="note"/>
1020
+ </zeroOrMore>
1021
+ </element>
1022
+ </define>
1023
+ <define name="dt">
1024
+ <element name="dt">
1025
+ <zeroOrMore>
1026
+ <ref name="TextElement"/>
1027
+ </zeroOrMore>
1028
+ </element>
1029
+ </define>
1030
+ <define name="dd">
1031
+ <element name="dd">
1032
+ <zeroOrMore>
1033
+ <ref name="paragraph-with-footnote"/>
1034
+ </zeroOrMore>
1035
+ </element>
1036
+ </define>
1037
+ <define name="ext">
1038
+ <element name="ext">
1039
+ <ref name="BibDataExtensionType"/>
1040
+ </element>
1041
+ </define>
1042
+ <define name="BibDataExtensionType">
1043
+ <ref name="doctype"/>
1044
+ </define>
1045
+ <define name="doctype">
1046
+ <element name="doctype">
1047
+ <ref name="DocumentType"/>
1048
+ </element>
1049
+ </define>
1050
+ <define name="DocumentType">
1051
+ <value>document</value>
1052
+ </define>
1053
+ <define name="BibData">
1054
+ <ref name="BibliographicItem"/>
1055
+ <optional>
1056
+ <ref name="ext"/>
1057
+ </optional>
1058
+ </define>
1059
+ </grammar>