metanorma-iso 2.0.8.1 → 2.1.2

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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +169 -0
  3. data/lib/isodoc/iso/base_convert.rb +11 -1
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +407 -427
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +482 -438
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +3 -1
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +26 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +16 -6
  17. data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
  18. data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
  19. data/lib/isodoc/iso/html_convert.rb +7 -2
  20. data/lib/isodoc/iso/i18n-en.yaml +33 -4
  21. data/lib/isodoc/iso/i18n-fr.yaml +30 -3
  22. data/lib/isodoc/iso/i18n-ru.yaml +33 -4
  23. data/lib/isodoc/iso/i18n-zh-Hans.yaml +33 -3
  24. data/lib/isodoc/iso/i18n.rb +1 -1
  25. data/lib/isodoc/iso/init.rb +17 -1
  26. data/lib/isodoc/iso/iso.amendment.xsl +1711 -367
  27. data/lib/isodoc/iso/iso.international-standard.xsl +1711 -367
  28. data/lib/isodoc/iso/metadata.rb +72 -78
  29. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  30. data/lib/isodoc/iso/presentation_xml_convert.rb +52 -100
  31. data/lib/isodoc/iso/presentation_xref.rb +132 -0
  32. data/lib/isodoc/iso/sections.rb +3 -3
  33. data/lib/isodoc/iso/word_cleanup.rb +17 -0
  34. data/lib/isodoc/iso/word_convert.rb +32 -12
  35. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  36. data/lib/isodoc/iso/word_dis_convert.rb +122 -0
  37. data/lib/isodoc/iso/xref.rb +78 -29
  38. data/lib/metanorma/iso/base.rb +20 -1
  39. data/lib/metanorma/iso/biblio.rng +69 -42
  40. data/lib/metanorma/iso/boilerplate-fr.xml +4 -1
  41. data/lib/metanorma/iso/boilerplate-ru.xml +4 -3
  42. data/lib/metanorma/iso/boilerplate.xml +4 -3
  43. data/lib/metanorma/iso/cleanup.rb +29 -1
  44. data/lib/metanorma/iso/front.rb +31 -6
  45. data/lib/metanorma/iso/front_id.rb +2 -0
  46. data/lib/metanorma/iso/isodoc.rng +65 -0
  47. data/lib/metanorma/iso/isostandard.rng +30 -12
  48. data/lib/metanorma/iso/macros.rb +29 -0
  49. data/lib/metanorma/iso/version.rb +1 -1
  50. data/lib/metanorma-iso.rb +1 -0
  51. data/lib/relaton/render/config.yml +4 -0
  52. data/lib/relaton/render/general.rb +13 -0
  53. data/metanorma-iso.gemspec +1 -1
  54. data/spec/isodoc/amd_spec.rb +35 -60
  55. data/spec/isodoc/blocks_spec.rb +783 -179
  56. data/spec/isodoc/i18n_spec.rb +331 -100
  57. data/spec/isodoc/inline_spec.rb +35 -42
  58. data/spec/isodoc/iso_spec.rb +51 -170
  59. data/spec/isodoc/metadata_spec.rb +240 -99
  60. data/spec/isodoc/postproc_spec.rb +68 -7
  61. data/spec/isodoc/ref_spec.rb +66 -69
  62. data/spec/isodoc/section_spec.rb +88 -80
  63. data/spec/isodoc/table_spec.rb +2 -2
  64. data/spec/isodoc/terms_spec.rb +2 -2
  65. data/spec/isodoc/word_dis_spec.rb +1886 -0
  66. data/spec/isodoc/xref_spec.rb +138 -64
  67. data/spec/metanorma/amd_spec.rb +53 -1
  68. data/spec/metanorma/base_spec.rb +195 -20
  69. data/spec/metanorma/blocks_spec.rb +54 -0
  70. data/spec/metanorma/lists_spec.rb +2 -2
  71. data/spec/metanorma/section_spec.rb +2 -2
  72. data/spec/spec_helper.rb +23 -4
  73. data/spec/vcr_cassettes/withdrawn_iso.yml +25 -25
  74. metadata +15 -10
  75. data/docs/asciiiso-syntax.adoc +0 -307
  76. data/docs/guidance.adoc +0 -487
  77. data/docs/navigation.adoc +0 -23
  78. data/docs/quickstart.adoc +0 -179
  79. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -93,7 +93,7 @@ RSpec.describe IsoDoc do
