metanorma-iso 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -437,12 +437,12 @@ RSpec.describe IsoDoc do
437
437
  <li><concept><refterm>term6</refterm>
438
438
  <renderterm>word</renderterm>
439
439
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
440
- <localityStack>
440
+ <localityStack connective="and">
441
441
  <locality type='clause'>
442
442
  <referenceFrom>3.1</referenceFrom>
443
443
  </locality>
444
444
  </localityStack>
445
- <localityStack>
445
+ <localityStack connective="and">
446
446
  <locality type='figure'>
447
447
  <referenceFrom>b</referenceFrom>
448
448
  </locality>
@@ -452,12 +452,12 @@ RSpec.describe IsoDoc do
452
452
  <li><concept><refterm>term7</refterm>
453
453
  <renderterm>word</renderterm>
454
454
  <eref bibitemid="ISO712" type="inline" citeas="ISO 712">
455
- <localityStack>
455
+ <localityStack connective="and">
456
456
  <locality type='clause'>
457
457
  <referenceFrom>3.1</referenceFrom>
458
458
  </locality>
459
459
  </localityStack>
460
- <localityStack>
460
+ <localityStack connective="and">
461
461
  <locality type='figure'>
462
462
  <referenceFrom>b</referenceFrom>
463
463
  </locality>
@@ -537,25 +537,25 @@ RSpec.describe IsoDoc do
537
537
  </li>
538
538
  <li>
539
539
  <em>word</em>
540
- (<eref bibitemid="ISO712" type="inline" citeas="ISO 712"><localityStack>
540
+ (<eref bibitemid="ISO712" type="inline" citeas="ISO 712"><localityStack connective="and">
541
541
  <locality type="clause">
542
542
  <referenceFrom>3.1</referenceFrom>
543
543
  </locality>
544
- </localityStack><localityStack>
544
+ </localityStack><localityStack connective="and">
545
545
  <locality type="figure">
546
546
  <referenceFrom>b</referenceFrom>
547
547
  </locality>
548
- </localityStack>ISO 712, 3.1; Figure b</eref>)
548
+ </localityStack>ISO 712, 3.1 and Figure b</eref>)
549
549
  </li>
550
550
  <li>
551
551
  <em>word</em>
