metanorma-nist 1.2.9 → 1.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -0
- data/.rubocop.yml +0 -4
- data/README.adoc +23 -3
- data/lib/asciidoctor/nist/basicdoc.rng +20 -3
- data/lib/asciidoctor/nist/boilerplate.rb +5 -3
- data/lib/asciidoctor/nist/cleanup.rb +4 -3
- data/lib/asciidoctor/nist/converter.rb +5 -2
- data/lib/asciidoctor/nist/front.rb +37 -46
- data/lib/asciidoctor/nist/front_id.rb +18 -7
- data/lib/asciidoctor/nist/isodoc.rng +118 -4
- data/lib/asciidoctor/nist/nist.rng +6 -0
- data/lib/asciidoctor/nist/nist_intro.xml +9 -9
- data/lib/asciidoctor/nist/nist_intro_cswp.xml +9 -9
- data/lib/asciidoctor/nist/validate.rb +17 -6
- data/lib/isodoc/nist/base_convert.rb +2 -3
- data/lib/isodoc/nist/html/header_cswp.html +2 -3
- data/lib/isodoc/nist/html/html_nist_titlepage.html +5 -3
- data/lib/isodoc/nist/html/word_nist_titlepage.html +8 -8
- data/lib/isodoc/nist/html/word_nist_titlepage_cswp.html +2 -0
- data/lib/isodoc/nist/html_convert.rb +6 -8
- data/lib/isodoc/nist/metadata.rb +28 -40
- data/lib/isodoc/nist/metadata_id.rb +3 -7
- data/lib/isodoc/nist/nist.csts.xsl +4844 -0
- data/lib/isodoc/nist/nist.cswp.xsl +477 -292
- data/lib/isodoc/nist/nist.sp.xsl +464 -327
- data/lib/isodoc/nist/pdf_convert.rb +5 -1
- data/lib/isodoc/nist/presentation_xml_convert.rb +30 -10
- data/lib/isodoc/nist/refs.rb +4 -20
- data/lib/isodoc/nist/render.rb +42 -40
- data/lib/isodoc/nist/render_dates.rb +8 -9
- data/lib/isodoc/nist/word_convert.rb +5 -6
- data/lib/isodoc/nist/xref.rb +11 -5
- data/lib/metanorma/nist/processor.rb +12 -0
- data/lib/metanorma/nist/version.rb +1 -1
- data/metanorma-nist.gemspec +2 -2
- metadata +8 -8
- data/lib/metanorma/nist/fonts_manifest.yaml +0 -6
@@ -194,6 +194,9 @@
|
|
194
194
|
<zeroOrMore>
|
195
195
|
<ref name="termdocsource"/>
|
196
196
|
</zeroOrMore>
|
197
|
+
<optional>
|
198
|
+
<ref name="misccontainer"/>
|
199
|
+
</optional>
|
197
200
|
<optional>
|
198
201
|
<ref name="boilerplate"/>
|
199
202
|
</optional>
|
@@ -207,6 +210,9 @@
|
|
207
210
|
<optional>
|
208
211
|
<ref name="bibliography"/>
|
209
212
|
</optional>
|
213
|
+
<zeroOrMore>
|
214
|
+
<ref name="indexsect"/>
|
215
|
+
</zeroOrMore>
|
210
216
|
</element>
|
211
217
|
</define>
|
212
218
|
</grammar>
|
@@ -6,21 +6,21 @@
|
|
6
6
|
<p>
|
7
7
|
{%- if substage == "retired" or substage == "withdrawn" -%}
|
8
8
|
{%- if unpublished -%}
|
9
|
-
{%- if substage == "retired" %}{{draft-retired-boilerplate}}{% else %}{{draft-withdrawn-boilerplate}}{% endif -%}
|
9
|
+
{%- if substage == "retired" %}{{labels["draft-retired-boilerplate"]}}{% else %}{{labels["draft-withdrawn-boilerplate"]}}{% endif -%}
|
10
10
|
{%- else -%}
|
11
|
-
{%- if withdrawal_pending %}{{ withdrawal-pending-boilerplate}}{% else %}{{ publication-withdrawn-boilerplate }}{% endif -%}
|
11
|
+
{%- if withdrawal_pending %}{{ labels["withdrawal-pending-boilerplate"]}}{% else %}{{ labels["publication-withdrawn-boilerplate"] }}{% endif -%}
|
12
12
|
{%- endif -%}
|
13
13
|
{%- else -%}
|
14
14
|
{%- if status == "Internal Draft" -%}
|
15
|
-
{{- draft-internal-boilerplate -}}
|
15
|
+
{{- labels["draft-internal-boilerplate"] -}}
|
16
16
|
{%- elsif status == "Work-in-Progress Draft" -%}
|
17
|
-
{{- draft-wip-boilerplate -}}
|
17
|
+
{{- labels["draft-wip-boilerplate"] -}}
|
18
18
|
{%- elsif status == "Preliminary Draft" -%}
|
19
|
-
{{- draft-prelim-boilerplate -}}
|
19
|
+
{{- labels["draft-prelim-boilerplate"] -}}
|
20
20
|
{%- elsif status == "Public Draft" -%}
|
21
|
-
{{- draft-public-boilerplate -}}
|
21
|
+
{{- labels["draft-public-boilerplate"] -}}
|
22
22
|
{%- elsif status == "Approval Draft" -%}
|
23
|
-
{{- draft-public-boilerplate -}}
|
23
|
+
{{- labels["draft-public-boilerplate"] -}}
|
24
24
|
{%- endif -%}
|
25
25
|
{%- endif -%}
|
26
26
|
</p>
|
@@ -78,8 +78,8 @@ CODEN: NSPUE2</p>
|
|
78
78
|
<p align="center"><strong>Comments on this publication may be submitted to:</strong></p>
|
79
79
|
|
80
80
|
<p align="center">National Institute of Standards and Technology <br/>
|
81
|
-
Attn: {{ nist_division }} <br/>
|
82
|
-
{{ nist_division_address }} <br/>
|
81
|
+
Attn: {{ labels["nist_division"] }} <br/>
|
82
|
+
{{ labels["nist_division_address"] }} <br/>
|
83
83
|
{% if email %}
|
84
84
|
Email: <link target="mailto:{{ email }}"/>
|
85
85
|
{% endif %}</p>
|
@@ -6,21 +6,21 @@
|
|
6
6
|
<p>
|
7
7
|
{%- if substage == "retired" or substage == "withdrawn" -%}
|
8
8
|
{%- if unpublished -%}
|
9
|
-
{%- if substage == "retired" %}{{draft-retired-boilerplate}}{% else %}{{draft-withdrawn-boilerplate}}{% endif -%}
|
9
|
+
{%- if substage == "retired" %}{{labels["draft-retired-boilerplate"]}}{% else %}{{labels["draft-withdrawn-boilerplate"]}}{% endif -%}
|
10
10
|
{%- else -%}
|
11
|
-
{%- if withdrawal_pending %}{{ withdrawal-pending-boilerplate}}{% else %}{{ publication-withdrawn-boilerplate }}{% endif -%}
|
11
|
+
{%- if withdrawal_pending %}{{ labels["withdrawal-pending-boilerplate"]}}{% else %}{{ labels["publication-withdrawn-boilerplate"] }}{% endif -%}
|
12
12
|
{%- endif -%}
|
13
13
|
{%- else -%}
|
14
14
|
{%- if status == "Internal Draft" -%}
|
15
|
-
{{- draft-internal-boilerplate -}}
|
15
|
+
{{- labels["draft-internal-boilerplate"] -}}
|
16
16
|
{%- elsif status == "Work-in-Progress Draft" -%}
|
17
|
-
{{- draft-wip-boilerplate -}}
|
17
|
+
{{- labels["draft-wip-boilerplate"] -}}
|
18
18
|
{%- elsif status == "Preliminary Draft" -%}
|
19
|
-
{{- draft-prelim-boilerplate -}}
|
19
|
+
{{- labels["draft-prelim-boilerplate"] -}}
|
20
20
|
{%- elsif status == "Public Draft" -%}
|
21
|
-
{{- draft-public-boilerplate -}}
|
21
|
+
{{- labels["draft-public-boilerplate"] -}}
|
22
22
|
{%- elsif status == "Approval Draft" -%}
|
23
|
-
{{- draft-public-boilerplate -}}
|
23
|
+
{{- labels["draft-public-boilerplate"] -}}
|
24
24
|
{%- endif -%}
|
25
25
|
{%- endif -%}
|
26
26
|
</p>
|
@@ -62,8 +62,8 @@
|
|
62
62
|
<p align="center"><strong>Comments on this publication may be submitted to:</strong></p>
|
63
63
|
|
64
64
|
<p align="center">National Institute of Standards and Technology <br/>
|
65
|
-
Attn: {{ nist_division }} <br/>
|
66
|
-
{{ nist_division_address }} <br/>
|
65
|
+
Attn: {{ labels["nist_division"] }} <br/>
|
66
|
+
{{ labels["nist_division_address"] }} <br/>
|
67
67
|
{% if email %}
|
68
68
|
Email: <link target="mailto:{{ email }}"/>
|
69
69
|
{% endif %}</p>
|
@@ -48,18 +48,29 @@ module Asciidoctor
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def series_validate(xmldoc)
|
51
|
-
series = xmldoc&.at("//bibdata/series/title")&.text or return
|
51
|
+
series = xmldoc&.at("//bibdata/series[@type = 'main']/title")&.text or return
|
52
|
+
recognised_series_validate(series)
|
53
|
+
subseries_validate(series, xmldoc)
|
54
|
+
end
|
55
|
+
|
56
|
+
def recognised_series_validate(series)
|
52
57
|
found = false
|
53
58
|
SERIES.each { |_, v| found = true if v == series }
|
54
|
-
found or
|
55
|
-
|
56
|
-
|
59
|
+
found or @log.add("Document Attributes", nil, "#{series} is not a recognised series")
|
60
|
+
end
|
61
|
+
|
62
|
+
def subseries_validate(series, xmldoc)
|
63
|
+
subseries = xmldoc&.at("//bibdata/series[@type = 'secondary']")
|
64
|
+
csts = series == "NIST Cybersecurity Technical Specification"
|
65
|
+
subseries && !csts and
|
66
|
+
@log.add("Document Attributes", nil, "Subseries are not permitted on the series #{series}")
|
67
|
+
!subseries && csts and
|
68
|
+
@log.add("Document Attributes", nil, "Subseries are required on the series #{series}")
|
57
69
|
end
|
58
70
|
|
59
71
|
def validate(doc)
|
60
72
|
content_validate(doc)
|
61
|
-
schema_validate(formattedstr_strip(doc.dup),
|
62
|
-
File.join(File.dirname(__FILE__), "nist.rng"))
|
73
|
+
schema_validate(formattedstr_strip(doc.dup), File.join(File.dirname(__FILE__), "nist.rng"))
|
63
74
|
end
|
64
75
|
|
65
76
|
def introduction_validate(doc)
|
@@ -113,7 +113,7 @@ module IsoDoc
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
def middle_clause
|
116
|
+
def middle_clause(_docxml)
|
117
117
|
"//clause[parent::sections] | //terms[parent::sections]"
|
118
118
|
end
|
119
119
|
|
@@ -175,8 +175,7 @@ module IsoDoc
|
|
175
175
|
|
176
176
|
def modification_parse(node, out)
|
177
177
|
out << @i18n.modified
|
178
|
-
node.at(ns("./p[text()[normalize-space() != '']]")) and
|
179
|
-
out << " — "
|
178
|
+
node.at(ns("./p[text()[normalize-space() != '']]")) and out << " — "
|
180
179
|
node.at(ns("./p")).children.each { |n| parse(n, out) }
|
181
180
|
end
|
182
181
|
|
@@ -65,8 +65,7 @@ href="../{{ filename }}.html">
|
|
65
65
|
|
66
66
|
<p class=MsoHeaderCxSpFirst style='tab-stops:center 234.0pt right 468.0pt'><span
|
67
67
|
lang=EN-US style='font-size:10.0pt;font-family:"Arial",sans-serif;font-variant:
|
68
|
-
small-caps;color:#244061;mso-themecolor:accent1;mso-themeshade:128'>
|
69
|
-
Cybersecurity White Paper<span style='mso-tab-count:2'> </span></span><!--[if supportFields]><span
|
68
|
+
small-caps;color:#244061;mso-themecolor:accent1;mso-themeshade:128'>{{ series }}<span style='mso-tab-count:2'> </span></span><!--[if supportFields]><span
|
70
69
|
lang=EN-US style='font-size:10.0pt;font-family:"Arial",sans-serif;font-variant:
|
71
70
|
small-caps;color:#244061;mso-themecolor:accent1;mso-themeshade:128'><span
|
72
71
|
style='mso-element:field-begin'></span> DOCPROPERTY<span
|
@@ -199,7 +198,7 @@ _Hlk10701209'></span></a><w:Sdt SdtDocPart="t" DocPartType="Watermarks"
|
|
199
198
|
style='mso-bookmark:_Hlk10701209'><span lang=EN-US style='font-size:10.0pt;
|
200
199
|
font-family:"Arial",sans-serif;font-variant:small-caps;color:white;mso-themecolor:
|
201
200
|
background1;background:#244061;mso-shading-themecolor:accent1;mso-shading-themeshade:
|
202
|
-
128'>
|
201
|
+
128'>{{ series }} {% if draft_prefix %}(DRAFT){% endif %}</span></span></span><span
|
203
202
|
style='mso-bookmark:_Hlk10701208'><span style='mso-bookmark:_Hlk10701209'><span
|
204
203
|
class=MsoCommentReference><span lang=EN-US style='font-size:10.0pt;font-family:
|
205
204
|
"Arial",sans-serif;font-variant:small-caps;color:white;mso-color-alt:windowtext'><span
|
@@ -86,7 +86,7 @@
|
|
86
86
|
{% if unpublished %}
|
87
87
|
<div class="coverpage-warning">
|
88
88
|
<!--
|
89
|
-
<p>{% if substage == "retired" %}{{draft-retired-boilerplate}}{% else %}{{draft-withdrawn-boilerplate}}{% endif %}</p>
|
89
|
+
<p>{% if substage == "retired" %}{{labels["draft-retired-boilerplate"]}}{% else %}{{labels["draft-withdrawn-boilerplate"]}}{% endif %}</p>
|
90
90
|
-->
|
91
91
|
<div class="authority6"/>
|
92
92
|
|
@@ -105,9 +105,9 @@
|
|
105
105
|
<div class="coverpage-warning">
|
106
106
|
<!--
|
107
107
|
{% if withdrawal_pending %}
|
108
|
-
<p>{{ withdrawal-pending-boilerplate}}</p>
|
108
|
+
<p>{{ labels["withdrawal-pending-boilerplate"]}}</p>
|
109
109
|
{% else %}
|
110
|
-
<p>{{ publication-withdrawn-boilerplate }}</p>
|
110
|
+
<p>{{ labels["publication-withdrawn-boilerplate"] }}</p>
|
111
111
|
{% endif %}
|
112
112
|
-->
|
113
113
|
<div class="authority6"/>
|
@@ -172,12 +172,14 @@
|
|
172
172
|
{% endif %}
|
173
173
|
</div>
|
174
174
|
|
175
|
+
{% if doi %}
|
175
176
|
<div class="download-info">
|
176
177
|
|
177
178
|
This publication is available free of charge from: <br>
|
178
179
|
<a href="{{doi}}">{{ doi }}</a>
|
179
180
|
|
180
181
|
</div>
|
182
|
+
{% endif %}
|
181
183
|
{% endunless %}
|
182
184
|
|
183
185
|
{% endif %}
|
@@ -59,9 +59,9 @@ AABkcnMvZG93bnJldi54bWxQSwUGAAAAAAQABADzAAAAkwUAAAAA
|
|
59
59
|
style='mso-bidi-font-weight:normal'><span lang="EN-US">Warning Notice<o:p></o:p></span></b></p>
|
60
60
|
<p class="Default"><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
61
61
|
{% if substage == "retired" %}
|
62
|
-
<p class="Default" style='font-size:12.0pt;'><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'>{{draft-retired-boilerplate}}<o:p></o:p></span></p>
|
62
|
+
<p class="Default" style='font-size:12.0pt;'><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'>{{labels["draft-retired-boilerplate"]}}<o:p></o:p></span></p>
|
63
63
|
{% else %}
|
64
|
-
<p class="Default" style='font-size:12.0pt;'><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'>{{draft-withdrawn-boilerplate}}<o:p></o:p></span></p>
|
64
|
+
<p class="Default" style='font-size:12.0pt;'><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'>{{labels["draft-withdrawn-boilerplate"]}}<o:p></o:p></span></p>
|
65
65
|
{% endif %}
|
66
66
|
-->
|
67
67
|
<div class="authority6"/>
|
@@ -375,7 +375,7 @@ AABkcnMvZG93bnJldi54bWxQSwUGAAAAAAQABADzAAAAkwUAAAAA
|
|
375
375
|
<p class="Default" align="center" style='text-align:center;font-size:12.0pt;'><b
|
376
376
|
style='mso-bidi-font-weight:normal'><span lang="EN-US">Warning Notice<o:p></o:p></span></b></p>
|
377
377
|
<p class="Default"><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
378
|
-
<p class="Default" style='font-size:12.0pt;'><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'>{{ withdrawal-pending-boilerplate}}<o:p></o:p></span></p>
|
378
|
+
<p class="Default" style='font-size:12.0pt;'><span lang="EN-US" style='mso-fareast-font-family:"Times New Roman"'>{{ labels["withdrawal-pending-boilerplate"]}}<o:p></o:p></span></p>
|
379
379
|
-->
|
380
380
|
<p class="Default" align="center" style='text-align:center'><span lang="EN-US"
|
381
381
|
style='mso-fareast-font-family:"Times New Roman"'><o:p> </o:p></span></p>
|
@@ -593,7 +593,7 @@ style='width:477.0pt;margin-left:-5.25pt;border-collapse:collapse;border:none;ms
|
|
593
593
|
color:black;mso-themecolor:text1'><o:p> </o:p></span></p>
|
594
594
|
<p class="Default"><span lang="EN-US" style='font-size:11.0pt;font-family:"Calibri",sans-serif;
|
595
595
|
mso-ascii-theme-font:major-latin;mso-fareast-font-family:"Times New Roman";
|
596
|
-
mso-hansi-theme-font:major-latin;mso-bidi-font-family:"Times New Roman"'>{{publication-withdrawn-boilerplate}}<o:p></o:p></span></p>
|
596
|
+
mso-hansi-theme-font:major-latin;mso-bidi-font-family:"Times New Roman"'>{{labels["publication-withdrawn-boilerplate"]}}<o:p></o:p></span></p>
|
597
597
|
-->
|
598
598
|
<div class="withdrawn">
|
599
599
|
<div class="authority6"/>
|
@@ -1111,13 +1111,13 @@ style='font-size:14.0pt;color:black;mso-themecolor:text1'> </span></p>
|
|
1111
1111
|
style='font-size:14.0pt'> </span></p>
|
1112
1112
|
<p class="Default" align="left" style='text-align:justify;text-justify:inter-ideograph'><span lang="EN-US"
|
1113
1113
|
style='font-size:12.0pt'>{% if status == "Internal Draft" %}
|
1114
|
-
{{draft-internal-boilerplate}}
|
1114
|
+
{{labels["draft-internal-boilerplate"]}}
|
1115
1115
|
{% elsif status == "Work-in-Progress Draft" %}
|
1116
|
-
{{draft-wip-boilerplate}}
|
1116
|
+
{{labels["draft-wip-boilerplate"]}}
|
1117
1117
|
{% elsif status == "Preliminary Draft" %}
|
1118
|
-
{{draft-prelim-boilerplate}}
|
1118
|
+
{{labels["draft-prelim-boilerplate"]}}
|
1119
1119
|
{% elsif status == "Public Draft" %}
|
1120
|
-
{{draft-public-boilerplate}}
|
1120
|
+
{{labels["draft-public-boilerplate"]}}
|
1121
1121
|
{% else %}
|
1122
1122
|
{{status}}
|
1123
1123
|
{% endif %}</span></p>
|
@@ -62,7 +62,9 @@ mso-themeshade:128'>{{ issueddate_MMMddyyyy }}</span></p>
|
|
62
62
|
|
63
63
|
<p class="MsoNormal"> </p>
|
64
64
|
|
65
|
+
{% if doi %}
|
65
66
|
<p class="MsoNormal"><span
|
66
67
|
style='color:#244061;mso-themecolor:accent1;mso-themeshade:128'>This
|
67
68
|
publication is available free of charge from:<br/>
|
68
69
|
{{ doi }}</span></p>
|
70
|
+
{% endif %}
|
@@ -21,14 +21,12 @@ module IsoDoc
|
|
21
21
|
|
22
22
|
def default_fonts(options)
|
23
23
|
{
|
24
|
-
bodyfont:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
footnotefontsize: "0.9em",
|
31
|
-
monospacefontsize: "0.8em",
|
24
|
+
bodyfont: '"Libre Baskerville",serif',
|
25
|
+
headerfont: '"Libre Baskerville",serif',
|
26
|
+
monospacefont: '"Space Mono",monospace',
|
27
|
+
normalfontsize: "14px",
|
28
|
+
footnotefontsize: "0.9em",
|
29
|
+
monospacefontsize: "0.8em",
|
32
30
|
}
|
33
31
|
end
|
34
32
|
|
data/lib/isodoc/nist/metadata.rb
CHANGED
@@ -9,11 +9,9 @@ module IsoDoc
|
|
9
9
|
super
|
10
10
|
here = File.dirname(__FILE__)
|
11
11
|
set(:logo_nist, File.expand_path(File.join(here, "html", "logo.png")))
|
12
|
-
set(:logo_cswp,
|
13
|
-
File.expand_path(File.join(here, "html", "logo_cswp.png")))
|
12
|
+
set(:logo_cswp, File.expand_path(File.join(here, "html", "logo_cswp.png")))
|
14
13
|
set(:logo_commerce,
|
15
|
-
File.expand_path(File.join(here, "html",
|
16
|
-
"commerce-logo-color.png")))
|
14
|
+
File.expand_path(File.join(here, "html", "commerce-logo-color.png")))
|
17
15
|
set(:logo_commerce_word,
|
18
16
|
File.expand_path(File.join(here, "html", "deptofcommerce.png")))
|
19
17
|
end
|
@@ -57,12 +55,9 @@ module IsoDoc
|
|
57
55
|
ixml.xpath(ns("//bibdata/date")).each do |d|
|
58
56
|
val = Common::date_range(d)
|
59
57
|
next if val == "XXX"
|
60
|
-
set("#{d['type']}date_monthyear".to_sym,
|
61
|
-
|
62
|
-
set("#{d['type']}
|
63
|
-
daterange_proc(val, :mmddyyyy))
|
64
|
-
set("#{d['type']}date_MMMddyyyy".to_sym,
|
65
|
-
daterange_proc(val, :MMMddyyyy))
|
58
|
+
set("#{d['type']}date_monthyear".to_sym, daterange_proc(val, :monthyr))
|
59
|
+
set("#{d['type']}date_mmddyyyy".to_sym, daterange_proc(val, :mmddyyyy))
|
60
|
+
set("#{d['type']}date_MMMddyyyy".to_sym, daterange_proc(val, :MMMddyyyy))
|
66
61
|
end
|
67
62
|
withdrawal_pending(ixml)
|
68
63
|
most_recent_date(ixml)
|
@@ -101,13 +96,18 @@ module IsoDoc
|
|
101
96
|
end
|
102
97
|
|
103
98
|
def series(ixml, _out)
|
104
|
-
series = ixml.at(ns("//bibdata/series[@type = 'main']/title"))&.text and
|
105
|
-
|
106
|
-
seriesabbr =
|
107
|
-
ixml.at(ns("//bibdata/series[@type = 'main']/abbreviation"))&.text
|
99
|
+
series = ixml.at(ns("//bibdata/series[@type = 'main']/title"))&.text and set(:series, series)
|
100
|
+
seriesabbr = ixml.at(ns("//bibdata/series[@type = 'main']/abbreviation"))&.text
|
108
101
|
set(:seriesabbr, seriesabbr) if seriesabbr
|
109
|
-
subs = ixml.at(ns("//bibdata/series[@type = 'secondary']/"
|
110
|
-
|
102
|
+
subs = ixml.at(ns("//bibdata/series[@type = 'secondary']/title"))&.text
|
103
|
+
abbr = ixml.at(ns("//bibdata/series[@type = 'secondary']/abbreviation"))&.text
|
104
|
+
if (seriesabbr == "NIST CSTS")
|
105
|
+
subs and set(:series, subs)
|
106
|
+
abbr and set(:seriesabbr, abbr)
|
107
|
+
else
|
108
|
+
subs and set(:subseries, subs)
|
109
|
+
abbr and set(:subseriesabbr, abbr)
|
110
|
+
end
|
111
111
|
end
|
112
112
|
|
113
113
|
def mmddyyyy(isodate)
|
@@ -129,8 +129,7 @@ module IsoDoc
|
|
129
129
|
super
|
130
130
|
a = xml.at(ns("//bibdata/uri[@type = 'email']")) and set(:email, a.text)
|
131
131
|
a = xml.at(ns("//bibdata/uri[@type = 'doi']")) and set(:doi, a.text)
|
132
|
-
a = xml.at(ns("//bibdata/uri[@type = 'uri' or not(@type)]")) and
|
133
|
-
set(:url, a.text)
|
132
|
+
a = xml.at(ns("//bibdata/uri[@type = 'uri' or not(@type)]")) and set(:url, a.text)
|
134
133
|
end
|
135
134
|
|
136
135
|
def relations1(ixml, type)
|
@@ -157,35 +156,28 @@ module IsoDoc
|
|
157
156
|
def superseding_doc(ixml)
|
158
157
|
d = ixml.at(ns("//bibdata/relation[@type = 'obsoletedBy']/bibitem"))
|
159
158
|
return unless d
|
160
|
-
set(:superseding_status,
|
161
|
-
status_print(d.at(ns("./status/stage"))&.text || "final"))
|
159
|
+
set(:superseding_status, status_print(d.at(ns("./status/stage"))&.text || "final"))
|
162
160
|
superseding_iteration(d)
|
163
161
|
docid = d.at(ns("./docidentifier[@type = 'NIST']"))&.text and
|
164
162
|
set(:superseding_docidentifier, docid)
|
165
163
|
docid_long = d.at(ns("./docidentifier[@type = 'nist-long']"))&.text and
|
166
164
|
set(:superseding_docidentifier_long, docid_long)
|
167
165
|
superseding_dates(d)
|
168
|
-
doi = d.at(ns("./uri[@type = 'doi']"))&.text and
|
169
|
-
|
170
|
-
uri = d.at(ns("./uri[@type = 'uri']"))&.text and
|
171
|
-
set(:superseding_uri, uri)
|
166
|
+
doi = d.at(ns("./uri[@type = 'doi']"))&.text and set(:superseding_doi, doi)
|
167
|
+
uri = d.at(ns("./uri[@type = 'uri']"))&.text and set(:superseding_uri, uri)
|
172
168
|
superseding_titles(ixml, d)
|
173
169
|
authors = d.xpath(ns("./contributor[role/@type = 'author']/person"))
|
174
|
-
authors.empty? and authors =
|
175
|
-
ixml.xpath(ns("//bibdata/contributor[role/@type = 'author']/person"))
|
170
|
+
authors.empty? and authors = ixml.xpath(ns("//bibdata/contributor[role/@type = 'author']/person"))
|
176
171
|
set(:superseding_authors, extract_person_names(authors))
|
177
172
|
end
|
178
173
|
|
179
174
|
def superseding_titles(ixml, d)
|
180
175
|
if title = d.at(ns("./title[@type = 'main']"))&.text
|
181
176
|
set(:superseding_title, d.at(ns("./title[@type = 'main']"))&.text)
|
182
|
-
set(:superseding_subtitle,
|
183
|
-
d.at(ns("./title[@type = 'subtitle']"))&.text)
|
177
|
+
set(:superseding_subtitle, d.at(ns("./title[@type = 'subtitle']"))&.text)
|
184
178
|
else
|
185
|
-
set(:superseding_title,
|
186
|
-
|
187
|
-
set(:superseding_subtitle,
|
188
|
-
ixml.at(ns("//bibdata/title[@type = 'subtitle']"))&.text)
|
179
|
+
set(:superseding_title, ixml.at(ns("//bibdata/title[@type = 'main']"))&.text)
|
180
|
+
set(:superseding_subtitle, ixml.at(ns("//bibdata/title[@type = 'subtitle']"))&.text)
|
189
181
|
end
|
190
182
|
end
|
191
183
|
|
@@ -200,8 +192,7 @@ module IsoDoc
|
|
200
192
|
set(:superseding_iteration_ordinal, "Final")
|
201
193
|
set(:superseding_iteration_code, "FPD")
|
202
194
|
else
|
203
|
-
set(:superseding_iteration_ordinal,
|
204
|
-
iter.to_i.localize.to_rbnf_s("SpelloutRules", "spellout-ordinal"))
|
195
|
+
set(:superseding_iteration_ordinal, iter.to_i.localize.to_rbnf_s("SpelloutRules", "spellout-ordinal"))
|
205
196
|
set(:superseding_iteration_code, "#{iter}PD")
|
206
197
|
end
|
207
198
|
end
|
@@ -223,12 +214,9 @@ module IsoDoc
|
|
223
214
|
end
|
224
215
|
|
225
216
|
def note(xml, _out)
|
226
|
-
note = xml.at(ns("//bibdata/note[@type = 'additional-note']"))&.text and
|
227
|
-
|
228
|
-
note = xml.at(ns("//bibdata/note[@type = 'withdrawal-
|
229
|
-
set(:withdrawal_note, note)
|
230
|
-
note = xml.at(ns("//bibdata/note[@type = "\
|
231
|
-
"'withdrawal-announcement-link']"))&.text and
|
217
|
+
note = xml.at(ns("//bibdata/note[@type = 'additional-note']"))&.text and set(:additional_note, note)
|
218
|
+
note = xml.at(ns("//bibdata/note[@type = 'withdrawal-note']"))&.text and set(:withdrawal_note, note)
|
219
|
+
note = xml.at(ns("//bibdata/note[@type = 'withdrawal-announcement-link']"))&.text and
|
232
220
|
set(:withdrawal_announcement_link, note)
|
233
221
|
super
|
234
222
|
end
|
@@ -73,8 +73,7 @@ module IsoDoc
|
|
73
73
|
|
74
74
|
def docid(ixml, _out)
|
75
75
|
docid = ixml.at(ns("//bibdata/docidentifier[@type = 'NIST']"))&.text
|
76
|
-
docid_long = ixml.at(ns("//bibdata/docidentifier"
|
77
|
-
"[@type = 'nist-long']"))&.text
|
76
|
+
docid_long = ixml.at(ns("//bibdata/docidentifier[@type = 'nist-long']"))&.text
|
78
77
|
set(:docidentifier, docid)
|
79
78
|
set(:docidentifier_long, docid_long)
|
80
79
|
set(:docidentifier_undated, stripdate(docid))
|
@@ -86,8 +85,7 @@ module IsoDoc
|
|
86
85
|
|
87
86
|
def stripdate(id)
|
88
87
|
return if id.nil?
|
89
|
-
id.sub(/ \((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[^)]+\)$/,
|
90
|
-
"")
|
88
|
+
id.sub(/ \((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[^)]+\)$/, "")
|
91
89
|
end
|
92
90
|
|
93
91
|
def draft_prefix(ixml)
|
@@ -117,9 +115,7 @@ module IsoDoc
|
|
117
115
|
|
118
116
|
def draftinfo(draft, revdate)
|
119
117
|
draftinfo = ""
|
120
|
-
|
121
|
-
draftinfo = " #{@labels["draft_label"]} #{draft}"
|
122
|
-
end
|
118
|
+
draft and draftinfo = " #{@labels["draft_label"]} #{draft}"
|
123
119
|
@i18n.l10n(draftinfo, @lang, @script)
|
124
120
|
end
|
125
121
|
end
|