93
93
  <bibdata>
94
94
  <status>
95
95
  <stage abbreviation='IS' language=''>60</stage>
96
- <stage abbreviation='IS' language='en'>International standard</stage>
96
+ <stage abbreviation='IS' language='en'>International Standard</stage>
97
97
  </status>
98
98
  <language current='true'>en</language>
99
99
  <ext>
@@ -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='zzSTDTitle'/>
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,95 +445,98 @@ 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
276
454
  output = IsoDoc::Iso::PresentationXMLConvert.new({})
277
455
  .convert("test", <<~"INPUT", true)
278
- <iso-standard xmlns="http://riboseinc.com/isoxml">
279
- <bibdata>
280
- <status>
281
- <stage abbreviation='IS' language=''>60</stage>
282
- </status>
283
- <language>tlh</language>
284
- <ext>
285
- <doctype language=''>international-standard</doctype>
286
- </ext>
287
- </bibdata>
288
- <preface>
289
- <foreword obligation="informative">
290
- <title>Foreword</title>
291
- <p id="A">This is a preamble</p>
292
- </foreword>
293
- <introduction id="B" obligation="informative">
294
- <title>Introduction</title>
295
- <clause id="C" inline-header="false" obligation="informative">
296
- <title>Introduction Subsection</title>
456
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
457
+ <bibdata>
458
+ <status>
459
+ <stage abbreviation='IS' language=''>60</stage>
460
+ </status>
461
+ <language>tlh</language>
462
+ <ext>
463
+ <doctype language=''>international-standard</doctype>
464
+ </ext>
465
+ </bibdata>
466
+ <preface>
467
+ <foreword obligation="informative">
468
+ <title>Foreword</title>
469
+ <p id="A">This is a preamble</p>
470
+ </foreword>
471
+ <introduction id="B" obligation="informative">
472
+ <title>Introduction</title>
473
+ <clause id="C" inline-header="false" obligation="informative">
474
+ <title>Introduction Subsection</title>
475
+ </clause>
476
+ <p>This is patent boilerplate</p>
477
+ </introduction>
478
+ </preface>
479
+ <sections>
480
+ <clause id="D" obligation="normative" type="scope">
481
+ <title>Scope</title>
482
+ <p id="E">Text</p>
297
483
  </clause>
298
- <p>This is patent boilerplate</p>
299
- </introduction>
300
- </preface>
301
- <sections>
302
- <clause id="D" obligation="normative" type="scope">
303
- <title>Scope</title>
304
- <p id="E">Text</p>
305
- </clause>
306
- <clause id="H" obligation="normative">
307
- <title>Terms, definitions, symbols and abbreviated terms</title>
308
- <terms id="I" obligation="normative">
309
- <title>Normal Terms</title>
310
- <term id="J">
311
- <preferred><expression><name>Term2</name></expression></preferred>
312
- </term>
313
- </terms>
314
- <definitions id="K">
484
+ <clause id="H" obligation="normative">
485
+ <title>Terms, definitions, symbols and abbreviated terms</title>
486
+ <terms id="I" obligation="normative">
487
+ <title>Normal Terms</title>
488
+ <term id="J">
489
+ <preferred><expression><name>Term2</name></expression></preferred>
490
+ </term>
491
+ </terms>
492
+ <definitions id="K">
493
+ <dl>
494
+ <dt>Symbol</dt>
495
+ <dd>Definition</dd>
496
+ </dl>
497
+ </definitions>
498
+ </clause>
499
+ <definitions id="L">
315
500
  <dl>