552
552
  (<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
553
- <localityStack>
553
+ <localityStack connective="and">
554
554
  <locality type="clause">
555
555
  <referenceFrom>3.1</referenceFrom>
556
556
  </locality>
557
557
  </localityStack>
558
- <localityStack>
558
+ <localityStack connective="and">
559
559
  <locality type="figure">
560
560
  <referenceFrom>b</referenceFrom>
561
561
  </locality>
@@ -658,7 +658,7 @@ RSpec.describe IsoDoc do
658
658
  <li>
659
659
  <i>word</i>
660
660
  (
661
- <a href='#ISO712'>ISO 712, 3.1; Figure b</a>
661
+ <a href='#ISO712'>ISO 712, 3.1 and Figure b</a>
662
662
  )
663
663
  </li>
664
664
  <li>
@@ -947,4 +947,121 @@ RSpec.describe IsoDoc do
947
947
  expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
948
948
  .convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
949
949
  end
950
+
951
+ it "combines locality stacks with connectives, omitting subclauses" do
952
+ input = <<~INPUT
953
+ <itu-standard xmlns="https://www.calconnect.org/standards/itu">
954
+ <p id='_'>
955
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
956
+ <localityStack connective='from'>
957
+ <locality type='clause'>
958
+ <referenceFrom>3</referenceFrom>
959
+ </locality>
960
+ </localityStack>
961
+ <localityStack connective='to'>
962
+ <locality type='clause'>
963
+ <referenceFrom>5</referenceFrom>
964
+ </locality>
965
+ </localityStack>
966
+ </eref>
967
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
968
+ <localityStack connective='from'>
969
+ <locality type='clause'>
970
+ <referenceFrom>3.1</referenceFrom>
971
+ </locality>
972
+ </localityStack>
973
+ <localityStack connective='to'>
974
+ <locality type='clause'>
975
+ <referenceFrom>5.1</referenceFrom>
976
+ </locality>
977
+ </localityStack>
978
+ </eref>
979
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
980
+ <localityStack connective='from'>
981
+ <locality type='clause'>
982
+ <referenceFrom>3.1</referenceFrom>
983
+ </locality>
984
+ </localityStack>
985
+ <localityStack connective='to'>
986
+ <locality type='clause'>
987
+ <referenceFrom>5</referenceFrom>
988
+ </locality>
989
+ </localityStack>
990
+ </eref>
991
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
992
+ <localityStack connective='from'>
993
+ <locality type='clause'>
994
+ <referenceFrom>3.1</referenceFrom>
995
+ </locality>
996
+ </localityStack>
997
+ <localityStack connective='to'>
998
+ <locality type='table'>
999
+ <referenceFrom>5</referenceFrom>
1000
+ </locality>
1001
+ </localityStack>
1002
+ </eref>
1003
+ </p>
1004
+ </itu-standard>
1005
+ INPUT
1006
+ output = <<~OUTPUT
1007
+ <itu-standard xmlns='https://www.calconnect.org/standards/itu' type='presentation'>
1008
+ <p id='_'>
1009
+ <eref type='inline' bibitemid='ref1' citeas='XYZ' droploc=''>
1010
+ <localityStack connective='from'>
1011
+ <locality type='clause'>
1012
+ <referenceFrom>3</referenceFrom>
1013
+ </locality>
1014
+ </localityStack>
1015
+ <localityStack connective='to'>
1016
+ <locality type='clause'>
1017
+ <referenceFrom>5</referenceFrom>
1018
+ </locality>
1019
+ </localityStack>
1020
+ XYZ, Clause 3 to 5
1021
+ </eref>
1022
+ <eref type='inline' bibitemid='ref1' citeas='XYZ' droploc=''>
1023
+ <localityStack connective='from'>
1024
+ <locality type='clause'>
1025
+ <referenceFrom>3.1</referenceFrom>
1026
+ </locality>
1027
+ </localityStack>
1028
+ <localityStack connective='to'>
1029
+ <locality type='clause'>
1030
+ <referenceFrom>5.1</referenceFrom>
1031
+ </locality>
1032
+ </localityStack>
1033
+ XYZ, 3.1 to 5.1
1034
+ </eref>
1035
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
1036
+ <localityStack connective='from'>
1037
+ <locality type='clause'>
1038
+ <referenceFrom>3.1</referenceFrom>
1039
+ </locality>
1040
+ </localityStack>
1041
+ <localityStack connective='to'>
1042
+ <locality type='clause'>
1043
+ <referenceFrom>5</referenceFrom>
1044
+ </locality>
1045
+ </localityStack>
1046
+ XYZ, 3.1 to Clause 5
1047
+ </eref>
1048
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
1049
+ <localityStack connective='from'>
1050
+ <locality type='clause'>
1051
+ <referenceFrom>3.1</referenceFrom>
1052
+ </locality>
1053
+ </localityStack>
1054
+ <localityStack connective='to'>
1055
+ <locality type='table'>
1056
+ <referenceFrom>5</referenceFrom>
1057
+ </locality>
1058
+ </localityStack>
1059
+ XYZ, 3.1 to Table 5
1060
+ </eref>
1061
+ </p>
1062
+ </itu-standard>
1063
+ OUTPUT
1064
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1065
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1066
+ end
950
1067
  end
@@ -222,7 +222,7 @@ RSpec.describe IsoDoc do
222
222
  .sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
223
223
 
224
224
  expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
225
- <div class='WordSection3'>
225
+ <div class='WordSection3'>
226
226
  <p class='zzSTDTitle1'/>
227
227
  <div>
228
228
  <a name='_terms_and_definitions' id='_terms_and_definitions'/>
@@ -241,9 +241,7 @@ RSpec.describe IsoDoc do
241
241
  rice retaining its husk after threshing
242
242
  </p>
243
243
  <p class='Source'>
244
- [SOURCE:
245
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
246
- , modified &#x2013; The term "cargo rice" is shown as deprecated, and Note
244
+ [SOURCE: ISO 7301:2011, 3.1, modified &#x2013; The term "cargo rice" is shown as deprecated, and Note
247
245
  1 to entry is not included here]
248
246
  </p>
249
247
  </div>
@@ -161,7 +161,7 @@ RSpec.describe IsoDoc do
161
161
  </ul>
162
162
  </div>
163
163
  <p>[SOURCE:
164
- <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#8211;
164
+ ISO 7301:2011, 3.1, modified &#8211;
165
165
  The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
166
166
  <p class="TermNum" id="paddy">1.2</p>
167
167
  <p class="Terms" style="text-align:left;"><b>paddy</b></p>
@@ -187,7 +187,7 @@ RSpec.describe IsoDoc do
187
187
  <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
188
188
  </p>
189
189
  </div>
190
- <p>[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>]</p>
190
+ <p>[SOURCE: ISO 7301:2011, 3.1]</p>
191
191
  <p class='TermNum' id='A'>1.3</p>
192
192
  <p class='Terms' style='text-align:left;'><b>term1</b></p>
193
193
  term1 definition
@@ -213,7 +213,7 @@ RSpec.describe IsoDoc do
213
213
  </ul></div>
214
214
 
215
215
  <p class="Source">[SOURCE:
216
- <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#8211;
216
+ ISO 7301:2011, 3.1, modified &#8211;
217
217
  The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
218
218
  <p class="TermNum" id="paddy">1.2</p>
219
219
  <p class="Terms" style="text-align:left;"><b>paddy</b></p>
@@ -228,7 +228,7 @@ RSpec.describe IsoDoc do
228
228
  </div>
229
229
  <div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class="Note"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
230
230
  <div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
231
- <p class="Source">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>]</p>
231
+ <p class="Source">[SOURCE: ISO 7301:2011, 3.1]</p>
232
232
  <p class='TermNum' id='A'>1.3</p>
233
233
  <p class='Terms' style='text-align:left;'><b>term1</b></p>
234
234
  term1 definition
@@ -890,6 +890,7 @@ RSpec.describe Metanorma::ISO do
890
890
  </organization>
891
891
  </contributor>
892
892
  <edition>3</edition>
893
+ <note type='Unpublished-Status'><p>Withdrawn.</p></note>
893
894
  <language>en</language>
894
895
  <language>fr</language>
895
896
  <script>Latn</script>
@@ -137,7 +137,7 @@ RSpec.describe Metanorma::ISO do
137
137
  <terms id="_" obligation="normative">
138
138
  <title>Terms and definitions</title>
139
139
  #{TERM_BOILERPLATE}
140
- <term id="term-_-t90-">
140
+ <term id="term-t90">
141
141
  <preferred>
142
142
  <letter-symbol><name>
143
143
  <stem type="MathML">
@@ -1247,13 +1247,13 @@ RSpec.describe Metanorma::ISO do
1247
1247
  <li>
1248
1248
  <p id='_'>
1249
1249
  ISO Online browsing platform: available at
1250
- <link target='http://www.iso.org/obp'/>
1250
+ <link target='http://www.iso.org/obp'/>.
1251
1251
  </p>
1252
1252
  </li>
1253
1253
  <li>
1254
1254
  <p id='_'>
1255
1255
  IEC Electropedia: available at
1256
- <link target='http://www.electropedia.org'/>
1256
+ <link target='http://www.electropedia.org'/>.
1257
1257
  </p>
1258
1258
  </li>
1259
1259
  </ul>
@@ -1296,13 +1296,13 @@ RSpec.describe Metanorma::ISO do
1296
1296
  <li>
1297
1297
  <p id='_'>
1298
1298
  ISO Online browsing platform: available at
1299
- <link target='http://www.iso.org/obp'/>
1299
+ <link target='http://www.iso.org/obp'/>.
1300
1300
  </p>
1301
1301
  </li>
1302
1302
  <li>
1303
1303
  <p id='_'>
1304
1304
  IEC Electropedia: available at
1305
- <link target='http://www.electropedia.org'/>
1305
+ <link target='http://www.electropedia.org'/>.
1306
1306
  </p>
1307
1307
  </li>
1308
1308
  </ul>
@@ -1360,13 +1360,13 @@ RSpec.describe Metanorma::ISO do
1360
1360
  <li>
1361
1361
  <p id='_'>
1362
1362
  ISO Online browsing platform: available at
1363
- <link target='http://www.iso.org/obp'/>
1363
+ <link target='http://www.iso.org/obp'/>.
1364
1364
  </p>
1365
1365
  </li>
1366
1366
  <li>
1367
1367
  <p id='_'>
1368
1368
  IEC Electropedia: available at
1369
- <link target='http://www.electropedia.org'/>
1369
+ <link target='http://www.electropedia.org'/>.
1370
1370
  </p>
1371
1371
  </li>
1372
1372
  </ul>
@@ -1427,13 +1427,13 @@ RSpec.describe Metanorma::ISO do
1427
1427
  <li>
1428
1428
  <p id='_'>
1429
1429
  ISO Online browsing platform: available at
1430
- <link target='http://www.iso.org/obp'/>
1430
+ <link target='http://www.iso.org/obp'/>.
1431
1431
  </p>
1432
1432
  </li>
1433
1433
  <li>
1434
1434
  <p id='_'>
1435
1435
  IEC Electropedia: available at
1436
- <link target='http://www.electropedia.org'/>
1436
+ <link target='http://www.electropedia.org'/>.
1437
1437
  </p>
1438
1438
  </li>
1439
1439
  </ul>
@@ -1485,13 +1485,13 @@ RSpec.describe Metanorma::ISO do
1485
1485
  <li>
1486
1486
  <p id='_'>
1487
1487
  ISO Online browsing platform: available at
1488
- <link target='http://www.iso.org/obp'/>
1488
+ <link target='http://www.iso.org/obp'/>.
1489
1489
  </p>
1490
1490
  </li>
1491
1491
  <li>
1492
1492
  <p id='_'>
1493
1493
  IEC Electropedia: available at
1494
- <link target='http://www.electropedia.org'/>
1494
+ <link target='http://www.electropedia.org'/>.
1495
1495
  </p>
1496
1496
  </li>
1497
1497
  </ul>