metanorma-nist 1.2.9 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c3f8f7501c3253edf4e36a10084620a0809aa8bb388932c40527a3deed50f76
4
- data.tar.gz: 3f47ac4616595d8b62701f9d9a7d16ebf4f986f14b091494c94da488d51c5186
3
+ metadata.gz: 36ac09c63540d7f54f30b736c97745c39540395609ccc8ec87633b598c22fb1d
4
+ data.tar.gz: 5ea3cbb59d1771302c79eddc3bde4c59143c48e3bc4ed21849f5a76eb770004a
5
5
  SHA512:
6
- metadata.gz: 0d546a77f835d5527cda36a14160605ff0e1e50022216e0222ccf816c445c1c671a9dab9d02940dd1e4d900a38aaba3a1d9f5c5004f483a590655f60e45c3532
7
- data.tar.gz: 71ac09b0a49b3081c535eb54004e4358da63c85f32fdb3ca1b394ad2702cca433d8ef7ada8ac11545913727e6d9161674c3ea9f32eedadf092d945fab74b8e45
6
+ metadata.gz: d3922390af3fe4aba54d16c0fa110adfbeb1e037f553244c645f6c403daaec8c3eb7e3db3da5fa18f2b8f558c20eb8a11af67ed7ad9fba46f017a45a524cf9c9
7
+ data.tar.gz: 1cc37283a2d664adabfce277a46c5024a97d201a132a46f6fe2a5aa3134a18529a2efc5d56f506252676f07496931310b7e15673bebb20d9a25f919318ee6403
@@ -299,7 +299,7 @@ Can be a number, or text (e.g. "initial", "final").
299
299
  `:series:`:: The publication series that the document belongs to. Legal values are:
300
300
  +
301
301
  --
302
- * nist-ams
302
+ * nist-ams
303
303
  * building-science
304
304
  * nist-fips
305
305
  * nist-gcr
@@ -321,11 +321,28 @@ Can be a number, or text (e.g. "initial", "final").
321
321
  * csrc-use-case
322
322
  * csrc-building-block
323
323
  * nist-cswp
324
+ * nist-csts
324
325
  --
325
326
 
326
327
  Documents belonging to different series are expected to be rendered differently. As of this
327
- writing, styling has been provided for `nist-cswp` (Cybersecurity White Papers) and for
328
- `nist-sp` (SP-800).
328
+ writing, styling has been provided for `nist-cswp` (Cybersecurity White Papers),
329
+ `nist-csts` (Cybersecurity Technical Specifications, added in v1.2.10), and for `nist-sp` (SP-800).
330
+
331
+ `:series-title:`:: (Added in v1.2.10)
332
+ `:series-mrprefix:`:: (Added in v1.2.10)
333
+ `:series-abbrev:`:: (Added in v1.2.10) The formal documents published by NIST belong to a registered
334
+ list of series, each with a predefined title and abbreviation. Non-formal documents instead belong
335
+ to ad hoc series defined for the purposes of Metanorma, such as `nist-csts`. That particular series
336
+ acts as an umbrella for user-defined series of publications; so when it is used, the user needs to provide
337
+ a title (e.g. "Automated Cryptographic Validation Protocol") and abbreviation (e.g. ACVP) for the user-defined
338
+ series. The user also needs to provide the prefix by which the series will be identified in the machine-readable
339
+ NIST identifier, when it is at variance with the abbreviation.
340
+ +
341
+ --
342
+ In this case, CSTS is retained as the primary series of the publication (and all CSTS documents
343
+ are rendered the same way), and ACVP is modelled as a secondary series specific to CSTS. However,
344
+ the series information rendered for the document involves the user-defined series, not CSTS itself.
345
+ --
329
346
 
330
347
  `:comment-from:`:: The beginning of the period during which comments may be submitted to the NIST
331
348
  document draft. ISO-8601 date.
@@ -729,12 +729,27 @@
729
729
  </define>
730
730
  <define name="index">
731
731
  <element name="index">
