metanorma-iso 2.0.8 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +37 -0
  3. data/lib/isodoc/iso/base_convert.rb +1 -1
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +5 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +304 -242
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +379 -260
  7. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  8. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +4 -3
  9. data/lib/isodoc/iso/html/word_iso_titlepage.html +10 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
  11. data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
  12. data/lib/isodoc/iso/html_convert.rb +2 -2
  13. data/lib/isodoc/iso/i18n-en.yaml +1 -0
  14. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  15. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  16. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  17. data/lib/isodoc/iso/init.rb +17 -1
  18. data/lib/isodoc/iso/iso.amendment.xsl +1697 -426
  19. data/lib/isodoc/iso/iso.international-standard.xsl +1697 -426
  20. data/lib/isodoc/iso/metadata.rb +13 -19
  21. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  22. data/lib/isodoc/iso/presentation_xml_convert.rb +41 -100
  23. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  24. data/lib/isodoc/iso/sections.rb +2 -2
  25. data/lib/isodoc/iso/word_cleanup.rb +16 -2
  26. data/lib/isodoc/iso/word_convert.rb +29 -12
  27. data/lib/isodoc/iso/word_dis_convert.rb +183 -0
  28. data/lib/isodoc/iso/xref.rb +46 -25
  29. data/lib/metanorma/iso/biblio.rng +37 -8
  30. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  31. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  32. data/lib/metanorma/iso/boilerplate.xml +1 -3
  33. data/lib/metanorma/iso/cleanup.rb +2 -1
  34. data/lib/metanorma/iso/isodoc.rng +56 -0
  35. data/lib/metanorma/iso/version.rb +1 -1
  36. data/lib/metanorma-iso.rb +1 -0
  37. data/lib/relaton/render/config.yml +4 -0
  38. data/lib/relaton/render/general.rb +13 -0
  39. data/metanorma-iso.gemspec +1 -1
  40. data/spec/isodoc/amd_spec.rb +31 -30
  41. data/spec/isodoc/blocks_spec.rb +286 -179
  42. data/spec/isodoc/i18n_spec.rb +187 -21
  43. data/spec/isodoc/inline_spec.rb +35 -42
  44. data/spec/isodoc/iso_spec.rb +1 -1
  45. data/spec/isodoc/metadata_spec.rb +17 -17
  46. data/spec/isodoc/postproc_spec.rb +28 -3
  47. data/spec/isodoc/ref_spec.rb +66 -69
  48. data/spec/isodoc/section_spec.rb +78 -76
  49. data/spec/isodoc/table_spec.rb +2 -2
  50. data/spec/isodoc/terms_spec.rb +2 -2
  51. data/spec/isodoc/word_dis_spec.rb +760 -0
  52. data/spec/isodoc/xref_spec.rb +51 -51
  53. data/spec/metanorma/base_spec.rb +10 -10
  54. data/spec/spec_helper.rb +11 -1
  55. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  56. metadata +11 -5
  57. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -156,7 +156,7 @@ RSpec.describe IsoDoc do
156
156
  <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
157
157
  <title>
158
158
  <strong>Annex A</strong>
159
- <br/>(normative)
159
+ <br/><span class='obligation'>(normative)</span>
160
160
  <br/>
161
161
  <br/>
162
162
  <strong>Annex</strong></title>
@@ -263,6 +263,181 @@ RSpec.describe IsoDoc do
263
263
  </body>
264
264
  </html>
265
265
  OUTPUT