316
501
  <dt>Symbol</dt>
317
502
  <dd>Definition</dd>
318
503
  </dl>
319
504
  </definitions>
320
- </clause>
321
- <definitions id="L">
322
- <dl>
323
- <dt>Symbol</dt>
324
- <dd>Definition</dd>
325
- </dl>
326
- </definitions>
327
- <clause id="M" inline-header="false" obligation="normative">
328
- <title>Clause 4</title>
329
- <clause id="N" inline-header="false" obligation="normative">
330
- <title>Introduction</title>
331
- </clause>
332
- <clause id="O" inline-header="false" obligation="normative">
333
- <title>Clause 4.2</title>
505
+ <clause id="M" inline-header="false" obligation="normative">
506
+ <title>Clause 4</title>
507
+ <clause id="N" inline-header="false" obligation="normative">
508
+ <title>Introduction</title>
509
+ </clause>
510
+ <clause id="O" inline-header="false" obligation="normative">
511
+ <title>Clause 4.2</title>
512
+ </clause>
334
513
  </clause>
335
- </clause>
336
- </sections>
337
- <annex id="P" inline-header="false" obligation="normative">
338
- <title>Annex</title>
339
- <clause id="Q" inline-header="false" obligation="normative">
340
- <title>Annex A.1</title>
341
- <clause id="Q1" inline-header="false" obligation="normative">
342
- <title>Annex A.1a</title>
514
+ </sections>
515
+ <annex id="P" inline-header="false" obligation="normative">
516
+ <title>Annex</title>
517
+ <clause id="Q" inline-header="false" obligation="normative">
518
+ <title>Annex A.1</title>
519
+ <clause id="Q1" inline-header="false" obligation="normative">
520
+ <title>Annex A.1a</title>
521
+ </clause>
343
522
  </clause>
344
- </clause>
345
- <appendix id="Q2" inline-header="false" obligation="normative">
346
- <title>An Appendix</title>
347
- </appendix>
348
- </annex>
349
- <bibliography>
350
- <references id="R" normative="true" obligation="informative">
351
- <title>Normative References</title>
352
- </references>
353
- <clause id="S" obligation="informative">
354
- <title>Bibliography</title>
355
- <references id="T" normative="false" obligation="informative">
356
- <title>Bibliography Subsection</title>
523
+ <appendix id="Q2" inline-header="false" obligation="normative">
524
+ <title>An Appendix</title>
525
+ </appendix>
526
+ </annex>
527
+ <bibliography>
528
+ <references id="R" normative="true" obligation="informative">
529
+ <title>Normative References</title>
357
530
  </references>
358
- </clause>
359
- </bibliography>
360
- </iso-standard>
361
- INPUT
531
+ <clause id="S" obligation="informative">
532
+ <title>Bibliography</title>
533
+ <references id="T" normative="false" obligation="informative">
534
+ <title>Bibliography Subsection</title>
535
+ </references>
536
+ </clause>
537
+ </bibliography>
538
+ </iso-standard>
539
+ INPUT
362
540
  expect(xmlpp(output)
363
541
  .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
364
542
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
@@ -366,7 +544,7 @@ RSpec.describe IsoDoc do
366
544
  <bibdata>
367
545
  <status>
368
546
  <stage abbreviation='IS' language=''>60</stage>
369
- <stage abbreviation='IS' language='tlh'>International standard</stage>
547
+ <stage abbreviation='IS' language='tlh'>International Standard</stage>
370
548
  </status>
371
549
  <language current='true'>tlh</language>
372
550
  <ext>
@@ -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>
@@ -832,14 +1010,14 @@ RSpec.describe IsoDoc do
832
1010
  <status>
833
1011
  <stage abbreviation='IS' language=''>60</stage>
834
1012
  <stage abbreviation='IS' language='ru'>
835
- &#x41C;&#x435;&#x436;&#x434;&#x443;&#x43D;&#x430;&#x440;&#x43E;&#x434;&#x43D;&#x44B;&#x439; &#x441;&#x442;&#x430;&#x43D;&#x434;&#x430;&#x440;&#x442;
1013
+ Международный Стандарт
836
1014
  </stage>
837
1015
  </status>
838
1016
  <language current='true'>ru</language>
839
1017
  <ext>
840
1018
  <doctype language=''>international-standard</doctype>
841
1019
  <doctype language='ru'>
842
- &#x41C;&#x435;&#x436;&#x434;&#x443;&#x43D;&#x430;&#x440;&#x43E;&#x434;&#x43D;&#x44B;&#x439; &#x421;&#x442;&#x430;&#x43D;&#x434;&#x430;&#x440;&#x442;
1020
+ Международный Стандарт
843
1021
  </doctype>
844
1022
  </ext>
845
1023
  </bibdata>
@@ -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'>
@@ -1345,4 +1511,69 @@ RSpec.describe IsoDoc do
1345
1511
  .convert("test", presxml, true)))
