metanorma-standoc 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/standoc/base.rb +2 -2
  3. data/lib/asciidoctor/standoc/biblio.rng +1 -1
  4. data/lib/asciidoctor/standoc/blocks.rb +25 -95
  5. data/lib/asciidoctor/standoc/blocks_notes.rb +89 -0
  6. data/lib/asciidoctor/standoc/cleanup.rb +10 -6
  7. data/lib/asciidoctor/standoc/cleanup_inline.rb +1 -1
  8. data/lib/asciidoctor/standoc/cleanup_ref.rb +45 -0
  9. data/lib/asciidoctor/standoc/isodoc.rng +427 -0
  10. data/lib/asciidoctor/standoc/lists.rb +12 -12
  11. data/lib/asciidoctor/standoc/macros_yaml2text.rb +32 -15
  12. data/lib/asciidoctor/standoc/ref.rb +71 -29
  13. data/lib/asciidoctor/standoc/reqt.rb +11 -6
  14. data/lib/asciidoctor/standoc/reqt.rng +23 -0
  15. data/lib/asciidoctor/standoc/table.rb +3 -2
  16. data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +1 -1
  17. data/lib/metanorma/standoc/version.rb +1 -1
  18. data/spec/asciidoctor-standoc/blocks_spec.rb +55 -26
  19. data/spec/asciidoctor-standoc/cleanup_spec.rb +1 -1
  20. data/spec/asciidoctor-standoc/datamodel/attributes_table_preprocessor_spec.rb +35 -0
  21. data/spec/asciidoctor-standoc/lists_spec.rb +7 -5
  22. data/spec/asciidoctor-standoc/macros_spec.rb +3 -2
  23. data/spec/asciidoctor-standoc/refs_spec.rb +250 -5
  24. data/spec/asciidoctor-standoc/table_spec.rb +2 -2
  25. data/spec/asciidoctor-standoc/validate_spec.rb +56 -0
  26. data/spec/assets/iso123.rxl +107 -0
  27. data/spec/examples/datamodel/blank_definition_profile.adoc +4 -0
  28. data/spec/examples/datamodel/models/models/{Signature copy.yml → SignatureBlankDefinition.yml} +2 -2
  29. data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +51 -0
  30. metadata +7 -3
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Standoc
3
- VERSION = "1.4.0".freeze
3
+ VERSION = "1.4.1".freeze
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
  require "open3"
3
3
 
4
4
  RSpec.describe Asciidoctor::Standoc do
5
- it "processes pass blocks" do
5
+ it "processes format-specific pass blocks" do
6
6
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
7
7
  #{ASCIIDOC_BLANK_HDR}
8
8
 
@@ -19,6 +19,26 @@ RSpec.describe Asciidoctor::Standoc do
19
19
  OUTPUT
20
20
  end
21
21
 
22
+ it "processes Metanorma XML pass blocks" do
23
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
24
+ #{ASCIIDOC_BLANK_HDR}
25
+
26
+ ++++
27
+ <abc>X &gt;
28
+ ++++
29
+
30
+ ++++
31
+ Y</abc>
32
+ ++++
33
+ INPUT
34
+ #{BLANK_HDR}
35
+ <sections>
36
+ <abc>X &gt; Y</abc>
37
+ </sections>
38
+ </standard-document>
39
+ OUTPUT
40
+ end
41
+
22
42
  it "processes open blocks" do
23
43
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
24
44
  #{ASCIIDOC_BLANK_HDR}
@@ -43,7 +63,7 @@ RSpec.describe Asciidoctor::Standoc do
43
63
  #{ASCIIDOC_BLANK_HDR}
44
64
 
45
65
  [[ABC]]