266
+ word = <<~WORD
267
+ <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
268
+ <head>
269
+ <style></style>
270
+ <style></style>
271
+ </head>
272
+ <body lang='EN-US' link='blue' vlink='#954F72'>
273
+ <div class='WordSection1'>
274
+ <p> </p>
275
+ </div>
276
+ <p>
277
+ <br clear='all' class='section'/>
278
+ </p>
279
+ <div class='WordSection2'>
280
+ <p>
281
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
282
+ </p>
283
+ <div>
284
+ <h1 class='ForewordTitle'>Foreword</h1>
285
+ <p class='ForewordText' id='A'>This is a preamble</p>
286
+ </div>
287
+ <p>
288
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
289
+ </p>
290
+ <div class='Section3' id='B'>
291
+ <h1 class='IntroTitle'>
292
+ 0
293
+ <span style='mso-tab-count:1'>  </span>
294
+ Introduction
295
+ </h1>
296
+ <div id='C'>
297
+ <h2>
298
+ 0.1
299
+ <span style='mso-tab-count:1'>  </span>
300
+ Introduction Subsection
301
+ </h2>
302
+ </div>
303
+ <p>This is patent boilerplate</p>
304
+ </div>
305
+ <p> </p>
306
+ </div>
307
+ <p>
308
+ <br clear='all' class='section'/>
309
+ </p>
310
+ <div class='WordSection3'>
311
+ <p class='zzSTDTitle1'/>
312
+ <div id='D'>
313
+ <h1>
314
+ 1
315
+ <span style='mso-tab-count:1'>  </span>
316
+ Scope
317
+ </h1>
318
+ <p id='E'>Text</p>
319
+ </div>
320
+ <div>
321
+ <h1>
322
+ 2
323
+ <span style='mso-tab-count:1'>  </span>
324
+ Normative References
325
+ </h1>
326
+ </div>
327
+ <div id='H'>
328
+ <h1>
329
+ 3
330
+ <span style='mso-tab-count:1'>  </span>
331
+ Terms, definitions, symbols and abbreviated terms
332
+ </h1>
333
+ <div id='I'>
334
+ <h2>
335
+ 3.1
336
+ <span style='mso-tab-count:1'>  </span>
337
+ Normal Terms
338
+ </h2>
339
+ <p class='TermNum' id='J'>3.1.1</p>
340
+ <p class='Terms' style='text-align:left;'>
341
+ <b>Term2</b>
342
+ </p>
343
+ </div>
344
+ <div id='K'>
345
+ <span class='zzMoveToFollowing'>
346
+ <b>
347
+ 3.2
348
+ <span style='mso-tab-count:1'>  </span>
349
+ </b>
350
+ </span>
351
+ <table class='dl'>
352
+ <tr>
353
+ <td valign='top' align='left'>
354
+ <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
355
+ </td>
356
+ <td valign='top'>Definition</td>
357
+ </tr>
358
+ </table>
359
+ </div>
360
+ </div>
361
+ <div id='L' class='Symbols'>
362
+ <h1>4</h1>
363
+ <table class='dl'>
364
+ <tr>
365
+ <td valign='top' align='left'>
366
+ <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
367
+ </td>
368
+ <td valign='top'>Definition</td>
369
+ </tr>
370
+ </table>
371
+ </div>
372
+ <div id='M'>
373
+ <h1>
374
+ 5
375
+ <span style='mso-tab-count:1'>  </span>
376
+ Clause 4
377
+ </h1>
378
+ <div id='N'>
379
+ <h2>
380
+ 5.1
381
+ <span style='mso-tab-count:1'>  </span>
382
+ Introduction
383
+ </h2>
384
+ </div>
385
+ <div id='O'>
386
+ <h2>
387
+ 5.2
388
+ <span style='mso-tab-count:1'>  </span>
389
+ Clause 4.2
390
+ </h2>
391
+ </div>
392
+ </div>
393
+ <p>
394
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
395
+ </p>
396
+ <div id='P' class='Section3'>
397
+ <h1 class='Annex'>
398
+ <br/>
399
+ <span style='font-weight:normal;'>(normative)</span>
400
+ <br/>
401
+ <br/>
402
+ <b>Annex</b>
403
+ </h1>
404
+ <div id='Q'>
405
+ <h2>
406
+ A.1
407
+ <span style='mso-tab-count:1'>  </span>
408
+ Annex A.1
409
+ </h2>
410
+ <div id='Q1'>
411
+ <h3>
412
+ A.1.1
413
+ <span style='mso-tab-count:1'>  </span>
414
+ Annex A.1a
415
+ </h3>
416
+ </div>
417
+ </div>
418
+ <div id='Q2'>
419
+ <h2>
420
+ Appendix 1
421
+ <span style='mso-tab-count:1'>  </span>
422
+ An Appendix
423
+ </h2>
424
+ </div>
425
+ </div>
426
+ <p>
427
+ <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
428
+ </p>
429
+ <div>
430
+ <h1 class='BiblioTitle'>Bibliography</h1>
431
+ <div>
432
+ <h2 class='BiblioTitle'>Bibliography Subsection</h2>
433
+ </div>
434
+ </div>
435
+ </div>
436
+ <br clear='all' style='page-break-before:left;mso-break-type:section-break'/>
437
+ <div class='colophon'/>
438
+ </body>
439
+ </html>
440
+ WORD
266
441
  expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