732
- <attribute name="primary"/>
732
+ <attribute name="to">
733
+ <data type="IDREF"/>
734
+ </attribute>
735
+ <element name="primary">
736
+ <oneOrMore>
737
+ <ref name="PureTextElement"/>
738
+ </oneOrMore>
739
+ </element>
733
740
  <optional>
734
- <attribute name="secondary"/>
741
+ <element name="secondary">
742
+ <oneOrMore>
743
+ <ref name="PureTextElement"/>
744
+ </oneOrMore>
745
+ </element>
735
746
  </optional>
736
747
  <optional>
737
- <attribute name="tertiary"/>
748
+ <element name="tertiary">
749
+ <oneOrMore>
750
+ <ref name="PureTextElement"/>
751
+ </oneOrMore>
752
+ </element>
738
753
  </optional>
739
754
  </element>
740
755
  </define>
@@ -24,6 +24,7 @@ module Asciidoctor
24
24
  "csrc-use-case": "CSRC Use Case",
25
25
  "csrc-building-block": "CSRC Building Block",
26
26
  "nist-cswp": "NIST Cybersecurity White Paper",
27
+ "nist-csts": "NIST Cybersecurity Technical Specification",
27
28
  }.freeze
28
29
 
29
30
  SERIES_ABBR = {
@@ -49,6 +50,7 @@ module Asciidoctor
49
50
  "csrc-use-case": "CSRC Use Case",
50
51
  "csrc-building-block": "CSRC Building Block",
51
52
  "nist-cswp": "NIST CSWP",
53
+ "nist-csts": "NIST CSTS",
52
54
  }.freeze
53
55
 
54
56
  CALL_FOR_PATENT_CLAIMS = <<~END.freeze
@@ -100,7 +102,7 @@ module Asciidoctor
100
102
  end
101
103
 
102
104
  def boilerplate_file(xmldoc)
103
- File.join(@libdir, @series == "nist-cswp" ? "nist_intro_cswp.xml" : "nist_intro.xml")
105
+ File.join(@libdir, @cswp ? "nist_intro_cswp.xml" : "nist_intro.xml")
104
106
  end
105
107
  end
106
108
  end
@@ -72,7 +72,7 @@ module Asciidoctor
72
72
  end
73
73
 
74
74
  def callforpatentclaims(x, preface)
75
- return if @series == "nist-cswp"
75
+ return if @cswp
76
76
  if @callforpatentclaims
77
77
  docemail = x&.at("//uri[@type = 'email']")&.text || "???"
78
78
  docnumber = x&.at("//docnumber")&.text || "???"
@@ -103,6 +103,7 @@ module Asciidoctor
103
103
  @nistdivisionaddress = node.attr("nist-division-address") ||
104
104
  "100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930"
105
105
  @series = node.attr("series")
106
+ @cswp = %w(nist-cswp nist-csts).include?(@series)
106
107
  super
107
108
  end
108
109
 
@@ -29,8 +29,7 @@ module Asciidoctor
29
29
  t.title(**attr_code(at.merge(type: "subtitle"))) do |t1|
30
30
  t1 << asciidoc_sub(node.attr("title-sub"))
31
31
  end
32
- node.attr("title-sub-short") and
33
- t.title(**attr_code(at.merge(type: "short-subtitle"))) do |t1|
32
+ node.attr("title-sub-short") and t.title(**attr_code(at.merge(type: "short-subtitle"))) do |t1|
34
33
  t1 << asciidoc_sub(node.attr("title-sub-short"))
35
34
  end
36
35
  end
@@ -46,8 +45,7 @@ module Asciidoctor
46
45
  t.title(**attr_code(at.merge(type: "main"))) do |t1|
47
46
  t1 << (asciidoc_sub(node.attr("title-main")) || node.title)
48
47
  end
49
- node.attr("title-main-short") and
50
- t.title(**attr_code(at.merge(type: "short-title"))) do |t1|
48
+ node.attr("title-main-short") and t.title(**attr_code(at.merge(type: "short-title"))) do |t1|
51
49
  t1 << asciidoc_sub(node.attr("title-main-short"))
