metanorma-nist 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -598,7 +598,7 @@
598
598
  <ref name="script"/>
599
599
  </zeroOrMore>
600
600
  <zeroOrMore>
601
- <ref name="abstract"/>
601
+ <ref name="bibabstract"/>
602
602
  </zeroOrMore>
603
603
  <optional>
604
604
  <ref name="status"/>
@@ -817,7 +817,7 @@
817
817
  <define name="medium">
818
818
  <element name="medium">
819
819
  <optional>
820
- <ref name="content"/>
820
+ <ref name="bcontent"/>
821
821
  </optional>
822
822
  <optional>
823
823
  <ref name="genre"/>
@@ -836,7 +836,7 @@
836
836
  </optional>
837
837
  </element>
838
838
  </define>
839
- <define name="content">
839
+ <define name="bcontent">
840
840
  <element name="content">
841
841
  <text/>
842
842
  </element>
@@ -959,7 +959,7 @@
959
959
  <ref name="FormattedString"/>
960
960
  </element>
961
961
  </define>
962
- <define name="abstract">
962
+ <define name="bibabstract">
963
963
  <element name="abstract">
964
964
  <ref name="FormattedString"/>
965
965
  </element>
@@ -16,7 +16,8 @@ module Asciidoctor
16
16
  register_for "nist"
17
17
 
18
18
  def example(node)
19
- return pseudocode_example(node) if node.attr("style") == "pseudocode"
19
+ role = node.role || node.attr("style")
20
+ return pseudocode_example(node) if role == "pseudocode"
20
21
  super
21
22
  end
22
23
 
@@ -31,7 +32,8 @@ module Asciidoctor
31
32
  end
32
33
 
33
34
  def table(node)
34
- return errata(node) if node.attr("style") == "errata"
35
+ role = node.role || node.attr("style")
36
+ return errata(node) if role == "errata"
35
37
  super
36
38
  end
37
39
 
@@ -68,7 +70,8 @@ module Asciidoctor
68
70
  end
69
71
 
70
72
  def dlist(node)
71
- return glossary(node) if node.attr("style") == "glossary"
73
+ role = node.role || node.attr("style")
74
+ return glossary(node) if role == "glossary"
72
75
  super
73
76
  end
74
77
 
@@ -145,9 +148,9 @@ module Asciidoctor
145
148
  end
146
149
 
147
150
  def clause_parse(attrs, xml, node)
148
- attrs[:preface] = true if node.attr("style") == "preface"
149
- attrs[:executivesummary] = true if node.attr("style") ==
150
- "executive-summary"
151
+ role = node.role || node.attr("style")
152
+ attrs[:preface] = true if role == "preface"
153
+ attrs[:executivesummary] = true if role == "executive-summary"
151
154
  super
152
155
  end
153
156
 
@@ -174,7 +177,7 @@ module Asciidoctor
174
177
  end
175
178
 
176
179
  def section(node)
177
- a = { id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node) }
180
+ a = section_attributes(node)
178
181
  noko do |xml|
179
182
  case sectiontype(node)
180
183
  #when "normative references" then norm_ref_parse(a, xml, node)
@@ -182,13 +182,6 @@ module Asciidoctor
182
182
  end
183
183
  end
184
184
 
185
- def metadata_keywords(node, xml)
186
- return unless node.attr("keywords")
187
- node.attr("keywords").split(/,[ ]*/).each do |kw|
188
- xml.keyword kw
189
- end
190
- end
191
-
192
185
  def metadata_source(node, xml)
193
186
  super
194
187
  node.attr("doc-email") && xml.uri(node.attr("doc-email"), type: "email")
@@ -309,7 +302,6 @@ module Asciidoctor
309
302
  def metadata_ext(node, xml)
310
303
  metadata_doctype(node, xml)
311
304
  metadata_committee(node, xml)
312
- metadata_keywords(node, xml)
313
305
  metadata_commentperiod(node, xml)
314
306
  end
315
307
  end
@@ -17,14 +17,23 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
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">
20
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
21
  <include href="reqt.rng"/>
22
22
  <!-- include "biblio.rnc" { } -->