267
442
  .convert("test", input, true))
268
443
  .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
@@ -270,6 +445,9 @@ RSpec.describe IsoDoc do
270
445
  expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
271
446
  .convert("test", presxml, true)))
272
447
  .to be_equivalent_to xmlpp(html)
448
+ expect(xmlpp(IsoDoc::Iso::WordConvert.new({})
449
+ .convert("test", presxml, true)))
450
+ .to be_equivalent_to xmlpp(word)
273
451
  end
274
452
 
275
453
  it "defaults to English" do
@@ -429,7 +607,7 @@ RSpec.describe IsoDoc do
429
607
  <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
430
608
  <title>
431
609
  <strong>Annex A</strong>
432
- <br/>(normative)
610
+ <br/><span class='obligation'>(normative)</span>
433
611
  <br/>
434
612
  <br/>
435
613
  <strong>Annex</strong></title>
@@ -613,7 +791,7 @@ RSpec.describe IsoDoc do
613
791
  <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
614
792
  <title>
615
793
  <strong>Annexe A</strong>
616
- <br/>(normative)
794
+ <br/><span class='obligation'>(normative)</span>
617
795
  <br/>
618
796
  <br/>
619
797
  <strong>Annex</strong></title>
@@ -898,7 +1076,7 @@ RSpec.describe IsoDoc do
898
1076
  <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
899
1077
  <title>
900
1078
  <strong>&#x414;&#x43E;&#x43F;&#x43E;&#x43B;&#x43D;&#x435;&#x43D;&#x438;&#x435; A</strong>