52
50
  end
53
51
  end
@@ -85,21 +83,16 @@ module Asciidoctor
85
83
  end
86
84
 
87
85
  def metadata_committee(node, xml)
88
- return unless node.attr("technical-committee") ||
89
- node.attr("subcommittee") ||
86
+ return unless node.attr("technical-committee") || node.attr("subcommittee") ||
90
87
  node.attr("workgroup") || node.attr("workinggroup")
91
88
  xml.editorialgroup do |a|
92
- node.attr("technical-committee") and
93
- a.committee(node.attr("technical-committee"))
94
- node.attr("subcommittee") and
95
- a.subcommittee(
96
- node.attr("subcommittee"),
97
- **attr_code(type: node.attr("subcommittee-type"),
98
- number: node.attr("subcommittee-number")))
99
- (node.attr("workgroup") || node.attr("workinggroup")) and
100
- a.workgroup(node.attr("workgroup") || node.attr("workinggroup"),
101
- **attr_code(type: node.attr("workgroup-type"),
102
- number: node.attr("workgroup-number")))
89
+ c = node.attr("technical-committee") and a.committee(c)
90
+ c = node.attr("subcommittee") and
91
+ a.subcommittee(c, **attr_code(type: node.attr("subcommittee-type"),
92
+ number: node.attr("subcommittee-number")))
93
+ c = (node.attr("workgroup") || node.attr("workinggroup")) and
94
+ a.workgroup(c,
95
+ **attr_code(type: node.attr("workgroup-type"), number: node.attr("workgroup-number")))
103
96
  end
104
97
  end
105
98
 
@@ -114,16 +107,26 @@ module Asciidoctor
114
107
 
115
108
  def metadata_source(node, xml)
116
109
  super
117
- node.attr("doc-email") && xml.uri(node.attr("doc-email"), type: "email")
118
- node.attr("doi") && xml.uri(node.attr("doi"), type: "doi")
110
+ node.attr("doc-email") and xml.uri(node.attr("doc-email"), type: "email")
111
+ node.attr("doi") and xml.uri(node.attr("doi"), type: "doi")
119
112
  end
120
113
 
121
114
  def metadata_series(node, xml)
122
115
  series = node.attr("series") || "nist-sp"
123
116
  series and xml.series **{ type: "main" } do |s|
124
117
  s.title (SERIES.dig(series.to_sym) || series)
125
- SERIES_ABBR.dig(series.to_sym) and
126
- s.abbreviation SERIES_ABBR.dig(series.to_sym)
118
+ SERIES_ABBR.dig(series.to_sym) and s.abbreviation SERIES_ABBR.dig(series.to_sym)
119
+ end
120
+ metadata_subseries(node, xml)
121
+ end
122
+
123
+ def metadata_subseries(node, xml)
124
+ title = node.attr("series-title")
125
+ abbrev = node.attr("series-abbrev")
126
+ return unless (title || abbrev)
127
+ xml.series **{ type: "secondary" } do |s|
128
+ title and s.title title
129
+ abbrev and s.abbreviation abbrev
127
130
  end
128
131
  end
129
132
 
@@ -143,13 +146,11 @@ module Asciidoctor
143
146
  end
144
147
 
145
148
  def relaton_relation_descriptions
146
- super.merge({ "supersedes" => "obsoletes",
147
- "superseded-by" => "obsoleted-by", })
149
+ super.merge({ "supersedes" => "obsoletes", "superseded-by" => "obsoleted-by", })
148
150
  end
149
151
 
150
152
  def metadata_getrelation(node, xml, type, desc = nil)
151
- if type == "obsoleted-by" and desc.nil? and
152
- node.attr("superseding-status")
153
+ if type == "obsoleted-by" and desc.nil? and node.attr("superseding-status")
153
154
  metadata_superseding_doc(node, xml)
154
155
  end
155
156
  super
