metanorma-bipm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/macos.yml +38 -0
  3. data/.github/workflows/ubuntu.yml +56 -0
  4. data/.github/workflows/windows.yml +40 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +11 -0
  7. data/LICENSE +25 -0
  8. data/README.adoc +154 -0
  9. data/Rakefile +8 -0
  10. data/bin/console +14 -0
  11. data/bin/rspec +18 -0
  12. data/bin/setup +8 -0
  13. data/lib/asciidoctor/bipm.rb +8 -0
  14. data/lib/asciidoctor/bipm/basicdoc.rng +1082 -0
  15. data/lib/asciidoctor/bipm/biblio.rng +1237 -0
  16. data/lib/asciidoctor/bipm/bipm.rng +152 -0
  17. data/lib/asciidoctor/bipm/boilerplate-en.xml +21 -0
  18. data/lib/asciidoctor/bipm/boilerplate-fr.xml +21 -0
  19. data/lib/asciidoctor/bipm/converter.rb +85 -0
  20. data/lib/asciidoctor/bipm/isodoc.rng +1620 -0
  21. data/lib/asciidoctor/bipm/reqt.rng +194 -0
  22. data/lib/isodoc/bipm.rb +9 -0
  23. data/lib/isodoc/bipm/base_convert.rb +11 -0
  24. data/lib/isodoc/bipm/bipm.brochure.xsl +5447 -0
  25. data/lib/isodoc/bipm/html/html_bipm_intro.html +8 -0
  26. data/lib/isodoc/bipm/html/html_bipm_titlepage.html +71 -0
  27. data/lib/isodoc/bipm/html/htmlstyle.css +986 -0
  28. data/lib/isodoc/bipm/html/htmlstyle.scss +743 -0
  29. data/lib/isodoc/bipm/html/logo.png +0 -0
  30. data/lib/isodoc/bipm/html/scripts.html +71 -0
  31. data/lib/isodoc/bipm/html_convert.rb +15 -0
  32. data/lib/isodoc/bipm/i18n-en.yaml +1 -0
  33. data/lib/isodoc/bipm/i18n-fr.yaml +18 -0
  34. data/lib/isodoc/bipm/i18n.rb +9 -0
  35. data/lib/isodoc/bipm/init.rb +24 -0
  36. data/lib/isodoc/bipm/metadata.rb +41 -0
  37. data/lib/isodoc/bipm/pdf_convert.rb +19 -0
  38. data/lib/isodoc/bipm/presentation_xml_convert.rb +27 -0
  39. data/lib/isodoc/bipm/xref.rb +16 -0
  40. data/lib/metanorma-bipm.rb +11 -0
  41. data/lib/metanorma/bipm.rb +32 -0
  42. data/lib/metanorma/bipm/processor.rb +35 -0
  43. data/lib/metanorma/bipm/version.rb +5 -0
  44. data/metanorma-bipm.gemspec +42 -0
  45. data/metanorma.yml +74 -0
  46. metadata +258 -0