901
- <br/>(&#x43D;&#x43E;&#x440;&#x43C;&#x430;&#x442;&#x438;&#x432;&#x43D;&#x43E;&#x435;)
1079
+ <br/><span class='obligation'>(&#x43D;&#x43E;&#x440;&#x43C;&#x430;&#x442;&#x438;&#x432;&#x43D;&#x43E;&#x435;)</span>
902
1080
  <br/>
903
1081
  <br/>
904
1082
  <strong>Annex</strong></title>
@@ -1109,14 +1287,8 @@ RSpec.describe IsoDoc do
1109
1287
  <references id="R" normative="true" obligation="informative">
1110
1288
  <title>Normative References</title>
1111
1289
  <bibitem id="ISO712" type="standard">
1112
- <title format="text/plain">Cereals and cereal products</title>
1290
+ <formattedref><em>Cereals and cereal products</em>.</formattedref>
1113
1291
  <docidentifier>ISO 712</docidentifier>
1114
- <contributor>
1115
- <role type="publisher"/>
1116
- <organization>
1117
- <abbreviation>ISO</abbreviation>
1118
- </organization>
1119
- </contributor>
1120
1292
  </bibitem>
1121
1293
  </references>
1122
1294
  <clause id="S" obligation="informative">
@@ -1160,7 +1332,7 @@ RSpec.describe IsoDoc do
1160
1332
  <clause id="D" obligation="normative" type="scope" displayorder='3'>
1161
1333
  <title depth="1">1<tab/>Scope</title>
1162
1334
  <p id="E">
1163
- <eref bibitemid="ISO712" type="inline"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, 1–1表</eref>
1335
+ <eref bibitemid="ISO712" type="inline"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, <span class='citetbl'>第1–1表</span></eref>
1164
1336
  </p>
1165
1337
  </clause>
1166
1338
  <clause id="H" obligation="normative" displayorder='5'>
@@ -1200,7 +1372,7 @@ RSpec.describe IsoDoc do
1200
1372
  <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
1201
1373
  <title>
1202
1374
  <strong>附件A</strong>
1203
- <br/>(规范性附录)
1375
+ <br/><span class='obligation'>(规范性附录)</span>
1204
1376
  <br/>
1205
1377
  <br/>
1206
1378
  <strong>Annex</strong></title>
@@ -1218,14 +1390,8 @@ RSpec.describe IsoDoc do
1218
1390
  <references id="R" normative="true" obligation="informative" displayorder='4'>
1219
1391
  <title depth="1">2<tab/>Normative References</title>
1220
1392
  <bibitem id="ISO712" type="standard">
1221
- <title format="text/plain">Cereals and cereal products</title>
1393
+ <formattedref><em>Cereals and cereal products</em>.</formattedref>
1222
1394
  <docidentifier>ISO 712</docidentifier>
1223
- <contributor>
1224
- <role type="publisher"/>
1225
- <organization>
1226
- <abbreviation>ISO</abbreviation>
1227
- </organization>
1228
- </contributor>
1229
1395
  </bibitem>
1230
1396
  </references>
1231
1397
  <clause id="S" obligation="informative" displayorder='9'>
@@ -1264,7 +1430,7 @@ RSpec.describe IsoDoc do
1264
1430
  <h1>2 Normative References</h1>
1265
1431
  <p id='ISO712' class='NormRef'>
1266
1432
  ISO 712,
1267
- <i>Cereals and cereal products</i>
1433
+ <i>Cereals and cereal products</i>.
1268
1434
  </p>
1269
1435
  </div>
1270
1436
  <div id='H'>
@@ -199,7 +199,7 @@ RSpec.describe IsoDoc do
199
199
  <title>1<tab/>
200
200
  Normative references</title>
201
201
  <bibitem id="ISO712" type="standard">
202
- <title format="text/plain">Cereals and cereal products</title>
202
+ <formattedref format="text/plain"><em>Cereals and cereal products</em></formattedref>
203
203
  <docidentifier>ISO 712</docidentifier>
204
204
  <contributor>
205
205
  <role type="publisher"/>
@@ -297,6 +297,7 @@ RSpec.describe IsoDoc do
297
297
  </locality>
298
298
  </eref>
299
299
  <eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
300
+ <eref bibitemid="ISO712" citeas="ISO/IEC DIR 1" type="inline"/>
300
301
  </p>
301
302
  </foreword>
302
303
  </preface>
@@ -328,40 +329,40 @@ RSpec.describe IsoDoc do
328
329
  <eref bibitemid="IEV" citeas="IEV" type="inline">
329
330
  <locality type="clause">
330
331
  <referenceFrom>1-2-3</referenceFrom>
331
- </locality>IEV, 1-2-3</eref>
332
- <eref bibitemid="ISO712" citeas="ISO 712" type="inline">ISO 712</eref>
332
+ </locality><span class='stdpublisher'>IEV</span>, <span class="citesec">1-2-3</span></eref>
333
+ <eref bibitemid="ISO712" citeas="ISO 712" type="inline"><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span></eref>
333
334
  <eref bibitemid="ISO712" type="inline">ISO 712</eref>
334
335
  <eref bibitemid="ISO712" type="inline">
335
336
  <locality type="table">
336
337
  <referenceFrom>1</referenceFrom>
337
- </locality>ISO 712, Table 1</eref>
338
+ </locality>ISO 712, <span class="citetbl">Table 1</span></eref>
338
339
  <eref bibitemid="ISO712" type="inline">
339
340
  <locality type="table">
340
341
  <referenceFrom>1</referenceFrom>
341
342
  <referenceTo>1</referenceTo>
342
- </locality>ISO 712, Table 1–1</eref>
343
+ </locality>ISO 712, <span class="citetbl">Table 1–1</span></eref>
343
344
  <eref bibitemid="ISO712" type="inline">
344
345
  <locality type="clause">
345
346
  <referenceFrom>1</referenceFrom>
346
347
  </locality>
347
348
  <locality type="table">
348
349
  <referenceFrom>1</referenceFrom>
349
- </locality>ISO 712, Clause 1, Table 1</eref>
350
+ </locality>ISO 712, <span class="citesec">Clause 1</span>, <span class="citetbl">Table 1</span></eref>
350
351
  <eref bibitemid="ISO712" type="inline">
351
352
  <locality type="clause">
352
353
  <referenceFrom>1</referenceFrom>
353
354
  </locality>
354
355
  <locality type="list">
355
356
  <referenceFrom>a</referenceFrom>
356
- </locality>ISO 712, Clause 1 a)</eref>
357
+ </locality>ISO 712, <span class="citesec">Clause 1</span> a)</eref>
357
358
  <eref bibitemid="ISO712" type="inline">