23
23
  <include href="basicdoc.rng">
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
- <define name="std_sections">
27
+ <define name="BibDataExtensionType">
28
+ <ref name="doctype"/>
29
+ <zeroOrMore>
30
+ <ref name="structuredidentifier"/>
31
+ </zeroOrMore>
32
+ </define>
33
+ <define name="TitleType">
34
+ <text/>
35
+ </define>
36
+ <define name="sections">
28
37
  <element name="sections">
29
38
  <oneOrMore>
30
39
  <choice>
@@ -35,12 +44,6 @@
35
44
  </oneOrMore>
36
45
  </element>
37
46
  </define>
38
- <define name="BibDataExtensionType">
39
- <ref name="doctype"/>
40
- <zeroOrMore>
41
- <ref name="structuredidentifier"/>
42
- </zeroOrMore>
43
- </define>
44
47
  </include>
45
48
  <define name="standard-document">
46
49
  <element name="standard-document">
@@ -51,7 +54,7 @@
51
54
  <optional>
52
55
  <ref name="preface"/>
53
56
  </optional>
54
- <ref name="std_sections"/>
57
+ <ref name="sections"/>
55
58
  <zeroOrMore>
56
59
  <ref name="annex"/>
57
60
  </zeroOrMore>
@@ -60,10 +63,6 @@
60
63
  </zeroOrMore>
61
64
  </element>
62
65
  </define>
63
- <!--
64
- bibdata =
65
- element bibdata { BibData }
66
- -->
67
66
  <define name="preface">
68
67
  <element name="preface">
69
68
  <oneOrMore>
@@ -77,6 +76,16 @@
77
76
  </oneOrMore>
78
77
  </element>
79
78
  </define>
79
+ <define name="foreword">
80
+ <element name="foreword">
81
+ <ref name="Content-Section"/>
82
+ </element>
83
+ </define>
84
+ <define name="introduction">
85
+ <element name="introduction">
86
+ <ref name="Content-Section"/>
87
+ </element>
88
+ </define>
80
89
  <define name="boilerplate">
81
90
  <element name="boilerplate">
82
91
  <optional>
@@ -113,12 +122,6 @@
113
122
  <ref name="Content-Section"/>
114
123
  </element>
115
124
  </define>
116
- <!--
117
- sections =
118
- element sections {
119
- ( clause | terms | definitions )+
120
- }
121
- -->
122
125
  <define name="definitions">
123
126
  <element name="definitions">
124
127
  <optional>
@@ -126,6 +129,12 @@
126
129
  <data type="ID"/>
127
130
  </attribute>
128
131
  </optional>
132
+ <optional>
133
+ <attribute name="language"/>
134
+ </optional>
135
+ <optional>
136
+ <attribute name="script"/>
137
+ </optional>
129
138
  <optional>
130
139
  <ref name="section-title"/>
131
140
  </optional>
@@ -137,25 +146,11 @@
137
146
  </oneOrMore>
138
147
  </element>
139
148
  </define>
140
- <!--
141
- section-title =
142
- element title { TextElement* }
143
- -->
144
149
  <define name="content">
145
150
  <element name="clause">
146
151
  <ref name="Content-Section"/>
147
152
  </element>
148
153
  </define>
149
- <define name="foreword">
150
- <element name="foreword">
151
- <ref name="Content-Section"/>
152
- </element>
153
- </define>
154
- <define name="introduction">
155
- <element name="introduction">
156
- <ref name="Content-Section"/>
157
- </element>
158
- </define>
159
154
  <define name="abstract">
160
155
  <element name="abstract">
161
156
  <ref name="Content-Section"/>
@@ -174,18 +169,18 @@
174
169
  <ref name="Content-Section"/>
175
170
  </element>
176
171
  </define>
177
- <!--
178
- Basic-Section =
179
- attribute id { xsd:ID }?,
180
- section-title?,
181
- BasicBlock?, note*
182
- -->
183
172
  <define name="Content-Section">
184
173
  <optional>
185
174
  <attribute name="id">
186
175
  <data type="ID"/>
187
176
  </attribute>
188
177
  </optional>
178
+ <optional>
179
+ <attribute name="language"/>
180
+ </optional>
181
+ <optional>
182
+ <attribute name="script"/>
183
+ </optional>
189
184
  <optional>