@@ -166,29 +167,24 @@ module Asciidoctor
166
167
  metadata_superseding_dates(b, node)
167
168
  b.status do |s|
168
169
  s.stage node.attr("superseding-status")
169
- iter = node.attr("superseding-iteration") and
170
- s.iteration iter
170
+ iter = node.attr("superseding-iteration") and s.iteration iter
171
171
  end
172
172
  end
173
173
  end
174
174
  end
175
175
 
176
176
  def metadata_superseding_ids(b, xml)
177
- did = xml&.parent&.at("./ancestor::bibdata/docidentifier"\
178
- "[@type = 'NIST']")&.text
179
- didl = xml&.parent&.at("./ancestor::bibdata/docidentifier"\
180
- "[@type = 'nist-long']")&.text
177
+ did = xml&.parent&.at("./ancestor::bibdata/docidentifier[@type = 'NIST']")&.text
178
+ didl = xml&.parent&.at("./ancestor::bibdata/docidentifier[@type = 'nist-long']")&.text
181
179
  b.docidentifier did, **{ type: "NIST" }
182
180
  b.docidentifier didl, **{ type: "nist-long" }
183
181
  end
184
182
 
185
183
  def metadata_superseding_dates(b, node)
186
- cdate = node.attr("superseding-circulated-date") and
187
- b.date **{ type: "circulated" } do |d|
184
+ cdate = node.attr("superseding-circulated-date") and b.date **{ type: "circulated" } do |d|
188
185
  d.on cdate
189
186
  end
190
- cdate = node.attr("superseding-issued-date") and
191
- b.date **{ type: "issued" } do |d|
187
+ cdate = node.attr("superseding-issued-date") and b.date **{ type: "issued" } do |d|
192
188
  d.on cdate
193
189
  end
194
190
  end
@@ -198,24 +194,21 @@ module Asciidoctor
198
194
  b.title **{ type: "main" } do |t|
199
195
  t << asciidoc_sub(node.attr("superseding-title"))
200
196
  end
201
- node.attr("superseding-subtitle") and
202
- b.title **{ type: "subtitle" } do |t|
197
+ node.attr("superseding-subtitle") and b.title **{ type: "subtitle" } do |t|
203
198
  t << asciidoc_sub(node.attr("superseding-subtitle"))
204
199
  end
205
200
  else
206
201
  b.title **{ type: "main" } do |t|
207
202
  t << (asciidoc_sub(node.attr("title-main")) || node.title)
208
203
  end
209
- node.attr("title-sub") and
210
- b.title **{ type: "subtitle" } do |t|
204
+ node.attr("title-sub") and b.title **{ type: "subtitle" } do |t|
211
205
  t << asciidoc_sub(node.attr("title-sub"))
212
206
  end
213
207
  end
214
208
  end
215
209
 
216
210
  def metadata_superseding_authors(b, node)
217
- node.attr("superseding-authors") and
218
- node.attr("superseding-authors").split(/,\s*/).each do |a|
211
+ node.attr("superseding-authors") and node.attr("superseding-authors").split(/,\s*/).each do |a|
219
212
  b.contributor do |c|
220
213
  c.role nil, **{ type: "author" }
221
214
  c.person do |p|
@@ -228,10 +221,8 @@ module Asciidoctor
228
221
  end
229
222
 
230
223
  def metadata_note(node, xml)
231
- note = node.attr("bib-additional-note") and
232
- xml.note note, **{ type: "additional-note" }
233
- note = node.attr("bib-withdrawal-note") and
234
- xml.note note, **{ type: "withdrawal-note" }
224
+ note = node.attr("bib-additional-note") and xml.note note, **{ type: "additional-note" }
225
+ note = node.attr("bib-withdrawal-note") and xml.note note, **{ type: "withdrawal-note" }
235
226
  note = node.attr("bib-withdrawal-announcement-link") and
236
227
  xml.note note, **{ type: "withdrawal-announcement-link" }
237
228
  end