358
359
  <locality type="clause">
359
360
  <referenceFrom>1</referenceFrom>
360
- </locality>ISO 712, Clause 1</eref>
361
+ </locality>ISO 712, <span class="citesec">Clause 1</span></eref>
361
362
  <eref bibitemid="ISO712" type="inline">
362
363
  <locality type="clause">
363
364
  <referenceFrom>1.5</referenceFrom>
364
- </locality>ISO 712, 1.5</eref>
365
+ </locality>ISO 712, <span class="citesec">1.5</span></eref>
365
366
  <eref bibitemid="ISO712" type="inline">
366
367
  <locality type="table">
367
368
  <referenceFrom>1</referenceFrom>
@@ -373,6 +374,11 @@ RSpec.describe IsoDoc do
373
374
  <referenceFrom>7</referenceFrom>
374
375
  </locality>ISO 712, Prelude 7</eref>
375
376
  <eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
377
+ <eref bibitemid='ISO712' citeas='ISO/IEC DIR 1' type='inline'>
378
+ <span class='stdpublisher'>ISO/IEC</span>
379
+ <span class='stddocNumber'>DIR</span>
380
+ <span class='stddocNumber'>1</span>
381
+ </eref>
376
382
  </p>
377
383
  </foreword>
378
384
  </preface>
@@ -381,14 +387,8 @@ RSpec.describe IsoDoc do
381
387
  <title depth="1">1<tab/>
382
388
  Normative References</title>
383
389
  <bibitem id="ISO712" type="standard">
384
- <title format="text/plain">Cereals and cereal products</title>
390
+ <formattedref><em><span class='stddocTitle'>Cereals and cereal products</span></em></formattedref>
385
391
  <docidentifier>ISO 712</docidentifier>
386
- <contributor>
387
- <role type="publisher"/>
388
- <organization>
389
- <abbreviation>ISO</abbreviation>
390
- </organization>
391
- </contributor>
392
392
  </bibitem>
393
393
  </references>
394
394
  </bibliography>
@@ -509,11 +509,11 @@ RSpec.describe IsoDoc do
509
509
  <p>
510
510
  <ul>
511
511
  <li>
512
- (<xref target="clause1">Clause 3</xref>)
512
+ (<xref target="clause1"><span class='citesec'>Clause 3</span></xref>)
513
513
  </li>
514
514
  <li>
515
515
  <em>term</em>
516
- (<xref target="clause1">Clause 3</xref>)
516
+ (<xref target="clause1"><span class='citesec'>Clause 3</span></xref>)
517
517
  </li>
518
518
  <li>
519
519
  <em>w[o]rd</em>
@@ -521,7 +521,7 @@ RSpec.describe IsoDoc do
521
521
  </li>
522
522
  <li>
523
523
  <em>term</em>