190
185
  <ref name="section-title"/>
191
186
  </optional>
@@ -217,6 +212,12 @@
217
212
  <data type="ID"/>
218
213
  </attribute>
219
214
  </optional>
215
+ <optional>
216
+ <attribute name="language"/>
217
+ </optional>
218
+ <optional>
219
+ <attribute name="script"/>
220
+ </optional>
220
221
  <optional>
221
222
  <ref name="section-title"/>
222
223
  </optional>
@@ -246,6 +247,12 @@
246
247
  <data type="ID"/>
247
248
  </attribute>
248
249
  </optional>
250
+ <optional>
251
+ <attribute name="language"/>
252
+ </optional>
253
+ <optional>
254
+ <attribute name="script"/>
255
+ </optional>
249
256
  <attribute name="obligation">
250
257
  <choice>
251
258
  <value>normative</value>
@@ -270,15 +277,6 @@
270
277
  </choice>
271
278
  </element>
272
279
  </define>
273
- <!--
274
- references =
275
- element references {
276
- attribute id { xsd:ID }?,
277
- section-title?,
278
- BasicBlock*,
279
- bibitem*
280
- }
281
- -->
282
280
  <define name="terms">
283
281
  <element name="terms">
284
282
  <optional>
@@ -286,6 +284,12 @@
286
284
  <data type="ID"/>
287
285
  </attribute>
288
286
  </optional>
287
+ <optional>
288
+ <attribute name="language"/>
289
+ </optional>
290
+ <optional>
291
+ <attribute name="script"/>
292
+ </optional>
289
293
  <zeroOrMore>
290
294
  <ref name="BasicBlock"/>
291
295
  </zeroOrMore>
@@ -427,340 +431,7 @@
427
431
  <ref name="paragraph"/>
428
432
  </element>
429
433
  </define>
