metanorma-iec 1.4.1 → 1.4.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.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Rakefile +1 -1
- data/lib/asciidoctor/iec/converter.rb +43 -26
- data/lib/asciidoctor/iec/front.rb +2 -3
- data/lib/asciidoctor/iec/iec.rng +48 -0
- data/lib/asciidoctor/iec/isodoc.rng +61 -18
- data/lib/asciidoctor/iec/isostandard.rng +14 -0
- data/lib/isodoc/iec/base_convert.rb +23 -58
- data/lib/isodoc/iec/html/htmlstyle.css +37 -5
- data/lib/isodoc/iec/html/htmlstyle.scss +34 -5
- data/lib/isodoc/iec/html/isodoc.css +1 -2
- data/lib/isodoc/iec/html/isodoc.scss +1 -2
- data/lib/isodoc/iec/html/scripts.html +0 -1
- data/lib/isodoc/iec/html/wordstyle.css +13 -11
- data/lib/isodoc/iec/html/wordstyle.scss +13 -11
- data/lib/isodoc/iec/iec.international-standard.xsl +428 -111
- data/lib/isodoc/iec/presentation_xml_convert.rb +193 -5
- data/lib/metanorma/iec/processor.rb +15 -8
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +2 -2
- data/spec/asciidoctor/base_spec.rb +0 -4
- data/spec/asciidoctor/cleanup_spec.rb +231 -202
- data/spec/asciidoctor/iev_spec.rb +195 -190
- data/spec/isodoc/iev_spec.rb +459 -118
- data/spec/isodoc/postproc_spec.rb +2 -5
- data/spec/isodoc/terms_spec.rb +183 -181
- data/spec/metanorma/processor_spec.rb +139 -44
- data/spec/spec_helper.rb +10 -12
- metadata +6 -6
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -64,8 +64,13 @@ RSpec.describe IsoDoc do
|
|
64
64
|
</body>
|
65
65
|
</html>
|
66
66
|
OUTPUT
|
67
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
68
|
-
|
67
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
68
|
+
.convert("test", input, true)
|
69
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
70
|
+
.to be_equivalent_to xmlpp(presxml)
|
71
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
72
|
+
.convert("test", presxml, true)))
|
73
|
+
.to be_equivalent_to xmlpp(html)
|
69
74
|
end
|
70
75
|
|
71
76
|
it "processes bibliographies under IEV" do
|
@@ -227,8 +232,13 @@ RSpec.describe IsoDoc do
|
|
227
232
|
</body>
|
228
233
|
</html>
|
229
234
|
OUTPUT
|
230
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
231
|
-
|
235
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
236
|
+
.convert("test", input, true)
|
237
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
238
|
+
.to be_equivalent_to xmlpp(presxml)
|
239
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
240
|
+
.convert("test", presxml, true)))
|
241
|
+
.to be_equivalent_to xmlpp(html)
|
232
242
|
end
|
233
243
|
|
234
244
|
it "processes IEV terms" do
|
@@ -241,8 +251,8 @@ RSpec.describe IsoDoc do
|
|
241
251
|
<sections>
|
242
252
|
<clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
|
243
253
|
<terms id="_general" obligation="normative"><title>General</title>
|
244
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
245
|
-
<definition><
|
254
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
255
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
246
256
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
247
257
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
248
258
|
<ul>
|
@@ -260,11 +270,12 @@ RSpec.describe IsoDoc do
|
|
260
270
|
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
261
271
|
</modification>
|
262
272
|
</termsource></term>
|
263
|
-
<term id="paddy"><preferred>paddy</preferred
|
264
|
-
<admitted>
|
265
|
-
<
|
273
|
+
<term id="paddy"><preferred><expression><name>paddy</name></expression></preferred>
|
274
|
+
<admitted><expression><name>paddy rice</name></expression></admitted>
|
275
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
276
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
266
277
|
<domain>rice</domain>
|
267
|
-
<definition><
|
278
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
268
279
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
269
280
|
<ul>
|
270
281
|
<li>A</li>
|
@@ -287,6 +298,7 @@ RSpec.describe IsoDoc do
|
|
287
298
|
INPUT
|
288
299
|
|
289
300
|
presxml = <<~INPUT
|
301
|
+
<?xml version='1.0'?>
|
290
302
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
291
303
|
<bibdata type='standard'>
|
292
304
|
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
@@ -297,7 +309,7 @@ RSpec.describe IsoDoc do
|
|
297
309
|
<terms id="_general" obligation="normative"><title>192-01 General</title>
|
298
310
|
<term id="paddy1">
|
299
311
|
<name>192-01-01</name>
|
300
|
-
<preferred>paddy</preferred>
|
312
|
+
<preferred><strong>paddy</strong></preferred>
|
301
313
|
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
302
314
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
303
315
|
<name>EXAMPLE 1</name>
|
@@ -312,19 +324,16 @@ RSpec.describe IsoDoc do
|
|
312
324
|
<li>A</li>
|
313
325
|
</ul>
|
314
326
|
</termexample>
|
315
|
-
<termsource status="modified">
|
316
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin
|
317
|
-
|
318
|
-
|
319
|
-
</modification>
|
320
|
-
</termsource></term>
|
327
|
+
<termsource status="modified">SOURCE:
|
328
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>, modified –
|
329
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</termsource>
|
330
|
+
</term>
|
321
331
|
<term id="paddy">
|
322
332
|
<name>192-01-02</name>
|
323
|
-
<preferred>paddy</preferred><admitted>paddy rice</admitted>
|
333
|
+
<preferred><strong>paddy</strong></preferred><admitted>paddy rice</admitted>
|
324
334
|
<admitted>rough rice</admitted>
|
325
335
|
<deprecates>cargo rice</deprecates>
|
326
|
-
<
|
327
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
336
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p></definition>
|
328
337
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
329
338
|
<name>EXAMPLE</name>
|
330
339
|
<ul>
|
@@ -340,7 +349,7 @@ RSpec.describe IsoDoc do
|
|
340
349
|
<ul><li>A</li></ul>
|
341
350
|
<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>
|
342
351
|
</termnote>
|
343
|
-
<termsource status="identical">
|
352
|
+
<termsource status="identical">SOURCE:
|
344
353
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
345
354
|
</termsource></term>
|
346
355
|
</terms>
|
@@ -356,87 +365,95 @@ RSpec.describe IsoDoc do
|
|
356
365
|
<div class='boilerplate_legal'/>
|
357
366
|
</div>
|
358
367
|
#{IEC_TITLE1}
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
368
|
+
<div id='_terms_and_definitions'>
|
369
|
+
<h1>1  Terms and definitions</h1>
|
370
|
+
<br/>
|
371
|
+
<div id='_general'>
|
372
|
+
<p class='zzSTDTitle2'>
|
373
|
+
<b>192-01 General</b>
|
374
|
+
</p>
|
375
|
+
<p class='TermNum' id='paddy1'>192-01-01</p>
|
376
|
+
<p class='Terms' style='text-align:left;'>
|
377
|
+
<b>paddy</b>
|
378
|
+
</p>
|
379
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
380
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' class='example'>
|
381
|
+
<p>
|
382
|
+
<span class='example_label'>EXAMPLE 1</span>
|
383
|
+
  Foreign seeds, husks, bran, sand, dust.
