metanorma-standoc 1.3.13 → 1.3.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +5 -1
  3. data/.github/workflows/ubuntu.yml +5 -1
  4. data/.github/workflows/windows.yml +5 -1
  5. data/lib/asciidoctor/standoc/base.rb +1 -0
  6. data/lib/asciidoctor/standoc/basicdoc.rng +20 -6
  7. data/lib/asciidoctor/standoc/cleanup.rb +13 -110
  8. data/lib/asciidoctor/standoc/cleanup_block.rb +5 -108
  9. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +1 -1
  10. data/lib/asciidoctor/standoc/cleanup_inline.rb +125 -0
  11. data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -73
  12. data/lib/asciidoctor/standoc/cleanup_section.rb +195 -0
  13. data/lib/asciidoctor/standoc/front.rb +1 -88
  14. data/lib/asciidoctor/standoc/front_contributor.rb +99 -0
  15. data/lib/asciidoctor/standoc/isodoc.rng +532 -18
  16. data/lib/asciidoctor/standoc/macros.rb +79 -45
  17. data/lib/asciidoctor/standoc/reqt.rb +3 -1
  18. data/lib/asciidoctor/standoc/reqt.rng +2 -2
  19. data/lib/asciidoctor/standoc/validate.rb +4 -4
  20. data/lib/metanorma/standoc/version.rb +1 -1
  21. data/metanorma-standoc.gemspec +1 -1
  22. data/spec/asciidoctor-standoc/base_spec.rb +2 -2
  23. data/spec/asciidoctor-standoc/blocks_spec.rb +10 -9
  24. data/spec/asciidoctor-standoc/cleanup_spec.rb +13 -11
  25. data/spec/asciidoctor-standoc/inline_spec.rb +1 -1
  26. data/spec/asciidoctor-standoc/isobib_cache_spec.rb +4 -2
  27. data/spec/asciidoctor-standoc/macros_spec.rb +140 -2
  28. data/spec/asciidoctor-standoc/refs_spec.rb +4 -0
  29. data/spec/asciidoctor-standoc/section_spec.rb +14 -14
  30. data/spec/asciidoctor-standoc/validate_spec.rb +9 -0
  31. data/spec/spec_helper.rb +1 -1
  32. metadata +7 -4
@@ -40,6 +40,36 @@ module Asciidoctor
40
40
  end
41
41
  end
42
42
 