@@ -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,8 @@
1
+ require "metanorma/bipm/version"
2
+ require_relative "bipm/converter"
3
+
4
+ module Asciidoctor
5
+ module BIPM
6
+
7
+ end
8
+ end
@@ -0,0 +1,1082 @@
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
+ <optional>
406
+ <attribute name="valign">
407
+ <choice>
408
+ <value>top</value>
409
+ <value>middle</value>
410
+ <value>bottom</value>
411
+ <value>baseline</value>
412
+ </choice>
413
+ </attribute>
414
+ </optional>
415
+ <choice>
416
+ <zeroOrMore>
417
+ <ref name="TextElement"/>
418
+ </zeroOrMore>
419
+ <oneOrMore>
420
+ <ref name="paragraph-with-footnote"/>
421
+ </oneOrMore>
422
+ </choice>
423
+ </element>
424
+ </define>
425
+ <define name="th">
426
+ <element name="th">
427
+ <optional>
428
+ <attribute name="colspan"/>
429
+ </optional>
430
+ <optional>
431
+ <attribute name="rowspan"/>
432
+ </optional>
433
+ <optional>
434
+ <attribute name="align">
435
+ <choice>
436
+ <value>left</value>
437
+ <value>right</value>
438
+ <value>center</value>
439
+ </choice>
440
+ </attribute>
441
+ </optional>
442
+ <optional>
443
+ <attribute name="valign">
444
+ <choice>
445
+ <value>top</value>
446
+ <value>middle</value>
447
+ <value>bottom</value>
448
+ <value>baseline</value>
449
+ </choice>
450
+ </attribute>
451
+ </optional>
452
+ <choice>
453
+ <zeroOrMore>
454
+ <ref name="TextElement"/>
455
+ </zeroOrMore>
456
+ <oneOrMore>
457
+ <ref name="paragraph-with-footnote"/>
458
+ </oneOrMore>
459
+ </choice>
460
+ </element>
461
+ </define>
462
+ <define name="example">
463
+ <element name="example">
464
+ <attribute name="id">
465
+ <data type="ID"/>
466
+ </attribute>
467
+ <optional>
468
+ <attribute name="unnumbered">
469
+ <data type="boolean"/>
470
+ </attribute>
471
+ </optional>
472
+ <optional>
473
+ <attribute name="subsequence"/>
474
+ </optional>
475
+ <optional>
476
+ <ref name="tname"/>
477
+ </optional>
478
+ <oneOrMore>
479
+ <choice>
480
+ <ref name="formula"/>
481
+ <ref name="ul"/>
482
+ <ref name="ol"/>
483
+ <ref name="dl"/>
484
+ <ref name="quote"/>
485
+ <ref name="sourcecode"/>
486
+ <ref name="paragraph-with-footnote"/>
487
+ </choice>
488
+ </oneOrMore>
489
+ <zeroOrMore>
490
+ <ref name="note"/>
491
+ </zeroOrMore>
492
+ </element>
493
+ </define>
494
+ <define name="admonition">
495
+ <element name="admonition">
496
+ <attribute name="type">
497
+ <ref name="AdmonitionType"/>
498
+ </attribute>
499
+ <optional>
500
+ <attribute name="class"/>
501
+ </optional>
502
+ <attribute name="id">
503
+ <data type="ID"/>
504
+ </attribute>
505
+ <optional>
506
+ <attribute name="uri">
507
+ <data type="anyURI"/>
508
+ </attribute>
509
+ </optional>
510
+ <optional>
511
+ <ref name="tname"/>
512
+ </optional>
513
+ <zeroOrMore>
514
+ <ref name="paragraph-with-footnote"/>
515
+ </zeroOrMore>
516
+ <zeroOrMore>
517
+ <ref name="note"/>
518
+ </zeroOrMore>
519
+ </element>
520
+ </define>
521
+ <define name="AdmonitionType">
522
+ <choice>
523
+ <value>warning</value>
524
+ <value>note</value>
525
+ <value>tip</value>
526
+ <value>important</value>
527
+ <value>caution</value>
528
+ <value>statement</value>
529
+ </choice>
530
+ </define>
531
+ <define name="figure">
532
+ <element name="figure">
533
+ <attribute name="id">
534
+ <data type="ID"/>
535
+ </attribute>
536
+ <optional>
537
+ <attribute name="unnumbered">
538
+ <data type="boolean"/>
539
+ </attribute>
540
+ </optional>
541
+ <optional>
542
+ <attribute name="subsequence"/>
543
+ </optional>
544
+ <optional>
545
+ <attribute name="class"/>
546
+ </optional>
547
+ <optional>
548
+ <ref name="source"/>
549
+ </optional>
550
+ <optional>
551
+ <ref name="tname"/>
552
+ </optional>
553
+ <choice>
554
+ <ref name="image"/>
555
+ <ref name="video"/>
556
+ <ref name="audio"/>
557
+ <ref name="pre"/>
558
+ <oneOrMore>
559
+ <ref name="paragraph-with-footnote"/>
560
+ </oneOrMore>
561
+ <zeroOrMore>
562
+ <ref name="figure"/>
563
+ </zeroOrMore>
564
+ </choice>
565
+ <zeroOrMore>
566
+ <ref name="fn"/>
567
+ </zeroOrMore>
568
+ <optional>
569
+ <ref name="dl"/>
570
+ </optional>
571
+ <zeroOrMore>
572
+ <ref name="note"/>
573
+ </zeroOrMore>
574
+ </element>
575
+ </define>
576
+ <define name="TextElement">
577
+ <choice>
578
+ <text/>
579
+ <ref name="em"/>
580
+ <ref name="eref"/>
581
+ <ref name="strong"/>
582
+ <ref name="stem"/>
583
+ <ref name="sub"/>
584
+ <ref name="sup"/>
585
+ <ref name="tt"/>
586
+ <ref name="underline"/>
587
+ <ref name="keyword"/>
588
+ <ref name="ruby"/>
589
+ <ref name="strike"/>
590
+ <ref name="smallcap"/>
591
+ <ref name="xref"/>
592
+ <ref name="br"/>
593
+ <ref name="hyperlink"/>
594
+ <ref name="hr"/>
595
+ <ref name="pagebreak"/>
596
+ <ref name="bookmark"/>
597
+ <ref name="image"/>
598
+ <ref name="index"/>
599
+ </choice>
600
+ </define>
601
+ <define name="PureTextElement">
602
+ <choice>
603
+ <text/>
604
+ <ref name="em"/>
605
+ <ref name="strong"/>
606
+ <ref name="sub"/>
607
+ <ref name="sup"/>
608
+ <ref name="tt"/>
609
+ <ref name="underline"/>
610
+ <ref name="strike"/>
611
+ <ref name="smallcap"/>
612
+ <ref name="br"/>
613
+ </choice>
614
+ </define>
615
+ <define name="source">
616
+ <element name="source">
617
+ <ref name="TypedUri"/>
618
+ </element>
619
+ </define>
620
+ <define name="em">
621
+ <element name="em">
622
+ <zeroOrMore>
623
+ <choice>
624
+ <ref name="PureTextElement"/>
625
+ <ref name="stem"/>
626
+ </choice>
627
+ </zeroOrMore>
628
+ </element>
629
+ </define>
630
+ <define name="strong">
631
+ <element name="strong">
632
+ <zeroOrMore>
633
+ <choice>
634
+ <ref name="PureTextElement"/>
635
+ <ref name="stem"/>
636
+ </choice>
637
+ </zeroOrMore>
638
+ </element>
639
+ </define>
640
+ <define name="tt">
641
+ <element name="tt">
642
+ <zeroOrMore>
643
+ <ref name="PureTextElement"/>
644
+ </zeroOrMore>
645
+ </element>
646
+ </define>
647
+ <define name="keyword">
648
+ <element name="keyword">
649
+ <zeroOrMore>
650
+ <ref name="PureTextElement"/>
651
+ </zeroOrMore>
652
+ </element>
653
+ </define>
654
+ <define name="sub">
655
+ <element name="sub">
656
+ <zeroOrMore>
657
+ <ref name="PureTextElement"/>
658
+ </zeroOrMore>
659
+ </element>
660
+ </define>
661
+ <define name="sup">
662
+ <element name="sup">
663
+ <zeroOrMore>
664
+ <ref name="PureTextElement"/>
665
+ </zeroOrMore>
666
+ </element>
667
+ </define>
668
+ <define name="strike">
669
+ <element name="strike">
670
+ <zeroOrMore>
671
+ <ref name="PureTextElement"/>
672
+ </zeroOrMore>
673
+ </element>
674
+ </define>
675
+ <define name="underline">
676
+ <element name="underline">
677
+ <zeroOrMore>
678
+ <ref name="PureTextElement"/>
679
+ </zeroOrMore>
680
+ </element>
681
+ </define>
682
+ <define name="smallcap">
683
+ <element name="smallcap">
684
+ <zeroOrMore>
685
+ <ref name="PureTextElement"/>
686
+ </zeroOrMore>
687
+ </element>
688
+ </define>
689
+ <define name="ruby">
690
+ <element name="ruby">
691
+ <zeroOrMore>
692
+ <choice>
693
+ <ref name="PureTextElement"/>
694
+ <ref name="rp"/>
695
+ <ref name="rt"/>
696
+ </choice>
697
+ </zeroOrMore>
698
+ </element>
699
+ </define>
700
+ <define name="rp">
701
+ <element name="rp">
702
+ <zeroOrMore>
703
+ <ref name="PureTextElement"/>
704
+ </zeroOrMore>
705
+ </element>
706
+ </define>
707
+ <define name="rt">
708
+ <element name="rt">
709
+ <zeroOrMore>
710
+ <ref name="PureTextElement"/>
711
+ </zeroOrMore>
712
+ </element>
713
+ </define>
714
+ <define name="br">
715
+ <element name="br">
716
+ <empty/>
717
+ </element>
718
+ </define>
719
+ <define name="hr">
720
+ <element name="hr">
721
+ <empty/>
722
+ </element>
723
+ </define>
724
+ <define name="pagebreak">
725
+ <element name="pagebreak">
726
+ <empty/>
727
+ </element>
728
+ </define>
729
+ <define name="index">
730
+ <element name="index">
731
+ <attribute name="primary"/>
732
+ <optional>
733
+ <attribute name="secondary"/>
734
+ </optional>
735
+ <optional>
736
+ <attribute name="tertiary"/>
737
+ </optional>
738
+ </element>
739
+ </define>
740
+ <!-- bare ID element, used for referencing arbitrary spans of text -->
741
+ <define name="bookmark">
742
+ <element name="bookmark">
743
+ <attribute name="id">
744
+ <data type="ID"/>
745
+ </attribute>
746
+ <empty/>
747
+ </element>
748
+ </define>
749
+ <define name="ReferenceFormat">
750
+ <choice>
751
+ <value>external</value>
752
+ <value>inline</value>
753
+ <value>footnote</value>
754
+ <value>callout</value>
755
+ </choice>
756
+ </define>
757
+ <define name="eref">
758
+ <element name="eref">
759
+ <ref name="erefType"/>
760
+ </element>
761
+ </define>
762
+ <define name="erefType">
763
+ <optional>
764
+ <attribute name="normative">
765
+ <data type="boolean"/>
766
+ </attribute>
767
+ </optional>
768
+ <attribute name="citeas"/>
769
+ <attribute name="type">
770
+ <ref name="ReferenceFormat"/>
771
+ </attribute>
772
+ <optional>
773
+ <attribute name="alt"/>
774
+ </optional>
775
+ <ref name="CitationType"/>
776
+ <text/>
777
+ </define>
778
+ <define name="hyperlink">
779
+ <element name="link">
780
+ <attribute name="target">
781
+ <data type="anyURI"/>
782
+ </attribute>
783
+ <attribute name="type">
784
+ <ref name="ReferenceFormat"/>
785
+ </attribute>
786
+ <optional>
787
+ <attribute name="alt"/>
788
+ </optional>
789
+ <text/>
790
+ </element>
791
+ </define>
792
+ <define name="xref">
793
+ <element name="xref">
794
+ <attribute name="target">
795
+ <data type="IDREF"/>
796
+ </attribute>
797
+ <attribute name="type">
798
+ <ref name="ReferenceFormat"/>
799
+ </attribute>
800
+ <optional>
801
+ <attribute name="alt"/>
802
+ </optional>
803
+ <text/>
804
+ </element>
805
+ </define>
806
+ <define name="fn">
807
+ <element name="fn">
808
+ <attribute name="reference"/>
809
+ <oneOrMore>
810
+ <ref name="paragraph"/>
811
+ </oneOrMore>
812
+ </element>
813
+ </define>
814
+ <!--
815
+ This is xref with fixed @type="footnote", and @target built in as paragraph+
816
+ @reference replaces ReferenceElement/text
817
+ so <fn reference="2"><p>This is a footnote</p></fn>
818
+ corresponds to
819
+ <eref type="footnote" target="fn2">2</xref> <p id="fn2">This is a footnote</p>
820
+ -->
821
+ <define name="callout">
822
+ <element name="callout">
823
+ <attribute name="target">
824
+ <data type="IDREF"/>
825
+ </attribute>
826
+ <text/>
827
+ </element>
828
+ </define>
829
+ <!--
830
+ This is xref with fixed @type="callout"; the target by convention is in an annotation in the same source code snippet
831
+ so <callout target="xyz">1</callout>
832
+ corresponds to <xref type="callout" target="xyz">1</xref>
833
+ -->
834
+ <define name="image">
835
+ <element name="image">
836
+ <attribute name="id">
837
+ <data type="ID"/>
838
+ </attribute>
839
+ <attribute name="src">
840
+ <data type="anyURI"/>
841
+ </attribute>
842
+ <attribute name="mimetype"/>
843
+ <optional>
844
+ <attribute name="filename"/>
845
+ </optional>
846
+ <optional>
847
+ <attribute name="width">
848
+ <choice>
849
+ <data type="int"/>
850
+ <value>auto</value>
851
+ </choice>
852
+ </attribute>
853
+ </optional>
854
+ <optional>
855
+ <attribute name="height">
856
+ <choice>
857
+ <data type="int"/>
858
+ <value>auto</value>
859
+ </choice>
860
+ </attribute>
861
+ </optional>
862
+ <optional>
863
+ <attribute name="alt"/>
864
+ </optional>
865
+ <optional>
866
+ <attribute name="title"/>
867
+ </optional>
868
+ <optional>
869
+ <attribute name="longdesc">
870
+ <data type="anyURI"/>
871
+ </attribute>
872
+ </optional>
873
+ </element>
874
+ </define>
875
+ <define name="video">
876
+ <element name="video">
877
+ <attribute name="id">
878
+ <data type="ID"/>
879
+ </attribute>
880
+ <attribute name="src">
881
+ <data type="anyURI"/>
882
+ </attribute>
883
+ <attribute name="mimetype"/>
884
+ <optional>
885
+ <attribute name="filename"/>
886
+ </optional>
887
+ <optional>
888
+ <attribute name="width">
889
+ <choice>
890
+ <data type="int"/>
891
+ <value>auto</value>
892
+ </choice>
893
+ </attribute>
894
+ </optional>
895
+ <optional>
896
+ <attribute name="height">
897
+ <choice>
898
+ <data type="int"/>
899
+ <value>auto</value>
900
+ </choice>
901
+ </attribute>
902
+ </optional>
903
+ <optional>
904
+ <attribute name="alt"/>
905
+ </optional>
906
+ <optional>
907
+ <attribute name="title"/>
908
+ </optional>
909
+ <optional>
910
+ <attribute name="longdesc">
911
+ <data type="anyURI"/>
912
+ </attribute>
913
+ </optional>
914
+ <zeroOrMore>
915
+ <ref name="altsource"/>
916
+ </zeroOrMore>
917
+ </element>
918
+ </define>
919
+ <define name="audio">
920
+ <element name="audio">
921
+ <attribute name="id">
922
+ <data type="ID"/>
923
+ </attribute>
924
+ <attribute name="src">
925
+ <data type="anyURI"/>
926
+ </attribute>
927
+ <attribute name="mimetype"/>
928
+ <optional>
929
+ <attribute name="filename"/>
930
+ </optional>
931
+ <optional>
932
+ <attribute name="alt"/>
933
+ </optional>
934
+ <optional>
935
+ <attribute name="title"/>
936
+ </optional>
937
+ <optional>
938
+ <attribute name="longdesc">
939
+ <data type="anyURI"/>
940
+ </attribute>
941
+ </optional>
942
+ <zeroOrMore>
943
+ <ref name="altsource"/>
944
+ </zeroOrMore>
945
+ </element>
946
+ </define>
947
+ <define name="altsource">
948
+ <element name="altsource">
949
+ <attribute name="src">
950
+ <data type="anyURI"/>
951
+ </attribute>
952
+ <attribute name="mimetype"/>
953
+ <optional>
954
+ <attribute name="filename"/>
955
+ </optional>
956
+ </element>
957
+ </define>
958
+ <define name="stem">
959
+ <element name="stem">
960
+ <attribute name="type">
961
+ <choice>
962
+ <value>MathML</value>
963
+ <value>AsciiMath</value>
964
+ </choice>
965
+ </attribute>
966
+ <oneOrMore>
967
+ <choice>
968
+ <text/>
969
+ <ref name="AnyElement"/>
970
+ </choice>
971
+ </oneOrMore>
972
+ </element>
973
+ </define>
974
+ <define name="annotation">
975
+ <element name="annotation">
976
+ <attribute name="id">
977
+ <data type="ID"/>
978
+ </attribute>
979
+ <ref name="paragraph"/>
980
+ </element>
981
+ </define>
982
+ <define name="ul">
983
+ <element name="ul">
984
+ <attribute name="id">
985
+ <data type="ID"/>
986
+ </attribute>
987
+ <oneOrMore>
988
+ <ref name="li"/>
989
+ </oneOrMore>
990
+ <zeroOrMore>
991
+ <ref name="note"/>
992
+ </zeroOrMore>
993
+ </element>
994
+ </define>
995
+ <define name="li">
996
+ <element name="li">
997
+ <optional>
998
+ <attribute name="id">
999
+ <data type="ID"/>
1000
+ </attribute>
1001
+ </optional>
1002
+ <oneOrMore>
1003
+ <ref name="paragraph-with-footnote"/>
1004
+ </oneOrMore>
1005
+ </element>
1006
+ </define>
1007
+ <define name="ol">
1008
+ <element name="ol">
1009
+ <attribute name="id">
1010
+ <data type="ID"/>
1011
+ </attribute>
1012
+ <attribute name="type">
1013
+ <choice>
1014
+ <value>roman</value>
1015
+ <value>alphabet</value>
1016
+ <value>arabic</value>
1017
+ <value>roman_upper</value>
1018
+ <value>alphabet_upper</value>
1019
+ </choice>
1020
+ </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1024
+ <oneOrMore>
1025
+ <ref name="li"/>
1026
+ </oneOrMore>
1027
+ <zeroOrMore>
1028
+ <ref name="note"/>
1029
+ </zeroOrMore>
1030
+ </element>
1031
+ </define>
1032
+ <define name="dl">
1033
+ <element name="dl">
1034
+ <attribute name="id">
1035
+ <data type="ID"/>
1036
+ </attribute>
1037
+ <oneOrMore>
1038
+ <ref name="dt"/>
1039
+ <ref name="dd"/>
1040
+ </oneOrMore>
1041
+ <zeroOrMore>
1042
+ <ref name="note"/>
1043
+ </zeroOrMore>
1044
+ </element>
1045
+ </define>
1046
+ <define name="dt">
1047
+ <element name="dt">
1048
+ <zeroOrMore>
1049
+ <ref name="TextElement"/>
1050
+ </zeroOrMore>
1051
+ </element>
1052
+ </define>
1053
+ <define name="dd">
1054
+ <element name="dd">
1055
+ <zeroOrMore>
1056
+ <ref name="paragraph-with-footnote"/>
1057
+ </zeroOrMore>
1058
+ </element>
1059
+ </define>
1060
+ <define name="ext">
1061
+ <element name="ext">
1062
+ <ref name="BibDataExtensionType"/>
1063
+ </element>
1064
+ </define>
1065
+ <define name="BibDataExtensionType">
1066
+ <ref name="doctype"/>
1067
+ </define>
1068
+ <define name="doctype">
1069
+ <element name="doctype">
1070
+ <ref name="DocumentType"/>
1071
+ </element>
1072
+ </define>
1073
+ <define name="DocumentType">
1074
+ <value>document</value>
1075
+ </define>
1076
+ <define name="BibData">
1077
+ <ref name="BibliographicItem"/>
1078
+ <optional>
1079
+ <ref name="ext"/>
1080
+ </optional>
1081
+ </define>
1082
+ </grammar>