|
384
|
+
</p>
|
385
|
+
<ul>
|
386
|
+
<li>A</li>
|
387
|
+
</ul>
|
388
|
+
</div>
|
389
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f894' class='example'>
|
390
|
+
<p>
|
391
|
+
<span class='example_label'>EXAMPLE 2</span>
|
392
|
+
 
|
393
|
+
</p>
|
394
|
+
<ul>
|
395
|
+
<li>A</li>
|
396
|
+
</ul>
|
397
|
+
</div>
|
398
|
+
<p>
|
399
|
+
SOURCE:
|
400
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
401
|
+
, modified – The term "cargo rice" is shown as deprecated, and
|
402
|
+
Note 1 to entry is not included here
|
403
|
+
</p>
|
404
|
+
<p class='TermNum' id='paddy'>192-01-02</p>
|
405
|
+
<p class='Terms' style='text-align:left;'>
|
406
|
+
<b>paddy</b>
|
407
|
+
</p>
|
408
|
+
<p class='AltTerms' style='text-align:left;'>paddy rice</p>
|
409
|
+
<p class='AltTerms' style='text-align:left;'>rough rice</p>
|
410
|
+
<p class='DeprecatedTerms' style='text-align:left;'>DEPRECATED: cargo rice</p>
|
411
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'><rice> rice retaining its husk after threshing</p>
|
412
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f893' class='example'>
|
413
|
+
<p>
|
414
|
+
<span class='example_label'>EXAMPLE</span>
|
415
|
+
 
