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.
- checksums.yaml +4 -4
- data/lib/html2doc/lists.rb +169 -0
- data/lib/isodoc/iso/base_convert.rb +11 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +407 -427
- data/lib/isodoc/iso/html/isodoc-dis.scss +482 -438
- data/lib/isodoc/iso/html/isodoc.css +38 -13
- data/lib/isodoc/iso/html/isodoc.scss +38 -12
- data/lib/isodoc/iso/html/style-human.css +14 -1
- data/lib/isodoc/iso/html/style-human.scss +10 -1
- data/lib/isodoc/iso/html/style-iso.css +35 -23
- data/lib/isodoc/iso/html/style-iso.scss +31 -23
- data/lib/isodoc/iso/html/word_iso_intro-dis.html +3 -1
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +26 -13
- data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +16 -6
- data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
- data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
- data/lib/isodoc/iso/html_convert.rb +7 -2
- data/lib/isodoc/iso/i18n-en.yaml +33 -4
- data/lib/isodoc/iso/i18n-fr.yaml +30 -3
- data/lib/isodoc/iso/i18n-ru.yaml +33 -4
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +33 -3
- data/lib/isodoc/iso/i18n.rb +1 -1
- data/lib/isodoc/iso/init.rb +17 -1
- data/lib/isodoc/iso/iso.amendment.xsl +1711 -367
- data/lib/isodoc/iso/iso.international-standard.xsl +1711 -367
- data/lib/isodoc/iso/metadata.rb +72 -78
- data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +52 -100
- data/lib/isodoc/iso/presentation_xref.rb +132 -0
- data/lib/isodoc/iso/sections.rb +3 -3
- data/lib/isodoc/iso/word_cleanup.rb +17 -0
- data/lib/isodoc/iso/word_convert.rb +32 -12
- data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
- data/lib/isodoc/iso/word_dis_convert.rb +122 -0
- data/lib/isodoc/iso/xref.rb +78 -29
- data/lib/metanorma/iso/base.rb +20 -1
- data/lib/metanorma/iso/biblio.rng +69 -42
- data/lib/metanorma/iso/boilerplate-fr.xml +4 -1
- data/lib/metanorma/iso/boilerplate-ru.xml +4 -3
- data/lib/metanorma/iso/boilerplate.xml +4 -3
- data/lib/metanorma/iso/cleanup.rb +29 -1
- data/lib/metanorma/iso/front.rb +31 -6
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +65 -0
- data/lib/metanorma/iso/isostandard.rng +30 -12
- data/lib/metanorma/iso/macros.rb +29 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/metanorma-iso.rb +1 -0
- data/lib/relaton/render/config.yml +4 -0
- data/lib/relaton/render/general.rb +13 -0
- data/metanorma-iso.gemspec +1 -1
- data/spec/isodoc/amd_spec.rb +35 -60
- data/spec/isodoc/blocks_spec.rb +783 -179
- data/spec/isodoc/i18n_spec.rb +331 -100
- data/spec/isodoc/inline_spec.rb +35 -42
- data/spec/isodoc/iso_spec.rb +51 -170
- data/spec/isodoc/metadata_spec.rb +240 -99
- data/spec/isodoc/postproc_spec.rb +68 -7
- data/spec/isodoc/ref_spec.rb +66 -69
- data/spec/isodoc/section_spec.rb +88 -80
- data/spec/isodoc/table_spec.rb +2 -2
- data/spec/isodoc/terms_spec.rb +2 -2
- data/spec/isodoc/word_dis_spec.rb +1886 -0
- data/spec/isodoc/xref_spec.rb +138 -64
- data/spec/metanorma/amd_spec.rb +53 -1
- data/spec/metanorma/base_spec.rb +195 -20
- data/spec/metanorma/blocks_spec.rb +54 -0
- data/spec/metanorma/lists_spec.rb +2 -2
- data/spec/metanorma/section_spec.rb +2 -2
- data/spec/spec_helper.rb +23 -4
- data/spec/vcr_cassettes/withdrawn_iso.yml +25 -25
- metadata +15 -10
- data/docs/asciiiso-syntax.adoc +0 -307
- data/docs/guidance.adoc +0 -487
- data/docs/navigation.adoc +0 -23
- data/docs/quickstart.adoc +0 -179
- data/spec/vcr_cassettes/docrels.yml +0 -385
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -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
|
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
|
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
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
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
|
-
<
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
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
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
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
|
-
</
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
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
|
-
|
345
|
-
|
346
|
-
|
347
|
-
</
|
348
|
-
|
349
|
-
|
350
|
-
|
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
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
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
|
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
|
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
|
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
|
-
|
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
|
-
|
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>Дополнение A</strong>
|
901
|
-
<br
|
1079
|
+
<br/><span class='obligation'>(нормативное)</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
|
-
<
|
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,
|
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
|
-
<
|
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
|