524
- (<eref bibitemid="ISO712" type="inline" citeas="ISO 712">ISO 712</eref>)
524
+ (<eref bibitemid="ISO712" type="inline" citeas="ISO 712"><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span></eref>)
525
525
  </li>
526
526
  <li>
527
527
  <em>word</em>
@@ -533,7 +533,7 @@ RSpec.describe IsoDoc do
533
533
  <referenceFrom>3.1</referenceFrom>
534
534
  </locality><locality type="figure">
535
535
  <referenceFrom>a</referenceFrom>
536
- </locality>ISO 712, 3.1, Figure a</eref>)
536
+ </locality><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span>, <span class="citesec">3.1</span>, <span class="citefig">Figure a</span></eref>)
537
537
  </li>
538
538
  <li>
539
539
  <em>word</em>
@@ -545,7 +545,7 @@ RSpec.describe IsoDoc do
545
545
  <locality type="figure">
546
546
  <referenceFrom>b</referenceFrom>
547
547
  </locality>
548
- </localityStack>ISO 712, 3.1 and Figure b</eref>)
548
+ </localityStack><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span>, <span class="citesec">3.1</span> and <span class="citefig">Figure b</span></eref>)
549
549
  </li>
550
550
  <li>
551
551
  <em>word</em>
@@ -584,15 +584,8 @@ RSpec.describe IsoDoc do
584
584
  <bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="1"><title depth="1">1<tab/>Normative References</title>
585
585
  <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>
586
586
  <bibitem id="ISO712" type="standard">
587
- <title format="text/plain">Cereals or cereal products</title>
588
- <title type="main" format="text/plain">Cereals and cereal products</title>
587
+ <formattedref><em><span class='stddocTitle'>Cereals and cereal products</span></em></formattedref>
589
588
  <docidentifier type="ISO">ISO 712</docidentifier>
590
- <contributor>
591
- <role type="publisher"/>
592
- <organization>
593
- <name>International Organization for Standardization</name>
594
- </organization>
595
- </contributor>
596
589
  </bibitem>
597
590
  </references></bibliography>
598
591
  </iso-standard>
@@ -768,7 +761,7 @@ RSpec.describe IsoDoc do
768
761
  <li>
769
762
  <em>term</em>
770
763
  (
771
- <xref target='clause1'>1.2</xref>
764
+ <xref target='clause1'><span class='citesec'>1.2</span></xref>
772
765
  )
773
766
  </li>
774
767
  <li> term </li>
@@ -780,7 +773,7 @@ RSpec.describe IsoDoc do
780
773
  <li>
781
774
  <em>term</em>
782
775
  (
783
- <xref target='clause1'>1.2</xref>
776
+ <xref target='clause1'><span class='citesec'>1.2</span></xref>
784
777
  )
785
778
  </li>
786
779
  <li> term </li>
@@ -850,15 +843,15 @@ RSpec.describe IsoDoc do
850
843
  <ul>
851
844
  <li>
852
845
  <em>term</em>
853
- (<xref target="clause1">Clause 1</xref>)
846
+ (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)
854
847
  </li>
855
848
  <li>
856
849
  term
857
- (<xref target="clause1">Clause 1</xref>)
850
+ (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)
858
851
  </li>
859
852
  <li>
860
853
  <em>term</em>
861
- (<xref target="clause1">Clause 1</xref>)
854
+ (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)
862
855
  </li>
863
856
  <li>
864
857
  term
@@ -869,10 +862,10 @@ RSpec.describe IsoDoc do
869
862
  <li>
870
863
  term
871
864
  </li>
872
- <li><xref target="clause1"><em>term</em></xref> (<xref target="clause1">Clause 1</xref>)</li>
873
- <li><xref target="clause1"><em>term</em></xref> (Clause 1)</li>
874
- <li><em>term</em> (<xref target="clause1">Clause 1</xref>)</li>
875
- <li><em>term</em> (Clause 1)</li>
865
+ <li><xref target="clause1"><em>term</em></xref> (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)</li>
866
+ <li><xref target="clause1"><em>term</em></xref> (<span class='citesec'>Clause 1</span>)</li>
867
+ <li><em>term</em> (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)</li>
868
+ <li><em>term</em> (<span class='citesec'>Clause 1</span>)</li>
876
869
  </ul></p>