@@ -24,6 +24,9 @@ module Asciidoctor
24
24
  {
25
25
  id: dn0,
26
26
  series: node.attr("series"),
27
+ subseries: node.attr("series-title") || node.attr("series-abbrev"),
28
+ subseries_abbr: node.attr("series-abbrev"),
29
+ subseries_mr: node.attr("series-mrprefix") || node.attr("series-abbrev"),
27
30
  edition: node.attr("edition"),
28
31
  version: node.attr("version"),
29
32
  revision: node.attr("revision"),
@@ -52,8 +55,7 @@ module Asciidoctor
52
55
  else
53
56
  args = id_args(node, dn0) || return
54
57
  xml.docidentifier add_id_parts(args, false), **attr_code(type: "NIST")
55
- xml.docidentifier add_id_parts(args, true),
56
- **attr_code(type: "nist-long")
58
+ xml.docidentifier add_id_parts(args, true), **attr_code(type: "nist-long")
57
59
  xml.docidentifier add_id_parts_mr(args), **attr_code(type: "nist-mr")
58
60
  end
59
61
  end
@@ -67,10 +69,20 @@ module Asciidoctor
67
69
  IsoDoc::NIST::Metadata.new(nil, nil, @i18n).status_abbr(stage, iter)
68
70
  end
69
71
 
72
+ def id_series_name(args, type)
73
+ if args[:series] == "nist-csts"
74
+ return ret = case type
75
+ when :long then args[:subseries]
76
+ when :short then args[:subseries_abbr]
77
+ when :mr then args[:subseries_mr]
78
+ end
79
+ end
80
+ type == :long ?
81
+ SERIES.dig(args[:series].to_sym) : SERIES_ABBR.dig(args[:series].to_sym)
82
+ end
83
+
70
84
  def add_id_parts(args, long)
71
- args[:series] and series_name = long ?
72
- SERIES.dig(args[:series].to_sym) :
73
- SERIES_ABBR.dig(args[:series].to_sym)
85
+ args[:series] and series_name = id_series_name(args, (long ? :long : :short))
74
86
  dn = (series_name || "NIST #{args[:series]}") + " " + args[:id]
75
87
  dn += " Volume #{args[:vol]}" if args[:vol]
76
88
  dn += "," if args[:vol] && args[:revision]
@@ -107,8 +119,7 @@ module Asciidoctor
107
119
 
108
120
  def add_id_parts_mr(args)
109
121
  ret = ["NIST"]
110
- args[:series] and
111
- ret << SERIES_ABBR&.dig(args[:series].to_sym)&.sub(/^NIST /, "")
122
+ args[:series] and ret << id_series_name(args, :mr)&.sub(/^NIST /, "")
112
123
  stage = status_abbr(args[:stage], nil) || ""
113
124
  stage += "[-#{args[:iter]}]" if args[:iter]
114
125
  ret << stage unless stage.empty?
@@ -55,6 +55,13 @@
55
55
  <param name="pattern">\i\c*|\c+#\c+</param>
56
56
  </data>
57
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
58
65
  <optional>
59
66
  <attribute name="type">
60
67
  <ref name="ReferenceFormat"/>
@@ -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
- @log.add("Document Attributes", nil,
56
- "#{series} is not a recognised series")
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 << " &mdash; "
178
+ node.at(ns("./p[text()[normalize-space() != '']]")) and out << " &mdash; "
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'>NIST
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'>NIST Cybersecurity White Paper {% if draft_prefix %}(DRAFT){% endif %}</span></span></span><span
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
@@ -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
- daterange_proc(val, :monthyr))
62
- set("#{d['type']}date_mmddyyyy".to_sym,
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
- set(:series, series)
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
- "title"))&.text and set(:subseries, subs)
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
- set(:superseding_doi, doi)
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
- ixml.at(ns("//bibdata/title[@type = 'main']"))&.text)
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
- set(:additional_note, note)
228
- note = xml.at(ns("//bibdata/note[@type = 'withdrawal-note']"))&.text and
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