1346
1512
  .to be_equivalent_to xmlpp(html)
1347
1513
  end
1514
+
1515
+ it "internationalises locality" do
1516
+ input = <<~"INPUT"
1517
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1518
+ <bibdata>
1519
+ <language>fr</language>
1520
+ <script>Latn</script>
1521
+ <status>
1522
+ <stage>published</stage>
1523
+ <substage>withdrawn</substage>
1524
+ </status>
1525
+ <edition>2</edition>
1526
+ <ext>
1527
+ <doctype>brochure</doctype>
1528
+ </ext>
1529
+ </bibdata>
1530
+ <preface>
1531
+ <foreword obligation="informative">
1532
+ <title>Foreword</title>
1533
+ <p id="A"><eref type="inline" bibitemid="ISO712"><locality type="locality:appendix"><referenceFrom>7</referenceFrom></locality></eref></p>
1534
+ <p id="B"><eref type="inline" bibitemid="ISO712"><locality type="annex"><referenceFrom>7</referenceFrom></locality></eref></p>
1535
+ </foreword>
1536
+ </preface>
1537
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
1538
+ <bibitem id="ISO712" type="standard">
1539
+ <title format="text/plain">Cereals and cereal products</title>
1540
+ <docidentifier>ISO 712</docidentifier>
1541
+ <contributor>
1542
+ <role type="publisher"/>
1543
+ <organization>
1544
+ <abbreviation>ISO</abbreviation>
1545
+ </organization>
1546
+ </contributor>
1547
+ </bibitem>
1548
+ </references>
1549
+ </bibliography>
1550
+ </iso-standard>
1551
+ INPUT
1552
+ presxml = <<~OUTPUT
1553
+ <foreword obligation='informative' displayorder='1'>
1554
+ <title>Foreword</title>
1555
+ <p id='A'>
1556
+ <eref type='inline' bibitemid='ISO712'>
1557
+ <locality type='locality:appendix'>
1558
+ <referenceFrom>7</referenceFrom>
1559
+ </locality>
1560
+ ISO 712, Appendice 7
1561
+ </eref>
1562
+ </p>
1563
+ <p id='B'>
1564
+ <eref type='inline' bibitemid='ISO712'>
1565
+ <locality type='annex'>
1566
+ <referenceFrom>7</referenceFrom>
1567
+ </locality>
1568
+ ISO 712,
1569
+ <span class='citeapp'>Annexe 7</span>
1570
+ </eref>
1571
+ </p>
1572
+ </foreword>
1573
+ OUTPUT
1574
+ expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::PresentationXMLConvert
1575
+ .new({}).convert("test", input, true))
1576
+ .at("//xmlns:foreword").to_xml))
1577
+ .to be_equivalent_to xmlpp(presxml)
1578
+ end
1348
1579
  end