|
416
|
+
</p>
|
417
|
+
<ul>
|
418
|
+
<li>A</li>
|
419
|
+
</ul>
|
420
|
+
</div>
|
421
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class='Note'>
|
422
|
+
<p>
|
423
|
+
Note 1 to entry: The starch of waxy rice consists almost entirely
|
424
|
+
of amylopectin. The kernels have a tendency to stick together
|
425
|
+
after cooking.
|
426
|
+
</p>
|
427
|
+
</div>
|
428
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class='Note'>
|
429
|
+
<p>
|
430
|
+
Note 2 to entry:
|
431
|
+
<ul>
|
432
|
+
<li>A</li>
|
433
|
+
</ul>
|
434
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
435
|
+
The starch of waxy rice consists almost entirely of amylopectin.
|
436
|
+
The kernels have a tendency to stick together after cooking.
|
437
|
+
</p>
|
438
|
+
</p>
|
439
|
+
</div>
|
440
|
+
<p>
|
441
|
+
SOURCE:
|
442
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
443
|
+
</p>
|
444
|
+
</div>
|
445
|
+
</div>
|
446
|
+
</div>
|
447
|
+
</body>
|
448
|
+
</html>
|
437
449
|
OUTPUT
|
438
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
439
|
-
|
450
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
451
|
+
.convert("test", input, true)
|
452
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
453
|
+
.to be_equivalent_to xmlpp(presxml)
|
454
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
455
|
+
.convert("test", presxml, true)))
|
456
|
+
.to be_equivalent_to xmlpp(html)
|
440
457
|
end
|
441
458
|
|
442
459
|
it "populates Word template with terms reference labels" do
|
@@ -451,8 +468,8 @@ RSpec.describe IsoDoc do
|
|
451
468
|
<sections>
|
452
469
|
<clause id="_terms_and_definitions" obligation="normative" displayorder="1"><title>Terms and definitions</title>
|
453
470
|
<terms id="_general" obligation="normative"><title>General</title>
|
454
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
455
|
-
<definition><
|
471
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
472
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
456
473
|
<termsource status="modified">
|
457
474
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
458
475
|
<modification>
|
@@ -477,23 +494,16 @@ RSpec.describe IsoDoc do
|
|
477
494
|
<title>192-01 General</title>
|
478
495
|
<term id='paddy1'>
|
479
496
|
<name>192-01-01</name>
|
480
|
-
<preferred>paddy</preferred>
|
497
|
+
<preferred><strong>paddy</strong></preferred>
|
481
498
|
<definition>
|
482
499
|
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
483
500
|
</definition>
|
484
|
-
<termsource status='modified'>
|
485
|
-
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
486
|
-
<locality type='clause'>
|
501
|
+
<termsource status='modified'>SOURCE:
|
502
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
487
503
|
<referenceFrom>3.1</referenceFrom>
|
488
|
-
</locality>
|
489
|
-
ISO 7301:2011, 3.1
|
490
|
-
</origin>
|
491
|
-
<modification>
|
492
|
-
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
504
|
+
</locality>ISO 7301:2011, 3.1</origin>, modified –
|
493
505
|
The term "cargo rice" is shown as deprecated, and Note 1 to
|
494
506
|
entry is not included here
|
495
|
-
</p>
|
496
|
-
</modification>
|
497
507
|
</termsource>
|
498
508
|
</term>
|
499
509
|
</terms>
|
@@ -501,9 +511,13 @@ RSpec.describe IsoDoc do
|
|
501
511
|
</sections>
|
502
512
|
</iso-standard>
|
503
513
|
OUTPUT
|
504
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
514
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
515
|
+
.convert("test", input, true)
|
516
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
517
|
+
.to be_equivalent_to xmlpp(presxml)
|
505
518
|
IsoDoc::Iec::WordConvert.new({}).convert("test", presxml, false)
|
506
|
-
word = File.read("test.doc")
|
519
|
+
word = File.read("test.doc")
|
520
|
+
.sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
|
507
521
|
.sub(%r{<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>.*$}m, "")
|
508
522
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
509
523
|
<div class='WordSection3'>
|
@@ -530,7 +544,7 @@ RSpec.describe IsoDoc do
|
|
530
544
|
<a name='paddy1' id='paddy1'/>
|
531
545
|
192-01-01
|
532
546
|
</p>
|
533
|
-
<p class='Terms' style='text-align:left;'>paddy</p>
|
547
|
+
<p class='Terms' style='text-align:left;'><b>paddy</b></p>
|
534
548
|
<p class='MsoNormal'>
|
535
549
|
<a name='_eb29b35e-123e-4d1c-b50b-2714d41e747f' id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'/>
|
536
550
|
rice retaining its husk after threshing
|
@@ -538,7 +552,7 @@ RSpec.describe IsoDoc do
|
|
538
552
|
<p class='MsoNormal'>
|
539
553
|
SOURCE:
|
540
554
|
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
541
|
-
, modified &#
|
555
|
+
, modified – The term "cargo rice" is shown as deprecated, and
|
542
556
|
Note 1 to entry is not included here
|
543
557
|
</p>
|
544
558
|
</div>
|
@@ -546,4 +560,331 @@ RSpec.describe IsoDoc do
|
|
546
560
|
</div>
|
547
561
|
OUTPUT
|
548
562
|
end
|
563
|
+
|
564
|
+
it "convert termbase references to the current document to xrefs" do
|
565
|
+
input = <<~INPUT
|
566
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
567
|
+
<bibdata type='standard'>
|
568
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
569
|
+
<docnumber>60050</docnumber>
|
570
|
+
<ext>
|
571
|
+
<doctype>international-standard</doctype>
|
572
|
+
<horizontal>false</horizontal>
|
573
|
+
<structuredidentifier>
|
574
|
+
<project-number part="192">IEC 60050</project-number>
|
575
|
+
</structuredidentifier>
|
576
|
+
<stagename>International standard</stagename>
|
577
|
+
</ext>
|
578
|
+
</bibdata>
|
579
|
+
<sections>
|
580
|
+
<clause id="_terms_and_definitions" obligation="normative" displayorder="1"><title>Terms and definitions</title>
|
581
|
+
<terms id="_general" obligation="normative"><title>General</title>
|
582
|
+
<term id="term-durability"><preferred><expression><name>durability</name></expression><field-of-application>of an item</field-of-application></preferred>
|
583
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
584
|
+
<termnote id="_5f49cfad-e57e-5029-78cf-5b7e3e10a3b3">
|
585
|
+
<p id="_8c830e60-8f09-73a2-6393-2a27d9c5b1ce">Dependability includes availability (<concept><refterm>192-01-02</refterm><renderterm>192-01-02</renderterm><termref base="IEV" target="192-01-02"/></concept>, <concept><refterm>191-01-02</refterm><renderterm>191-01-02</renderterm><termref base="IEV" target="191-01-02"/></concept>)</p>
|
586
|
+
</termnote>
|
587
|
+
</term>
|
588
|
+
<term id="term-sub-item"><preferred><expression><name>sub item</name></expression></preferred><definition><verbal-definition><p id="_6952e988-8803-159d-a32e-57147fbf3d86">part of the subject being considered</p></verbal-definition></definition>
|
589
|
+
</term>
|
590
|
+
</terms>
|
591
|
+
</clause>
|
592
|
+
</sections>
|
593
|
+
</iso-standard>
|
594
|
+
INPUT
|
595
|
+
presxml = <<~PRESXML
|
596
|
+
<?xml version='1.0'?>
|
597
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
598
|
+
<bibdata type='standard'>
|
599
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
600
|
+
<docnumber>60050</docnumber>
|
601
|
+
<ext>
|
602
|
+
<doctype language=''>international-standard</doctype>
|
603
|
+
<doctype language='fr'>Norme international</doctype>
|
604
|
+
<doctype language='en'>International Standard</doctype>
|
605
|
+
<horizontal language=''>false</horizontal>
|
606
|
+
<structuredidentifier>
|
607
|
+
<project-number part='192'>IEC 60050</project-number>
|
608
|
+
</structuredidentifier>
|
609
|
+
<stagename>International standard</stagename>
|
610
|
+
</ext>
|
611
|
+
</bibdata>
|
612
|
+
<sections>
|
613
|
+
<clause id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
614
|
+
<title depth='1'>1<tab/>Terms and definitions</title>
|
615
|
+
<terms id='_general' obligation='normative'>
|
616
|
+
<title>192-01 General</title>
|
617
|
+
<term id='term-durability'>
|
618
|
+
<name>192-01-01</name>
|
619
|
+
<preferred><strong>durability</strong>, <of an item></preferred>
|
620
|
+
<definition>
|
621
|
+
<verbaldefinition>
|
622
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
623
|
+
</verbaldefinition>
|
624
|
+
</definition>
|
625
|
+
<termnote id='_5f49cfad-e57e-5029-78cf-5b7e3e10a3b3'>
|
626
|
+
<name>Note 1 to entry</name>
|
627
|
+
<p id='_8c830e60-8f09-73a2-6393-2a27d9c5b1ce'>Dependability includes availability (<em>192-01-02</em>
|
628
|
+
(<xref target='term-sub-item'>192-01-02</xref>),
|
629
|
+
<em>191-01-02</em>
|
630
|
+
[term defined in
|
631
|
+
<termref base='IEV' target='191-01-02'/>])</p>
|
632
|
+
</termnote>
|
633
|
+
</term>
|
634
|
+
<term id='term-sub-item'>
|
635
|
+
<name>192-01-02</name>
|
636
|
+
<preferred><strong>sub item</strong></preferred>
|
637
|
+
<definition>
|
638
|
+
<p id='_6952e988-8803-159d-a32e-57147fbf3d86'>part of the subject being considered</p>
|
639
|
+
</definition>
|
640
|
+
</term>
|
641
|
+
</terms>
|
642
|
+
</clause>
|
643
|
+
</sections>
|
644
|
+
</iso-standard>
|
645
|
+
PRESXML
|
646
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
647
|
+
.convert("test", input, true)
|
648
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
649
|
+
.to be_equivalent_to xmlpp(presxml)
|
650
|
+
end
|
651
|
+
|
652
|
+
it "processes multilingual IEV terms" do
|
653
|
+
input = <<~INPUT
|
654
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
655
|
+
<bibdata type='standard'>
|
656
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
657
|
+
<docnumber>60050</docnumber>
|
658
|
+
</bibdata>
|
659
|
+
<sections>
|
660
|
+
<clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
|
661
|
+
<terms id="_general" obligation="normative"><title>General</title>
|
662
|
+
<term id="item" language="en" tag="item">
|
663
|
+
<preferred><expression language="en"><name>system</name></expression><field-of-application>in dependability</field-of-application></preferred>
|
664
|
+
<preferred><expression language="de"><name>Betrachtungseinheit</name<grammar><gender>feminine</gender></grammar></expression></preferred>
|
665
|
+
<preferred><expression language="ja"><name>アイテム</name></expression></preferred>
|
666
|
+
<preferred><expression language="de"><name>Einheit</name><grammar><gender>feminine</gender></grammar></expression></preferred>
|
667
|
+
<preferred><expression language="zh"><name>产品</name></expression><field-of-application>在可靠性方面</field-of-application></preferred>
|
668
|
+
<preferred><expression language="ar"><name>نظام،</name></expression><field-of-application>في الاعتمادیة</field-of-application></preferred>
|
669
|
+
<admitted><expression><name>paddy rice</name></expression></admitted>
|
670
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
671
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
672
|
+
<related type='contrast'><preferred><expression><name>Fifth Designation</name></expression></preferred><xref target="paddy1"/></related>
|
673
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">set of interrelated items that collectively fulfil a requirement</p></verbal-definition></definition>
|
674
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
675
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">A system is considered to have a defined real or abstract boundary.</p>
|
676
|
+
</termnote>
|
677
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74d">
|
678
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">External resources (from outside the system boundary) may be required for the system to operate.</p>
|
679
|
+
</termnote>
|
680
|
+
<termexample id="_671a1994-4783-40d0-bc81-987d06ffb740">
|
681
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d0">External resources (from outside the system boundary) may be required for the system to operate.</p>
|
682
|
+
</termexample>
|
683
|
+
<termsource status="modified">
|
684
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
685
|
+
<modification>modified by extension to suit the dependability context</modification>
|
686
|
+
</termsource></term>
|
687
|
+
<term id="item-fr" language="fr" tag="item">
|
688
|
+
<preferred><expression language="fr"><name>entité</name<grammar><gender>masculine</gender></grammar></expression>
|
689
|
+
<field-of-application>en sûreté de fonctionnement</field-of-application>
|
690
|
+
</preferred>
|
691
|
+
<related type='contrast'><preferred><expression><name>Designation cinquième</name></expression></preferred><xref target="paddy1"/></related>
|
692
|
+
<related type='see'><preferred><expression><name>Designation sixième</name></expression></preferred><xref target="paddy1"/></related>
|
693
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747d">ensemble d’entités reliées entre elles qui satisfont collectivement à une exigence</p></verbal-definition></definition>
|
694
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74c">
|
695
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">Un système est considéré comme ayant une frontière définie, réelle ou abstraite.</p>
|
696
|
+
</termnote>
|
697
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74b">
|
698
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">Des ressources externes (provenant d’au-delà de la frontière) peuvent être nécessaires au fonctionnement du système.</p>
|
699
|
+
</termnote>
|
700
|
+
<termexample id="_671a1994-4783-40d0-bc81-987d06ffb741">
|
701
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d1">External resources (from outside the system boundary) may be required for the system to operate.</p>
|
702
|
+
</termexample>
|
703
|
+
<termsource status="modified">
|
704
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
705
|
+
<modification>modifié pour adapter au contexte de la sûreté de fonctionnement</modification>
|
706
|
+
</termsource></term>
|
707
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
708
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747d">rice retaining its husk after threshing</p></verbal-definition></definition>
|
709
|
+
</term>
|
710
|
+
</terms>
|
711
|
+
</clause>
|
712
|
+
</sections>
|
713
|
+
</iso-standard>
|
714
|
+
INPUT
|
715
|
+
|
716
|
+
presxml = <<~PRESXML
|
717
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
718
|
+
<bibdata type='standard'>
|
719
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
720
|
+
<docnumber>60050</docnumber>
|
721
|
+
</bibdata>
|
722
|
+
<sections>
|
723
|
+
<clause id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
724
|
+
<title depth='1'>
|
725
|
+
1
|
726
|
+
<tab/>
|
727
|
+
Terms and definitions
|
728
|
+
</title>
|
729
|
+
<terms id='_general' obligation='normative'>
|
730
|
+
<title>192-01 General</title>
|
731
|
+
<term id='item' language='en,fr'>
|
732
|
+
<name>192-01-01</name>
|
733
|
+
<preferred>
|
734
|
+
<strong>system</strong>
|
735
|
+
, <in dependability>
|
736
|
+
</preferred>
|
737
|
+
<admitted>paddy rice</admitted>
|
738
|
+
<admitted>rough rice</admitted>
|
739
|
+
<deprecates>cargo rice</deprecates>
|
740
|
+
<definition>
|
741
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>set of interrelated items that collectively fulfil a requirement</p>
|
742
|
+
</definition>
|
743
|
+
<p>
|
744
|
+
CONTRAST:
|
745
|
+
<strong>Fifth Designation</strong>
|
746
|
+
(
|
747
|
+
<xref target='paddy1'>192-01-02</xref>
|
748
|
+
)
|
749
|
+
</p>
|
750
|
+
<termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
|
751
|
+
<name>EXAMPLE</name>
|
752
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d0'>
|
753
|
+
External resources (from outside the system boundary) may be
|
754
|
+
required for the system to operate.
|
755
|
+
</p>
|
756
|
+
</termexample>
|
757
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e'>
|
758
|
+
<name>Note 1 to entry</name>
|
759
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>A system is considered to have a defined real or abstract boundary.</p>
|
760
|
+
</termnote>
|
761
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74d'>
|
762
|
+
<name>Note 2 to entry</name>
|
763
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
764
|
+
External resources (from outside the system boundary) may be
|
765
|
+
required for the system to operate.
|
766
|
+
</p>
|
767
|
+
</termnote>
|
768
|
+
<termsource status='modified'>
|
769
|
+
SOURCE:
|
770
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
771
|
+
<locality type='clause'>
|
772
|
+
<referenceFrom>3.1</referenceFrom>
|
773
|
+
</locality>
|
774
|
+
ISO 7301:2011, 3.1
|
775
|
+
</origin>
|
776
|
+
, modified – modified by extension to suit the dependability
|
777
|
+
context
|
778
|
+
</termsource>
|
779
|
+
<preferred>
|
780
|
+
<strong>entité</strong>
|
781
|
+
, <en sûreté de fonctionnement>, m
|
782
|
+
</preferred>
|
783
|
+
<definition>
|
784
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>
|
785
|
+
ensemble d’entités reliées entre elles qui
|
786
|
+
satisfont collectivement à une exigence
|
787
|
+
</p>
|
788
|
+
</definition>
|
789
|
+
<p>
|
790
|
+
CONTRASTEZ:
|
791
|
+
<strong>Designation cinquième</strong>
|
792
|
+
(
|
793
|
+
<xref target='paddy1'>192-01-02</xref>
|
794
|
+
)
|
795
|
+
</p>
|
796
|
+
<p>
|
797
|
+
VOIR:
|
798
|
+
<strong>Designation sixième</strong>
|
799
|
+
(
|
800
|
+
<xref target='paddy1'>192-01-02</xref>
|
801
|
+
)
|
802
|
+
</p>
|
803
|
+
<termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>
|
804
|
+
<name>EXEMPLE</name>
|
805
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d1'>
|
806
|
+
External resources (from outside the system boundary) may be
|
807
|
+
required for the system to operate.
|
808
|
+
</p>
|
809
|
+
</termexample>
|
810
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74c'>
|
811
|
+
<name>Note 1 à l’article</name>
|
812
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
813
|
+
Un système est considéré comme ayant une
|
814
|
+
frontière définie, réelle ou abstraite.
|
815
|
+
</p>
|
816
|
+
</termnote>
|
817
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74b'>
|
818
|
+
<name>Note 2 à l’article</name>
|
819
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
820
|
+
Des ressources externes (provenant d’au-delà de la
|
821
|
+
frontière) peuvent être nécessaires au
|
822
|
+
fonctionnement du système.
|
823
|
+
</p>
|
824
|
+
</termnote>
|
825
|
+
<termsource status='modified'>
|
826
|
+
SOURCE:
|
827
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
828
|
+
<locality type='clause'>
|
829
|
+
<referenceFrom>3.1</referenceFrom>
|
830
|
+
</locality>
|
831
|
+
ISO 7301:2011, 3.1
|
832
|
+
</origin>
|
833
|
+
, modifié – modifié pour adapter au contexte de la
|
834
|
+
sûreté de fonctionnement
|
835
|
+
</termsource>
|
836
|
+
<dl type='other-lang'>
|
837
|
+
<dt>ar</dt>
|
838
|
+
<dd language='ar' script='Arab'>
|
839
|
+
<preferred>
|
840
|
+
<strong>؜نظام،؜</strong>
|
841
|
+
؜, <في
|
842
|
+
الاعتمادیة>؜
|
843
|
+
</preferred>
|
844
|
+
</dd>
|
845
|
+
<dt>de</dt>
|
846
|
+
<dd language='de' script='Latn'>
|
847
|
+
<preferred>
|
848
|
+
<strong>Betrachtungseinheit</strong>
|
849
|
+
, f
|
850
|
+
</preferred>
|
851
|
+
<preferred>
|
852
|
+
<strong>Einheit</strong>
|
853
|
+
, f
|
854
|
+
</preferred>
|
855
|
+
</dd>
|
856
|
+
<dt>ja</dt>
|
857
|
+
<dd language='ja' script='Jpan'>
|
858
|
+
<preferred>
|
859
|
+
<strong>アイテム</strong>
|
860
|
+
</preferred>
|
861
|
+
</dd>
|
862
|
+
<dt>zh</dt>
|
863
|
+
<dd language='zh' script='Hans'>
|
864
|
+
<preferred>
|
865
|
+
<strong>产品</strong>
|
866
|
+
、<在可靠性方面>
|
867
|
+
</preferred>
|
868
|
+
</dd>
|
869
|
+
</dl>
|
870
|
+
</term>
|
871
|
+
<term id='paddy1'>
|
872
|
+
<name>192-01-02</name>
|
873
|
+
<preferred>
|
874
|
+
<strong>paddy</strong>
|
875
|
+
</preferred>
|
876
|
+
<definition>
|
877
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>rice retaining its husk after threshing</p>
|
878
|
+
</definition>
|
879
|
+
</term>
|
880
|
+
</terms>
|
881
|
+
</clause>
|
882
|
+
</sections>
|
883
|
+
</iso-standard>
|
884
|
+
PRESXML
|
885
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
886
|
+
.convert("test", input, true)
|
887
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
888
|
+
.to be_equivalent_to xmlpp(presxml)
|
889
|
+
end
|
549
890
|
end
|