430
- <!--
431
- BasicBlock = paragraph-with-footnote | table | formula | admonition | ol | ul | dl | figure |
432
- quote | sourcecode | example | review | pre
433
-
434
- paragraph =
435
- element p { ParagraphType }
436
-
437
- Alignments = ( "left" | "right" | "center" | "justified" )
438
-
439
- ParagraphType =
440
- attribute id { xsd:ID },
441
- attribute align { Alignments }?,
442
- ( TextElement )*, note*
443
-
444
- paragraph-with-footnote =
445
- element p {
446
- attribute id { xsd:ID },
447
- attribute align { Alignments }?,
448
- ( TextElement | fn )*, note*
449
- }
450
-
451
- note =
452
- element note {
453
- attribute id { xsd:ID },
454
- paragraph+
455
- }
456
-
457
-
458
- review =
459
- element review {
460
- attribute id { xsd:ID },
461
- attribute reviewer { text },
462
- attribute date { xsd:dateTime }?,
463
- attribute from { xsd:IDREF },
464
- attribute to { xsd:IDREF }?,
465
- paragraph+
466
- }
467
-
468
- formula =
469
- element formula {
470
- attribute id { xsd:ID },
471
- attribute unnumbered { xsd:boolean }?,
472
- stem, dl?, note*
473
- }
474
-
475
- quote =
476
- element quote {
477
- attribute id { xsd:ID },
478
- attribute alignment { Alignments }?,
479
- quote-source?,
480
- quote-author?,
481
- paragraph-with-footnote+,
482
- note*
483
- }
484
-
485
- quote-source =
486
- element source { erefType }
487
-
488
- quote-author =
489
- element author { text }
490
-
491
- sourcecode =
492
- element sourcecode {
493
- attribute id { xsd:ID },
494
- attribute unnumbered { xsd:boolean }?,
495
- attribute lang { text }?,
496
- tname?, ( text | callout )+, annotation*, note*
497
- }
498
-
499
- pre =
500
- element pre {
501
- attribute id { xsd:ID },
502
- tname?, text, note*
503
- }
504
-
505
- table =
506
- element table {
507
- attribute id { xsd:ID },
508
- attribute unnumbered { xsd:boolean }?,
509
- attribute alt { text }?,
510
- attribute uri { xsd:anyURI }?,
511
- tname?, thead?, tbody, tfoot?, table-note*, dl?
512
- }
513
-
514
- tname = element name { text }
515
- thead = element thead { tr }
516
- tfoot = element tfoot { tr }
517
- tbody = element tbody { tr+ }
518
-
519
- table-note = element note { paragraph }
520
-
521
- tr =
522
- element tr { ( td | th )+ }
523
-
524
- td =
525
- element td {
526
- attribute colspan { text }?,
527
- attribute rowspan { text }?,
528
- attribute align { "left" | "right" | "center" }?,
529
- (
530
- (TextElement )* |
531
- paragraph-with-footnote+
532
- )
533
- }
534
-
535
- th =
536
- element th {
537
- attribute colspan { text }?,
538
- attribute rowspan { text }?,
539
- attribute align { "left" | "right" | "center" }?,
540
- (
541
- (TextElement )* |
542
- paragraph-with-footnote+
543
- )
544
- }
545
-
546
- example =
547
- element example {
548
- attribute id { xsd:ID },
549
- attribute unnumbered { xsd:boolean }?,
550
- ( formula | ul | ol | dl | quote | sourcecode | paragraph-with-footnote )+,
551
- note*
552
- }
553
-
554
- admonition =
555
- element admonition {
556
- attribute type { AdmonitionType },
557
- attribute class { text }?,
558
- attribute id { xsd:ID },
559
- attribute uri { xsd:anyURI }?,
560
- tname?,
561
- paragraph-with-footnote*,
562
- note*
563
- }
564
-
565
- AdmonitionType =
566
- "warning" | "note" | "tip" | "important" | "caution" | "statement"
567
-
568
- figure =
569
- element figure {
570
- attribute id { xsd:ID },
571
- attribute unnumbered { xsd:boolean }?,
572
- source?, tname?, tclass?, (image | pre | figure*), fn*, dl?, note*
573
- }
574
-
575
- TextElement =
576
- text | em | eref | strong | stem | sub | sup | tt | underline | keyword | ruby |
577
- strike | smallcap | xref | br | hyperlink | hr | pagebreak | bookmark | image
578
-
579
- PureTextElement =
580
- text | em | strong | sub | sup | tt | underline | strike | smallcap | br
581
-
582
- source = element source { TypedUri }
583
-
584
- em = element em { PureTextElement* }
585
- strong = element strong { PureTextElement* }
586
- tt = element tt { PureTextElement* }
587
- keyword = element keyword { PureTextElement* }
588
- sub = element sub { PureTextElement* }
589
- sup = element sup { PureTextElement* }
590
- strike = element strike { PureTextElement* }
591
- underline = element underline { PureTextElement* }
592
- smallcap = element smallcap { PureTextElement* }
593
-
594
- ruby = element ruby { ( PureTextElement | rp | rt )* }
595
- rp = element rp { PureTextElement* }
596
- rt = element rt { PureTextElement* }
597
-
598
-
599
- br = element br { empty }
600
- hr = element hr { empty }
601
- pagebreak = element pagebreak { empty }
602
-
603
- -->
604
- <!--
605
- image =
606
- element image {
607
- attribute id { xsd:ID },
608
- attribute src { xsd:anyURI },
609
- attribute mimetype { text },
610
- attribute filename { text }?,
611
- attribute width { xsd:int | "auto" }?,
612
- attribute height { xsd:int | "auto" }?,
613
- attribute alt { text }?,
614
- attribute longdesc { xsd:anyURI }?
615
- }
616
-
617
- video =
618
- element image {
619
- attribute id { xsd:ID },
620
- attribute src { xsd:anyURI },
621
- attribute mimetype { text },
622
- attribute filename { text }?,
623
- attribute width { xsd:int | "auto" }?,
624
- attribute height { xsd:int | "auto" }?,
625
- attribute alt { text }?,
626
- attribute longdesc { xsd:anyURI }?,
627
- altsource*
628
- }
629
-
630
- audio =
631
- element image {
632
- attribute id { xsd:ID },
633
- attribute src { xsd:anyURI },
634
- attribute mimetype { text },
635
- attribute filename { text }?,
636
- attribute alt { text }?,
637
- attribute longdesc { xsd:anyURI }?,
638
- altsource*
639
- }
640
-
641
- altsource =
642
- element altsource {
643
- attribute src { xsd:anyURI },
644
- attribute mimetype { text },
645
- attribute filename { text }?
646
- }
647
-
648
-
649
- stem =
650
- element stem {
651
- attribute type { "MathML" | "AsciiMath" },
652
- ( text | AnyElement )+
653
- }
654
-
655
- annotation =
656
- element annotation {
657
- attribute id { xsd:ID },
658
- paragraph
659
- }
660
-
661
- ul =
662
- element ul {
663
- attribute id { xsd:ID },
664
- li+, note*
665
- }
666
-
667
- li =
668
- element li {
669
- attribute id { xsd:ID }?,
670
- paragraph-with-footnote+
671
- }
672
-
673
- ol =
674
- element ol {
675
- attribute id { xsd:ID },
676
- attribute type { ( "roman" | "alphabet" | "arabic" |
677
- "roman_upper" | "alphabet_upper" ) },
678
- li+, note*
679
- }
680
-
681
- dl =
682
- element dl {
683
- attribute id { xsd:ID },
684
- (dt, dd)+, note*
685
- }
686
-
687
- dt =
688
- element dt { TextElement* }
689
-
690
- dd =
691
- element dd { paragraph-with-footnote* }
692
-
693
- ext =
694
- element ext { BibDataExtensionType }
695
-
696
- BibDataExtensionType =
697
- doctype,
698
- structuredidentifier*
699
-
700
- doctype = element doctype { DocumentType }
701
- -->
702
434
  <define name="structuredidentifier">