877
870
  </term>
878
871
  </terms>
@@ -1017,7 +1010,7 @@ RSpec.describe IsoDoc do
1017
1010
  <referenceFrom>5</referenceFrom>
1018
1011
  </locality>
1019
1012
  </localityStack>
1020
- XYZ, Clause 3 to 5
1013
+ <span class='stdpublisher'>XYZ</span>, <span class="citesec">Clause <span class="citesec">3</span> to <span class="citesec">5</span></span>
1021
1014
  </eref>
1022
1015
  <eref type='inline' bibitemid='ref1' citeas='XYZ' droploc=''>
1023
1016
  <localityStack connective='from'>
@@ -1030,7 +1023,7 @@ RSpec.describe IsoDoc do
1030
1023
  <referenceFrom>5.1</referenceFrom>
1031
1024
  </locality>
1032
1025
  </localityStack>
1033
- XYZ, 3.1 to 5.1
1026
+ <span class='stdpublisher'>XYZ</span>, <span class="citesec">3.1</span> to <span class="citesec">5.1</span>
1034
1027
  </eref>
1035
1028
  <eref type='inline' bibitemid='ref1' citeas='XYZ'>
1036
1029
  <localityStack connective='from'>
@@ -1043,7 +1036,7 @@ RSpec.describe IsoDoc do
1043
1036
  <referenceFrom>5</referenceFrom>
1044
1037
  </locality>
1045
1038
  </localityStack>
1046
- XYZ, 3.1 to Clause 5
1039
+ <span class='stdpublisher'>XYZ</span>, <span class="citesec">3.1</span> to <span class="citesec">Clause 5</span>
1047
1040
  </eref>
1048
1041
  <eref type='inline' bibitemid='ref1' citeas='XYZ'>
1049
1042
  <localityStack connective='from'>
@@ -1056,7 +1049,7 @@ RSpec.describe IsoDoc do
1056
1049
  <referenceFrom>5</referenceFrom>
1057
1050
  </locality>
1058
1051
  </localityStack>
1059
- XYZ, 3.1 to Table 5
1052
+ <span class='stdpublisher'>XYZ</span>, <span class="citesec">3.1</span> to <span class="citetbl">Table 5</span>
1060
1053
  </eref>
1061
1054
  </p>
1062
1055
  </itu-standard>
@@ -157,7 +157,7 @@ RSpec.describe IsoDoc::Iso do
157
157
  </relation>
158
158
  </bibitem>
159
159
  <bibitem id="ISO20483" type="standard">
160
- <title format="text/plain">Cereals and pulses</title>
160
+ <formattedref format="text/plain"><em>Cereals and pulses</em></formattedref>
161
161
  <docidentifier>ISO 20483</docidentifier>
162
162
  <date type="published">
163
163
  <from>2013</from>
@@ -97,21 +97,21 @@ RSpec.describe IsoDoc::Iso::Metadata do
97
97
  :circulateddate=>"XXX",
98
98
  :confirmeddate=>"XXX",
99
99
  :copieddate=>"XXX",
100
- :createddate=>"2010&ndash;2011",
100
+ :createddate=>"2010&#x2013;2011",
101
101
  :docnumber=>"ISO/PreCD3 17301-1",
102
102
  :docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
103
103
  :docnumber_reference=>"ISO/PreCD3 17301-1:2000 (E)",
104
104
  :docnumeric=>"1730",
105
- :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz",
105
+ :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1: Riz",
106
106
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
107
107
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
108
108
  :docsubtitlepart=>"Riz",
109
- :docsubtitlepartlabel=>"Partie&nbsp;1",
110
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice",
109
+ :docsubtitlepartlabel=>"Partie&#xa0;1",
110
+ :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1: Rice",
111
111
  :doctitleintro=>"Cereals and pulses",