46
- [stem%inequality]
66
+ [stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
47
67
  ++++
48
68
  r = 1 %
49
69
  r = 1 %
@@ -67,7 +87,7 @@ RSpec.describe Asciidoctor::Standoc do
67
87
  INPUT
68
88
  #{BLANK_HDR}
69
89
  <sections>
70
- <formula id="ABC" inequality="true">
90
+ <formula id="ABC" inequality="true" number="3" keep-with-next="true" keep-lines-together="true">
71
91
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
72
92
  </formula>
73
93
 
@@ -404,7 +424,7 @@ RSpec.describe Asciidoctor::Standoc do
404
424
  [[ABC]]
405
425
  NOTE: This is a note
406
426
 
407
- [NOTE,keep-separate=true]
427
+ [NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified]
408
428
  ====
409
429
  XYZ
410
430
  ====
@@ -416,14 +436,14 @@ RSpec.describe Asciidoctor::Standoc do
416
436
  <p id="_">This is a note</p>
417
437
  </note>
418
438
  </foreword></preface><sections>
439
+ <note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
440
+ <p id='_'>XYZ</p>
441
+ </note>
419
442
  <clause id="_" inline-header="false" obligation="normative">
420
443
  <title>Clause 1</title>
421
444
  <note id="ABC">
422
445
  <p id="_">This is a note</p>
423
446
  </note>
424
- <note id='_'>
425
- <p id='_'>XYZ</p>
426
- </note>
427
447
  </clause></sections>
428
448
 
429
449
  </standard-document>
@@ -436,7 +456,7 @@ RSpec.describe Asciidoctor::Standoc do
436
456
  #{ASCIIDOC_BLANK_HDR}
437
457
 
438
458
  [[ABC]]
439
- [alt=Literal]
459
+ [alt=Literal,keep-with-next=true,keep-lines-together=true]
440
460
  ....
441
461
  <LITERAL>
442
462
  FIGURATIVE
@@ -444,7 +464,7 @@ RSpec.describe Asciidoctor::Standoc do
444
464
  INPUT
445
465
  #{BLANK_HDR}
446
466
  <sections>
447
- <figure id="ABC">
467
+ <figure id="ABC" keep-with-next="true" keep-lines-together="true">
448
468
  <pre alt="Literal" id="_">&lt;LITERAL&gt;
449
469
  FIGURATIVE
450
470
  </pre>
@@ -477,7 +497,7 @@ RSpec.describe Asciidoctor::Standoc do
477
497
  #{ASCIIDOC_BLANK_HDR}
478
498
 
479
499
  [[ABC]]
480
- [CAUTION,type=Safety Precautions]
500
+ [CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
481
501
  .Precautions
482
502
  ====
483
503
  While werewolves are hardy community members, keep in mind the following dietary concerns:
@@ -489,7 +509,8 @@ RSpec.describe Asciidoctor::Standoc do
489
509
  INPUT
490
510
  #{BLANK_HDR}
491
511
  <sections>
492
- <admonition id="ABC" type="safety precautions"><name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
512
+ <admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
513
+ <name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
493
514
  <ol id="_" type="arabic">
494
515
  <li>
495
516
  <p id="_">They are allergic to cinnamon.</p>
@@ -598,7 +619,7 @@ RSpec.describe Asciidoctor::Standoc do
598
619
  #{ASCIIDOC_BLANK_HDR}
599
620
 
600
621
  [[ABC]]
601
- [example,subsequence=A]
622
+ [example,subsequence=A,keep-with-next=true,keep-lines-together=next]
602
623
  .Title
603
624
  ====
604
625
  This is an example
@@ -610,14 +631,20 @@ RSpec.describe Asciidoctor::Standoc do
610
631
  ====
611
632
  This is another example
612
633
  ====
634
+
635
+ [example,number=3]
636
+ ====
637
+ This is yet another example
638
+ ====
613
639
  INPUT
614
640
  #{BLANK_HDR}
615
641
  <sections>
616
- <example id="ABC" subsequence="A">
642
+ <example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
617
643
  <name>Title</name>
618
644
  <p id="_">This is an example</p>
619
645
  <p id="_">Amen</p></example>
620
646
  <example id="_" unnumbered="true"><p id="_">This is another example</p></example>
647
+ <example id="_" number="3"><p id="_">This is yet another example</p></example>
621
648
  </sections>
622
649
  </standard-document>
623
650
  OUTPUT
@@ -741,14 +768,14 @@ RSpec.describe Asciidoctor::Standoc do
741
768
  #{ASCIIDOC_BLANK_HDR}
742
769
 
743
770
  [[ABC]]
744
- [%unnumbered]
771
+ [%unnumbered,number=3]
745
772
  .Split-it-right sample divider
746
773
  image::spec/examples/rice_images/rice_image1.png[alttext]
747
774
 
748
775
  INPUT
749
776
  #{BLANK_HDR}
750
777
  <sections>
751
- <figure id="ABC" unnumbered="true">
778
+ <figure id="ABC" unnumbered="true" number="3">
752
779
  <name>Split-it-right sample divider</name>
753
780
  <image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto" alt="alttext"/>
754
781
  </figure>
@@ -840,15 +867,15 @@ RSpec.describe Asciidoctor::Standoc do
840
867
  INPUT
841
868
  end
842
869
 
843
- it "accepts alignment attribute on paragraphs" do
870
+ it "accepts attributes on paragraphs" do
844
871
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
845
872
  #{ASCIIDOC_BLANK_HDR}
846
- [align=right]
873
+ [align=right,keep-with-next=true,keep-lines-together=true]
847
874
  This para is right-aligned.
848
875
  INPUT
849
876
  #{BLANK_HDR}
850
877
  <sections>
851
- <p align="right" id="_">This para is right-aligned.</p>
878
+ <p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
852
879
  </sections>
853
880
  </standard-document>
854
881
  OUTPUT
@@ -859,14 +886,14 @@ RSpec.describe Asciidoctor::Standoc do
859
886
  #{ASCIIDOC_BLANK_HDR}
860
887
 
861
888
  [[ABC]]
862
- [quote, ISO, "ISO7301,section 1"]
889
+ [quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true]
863
890
  ____
864
891
  Block quotation
865
892
  ____
866
893
  INPUT
867
894
  #{BLANK_HDR}
868
895
  <sections>
869
- <quote id="ABC">
896
+ <quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
870
897
  <source type="inline" bibitemid="ISO7301" citeas="">
871
898
  <localityStack>
872
899
  <locality type="section"><referenceFrom>1</referenceFrom></locality>
@@ -886,7 +913,7 @@ RSpec.describe Asciidoctor::Standoc do
886
913
 
887
914
  [[ABC]]
888
915
  .Caption
889
- [source%unnumbered,ruby,filename=sourcecode1.rb]
916
+ [source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
890
917
  --
891
918
  puts "Hello, world."
892
919
  %w{a b c}.each do |x|
@@ -896,7 +923,8 @@ RSpec.describe Asciidoctor::Standoc do
896
923
  INPUT
897
924
  #{BLANK_HDR}
898
925
  <sections>
899
- <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true"><name>Caption</name>puts "Hello, world."
926
+ <sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
927
+ <name>Caption</name>puts "Hello, world."
900
928
  %w{a b c}.each do |x|
901
929
  puts x
902
930
  end</sourcecode>
@@ -1082,7 +1110,7 @@ RSpec.describe Asciidoctor::Standoc do
1082
1110
  input = <<~"INPUT"
1083
1111
  #{ASCIIDOC_BLANK_HDR}
1084
1112
  [[ABC]]
1085
- [.requirement,subsequence="A",inherit="/ss/584/2015/level/1 &amp; /ss/584/2015/level/2"]
1113
+ [.requirement,subsequence="A",inherit="/ss/584/2015/level/1 &amp; /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true]
1086
1114
  .Title
1087
1115
  ====
1088
1116
  I recommend this
@@ -1091,7 +1119,8 @@ RSpec.describe Asciidoctor::Standoc do
1091
1119
  output = <<~"OUTPUT"
1092
1120
  #{BLANK_HDR}
1093
1121
  <sections>
1094
- <requirement id="ABC" subsequence="A"><title>Title</title>
1122
+ <requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
1123
+ <title>Title</title>
1095
1124
  <inherit>/ss/584/2015/level/1 &amp; /ss/584/2015/level/2</inherit>
1096
1125
  <description><p id="_">I recommend this</p></description>
1097
1126
  </requirement>
@@ -1169,7 +1198,7 @@ RSpec.describe Asciidoctor::Standoc do
1169
1198
  ====
1170
1199
  I recommend _this_.
1171
1200
 
1172
- [.specification,type="tabular"]
1201
+ [.specification,type="tabular",keep-with-next=true,keep-lines-together=true]
1173
1202
  --
1174
1203
  This is the object of the recommendation:
1175
1204
  |===
@@ -1217,7 +1246,7 @@ RSpec.describe Asciidoctor::Standoc do
1217
1246
  <recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
1218
1247
  <classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System &amp; Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
1219
1248
  <description><p id="_">I recommend <em>this</em>.</p>
1220
- </description><specification exclude="false" type="tabular"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td align="left">Object</td> <td align="left">Value</td> </tr> <tr> <td align="left">Mission</td> <td align="left">Accomplished</td> </tr> </tbody></table></specification><description>
1249
+ </description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td align="left">Object</td> <td align="left">Value</td> </tr> <tr> <td align="left">Mission</td> <td align="left">Accomplished</td> </tr> </tbody></table></specification><description>
1221
1250
  <p id="_">As for the measurement targets,</p>
1222
1251
  </description><measurement-target exclude="false"><p id="_">The measurement target shall be measured as:</p><formula id="_"> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mi>r</mi><mn>1</mn></mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
1223
1252
  <verification exclude="false"><p id="_">The following code will be run for verification:</p><sourcecode lang="CoreRoot" id="_">CoreRoot(success): HttpResponse
@@ -982,7 +982,7 @@ end
982
982
  <name>ISO</name>
983
983
  </organization>
984
984
  </contributor>
985
- <note format="text/plain">ISO DATE: The standard is in press</note>
985
+ <note format="text/plain" type="ISO DATE">The standard is in press</note>
986
986
  </bibitem>
987
987
  </references>
988
988
  </bibliography>
@@ -72,5 +72,40 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
72
72
  .to(be_equivalent_to(xmlpp(output)))
73
73
  end
74
74
  end
75
+
76
+ context 'when missing definition' do
77
+ let(:datamodel_file) do
78
+ examples_path('datamodel/blank_definition_profile.adoc')
79
+ end
80
+ let(:result_file) do
81
+ examples_path('datamodel/blank_definition_profile.xml')
82
+ end
83
+ let(:output) do
84
+ path = fixtures_path('macros_datamodel/blank_definition_profile.xml')
85
+ [
86
+ BLANK_HDR,
87
+ File.read(path)
88
+ ].join("\n")
89
+ end
90
+
91
+ after do
92
+ %w[doc html xml err].each do |extention|
93
+ path = examples_path(
94
+ "datamodel/blank_definition_profile.#{extention}"
95
+ )
96
+ FileUtils.rm_f(path)
97
+ FileUtils.rm_f("blank_definition_profile.#{extention}")
98
+ end
99
+ end
100
+
101
+ it 'correctly renders input' do
102
+ Asciidoctor.convert_file(datamodel_file,
103
+ backend: :standoc,
104
+ safe: :safe,
105
+ header_footer: true)
106
+ expect(xmlpp(strip_guid(File.read(result_file))))
107
+ .to(be_equivalent_to(xmlpp(output)))
108
+ end
109
+ end
75
110
  end
76
111
  end
@@ -73,6 +73,7 @@ RSpec.describe Asciidoctor::Standoc do
73
73
  output = Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
74
74
  #{ASCIIDOC_BLANK_HDR}
75
75
  [[id]]
76
+ [keep-with-next=true,keep-lines-together=true]
76
77
  * First
77
78
  * Second
78
79
  +
@@ -83,6 +84,7 @@ RSpec.describe Asciidoctor::Standoc do
83
84
  --
84
85
 
85
86
  [[id1]]
87
+ [keep-with-next=true,keep-lines-together=true]
86
88
  [loweralpha]
87
89
  . First
88
90
  . Second
@@ -101,8 +103,7 @@ RSpec.describe Asciidoctor::Standoc do
101
103
  [arabic]
102
104
  ... E
103
105
  ... F
104
-
105
-
106
+ [keep-with-next=true,keep-lines-together=true]
106
107
  Notes1::
107
108
  Notes:: Note 1.
108
109
  +
@@ -113,14 +114,14 @@ RSpec.describe Asciidoctor::Standoc do
113
114
  INPUT
114
115
  expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
115
116
  #{BLANK_HDR}
116
- <sections><ul id="id">
117
+ <sections><ul id="id" keep-with-next="true" keep-lines-together="true">
117
118
  <li>
118
119
  <p id="_">First</p>
119
120
  </li>
120
121
  <li><p id="_">Second</p><p id="_">entry1</p>
121
122
  <p id="_">entry2</p></li>
122
123
  </ul>
123
- <ol id="id1" type="alphabet">
124
+ <ol id="id1" type="alphabet" keep-with-next="true" keep-lines-together="true">
124
125
  <li>
125
126
  <p id="_">First</p>
126
127
  </li>
@@ -160,7 +161,8 @@ RSpec.describe Asciidoctor::Standoc do
160
161
  </li>
161
162
  <li>
162
163
  <p id="_">F</p>
163
- <dl id="_">
164
+
165
+ <dl id="_" keep-with-next="true" keep-lines-together="true">
164
166
  <dt>Notes1</dt>
165
167
  <dd/>
166
168
  <dt>Notes</dt>
@@ -223,7 +223,7 @@ OUTPUT
223
223
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
224
224
  #{ASCIIDOC_BLANK_HDR}
225
225
 
226
- [pseudocode,subsequence="A"]
226
+ [pseudocode,subsequence="A",number="3",keep-with-next=true,keep-lines-together=true]
227
227
  [%unnumbered]
228
228
  ====
229
229
  *A* +
@@ -234,7 +234,8 @@ OUTPUT
234
234
  INPUT
235
235
  #{BLANK_HDR}
236
236
  <sections>
237
- <figure id="_" subsequence='A' class="pseudocode" unnumbered="true"><p id="_">  <strong>A</strong><br/>
237
+ <figure id="_" subsequence='A' class="pseudocode" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
238
+ <p id="_">  <strong>A</strong><br/>
238
239
          <smallcap>B</smallcap></p>
239
240
  <p id="_">  <em>C</em></p></figure>
240
241
  </sections>
@@ -748,8 +748,8 @@ RSpec.describe Asciidoctor::Standoc do
748
748
  <formattedref format='application/x-isodoc+xml'>
749
749
  <em>Standard</em>
750
750
  </formattedref>
751
- <docidentifier>ISO/IEC TR 12382:1992</docidentifier>
752
- <docnumber>12382:1992)</docnumber>
751
+ <docidentifier type='ISO'>ISO/IEC TR 12382:1992</docidentifier>
752
+ <docnumber>12382:1992</docnumber>
753
753
  </bibitem>
754
754
  <bibitem id='iso124' type='standard'>
755
755
  <fetched>#{Date.today}</fetched>
@@ -850,7 +850,7 @@ OUTPUT
850
850
  <name>ISO</name>
851
851
  </organization>
852
852
  </contributor>
853
- <note format="text/plain">ISO DATE: The standard is in press</note>
853
+ <note format="text/plain" type="ISO DATE">The standard is in press</note>
854
854
  </bibitem>
855
855
  <bibitem id="iso125" type="standard">
856
856
  <title format="text/plain">Standard</title>
@@ -865,7 +865,7 @@ OUTPUT
865
865
  <name>ISO</name>
866
866
  </organization>
867
867
  </contributor>
868
- <note format="text/plain">ISO DATE: The standard is in press</note>
868
+ <note format="text/plain" type="ISO DATE">The standard is in press</note>
869
869
  </bibitem>
870
870
  <bibitem id='iso126' type='standard'>
871
871
  <title format='text/plain'>Standard</title>
@@ -1244,7 +1244,252 @@ OUTPUT
1244
1244
  OUTPUT
1245
1245
  end
1246
1246
 
1247
- private
1247
+ it "processes repository reference" do
1248
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
1249
+ #{ISOBIB_BLANK_HDR}
1250
+ == Scope
1251
+
1252
+ <<iso123>>
1253
+
1254
+ <<iso123,clause=1>>
1255
+
1256
+ [bibliography]
1257
+ == Normative References
1258
+
1259
+ * [[[iso123,repo:(a/b,ISO 123)]]] _Standard_
1260
+ INPUT
1261
+ #{BLANK_HDR}
1262
+ <sections>
1263
+ <clause id='_' inline-header='false' obligation='normative'>
1264
+ <title>Scope</title>
1265
+ <p id='_'>
1266
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
1267
+ </p>
1268
+ <p id='_'>
1269
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'>
1270
+ <localityStack>
1271
+ <locality type='clause'>
1272
+ <referenceFrom>1</referenceFrom>
1273
+ </locality>
1274
+ </localityStack>
1275
+ </eref>
1276
+ </p>
1277
+ </clause>
1278
+ </sections>
1279
+ <bibliography>
1280
+ <references id='_' normative='true' obligation='informative'>
1281
+ <title>Normative References</title>
1282
+ <p id='_'>
1283
+ The following documents are referred to in the text in such a way that
1284
+ some or all of their content constitutes requirements of this document.
1285
+ For dated references, only the edition cited applies. For undated
1286
+ references, the latest edition of the referenced document (including any
1287
+ amendments) applies.
1288
+ </p>
1289
+ <bibitem id='iso123'>
1290
+ <formattedref format='application/x-isodoc+xml'>
1291
+ <em>Standard</em>
1292
+ </formattedref>
1293
+ <docidentifier type="ISO">ISO 123</docidentifier>
1294
+ <docidentifier type="repository">a/b</docidentifier>
1295
+ <docnumber>123</docnumber>
1296
+ </bibitem>
1297
+ </references>
1298
+ </bibliography>
1299
+ </standard-document>
1300
+ OUTPUT
1301
+ end
1302
+
1303
+ it "processes hyperlink reference, ingest RXL or XML if available" do
1304
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
1305
+ #{ISOBIB_BLANK_HDR}
1306
+ == Scope
1307
+
1308
+ <<iso123>>
1309
+
1310
+ <<iso124,clause=1>>
1311
+
1312
+ <<iso123,anchor=xyz>>
1313
+
1314
+ <<iso124,clause=1,anchor=xyz>>
1315
+
1316
+ [bibliography]
1317
+ == Normative References
1318
+
1319
+ * [[[iso123,path:(spec/assets/iso123,ISO 123)]]] _Standard_
1320
+ * [[[iso124,path:(a/b.adoc,ISO 124)]]] _Standard_
1321
+ INPUT
1322
+ #{BLANK_HDR}
1323
+ <sections>
1324
+ <clause id='_' inline-header='false' obligation='normative'>
1325
+ <title>Scope</title>
1326
+ <p id='_'>
1327
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123 (all parts)'/>
1328
+ </p>
1329
+ <p id='_'>
1330
+ <eref type='inline' bibitemid='iso124' citeas='ISO 124'>
1331
+ <localityStack>
1332
+ <locality type='clause'>
1333
+ <referenceFrom>1</referenceFrom>
1334
+ </locality>
1335
+ </localityStack>
1336
+ </eref>
1337
+ </p>
1338
+ <p id='_'>
1339
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123 (all parts)'>
1340
+ <localityStack>
1341
+ <locality type='anchor'>
1342
+ <referenceFrom>xyz</referenceFrom>
1343
+ </locality>
1344
+ </localityStack>
1345
+ </eref>
1346
+ </p>
1347
+ <p id='_'>
1348
+ <eref type='inline' bibitemid='iso124' citeas='ISO 124'>
1349
+ <localityStack>
1350
+ <locality type='clause'>
1351
+ <referenceFrom>1</referenceFrom>
1352
+ </locality>
1353
+ <locality type='anchor'>
1354
+ <referenceFrom>xyz</referenceFrom>
1355
+ </locality>
1356
+ </localityStack>
1357
+ </eref>
1358
+ </p>
1359
+ </clause>
1360
+ </sections>
1361
+ <bibliography>
1362
+ <references id='_' normative='true' obligation='informative'>
1363
+ <title>Normative References</title>
1364
+ <p id='_'>
1365
+ The following documents are referred to in the text in such a way that
1366
+ some or all of their content constitutes requirements of this document.
1367
+ For dated references, only the edition cited applies. For undated
1368
+ references, the latest edition of the referenced document (including any
1369
+ amendments) applies.
1370
+ </p>
1371
+ <bibitem id='iso123' type='standard'>
1372
+ <fetched>2020-06-12</fetched>
1373
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1374
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1375
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
1376
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
1377
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
1378
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc – Échantillonnage</title>
1379
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1380
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1381
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1382
+ <uri type='citation'>spec/assets/iso123</uri>
1383
+ <docidentifier type='ISO'>ISO 123 (all parts)</docidentifier>
1384
+ <docnumber>123</docnumber>
1385
+ <date type='published'>
1386
+ <on>2001</on>
1387
+ </date>
1388
+ <contributor>
1389
+ <role type='publisher'/>
1390
+ <organization>
1391
+ <name>International Organization for Standardization</name>
1392
+ <abbreviation>ISO</abbreviation>
1393
+ <uri>www.iso.org</uri>
1394
+ </organization>
1395
+ </contributor>
1396
+ <edition>3</edition>
1397
+ <language>en</language>
1398
+ <language>fr</language>
1399
+ <script>Latn</script>
1400
+ <status>
1401
+ <stage>90</stage>
1402
+ <substage>93</substage>
1403
+ </status>
1404
+ <copyright>
1405
+ <from>2001</from>
1406
+ <owner>
1407
+ <organization>
1408
+ <name>ISO</name>
1409
+ </organization>
1410
+ </owner>
1411
+ </copyright>
1412
+ <relation type='obsoletes'>
1413
+ <bibitem type='standard'>
1414
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1415
+ </bibitem>
1416
+ </relation>
1417
+ <relation type='instance'>
1418
+ <bibitem type='standard'>
1419
+ <fetched>2020-06-12</fetched>
1420
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1421
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1422
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
1423
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
1424
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
1425
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc – Échantillonnage</title>
1426
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1427
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1428
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1429
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
1430
+ <docnumber>123</docnumber>
1431
+ <date type='published'>
1432
+ <on>2001</on>
1433
+ </date>
1434
+ <contributor>
1435
+ <role type='publisher'/>
1436
+ <organization>
1437
+ <name>International Organization for Standardization</name>
1438
+ <abbreviation>ISO</abbreviation>
1439
+ <uri>www.iso.org</uri>
1440
+ </organization>
1441
+ </contributor>
1442
+ <edition>3</edition>
1443
+ <language>en</language>
1444
+ <language>fr</language>
1445
+ <script>Latn</script>
1446
+ <status>
1447
+ <stage>90</stage>
1448
+ <substage>93</substage>
1449
+ </status>
1450
+ <copyright>
1451
+ <from>2001</from>
1452
+ <owner>
1453
+ <organization>
1454
+ <name>ISO</name>
1455
+ </organization>
1456
+ </owner>
1457
+ </copyright>
1458
+ <relation type='obsoletes'>
1459
+ <bibitem type='standard'>
1460
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1461
+ </bibitem>
1462
+ </relation>
1463
+ <place>Geneva</place>
1464
+ </bibitem>
1465
+ </relation>
1466
+ <relation type='instance'>
1467
+ <bibitem type='standard'>
1468
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1469
+ </bibitem>
1470
+ </relation>
1471
+ <relation type='instance'>
1472
+ <bibitem type='standard'>
1473
+ <formattedref format='text/plain'>ISO 123:1974</formattedref>
1474
+ </bibitem>
1475
+ </relation>
1476
+ <place>Geneva</place>
1477
+ </bibitem>
1478
+ <bibitem id='iso124'>
1479
+ <formattedref format='application/x-isodoc+xml'>
1480
+ <em>Standard</em>
1481
+ </formattedref>
1482
+ <uri type='URI'>a/b</uri>
1483
+ <uri type='citation'>a/b</uri>
1484
+ <docidentifier type="ISO">ISO 124</docidentifier>
1485
+ <docnumber>124</docnumber>
1486
+ </bibitem>
1487
+ </references>
1488
+ </bibliography>
1489
+ </standard-document>
1490
+ OUTPUT
1491
+ end
1492
+
1248
1493
 
1249
1494
  private
1250
1495