metanorma-ietf 1.0.10 → 2.0.0

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