43
+ class ConceptInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
44
+ use_dsl
45
+ named :concept
46
+ name_positional_attributes "id", "word", "term"
47
+ #match %r{concept:(?<target>[^\[]*)\[(?<content>|.*?[^\\])\]$}
48
+ match /\{\{(?<content>|.*?[^\\])\}\}$/
49
+ using_format :short
50
+
51
+ # deal with locality attrs and their disruption of positional attrs
52
+ def preprocess_attrs(attrs)
53
+ attrs.delete("term") if attrs["term"] and !attrs["word"]
54
+ attrs.delete(3) if attrs[3] == attrs["term"]
55
+ a = attrs.keys.reject { |k| k.is_a? String or [1, 2].include? k }
56
+ attrs["word"] ||= attrs[a[0]] if a.length() > 0
57
+ attrs["term"] ||= attrs[a[1]] if a.length() > 1
58
+ attrs
59
+ end
60
+
61
+ def process(parent, _target, attr)
62
+ attr = preprocess_attrs(attr)
63
+ localities = attr.keys.reject { |k| %w(id word term).include? k }.
64
+ reject { |k| k.is_a? Numeric }.
65
+ map { |k| "#{k}=#{attr[k]}" }.join(",")
66
+ text = [localities, attr["word"]].reject{ |k| k.nil? || k.empty? }.
67
+ join(",")
68
+ out = Asciidoctor::Inline.new(parent, :quoted, text).convert
69
+ %{<concept key="#{attr['id']}" term="#{attr['term']}">#{out}</concept>}
70
+ end
71
+ end
72
+
43
73
  class PseudocodeBlockMacro < Asciidoctor::Extensions::BlockProcessor
44
74
  use_dsl
45
75
  named :pseudocode
@@ -47,16 +77,15 @@ module Asciidoctor
47
77
 
48
78
  def init_indent(s)
49
79
  /^(?<prefix>[ \t]*)(?<suffix>.*)$/ =~ s
50
- prefix = prefix.gsub(/\t/, "\u00a0\u00a0\u00a0\u00a0").gsub(/ /, "\u00a0")
80
+ prefix = prefix.gsub(/\t/, "\u00a0\u00a0\u00a0\u00a0").
81
+ gsub(/ /, "\u00a0")
51
82
  prefix + suffix
52
83
  end
53
84
 
54
85
  def supply_br(lines)
55
86
  lines.each_with_index do |l, i|
56
- next if l.empty?
57
- next if l.match(/ \+$/)
58
- next if i == lines.size - 1
59
- next if i < lines.size - 1 && lines[i+1].empty?
87
+ next if l.empty? || l.match(/ \+$/)
88
+ next if i == lines.size - 1 || i < lines.size - 1 && lines[i+1].empty?
60
89
  lines[i] += " +"
61
90
  end
62
91
  lines
@@ -69,8 +98,7 @@ module Asciidoctor
69
98
  def process parent, reader, attrs
70
99
  attrs['role'] = 'pseudocode'
71
100
  lines = reader.lines.map { |m| prevent_smart_quotes(init_indent(m)) }
72
- create_block(parent, :example,
73
- supply_br(lines),
101
+ create_block(parent, :example, supply_br(lines),
74
102
  attrs, content_model: :compound)
75
103
  end
76
104
  end
@@ -79,7 +107,6 @@ module Asciidoctor
79
107
  use_dsl
80
108
  named :ruby
81
109
  parse_content_as :text
82
-
83
110
  option :pos_attrs, %w(rpbegin rt rpend)
84
111
 
85
112
  def process(parent, target, attributes)
@@ -87,17 +114,18 @@ module Asciidoctor
87
114
  rpend = ')'
88
115
  if attributes.size == 1 and attributes.key?("text")
89
116
  rt = attributes["text"]
90
- elsif attributes.size == 2 and attributes.key?(1) and attributes.key?("rpbegin")
117
+ elsif attributes.size == 2 and attributes.key?(1) and
118
+ attributes.key?("rpbegin")
91
119
  # for example, html5ruby:楽聖少女[がくせいしょうじょ]
92
- rt = attributes[1]
93
- rt ||= ""
120
+ rt = attributes[1] || ""
94
121
  else
95
122
  rpbegin = attributes['rpbegin']
96
123
  rt = attributes['rt']
97
124
  rpend = attributes['rpend']
98
125
  end
99
126
 
100
- %(<ruby>#{target}<rp>#{rpbegin}</rp><rt>#{rt}</rt><rp>#{rpend}</rp></ruby>)
127
+ "<ruby>#{target}<rp>#{rpbegin}</rp><rt>#{rt}</rt>"\
128
+ "<rp>#{rpend}</rp></ruby>"
101
129
  end
102
130
  end
103
131
 
@@ -143,25 +171,30 @@ module Asciidoctor
143
171
  nil
144
172
  end
145
173
 
174
+ def self.run umlfile, outfile
175
+ system "plantuml #{umlfile.path}" or (warn $? and return false)
176
+ i = 0
177
+ until !Gem.win_platform? || File.exist?(outfile) || i == 15
178
+ sleep(1)
179
+ i += 1
180
+ end
181
+ File.exist?(outfile)
182
+ end
183
+
146
184
  # if no :imagesdir: leave image file in plantuml
185
+ # sleep need for windows because dot works in separate process and
186
+ # plantuml process may finish earlier then dot, as result png file
187
+ # maybe not created yet after plantuml finish
147
188
  def self.generate_file parent, reader
148
189
  localdir = Utils::localdir(parent.document)
149
- fn = save_plantuml parent, reader, localdir
150
- umlfile = Pathname.new(localdir) + "plantuml" + "#{fn}.pml"
151
- system "plantuml #{umlfile}"
152
- # sleep need for windows because dot works in separate process and plantuml process may
153
- # finish erlier then dot, as result png file maybe not created yet after plantuml finish
154
- until !Gem.win_platform? || File.exist?(Pathname.new(localdir) + "plantuml" + "#{fn}.png")
155
- sleep(1)
156
- end
157
- outfile = parent.image_uri("#{fn}.png")
158
- if outfile == "#{fn}.png"
159
- (Pathname.new("plantuml") + "#{fn}.png").to_s
160
- else
161
- FileUtils.mv (Pathname.new(localdir) + "plantuml" + "#{fn}.png").to_s,
162
- (Pathname.new(localdir) + outfile).to_s
163
- (Pathname.new("#{fn}.png")).to_s
164
- end
190
+ umlfile, outfile = save_plantuml parent, reader, localdir
191
+ run(umlfile, outfile) or return
192
+ path = Pathname.new(localdir) + "plantuml"
193
+ path.mkpath()
194
+ File.exist?(path) && File.writable?(path) or return
195
+ FileUtils.cp outfile, path
196
+ umlfile.unlink
197
+ File.join(path,File.basename(outfile))
165
198
  end
166
199
 
167
200
  def self.save_plantuml parent, reader, localdir
@@ -169,11 +202,11 @@ module Asciidoctor
169
202
  reader.lines.first.sub(/\s+$/, "").match /^@startuml($| )/ or
170
203
  src = "@startuml\n#{src}\n@enduml\n"
171
204
  /^@startuml (?<fn>[^\n]+)\n/ =~ src
172
- fn ||= UUIDTools::UUID.random_create
173
- path = Pathname.new(localdir) + "plantuml"
174
- path.mkpath()
175
- (path + "#{fn}.pml").write(src)
176
- fn
205
+ Tempfile.open(["plantuml", ".pml"], :encoding => "utf-8") do |f|
206
+ f.write(src)
207
+ [f, File.join(File.dirname(f.path),
208
+ (fn || File.basename(f.path, ".pml")) + ".png")]
209
+ end
177
210
  end
178
211
 
179
212
  def self.generate_attrs attrs
@@ -191,19 +224,20 @@ module Asciidoctor
191
224
  on_context :literal
192
225
  parse_content_as :raw
193
226
 
227
+ def abort(parent, reader, attrs, msg)
228
+ warn msg
229
+ attrs["language"] = "plantuml"
230
+ create_listing_block parent, reader.source, attrs.reject { |k, v| k == 1 }
231
+ end
232
+
194
233
  def process(parent, reader, attrs)
195
- if PlantUMLBlockMacroBackend.plantuml_installed?
196
- filename = PlantUMLBlockMacroBackend.generate_file parent, reader
197
- through_attrs = PlantUMLBlockMacroBackend.generate_attrs attrs
198
- through_attrs["target"] = filename
199
- create_image_block parent, through_attrs
200
- else
201
- warn "PlantUML not installed"
202
- # attrs.delete(1) : remove the style attribute
203
- attrs["language"] = "plantuml"
204
- create_listing_block parent, reader.source,
205
- attrs.reject { |k, v| k == 1 }
206
- end
234
+ PlantUMLBlockMacroBackend.plantuml_installed? or
235
+ return abort(parent, reader, attrs, "PlantUML not installed")
236
+ filename = PlantUMLBlockMacroBackend.generate_file(parent, reader) or
237
+ return abort(parent, reader, attrs, "Failed to process PlantUML")
238
+ through_attrs = PlantUMLBlockMacroBackend.generate_attrs attrs
239
+ through_attrs["target"] = filename
240
+ create_image_block parent, through_attrs
207
241
  end
208
242
  end
209
243
  end
@@ -54,7 +54,9 @@ module Asciidoctor
54
54
  ex.title node.title if node.title
55
55
  ex.label node.attr("label") if node.attr("label")
56
56
  ex.subject node.attr("subject") if node.attr("subject")
57
- ex.inherit node.attr("inherit") if node.attr("inherit")
57
+ node&.attr("inherit")&.split(/;\s*/)&.each do |i|
58
+ ex.inherit i
59
+ end
58
60
  requirement_classification(classif, ex) if classif
59
61
  wrap_in_para(node, ex)
60
62
  end
@@ -54,9 +54,9 @@
54
54
  <optional>
55
55
  <ref name="subject"/>
56
56
  </optional>
57
- <optional>
57
+ <zeroOrMore>
58
58
  <ref name="reqinherit"/>
59
- </optional>
59
+ </zeroOrMore>
60
60
  <zeroOrMore>
61
61
  <ref name="classification"/>
62
62
  </zeroOrMore>
@@ -39,7 +39,6 @@ module Asciidoctor
39
39
  begin
40
40
  f.write(doc.to_xml)
41
41
  f.close
42
- #File.open(".tmp.xml", "w:UTF-8") { |f| f.write(doc.to_xml) }
43
42
  errors = Jing.new(schema).validate(f.path)
44
43
  warn "Valid!" if errors.none?
45
44
  errors.each do |error|
@@ -57,11 +56,12 @@ module Asciidoctor
57
56
  # any attributes from FormattedString instances (which can contain
58
57
  # xs:any markup, and are signalled with @format) before validation.
59
58
  def formattedstr_strip(doc)
60
- doc.xpath("//*[@format]").each do |n|
59
+ doc.xpath("//*[@format] | //stem | //bibdata//description | "\
60
+ "//formattedref | //bibdata//note | //bibdata/abstract | "\
61
+ "//bibitem/abstract | //bibitem/note").each do |n|
61
62
  n.elements.each do |e|
62
63
  e.traverse do |e1|
63
- next unless e1.element?
64
- e1.each { |k, _v| e.delete(k) }
64
+ e1.element? and e1.each { |k, _v| e1.delete(k) }
65
65
  end
66
66
  end
67
67
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Standoc
3
- VERSION = "1.3.13".freeze
3
+ VERSION = "1.3.14".freeze
4
4
  end
5
5
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "isodoc", "~> 1.0.0"
32
32
  spec.add_dependency "iev", "~> 0.2.1"
33
- spec.add_dependency "relaton", "~> 0.6.0"
33
+ spec.add_dependency "relaton", "~> 0.7.0"
34
34
  spec.add_dependency "relaton-iev", "~> 0.1.0"
35
35
  spec.add_dependency "sterile", "~> 1.0.14"
36
36
  spec.add_dependency "concurrent-ruby"
@@ -365,8 +365,8 @@ RSpec.describe Asciidoctor::Standoc do
365
365
  </contributor>
366
366
  <language>el</language>
367
367
  <script>Grek</script>
368
- <abstract><p id="_">This is the abstract of the document</p>
369
- <p id="_">This is the second paragraph of the abstract of the document.</p></abstract>
368
+ <abstract><p>This is the abstract of the document</p>
369
+ <p>This is the second paragraph of the abstract of the document.</p></abstract>
370
370
  <status><stage>published</stage></status>
371
371
  <copyright>
372
372
  <from>#{Date.today.year}</from>
@@ -312,7 +312,7 @@ RSpec.describe Asciidoctor::Standoc do
312
312
  <sections>
313
313
  <terms id="_" obligation="normative">
314
314
  <title>Terms and definitions</title>
315
- <p>For the purposes of this document, the following terms and definitions apply.</p>
315
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
316
316
  <term id="_">
317
317
  <preferred>Term1</preferred>
318
318
  <termnote id="_">
@@ -339,7 +339,7 @@ RSpec.describe Asciidoctor::Standoc do
339
339
  <sections>
340
340
  <terms id="_" obligation="normative">
341
341
  <title>Terms and definitions</title>
342
- <p>No terms and definitions are listed in this document.</p>
342
+ <p id="_">No terms and definitions are listed in this document.</p>
343
343
  <clause id="_" inline-header="false" obligation="normative">
344
344
  <title>Term1</title>
345
345
  <note id="_">
@@ -367,7 +367,7 @@ RSpec.describe Asciidoctor::Standoc do
367
367
  #{BLANK_HDR}
368
368
  <sections>
369
369
  <terms id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
370
- <p>For the purposes of this document, the following terms and definitions apply.</p>
370
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
371
371
  <term id="_">
372
372
  <preferred>Term1</preferred>
373
373
  </term>
@@ -499,7 +499,7 @@ RSpec.describe Asciidoctor::Standoc do
499
499
  <sections>
500
500
  <terms id="_" obligation="normative">
501
501
  <title>Terms and definitions</title>
502
- <p>For the purposes of this document, the following terms and definitions apply.</p>
502
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
503
503
  <term id="_">
504
504
  <preferred>Term1</preferred>
505
505
 
@@ -527,7 +527,7 @@ RSpec.describe Asciidoctor::Standoc do
527
527
  <sections>
528
528
  <terms id="_" obligation="normative">
529
529
  <title>Terms and definitions</title>
530
- <p>No terms and definitions are listed in this document.</p>
530
+ <p id="_">No terms and definitions are listed in this document.</p>
531
531
  <clause id="_" inline-header="false" obligation="normative">
532
532
  <title>Term1</title>
533
533
  <example id="_">
@@ -555,7 +555,7 @@ RSpec.describe Asciidoctor::Standoc do
555
555
  #{BLANK_HDR}
556
556
  <sections>
557
557
  <terms id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
558
- <p>For the purposes of this document, the following terms and definitions apply.</p><term id="_">
558
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="_">
559
559
  <preferred>Term1</preferred>
560
560
  </term>
561
561
  <definitions id="_">
@@ -910,7 +910,7 @@ RSpec.describe Asciidoctor::Standoc do
910
910
  #{BLANK_HDR}
911
911
  <sections>
912
912
  <terms id="_" obligation="normative">
913
- <title>Terms and definitions</title><p>For the purposes of this document,
913
+ <title>Terms and definitions</title><p id="_">For the purposes of this document,
914
914
  the following terms and definitions apply.</p>
915
915
  <term id="_">
916
916
  <preferred>Term1</preferred>
@@ -938,7 +938,7 @@ RSpec.describe Asciidoctor::Standoc do
938
938
  <sections>
939
939
  <terms id="_" obligation="normative">
940
940
  <title>Terms and definitions</title>
941
- <p>For the purposes of this document,
941
+ <p id="_">For the purposes of this document,
942
942
  the following terms and definitions apply.</p>
943
943
  <term id="_">
944
944
  <preferred>Term1</preferred>
@@ -958,7 +958,7 @@ RSpec.describe Asciidoctor::Standoc do
958
958
  it "processes recommendation" do
959
959
  input = <<~"INPUT"
960
960
  #{ASCIIDOC_BLANK_HDR}
961
- [.recommendation,label="/ogc/recommendation/wfs/2",subject="user",inherit="/ss/584/2015/level/1",options="unnumbered",type=verification,model=ogc]
961
+ [.recommendation,label="/ogc/recommendation/wfs/2",subject="user",inherit="/ss/584/2015/level/1; /ss/584/2015/level/2",options="unnumbered",type=verification,model=ogc]
962
962
  ====
963
963
  I recommend this
964
964
  ====
@@ -970,6 +970,7 @@ RSpec.describe Asciidoctor::Standoc do
970
970
  <label>/ogc/recommendation/wfs/2</label>
971
971
  <subject>user</subject>
972
972
  <inherit>/ss/584/2015/level/1</inherit>
973
+ <inherit>/ss/584/2015/level/2</inherit>
973
974
  <description><p id="_">I recommend this</p></description>
974
975
  </recommendation>
975
976
  </sections>
@@ -157,7 +157,7 @@ RSpec.describe Asciidoctor::Standoc do
157
157
  <sections>
158
158
  <terms id="_" obligation="normative">
159
159
  <title>Terms and definitions</title>
160
- <p>For the purposes of this document, the following terms and definitions apply.</p>
160
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
161
161
  <term id="_"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>91</mn></msub></math></stem></admitted>
162
162
  <definition><p id="_">Time</p></definition></term>
163
163
  </terms>
@@ -185,7 +185,7 @@ RSpec.describe Asciidoctor::Standoc do
185
185
  <sections>
186
186
  <terms id="_" obligation="normative">
187
187
  <title>Terms and definitions</title>
188
- <p>For the purposes of this document, the following terms and definitions apply.</p>
188
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
189
189
  <term id="_">
190
190
  <preferred>Tempus</preferred>
191
191
  <domain>relativity</domain><definition><p id="_"> Time</p></definition>
@@ -228,7 +228,7 @@ RSpec.describe Asciidoctor::Standoc do
228
228
  <sections>
229
229
  <terms id="_" obligation="normative">
230
230
  <title>Terms and definitions</title>
231
- <p>For the purposes of this document, the following terms and definitions apply.</p>
231
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
232
232
  <term id="_"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><definition><formula id="_">
233
233
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>A</mi></msub></math></stem>
234
234
  </formula>
@@ -256,7 +256,7 @@ RSpec.describe Asciidoctor::Standoc do
256
256
  #{BLANK_HDR}
257
257
  <sections>
258
258
  <terms id="_" obligation="normative"><title>Terms and definitions</title>
259
- <p>For the purposes of this document, the following terms and definitions apply.</p>
259
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
260
260
 
261
261
  <term id="_">
262
262
  <preferred>Time</preferred>
@@ -436,7 +436,7 @@ RSpec.describe Asciidoctor::Standoc do
436
436
  <sections>
437
437
  <terms id="_" obligation="normative">
438
438
  <title>Terms and definitions</title>
439
- <p>For the purposes of this document, the following terms and definitions apply.</p>
439
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
440
440
  <term id="_">
441
441
  <preferred>Term1</preferred>
442
442
  <termsource status="identical">
@@ -871,7 +871,7 @@ RSpec.describe Asciidoctor::Standoc do
871
871
  <sections>
872
872
  <terms id="_" obligation="normative">
873
873
  <title>Terms and definitions</title>
874
- <p>For the purposes of this document, the following terms and definitions apply.</p>
874
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
875
875
  <term id="_"><preferred>Term</preferred>
876
876
 
877
877
 
@@ -994,7 +994,7 @@ RSpec.describe Asciidoctor::Standoc do
994
994
 
995
995
  <sections>
996
996
  <terms id="_" obligation="normative"><title>Terms and definitions</title>
997
- <p>For the purposes of this document, the following terms and definitions apply.</p>
997
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
998
998
  <term id="_">
999
999
  <preferred>Automation1</preferred>
1000
1000
  <termsource status="identical">
@@ -1052,6 +1052,7 @@ RSpec.describe Asciidoctor::Standoc do
1052
1052
  </organization>
1053
1053
  </owner>
1054
1054
  </copyright>
1055
+ <place>Geneva</place>
1055
1056
  </bibitem><bibitem type="standard" id="IEC60050-103">
1056
1057
  <fetched>#{Date.today}</fetched>
1057
1058
  <title type="title-main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)</title>
@@ -1089,6 +1090,7 @@ RSpec.describe Asciidoctor::Standoc do
1089
1090
  </organization>
1090
1091
  </owner>
1091
1092
  </copyright>
1093
+ <place>Geneva</place>
1092
1094
  </bibitem>
1093
1095
  </references></bibliography>
1094
1096
  </standard-document>
@@ -1331,7 +1333,7 @@ OUTPUT
1331
1333
  <sections>
1332
1334
 
1333
1335
  </sections><bibliography><references id="_" obligation="informative">
1334
- <title>Normative References</title><p>There are no normative references in this document.</p>
1336
+ <title>Normative References</title><p id="_">There are no normative references in this document.</p>
1335
1337
  </references></bibliography>
1336
1338
  </standard-document>
1337
1339
  OUTPUT
@@ -1350,7 +1352,7 @@ OUTPUT
1350
1352
  <sections>
1351
1353
 
1352
1354
  </sections><bibliography><references id="_" obligation="informative">
1353
- <title>Normative References</title><p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
1355
+ <title>Normative References</title><p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
1354
1356
  <bibitem id="a">
1355
1357
  <formattedref format="application/x-isodoc+xml">A</formattedref>
1356
1358
  <docidentifier>b</docidentifier>
@@ -1379,7 +1381,7 @@ it "inserts boilerplate before empty Normative References in French" do
1379
1381
  <sections>
1380
1382
 
1381
1383
  </sections><bibliography><references id="_" obligation="informative">
1382
- <title>Normative References</title><p>Le présent document ne contient aucune référence normative.</p>
1384
+ <title>Normative References</title><p id="_">Le présent document ne contient aucune référence normative.</p>
1383
1385
  </references></bibliography>
1384
1386
  </standard-document>
1385
1387
  OUTPUT
@@ -1425,7 +1427,7 @@ it "removes bibdata bibitem IDs" do
1425
1427
  <bibliography>
1426
1428
  <references id='_' obligation='informative'>
1427
1429
  <title>Normative References</title>
1428
- <p>There are no normative references in this document.</p>
1430
+ <p id="_">There are no normative references in this document.</p>
1429
1431
  </references>
1430
1432
  </bibliography>
1431
1433
  </standard-document>
@@ -220,7 +220,7 @@ text, including <strong><em>nest</em></strong>ed markup.</p>
220
220
 
221
221
  </sections><bibliography><references id="_" obligation="informative">
222
222
  <title>Normative References</title>
223
- <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
223
+ <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
224
224
  <bibitem id="ISO712">
225
225
  <formattedref format="application/x-isodoc+xml">Reference</formattedref>
226
226
  <docidentifier>x</docidentifier>
@@ -90,6 +90,7 @@ EOS
90
90
  <formattedref format="text/plain">ISO 124:2011</formattedref>
91
91
  </bibitem>
92
92
  </relation>
93
+ <place>Geneva</place>
93
94
  <ext>
94
95
  <doctype>international-standard</doctype>
95
96
  <editorialgroup>
@@ -257,6 +258,7 @@ EOS
257
258
  <formattedref format="text/plain">ISO 123:1985</formattedref>
258
259
  </bibitem>
259
260
  </relation>
261
+ <place>Geneva</place>
260
262
  <ext>
261
263
  <doctype>international-standard</doctype>
262
264
  <editorialgroup>
@@ -368,7 +370,7 @@ EOS
368
370
  db = Relaton::Db.new "#{Dir.home}/.relaton/cache", nil
369
371
  entry = db.load_entry("ISO(ISO 123:2001)")
370
372
  expect(entry).to include("<fetched>#{Date.today.to_s}</fetched>")
371
- expect(entry).to be_equivalent_to(ISO_123_DATED)
373
+ expect(xmlpp(entry)).to be_equivalent_to(xmlpp(ISO_123_DATED))
372
374
 
373
375
  FileUtils.rm_rf File.expand_path("~/.relaton/cache")
374
376
  FileUtils.rm_rf File.expand_path("~/.iev/cache")
@@ -557,7 +559,7 @@ EOS
557
559
  entry = db.load_entry("ISO(ISO 124:2014)")
558
560
  #expect(db.fetched("ISO(ISO 124:2014)")).to eq(Date.today.to_s)
559
561
  expect(entry).to include("<fetched>#{Date.today.to_s}</fetched>")
560
- expect(entry).to be_equivalent_to(ISO_124_DATED)
562
+ expect(xmlpp(entry)).to be_equivalent_to(xmlpp(ISO_124_DATED))
561
563
 
562
564
  FileUtils.rm_rf File.expand_path("~/.relaton/cache")
563
565
  FileUtils.mv File.expand_path("~/.relaton-bib.pstore1"), File.expand_path("~/.relaton/cache"), force: true