112
112
  :doctitlemain=>"Specifications and test methods",
113
113
  :doctitlepart=>"Rice",
114
- :doctitlepartlabel=>"Part&nbsp;1",
114
+ :doctitlepartlabel=>"Part&#xa0;1",
115
115
  :doctype=>"International Standard",
116
116
  :doctype_display=>"International Standard",
117
117
  :docyear=>"2016",
@@ -238,16 +238,16 @@ RSpec.describe IsoDoc::Iso::Metadata do
238
238
  :docnumber=>"ISO/IEC/CD 17301-1-3",
239
239
  :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
240
240
  :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
241
- :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
241
+ :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1&#x2013;3: Riz",
242
242
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
243
243
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
244
244
  :docsubtitlepart=>"Riz",
245
- :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3",
246
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
245
+ :docsubtitlepartlabel=>"Partie&#xa0;1&#x2013;3",
246
+ :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
247
247
  :doctitleintro=>"Cereals and pulses",
248
248
  :doctitlemain=>"Specifications and test methods",
249
249
  :doctitlepart=>"Rice",
250
- :doctitlepartlabel=>"Part&nbsp;1&ndash;3",
250
+ :doctitlepartlabel=>"Part&#xa0;1&#x2013;3",
251
251
  :doctype=>"International Standard",
252
252
  :doctype_display=>"International Standard",
253
253
  :docyear=>"2016",
@@ -374,16 +374,16 @@ RSpec.describe IsoDoc::Iso::Metadata do
374
374
  :docnumber=>"ISO/IEC/CD 17301-1-3",
375
375
  :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
376
376
  :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
377
- :docsubtitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
377
+ :docsubtitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
378
378
  :docsubtitleintro=>"Cereals and pulses",
379
379
  :docsubtitlemain=>"Specifications and test methods",
380
380
  :docsubtitlepart=>"Rice",
381
- :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
382
- :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
381
+ :docsubtitlepartlabel=>"Part&#xa0;1&#x2013;3",
382
+ :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1&#x2013;3: Riz",
383
383
  :doctitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
384
384
  :doctitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
385
385
  :doctitlepart=>"Riz",
386
- :doctitlepartlabel=>"Partie&nbsp;1&ndash;3",
386
+ :doctitlepartlabel=>"Partie&#xa0;1&#x2013;3",
387
387
  :doctype=>"International Standard",
388
388
  :doctype_display=>"Standard International",
389
389
  :docyear=>"2016",
@@ -515,16 +515,16 @@ RSpec.describe IsoDoc::Iso::Metadata do
515
515
  :docnumber=>"ISO/IEC/CD 17301-1-3",
516
516
  :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
517
517
  :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
518
- :docsubtitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
518
+ :docsubtitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
519
519
  :docsubtitleintro=>"Cereals and pulses",
520
520
  :docsubtitlemain=>"Specifications and test methods",
521
521
  :docsubtitlepart=>"Rice",
522
- :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
523
- :doctitle=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;&nbsp;&mdash; &#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;&nbsp;&mdash; Часть&nbsp;1&ndash;3: &#x420;&#x438;&#x441;",
522
+ :docsubtitlepartlabel=>"Part&#xa0;1&#x2013;3",
523
+ :doctitle=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;&#xa0;&#x2014; &#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;&#xa0;&#x2014; Часть&#xa0;1&#x2013;3: &#x420;&#x438;&#x441;",
524
524
  :doctitleintro=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;",
525
525
  :doctitlemain=>"&#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;",
526
526
  :doctitlepart=>"&#x420;&#x438;&#x441;",
527
- :doctitlepartlabel=>"Часть&nbsp;1&ndash;3",
527
+ :doctitlepartlabel=>"Часть&#xa0;1&#x2013;3",
528
528
  :doctype=>"International Standard",
529
529
  :doctype_display=>"International Standard",
530
530
  :docyear=>"2016",