703
- <a:documentation>bare ID element, used for referencing arbitrary spans of text</a:documentation>
704
- <!--
705
- bookmark =
706
- element bookmark {
707
- attribute id { xsd:ID },
708
- empty
709
- }
710
-
711
- ReferenceFormat = ( "external" | "inline" | "footnote" | "callout" )
712
-
713
- eref =
714
- element eref { erefType }
715
-
716
- erefType =
717
- attribute normative { xsd:boolean }?,
718
- attribute citeas { text },
719
- attribute type { ReferenceFormat },
720
- attribute alt { text }?,
721
- CitationType,
722
- text
723
-
724
- hyperlink =
725
- element link {
726
- attribute target { xsd:anyURI },
727
- attribute type { ReferenceFormat },
728
- attribute alt { text }?,
729
- text
730
- }
731
-
732
- xref =
733
- element xref {
734
- attribute target { xsd:IDREF },
735
- attribute type { ReferenceFormat },
736
- attribute alt { text }?,
737
- text
738
- }
739
-
740
- fn =
741
- element fn {
742
- attribute reference { text },
743
- paragraph+
744
- }
745
- -->
746
- <a:documentation>This is xref with fixed @type="footnote", and @target built in as paragraph+
747
- @reference replaces ReferenceElement/text
748
- so &lt;fn reference="2"&gt;&lt;p&gt;This is a footnote&lt;/p&gt;&lt;/fn&gt;
749
- corresponds to
750
- &lt;eref type="footnote" target="fn2"&gt;2&lt;/xref&gt; &lt;p id="fn2"&gt;This is a footnote&lt;/p&gt;</a:documentation>
751
- <!--
752
-
753
- callout =
754
- element callout {
755
- attribute target { xsd:IDREF },
756
- text
757
- }
758
-
759
- -->
760
- <a:documentation>This is xref with fixed @type="callout"; the target by convention is in an annotation in the same source code snippet
761
- so &lt;callout target="xyz"&gt;1&lt;/callout&gt;
762
- corresponds to &lt;xref type="callout" target="xyz"&gt;1&lt;/xref&gt;
763
- </a:documentation>
764
435
  <element name="structuredidentifier">
765
436
  <optional>
766
437
  <attribute name="type"/>
@@ -815,11 +486,4 @@ corresponds to &lt;xref type="callout" target="xyz"&gt;1&lt;/xref&gt;
815
486
  </optional>
816
487
  </element>
817
488
  </define>
818
- <!--
819
- DocumentType = ( "document" )
820
-
821
- BibData =
822
- BibliographicItem,
823
- ext?
824
- -->
825
489
  </grammar>