metanorma-iec 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,14 @@ require "isodoc"
4
4
  module IsoDoc
5
5
  module Iec
6
6
  class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
7
+ def i18n_init(lang, script, i18nyaml = nil)
8
+ super
9
+ @i18n_lg = {}
10
+ @i18n_lg["en"] = I18n.new("en", "Latn", i18nyaml || @i18nyaml)
11
+ @i18n_lg["fr"] = I18n.new("fr", "Latn", i18nyaml || @i18nyaml)
12
+ @i18n_lg["default"] = @i18n
13
+ end
14
+
7
15
  def clause(docxml)
8
16
  docxml.xpath(ns("//clause[not(ancestor::annex)] | "\
9
17
  "//definitions | //references | "\
@@ -68,6 +76,129 @@ module IsoDoc
68
76
  termref["target"] = newtarget
69
77
  end
70
78
 
79
+ def terms(docxml)
80
+ otherlang_designations(docxml)
81
+ super
82
+ merge_fr_into_en_term(docxml)
83
+ end
84
+
85
+ def merge_fr_into_en_term(docxml)
86
+ return unless @is_iev
87
+
88
+ docxml.xpath(ns("//term[@language = 'en'][@tag]")).each do |en|
89
+ fr = docxml.at(ns("//term[@language = 'fr'][@tag = '#{en['tag']}']"))
90
+ merge_fr_into_en_term1(en, fr) if fr
91
+ end
92
+ @xrefs.parse docxml
93
+ docxml.xpath(ns("//term/name")).each(&:remove)
94
+ term(docxml)
95
+ end
96
+
97
+ def merge_fr_into_en_term1(en_term, fr_term)
98
+ dl = en_term&.at(ns("./dl[@type = 'other-lang']"))&.remove
99
+ en_term << fr_term.remove.children
100
+ en_term << dl if dl
101
+ en_term["language"] = "en,fr"
102
+ en_term.delete("tag")
103
+ end
104
+
105
+ def otherlang_designations(docxml)
106
+ return unless @is_iev
107
+
108
+ docxml.xpath(ns("//term")).each do |t|
109
+ otherlang_designations1(t, t["language"]&.split(/,/) || %w(en fr))
110
+ end
111
+ end
112
+
113
+ def extract_otherlang_designations(term, lgs)
114
+ term.xpath(ns(".//preferred/expression[@language]"))
115
+ .each_with_object([]) do |d, m|
116
+ lg = d["language"]
117
+ d.delete("language")
118
+ next if lgs.include?(lg)
119
+
120
+ p = d.parent
121
+ designation_annotate(p, d.at(ns("./name")))
122
+ m << { lang: lg, script: Metanorma::Utils.default_script(lg),
123
+ designation: l10n_recursive(p.remove, lg) }
124
+ end
125
+ end
126
+
127
+ def l10n_recursive(xml, lang)
128
+ script = Metanorma::Utils.default_script(lang)
129
+ xml.traverse do |x|
130
+ next unless x.text?
131
+
132
+ x.replace(l10n(x, lang, script))
133
+ end
134
+ xml
135
+ end
136
+
137
+ def otherlang_designations1(term, lgs)
138
+ pr = extract_otherlang_designations(term, lgs)
139
+ return if pr.empty?
140
+
141
+ prefs = pr.map do |p|
142
+ "<dt>#{p[:lang]}</dt>"\
143
+ "<dd language='#{p[:lang]}' script='#{p[:script]}'>"\
144
+ "#{p[:designation].to_xml}</dd>"
145
+ end
146
+ term << "<dl type='other-lang'>#{prefs.join}</dl>"
147
+ end
148
+
149
+ def related1(node)
150
+ lg = node&.at("./ancestor::xmlns:term/@language")&.text
151
+ @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
152
+ super
153
+ @i18n = @i18n_lg["default"]
154
+ end
155
+
156
+ def termsource_modification(node)
157
+ lg = node&.at("./ancestor::xmlns:term/@language")&.text
158
+ @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
159
+ super
160
+ @i18n = @i18n_lg["default"]
161
+ end
162
+
163
+ def termsource1(node)
164
+ lg = node&.at("./ancestor::xmlns:term/@language")&.text
165
+ @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
166
+ if @is_iev then termsource1_iev(node)
167
+ else super
168
+ end
169
+ @i18n = @i18n_lg["default"]
170
+ end
171
+
172
+ def termsource1_iev(elem)
173
+ while elem&.next_element&.name == "termsource"
174
+ elem << "; #{elem.next_element.remove.children.to_xml}"
175
+ end
176
+ elem.children = l10n("#{@i18n.source}: #{elem.children.to_xml.strip}")
177
+ end
178
+
179
+ def termexample(docxml)
180
+ docxml.xpath(ns("//termexample")).each do |f|
181
+ termexample1(f)
182
+ end
183
+ end
184
+
185
+ def termexample1(elem)
186
+ lg = elem&.at("./ancestor::xmlns:term/@language")&.text
187
+ @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
188
+ example1(elem)
189
+ @i18n = @i18n_lg["default"]
190
+ end
191
+
192
+ def termnote1(elem)
193
+ lg = elem&.at("./ancestor::xmlns:term/@language")&.text
194
+ @i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
195
+
196
+ val = @xrefs.anchor(elem["id"], :value) || "???"
197
+ lbl = @i18n.termnote.gsub(/%/, val)
198
+ prefix_name(elem, "", lower2cap(lbl), "name")
199
+ @i18n = @i18n_lg["default"]
200
+ end
201
+
71
202
  include Init
72
203
  end
73
204
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.4.3".freeze
3
+ VERSION = "1.4.4".freeze
4
4
  end
5
5
  end
6
6
 
@@ -324,12 +324,10 @@ RSpec.describe IsoDoc do
324
324
  <li>A</li>
325
325
  </ul>
326
326
  </termexample>
327
- <termsource status="modified">
328
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
329
- <modification>
330
- <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>
331
- </modification>
332
- </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 &#x2013;
329
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</termsource>
330
+ </term>
333
331
  <term id="paddy">
334
332
  <name>192-01-02</name>
335
333
  <preferred><strong>paddy</strong></preferred><admitted>paddy rice</admitted>
@@ -351,7 +349,7 @@ RSpec.describe IsoDoc do
351
349
  <ul><li>A</li></ul>
352
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>
353
351
  </termnote>
354
- <termsource status="identical">
352
+ <termsource status="identical">SOURCE:
355
353
  <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
356
354
  </termsource></term>
357
355
  </terms>
@@ -367,84 +365,87 @@ RSpec.describe IsoDoc do
367
365
  <div class='boilerplate_legal'/>
368
366
  </div>
369
367
  #{IEC_TITLE1}
370
- <div id='_terms_and_definitions'>
371
- <h1>1&#160; Terms and definitions</h1>
372
- <br/>
373
- <div id='_general'>
374
- <p class='zzSTDTitle2'>
375
- <b>192-01 General</b>
376
- </p>
377
- <p class='TermNum' id='paddy1'>192-01-01</p>
378
- <p class='Terms' style='text-align:left;'><b>paddy</b></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
- &#160; 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
- &#160;
393
- </p>
394
- <ul>
395
- <li>A</li>
396
- </ul>
397
- </div>
398
- <p>
399
- [TERMREF]
400
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
401
- [MODIFICATION]The term "cargo rice" is shown as deprecated, and
402
- Note 1 to entry is not included here [/TERMREF]
403
- </p>
404
- <p class='TermNum' id='paddy'>192-01-02</p>
405
- <p class='Terms' style='text-align:left;'><b>paddy</b></p>
406
- <p class='AltTerms' style='text-align:left;'>paddy rice</p>
407
- <p class='AltTerms' style='text-align:left;'>rough rice</p>
408
- <p class='DeprecatedTerms' style='text-align:left;'>DEPRECATED: cargo rice</p>
409
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>&lt;rice&gt; rice retaining its husk after threshing</p>
410
- <div id='_bd57bbf1-f948-4bae-b0ce-73c00431f893' class='example'>
411
- <p>
412
- <span class='example_label'>EXAMPLE</span>
413
- &#160;
414
- </p>
415
- <ul>
416
- <li>A</li>
417
- </ul>
418
- </div>
419
- <div class='Note' id='_671a1994-4783-40d0-bc81-987d06ffb74e'>
420
- <p>
421
- Note 1 to entry: The starch of waxy rice consists almost entirely
422
- of amylopectin. The kernels have a tendency to stick together
423
- after cooking.
424
- </p>
425
- </div>
426
- <div class='Note' id='_671a1994-4783-40d0-bc81-987d06ffb74f'>
427
- <p>
428
- Note 2 to entry:
429
- <ul>
430
- <li>A</li>
431
- </ul>
432
- <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
433
- The starch of waxy rice consists almost entirely of amylopectin.
434
- The kernels have a tendency to stick together after cooking.
435
- </p>
436
- </p>
437
- </div>
438
- <p>
439
- [TERMREF]
440
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
441
- [/TERMREF]
442
- </p>
443
- </div>
444
- </div>
445
- </div>
446
- </body>
447
- </html>
368
+ <div id='_terms_and_definitions'>
369
+ <h1>1&#160; 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
+ &#160; 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
+ &#160;
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 &#8211; 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'>&lt;rice&gt; 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
+ &#160;
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>
448
449
  OUTPUT
449
450
  expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
450
451
  .convert("test", input, true)
@@ -497,19 +498,12 @@ RSpec.describe IsoDoc do
497
498
  <definition>
498
499
  <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
499
500
  </definition>
500
- <termsource status='modified'>
501
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
502
- <locality type='clause'>
501
+ <termsource status='modified'>SOURCE:
502
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
503
503
  <referenceFrom>3.1</referenceFrom>
504
- </locality>
505
- ISO 7301:2011, 3.1
506
- </origin>
507
- <modification>
508
- <p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
504
+ </locality>ISO 7301:2011, 3.1</origin>, modified &#x2013;
509
505
  The term "cargo rice" is shown as deprecated, and Note 1 to
510
506
  entry is not included here
511
- </p>
512
- </modification>
513
507
  </termsource>
514
508
  </term>
515
509
  </terms>
@@ -558,7 +552,7 @@ RSpec.describe IsoDoc do
558
552
  <p class='MsoNormal'>
559
553
  SOURCE:
560
554
  <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
561
- , modified &#x2014; The term "cargo rice" is shown as deprecated, and
555
+ , modified &#x2013; The term "cargo rice" is shown as deprecated, and
562
556
  Note 1 to entry is not included here
563
557
  </p>
564
558
  </div>
@@ -622,7 +616,7 @@ RSpec.describe IsoDoc do
622
616
  <title>192-01 General</title>
623
617
  <term id='term-durability'>
624
618
  <name>192-01-01</name>
625
- <preferred><strong>durability, &#x3c;of an item&#x3e;</strong></preferred>
619
+ <preferred><strong>durability</strong>, &#x3c;of an item&#x3e;</preferred>
626
620
  <definition>
627
621
  <verbaldefinition>
628
622
  <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
@@ -654,4 +648,234 @@ RSpec.describe IsoDoc do
654
648
  .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
655
649
  .to be_equivalent_to xmlpp(presxml)
656
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="ar"><name>نظام،</name></expression><field-of-application>في الاعتمادیة</field-of-application></preferred>
665
+ <preferred><expression language="de"><name>Betrachtungseinheit</name<grammar><gender>feminine</gender></grammar></expression></preferred>
666
+ <preferred><expression language="de"><name>Einheit</name><grammar><gender>feminine</gender></grammar></expression></preferred>
667
+ <preferred><expression language="ja"><name>アイテム</name></expression></preferred>
668
+ <admitted><expression><name>paddy rice</name></expression></admitted>
669
+ <admitted><expression><name>rough rice</name></expression></admitted>
670
+ <deprecates><expression><name>cargo rice</name></expression></deprecates>
671
+ <related type='contrast'><preferred><expression><name>Fifth Designation</name></expression></preferred><xref target="paddy1"/></related>
672
+ <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">set of interrelated items that collectively fulfil a requirement</p></verbal-definition></definition>
673
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
674
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">A system is considered to have a defined real or abstract boundary.</p>
675
+ </termnote>
676
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74d">
677
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">External resources (from outside the system boundary) may be required for the system to operate.</p>
678
+ </termnote>
679
+ <termexample id="_671a1994-4783-40d0-bc81-987d06ffb740">
680
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d0">External resources (from outside the system boundary) may be required for the system to operate.</p>
681
+ </termexample>
682
+ <termsource status="modified">
683
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
684
+ <modification>modified by extension to suit the dependability context</modification>
685
+ </termsource></term>
686
+ <term id="item-fr" language="fr" tag="item">
687
+ <preferred><expression language="fr"><name>entité</name<grammar><gender>masculine</gender></grammar></expression>
688
+ <field-of-application>en sûreté de fonctionnement</field-of-application>
689
+ </preferred>
690
+ <related type='contrast'><preferred><expression><name>Designation cinquième</name></expression></preferred><xref target="paddy1"/></related>
691
+ <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>
692
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74c">
693
+ <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>
694
+ </termnote>
695
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74b">
696
+ <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>
697
+ </termnote>
698
+ <termexample id="_671a1994-4783-40d0-bc81-987d06ffb741">
699
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d1">External resources (from outside the system boundary) may be required for the system to operate.</p>
700
+ </termexample>
701
+ <termsource status="modified">
702
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
703
+ <modification>modifié pour adapter au contexte de la sûreté de fonctionnement</modification>
704
+ </termsource></term>
705
+ <term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
706
+ <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747d">rice retaining its husk after threshing</p></verbal-definition></definition>
707
+ </term>
708
+ </terms>
709
+ </clause>
710
+ </sections>
711
+ </iso-standard>
712
+ INPUT
713
+
714
+ presxml = <<~PRESXML
715
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
716
+ <bibdata type='standard'>
717
+ <docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
718
+ <docnumber>60050</docnumber>
719
+ </bibdata>
720
+ <sections>
721
+ <clause id='_terms_and_definitions' obligation='normative' displayorder='1'>
722
+ <title depth='1'>
723
+ 1
724
+ <tab/>
725
+ Terms and definitions
726
+ </title>
727
+ <terms id='_general' obligation='normative'>
728
+ <title>192-01 General</title>
729
+ <term id='item' language='en,fr'>
730
+ <name>192-01-01</name>
731
+ <preferred>
732
+ <strong>system</strong>
733
+ , &#x3c;in dependability&#x3e;
734
+ </preferred>
735
+ <admitted>paddy rice</admitted>
736
+ <admitted>rough rice</admitted>
737
+ <deprecates>cargo rice</deprecates>
738
+ <p>
739
+ <strong>CONTRAST:</strong>
740
+ <em>
741
+ <preferred>
742
+ <strong>Fifth Designation</strong>
743
+ </preferred>
744
+ </em>
745
+ (
746
+ <xref target='paddy1'>192-01-02</xref>
747
+ )
748
+ </p>
749
+ <definition>
750
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>set of interrelated items that collectively fulfil a requirement</p>
751
+ </definition>
752
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e'>
753
+ <name>Note 1 to entry</name>
754
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>A system is considered to have a defined real or abstract boundary.</p>
755
+ </termnote>
756
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74d'>
757
+ <name>Note 2 to entry</name>
758
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
759
+ External resources (from outside the system boundary) may be
760
+ required for the system to operate.
761
+ </p>
762
+ </termnote>
763
+ <termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
764
+ <name>EXAMPLE</name>
765
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d0'>
766
+ External resources (from outside the system boundary) may be
767
+ required for the system to operate.
768
+ </p>
769
+ </termexample>
770
+ <termsource status='modified'>SOURCE:
771
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
772
+ <locality type='clause'>
773
+ <referenceFrom>3.1</referenceFrom>
774
+ </locality>
775
+ ISO 7301:2011, 3.1
776
+ </origin>, modified &#x2013;
777
+ modified by extension to suit the dependability context
778
+ </termsource>
779
+ <preferred>
780
+ <strong>entit&#xE9;</strong>
781
+ , &#x3c;en s&#xFB;ret&#xE9; de fonctionnement&#x3e;, m
782
+ </preferred>
783
+ <p>
784
+ <strong>CONTRASTEZ:</strong>
785
+ <em>
786
+ <preferred>
787
+ <strong>Designation cinqui&#xE8;me</strong>
788
+ </preferred>
789
+ </em>
790
+ (
791
+ <xref target='paddy1'>192-01-02</xref>
792
+ )
793
+ </p>
794
+ <definition>
795
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>
796
+ ensemble d&#x2019;entit&#xE9;s reli&#xE9;es entre elles qui
797
+ satisfont collectivement &#xE0; une exigence
798
+ </p>
799
+ </definition>
800
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74c'>
801
+ <name>Note 1 &#xE0; l&#x2019;article</name>
802
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
803
+ Un syst&#xE8;me est consid&#xE9;r&#xE9; comme ayant une
804
+ fronti&#xE8;re d&#xE9;finie, r&#xE9;elle ou abstraite.
805
+ </p>
806
+ </termnote>
807
+ <termnote id='_671a1994-4783-40d0-bc81-987d06ffb74b'>
808
+ <name>Note 2 &#xE0; l&#x2019;article</name>
809
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
810
+ Des ressources externes (provenant d&#x2019;au-del&#xE0; de la
811
+ fronti&#xE8;re) peuvent &#xEA;tre n&#xE9;cessaires au
812
+ fonctionnement du syst&#xE8;me.
813
+ </p>
814
+ </termnote>
815
+ <termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>
816
+ <name>EXEMPLE</name>
817
+ <p id='_19830f33-e46c-42cc-94ca-a5ef101132d1'>
818
+ External resources (from outside the system boundary) may be
819
+ required for the system to operate.
820
+ </p>
821
+ </termexample>
822
+ <termsource status='modified'>SOURCE:
823
+ <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
824
+ <locality type='clause'>
825
+ <referenceFrom>3.1</referenceFrom>
826
+ </locality>
827
+ ISO 7301:2011, 3.1
828
+ </origin>, modifi&#xE9; &#x2013;
829
+ modifi&#xE9; pour adapter au contexte de la s&#xFB;ret&#xE9; de fonctionnement
830
+ </termsource>
831
+ <dl type='other-lang'>
832
+ <dt>ar</dt>
833
+ <dd language="ar" script="Arab">
834
+ <preferred>
835
+ <strong>&#x61C;&#x646;&#x638;&#x627;&#x645;&#x60C;&#x61C;</strong>
836
+ &#x61C;, &#x3c;&#x641;&#x64A;
837
+ &#x627;&#x644;&#x627;&#x639;&#x62A;&#x645;&#x627;&#x62F;&#x6CC;&#x629;&#x3e;&#x61C;
838
+ </preferred>
839
+ </dd>
840
+ <dt>de</dt>
841
+ <dd language="de" script="Latn">
842
+ <preferred>
843
+ <strong>Betrachtungseinheit</strong>
844
+ , f
845
+ </preferred>
846
+ </dd>
847
+ <dt>de</dt>
848
+ <dd language="de" script="Latn">
849
+ <preferred>
850
+ <strong>Einheit</strong>
851
+ , f
852
+ </preferred>
853
+ </dd>
854
+ <dt>ja</dt>
855
+ <dd language="ja" script="Jpan">
856
+ <preferred>
857
+ <strong>&#x30A2;&#x30A4;&#x30C6;&#x30E0;</strong>
858
+ </preferred>
859
+ </dd>
860
+ </dl>
861
+ </term>
862
+ <term id='paddy1'>
863
+ <name>192-01-02</name>
864
+ <preferred>
865
+ <strong>paddy</strong>
866
+ </preferred>
867
+ <definition>
868
+ <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>rice retaining its husk after threshing</p>
869
+ </definition>
870
+ </term>
871
+ </terms>
872
+ </clause>
873
+ </sections>
874
+ </iso-standard>
875
+ PRESXML
876
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
877
+ .convert("test", input, true)
878
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
879
+ .to be_equivalent_to xmlpp(presxml)
880
+ end
657
881
  end
@@ -127,11 +127,8 @@ RSpec.describe IsoDoc do
127
127
  <name>1.1</name>
128
128
  <preferred>paddy</preferred>
129
129
  <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
130
- <termsource status="modified">
131
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
132
- <modification>
133
- <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>
134
- </modification>
130
+ <termsource status="modified">[SOURCE:
131
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
135
132
  </termsource></term>
136
133
  </terms>
137
134
  </sections>