isodoc 1.7.6 → 1.8.1
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/isodoc.gemspec +1 -1
- data/lib/isodoc/class_utils.rb +23 -0
- data/lib/isodoc/convert.rb +9 -0
- data/lib/isodoc/function/cleanup.rb +4 -0
- data/lib/isodoc/function/inline.rb +2 -4
- data/lib/isodoc/function/utils.rb +1 -1
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/html_function/postprocess.rb +4 -6
- data/lib/isodoc/metadata_date.rb +13 -11
- data/lib/isodoc/presentation_function/bibdata.rb +2 -2
- data/lib/isodoc/presentation_function/block.rb +0 -36
- data/lib/isodoc/presentation_function/inline.rb +14 -11
- data/lib/isodoc/presentation_function/terms.rb +179 -0
- data/lib/isodoc/presentation_xml_convert.rb +11 -4
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +24 -14
- data/lib/isodoc/word_function/comments.rb +0 -4
- data/lib/isodoc/word_function/postprocess.rb +184 -176
- data/lib/isodoc/xref/xref_gen.rb +18 -22
- data/lib/isodoc/xref/xref_gen_seq.rb +10 -16
- data/lib/isodoc/xref/xref_sect_gen.rb +134 -129
- data/lib/isodoc/xslfo_convert.rb +11 -7
- data/lib/isodoc-yaml/i18n-ar.yaml +22 -0
- data/lib/isodoc-yaml/i18n-de.yaml +20 -0
- data/lib/isodoc-yaml/i18n-en.yaml +20 -0
- data/lib/isodoc-yaml/i18n-es.yaml +20 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +20 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +21 -1
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +21 -0
- data/lib/metanorma/output/xslfo.rb +4 -11
- data/spec/assets/i18n.yaml +3 -1
- data/spec/isodoc/blocks_spec.rb +14 -8
- data/spec/isodoc/i18n_spec.rb +8 -8
- data/spec/isodoc/inline_spec.rb +200 -6
- data/spec/isodoc/lists_spec.rb +344 -222
- data/spec/isodoc/section_spec.rb +11 -10
- data/spec/isodoc/table_spec.rb +71 -73
- data/spec/isodoc/terms_spec.rb +354 -34
- data/spec/isodoc/xref_numbering_spec.rb +347 -0
- data/spec/isodoc/xref_spec.rb +271 -350
- data/spec/isodoc/xslfo_convert_spec.rb +34 -9
- metadata +7 -6
- data/lib/isodoc/presentation_function/concept.rb +0 -68
data/spec/isodoc/terms_spec.rb
CHANGED
@@ -7,9 +7,16 @@ RSpec.describe IsoDoc do
|
|
7
7
|
<sections>
|
8
8
|
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
9
9
|
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
10
|
-
<term id="paddy1"><preferred>paddy</
|
10
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression>
|
11
|
+
<termsource status="modified">
|
12
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
13
|
+
<modification>
|
14
|
+
<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>
|
15
|
+
</modification>
|
16
|
+
</termsource>
|
17
|
+
</preferred>
|
11
18
|
<domain>rice</domain>
|
12
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
19
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
13
20
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
|
14
21
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
15
22
|
<ul>
|
@@ -21,12 +28,6 @@ RSpec.describe IsoDoc do
|
|
21
28
|
<li>A</li>
|
22
29
|
</ul>
|
23
30
|
</termexample>
|
24
|
-
<termsource status="modified">
|
25
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
26
|
-
<modification>
|
27
|
-
<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>
|
28
|
-
</modification>
|
29
|
-
</termsource>
|
30
31
|
<termsource status='identical'>
|
31
32
|
<origin citeas=''>
|
32
33
|
<termref base='IEV' target='xyz'>t1</termref>
|
@@ -41,10 +42,11 @@ RSpec.describe IsoDoc do
|
|
41
42
|
</modification>
|
42
43
|
</termsource>
|
43
44
|
</term>
|
44
|
-
<term id="paddy"><preferred>paddy</preferred
|
45
|
-
<admitted>
|
46
|
-
<
|
47
|
-
<
|
45
|
+
<term id="paddy"><preferred><expression><name>paddy</name></expression></preferred>
|
46
|
+
<admitted><letter-symbol><name>paddy rice</name></letter-symbol></admitted>
|
47
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
48
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
49
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
48
50
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
49
51
|
<ul>
|
50
52
|
<li>A</li>
|
@@ -78,6 +80,17 @@ RSpec.describe IsoDoc do
|
|
78
80
|
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
79
81
|
<term id='paddy1'><name>1.1.</name>
|
80
82
|
<preferred>paddy</preferred>
|
83
|
+
<termsource status='modified'>
|
84
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
85
|
+
<referenceFrom>3.1</referenceFrom>
|
86
|
+
</locality>ISO 7301:2011, Clause 3.1</origin>
|
87
|
+
<modification>
|
88
|
+
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
89
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry
|
90
|
+
is not included here
|
91
|
+
</p>
|
92
|
+
</modification>
|
93
|
+
</termsource>
|
81
94
|
<domain>rice</domain>
|
82
95
|
<definition>
|
83
96
|
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
@@ -95,17 +108,6 @@ RSpec.describe IsoDoc do
|
|
95
108
|
<li>A</li>
|
96
109
|
</ul>
|
97
110
|
</termexample>
|
98
|
-
<termsource status='modified'>
|
99
|
-
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
100
|
-
<referenceFrom>3.1</referenceFrom>
|
101
|
-
</locality>ISO 7301:2011, Clause 3.1</origin>
|
102
|
-
<modification>
|
103
|
-
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
104
|
-
The term "cargo rice" is shown as deprecated, and Note 1 to entry
|
105
|
-
is not included here
|
106
|
-
</p>
|
107
|
-
</modification>
|
108
|
-
</termsource>
|
109
111
|
<termsource status='identical'>
|
110
112
|
<origin citeas=''>
|
111
113
|
<termref base='IEV' target='xyz'>t1</termref>
|
@@ -173,6 +175,10 @@ RSpec.describe IsoDoc do
|
|
173
175
|
<p>For the purposes of this document,
|
174
176
|
the following terms and definitions apply.</p>
|
175
177
|
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
178
|
+
<p>[TERMREF]
|
179
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
180
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
181
|
+
[/TERMREF]</p>
|
176
182
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
177
183
|
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
178
184
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
@@ -185,10 +191,6 @@ RSpec.describe IsoDoc do
|
|
185
191
|
<li>A</li>
|
186
192
|
</ul>
|
187
193
|
</div>
|
188
|
-
<p>[TERMREF]
|
189
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
190
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
191
|
-
[/TERMREF]</p>
|
192
194
|
<p>[TERMREF] t1 [/TERMREF]</p>
|
193
195
|
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
194
196
|
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
@@ -217,6 +219,10 @@ RSpec.describe IsoDoc do
|
|
217
219
|
<div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">  </span>Terms and Definitions</h1><p>For the purposes of this document,
|
218
220
|
the following terms and definitions apply.</p>
|
219
221
|
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
222
|
+
<p>[TERMREF]
|
223
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
224
|
+
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
225
|
+
[/TERMREF]</p>
|
220
226
|
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
221
227
|
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example" style='page-break-after: avoid;page-break-inside: avoid;'><p class="example-title">EXAMPLE 1</p>
|
222
228
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
@@ -229,10 +235,6 @@ RSpec.describe IsoDoc do
|
|
229
235
|
<li>A</li>
|
230
236
|
</ul>
|
231
237
|
</div>
|
232
|
-
<p>[TERMREF]
|
233
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
234
|
-
[MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
235
|
-
[/TERMREF]</p>
|
236
238
|
<p>[TERMREF] t1 [/TERMREF]</p>
|
237
239
|
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
238
240
|
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
@@ -268,16 +270,17 @@ RSpec.describe IsoDoc do
|
|
268
270
|
<sections>
|
269
271
|
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
270
272
|
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
271
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
273
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
272
274
|
<domain>rice</domain>
|
273
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
274
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747e">rice retaining its husk after threshing, mark 2</p>
|
275
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
276
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747e">rice retaining its husk after threshing, mark 2</p>
|
275
277
|
<termsource status="modified">
|
276
278
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
277
279
|
<modification>
|
278
280
|
<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>
|
279
281
|
</modification>
|
280
282
|
</termsource>
|
283
|
+
</verbaldefinition>
|
281
284
|
</definition>
|
282
285
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
|
283
286
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
@@ -377,4 +380,321 @@ RSpec.describe IsoDoc do
|
|
377
380
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
378
381
|
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
379
382
|
end
|
383
|
+
|
384
|
+
it "processes IsoXML term with multiple preferred terms" do
|
385
|
+
input = <<~"INPUT"
|
386
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
387
|
+
<sections>
|
388
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
389
|
+
<term id="paddy1">
|
390
|
+
<preferred><expression><name>paddy</name></expression></preferred>
|
391
|
+
<preferred><expression><name>muddy rice</name></expression></preferred>
|
392
|
+
<domain>rice</domain>
|
393
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
394
|
+
</term>
|
395
|
+
</terms>
|
396
|
+
</sections>
|
397
|
+
</iso-standard>
|
398
|
+
INPUT
|
399
|
+
presxml = <<~PRESXML
|
400
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
401
|
+
<sections>
|
402
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
403
|
+
<title depth='1'>
|
404
|
+
1.
|
405
|
+
<tab/>
|
406
|
+
Terms and Definitions
|
407
|
+
</title>
|
408
|
+
<term id='paddy1'>
|
409
|
+
<name>1.1.</name>
|
410
|
+
<preferred>paddy; muddy rice</preferred>
|
411
|
+
<domain>rice</domain>
|
412
|
+
<definition>
|
413
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
414
|
+
</definition>
|
415
|
+
</term>
|
416
|
+
</terms>
|
417
|
+
</sections>
|
418
|
+
</iso-standard>
|
419
|
+
PRESXML
|
420
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
421
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
422
|
+
end
|
423
|
+
|
424
|
+
it "processes IsoXML term with grammatical information" do
|
425
|
+
input = <<~"INPUT"
|
426
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
427
|
+
<sections>
|
428
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
429
|
+
<term id="paddy1">
|
430
|
+
<preferred><expression><name>paddy</name>
|
431
|
+
<grammar>
|
432
|
+
<gender>masculine</gender>
|
433
|
+
<gender>feminine</gender>
|
434
|
+
<isPreposition>false</isPreposition>
|
435
|
+
<isNoun>true</isNoun>
|
436
|
+
<grammarValue>irregular declension</grammarValue>
|
437
|
+
</grammar>
|
438
|
+
</expression></preferred>
|
439
|
+
<preferred><expression><name>muddy rice</name>
|
440
|
+
<grammar>
|
441
|
+
<gender>neuter</gender>
|
442
|
+
<isNoun>true</isNoun>
|
443
|
+
<grammarValue>irregular declension</grammarValue>
|
444
|
+
</grammar>
|
445
|
+
</expression></preferred>
|
446
|
+
<domain>rice</domain>
|
447
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
448
|
+
</term>
|
449
|
+
</terms>
|
450
|
+
</sections>
|
451
|
+
</iso-standard>
|
452
|
+
INPUT
|
453
|
+
presxml = <<~PRESXML
|
454
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
455
|
+
<sections>
|
456
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
457
|
+
<title depth='1'>
|
458
|
+
1.
|
459
|
+
<tab/>
|
460
|
+
Terms and Definitions
|
461
|
+
</title>
|
462
|
+
<term id='paddy1'>
|
463
|
+
<name>1.1.</name>
|
464
|
+
<preferred>paddy masc, fem, n; muddy rice neut, n</preferred>
|
465
|
+
<domain>rice</domain>
|
466
|
+
<definition>
|
467
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
468
|
+
</definition>
|
469
|
+
</term>
|
470
|
+
</terms>
|
471
|
+
</sections>
|
472
|
+
</iso-standard>
|
473
|
+
PRESXML
|
474
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
475
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
476
|
+
end
|
477
|
+
|
478
|
+
it "processes IsoXML term with empty or graphical designations" do
|
479
|
+
input = <<~"INPUT"
|
480
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
481
|
+
<sections>
|
482
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
483
|
+
<term id="paddy1">
|
484
|
+
<preferred><expression><name/></expression></preferred>
|
485
|
+
<preferred isInternational='true'><graphical-symbol><figure id='_'><pre id='_'><LITERAL> FIGURATIVE</pre></figure>
|
486
|
+
</graphical-symbol>
|
487
|
+
</preferred>
|
488
|
+
<domain>rice</domain>
|
489
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
490
|
+
</term>
|
491
|
+
</terms>
|
492
|
+
</sections>
|
493
|
+
</iso-standard>
|
494
|
+
INPUT
|
495
|
+
presxml = <<~PRESXML
|
496
|
+
<?xml version='1.0'?>
|
497
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
498
|
+
<sections>
|
499
|
+
<terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
500
|
+
<title depth='1'>1.<tab/>Terms and Definitions</title>
|
501
|
+
<term id='paddy1'>
|
502
|
+
<name>1.1.</name>
|
503
|
+
<preferred>; <figure id='_'>
|
504
|
+
<name>Figure 1</name>
|
505
|
+
<pre id='_'><LITERAL> FIGURATIVE</pre>
|
506
|
+
</figure>
|
507
|
+
</preferred>
|
508
|
+
<domain>rice</domain>
|
509
|
+
<definition>
|
510
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
511
|
+
</definition>
|
512
|
+
</term>
|
513
|
+
</terms>
|
514
|
+
</sections>
|
515
|
+
</iso-standard>
|
516
|
+
PRESXML
|
517
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
518
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
519
|
+
end
|
520
|
+
|
521
|
+
it "processes IsoXML term with nonverbal definitions" do
|
522
|
+
input = <<~"INPUT"
|
523
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
524
|
+
<sections>
|
525
|
+
<terms id='A' obligation='normative'>
|
526
|
+
<title>Terms and definitions</title>
|
527
|
+
<p id='B'>For the purposes of this document, the following terms and definitions apply.</p>
|
528
|
+
<term id='term-term'>
|
529
|
+
<preferred>
|
530
|
+
<expression>
|
531
|
+
<name>Term</name>
|
532
|
+
</expression>
|
533
|
+
</preferred>
|
534
|
+
<definition>
|
535
|
+
<verbaldefinition>
|
536
|
+
<p id='C'>Definition</p>
|
537
|
+
<termsource status='identical' type='authoritative'>
|
538
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
539
|
+
<localityStack>
|
540
|
+
<locality type='section'>
|
541
|
+
<referenceFrom>1</referenceFrom>
|
542
|
+
</locality>
|
543
|
+
</localityStack>
|
544
|
+
</origin>
|
545
|
+
</termsource>
|
546
|
+
</verbaldefinition>
|
547
|
+
<nonverbalrepresentation>
|
548
|
+
<table id='D'>
|
549
|
+
<thead>
|
550
|
+
<tr>
|
551
|
+
<th valign='top' align='left'>A</th>
|
552
|
+
<th valign='top' align='left'>B</th>
|
553
|
+
</tr>
|
554
|
+
</thead>
|
555
|
+
<tbody>
|
556
|
+
<tr>
|
557
|
+
<td valign='top' align='left'>C</td>
|
558
|
+
<td valign='top' align='left'>D</td>
|
559
|
+
</tr>
|
560
|
+
</tbody>
|
561
|
+
</table>
|
562
|
+
</nonverbalrepresentation>
|
563
|
+
</definition>
|
564
|
+
<termsource status='identical' type='authoritative'>
|
565
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
566
|
+
<localityStack>
|
567
|
+
<locality type='section'>
|
568
|
+
<referenceFrom>2</referenceFrom>
|
569
|
+
</locality>
|
570
|
+
</localityStack>
|
571
|
+
</origin>
|
572
|
+
</termsource>
|
573
|
+
</term>
|
574
|
+
<term id='term-term-2'>
|
575
|
+
<preferred>
|
576
|
+
<expression>
|
577
|
+
<name>Term 2</name>
|
578
|
+
</expression>
|
579
|
+
</preferred>
|
580
|
+
<definition>
|
581
|
+
<nonverbalrepresentation>
|
582
|
+
<figure id='E'>
|
583
|
+
<pre id='F'>Literal</pre>
|
584
|
+
</figure>
|
585
|
+
<formula id='G'>
|
586
|
+
<stem type='MathML'>
|
587
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
588
|
+
<mi>x</mi>
|
589
|
+
<mo>=</mo>
|
590
|
+
<mi>y</mi>
|
591
|
+
</math>
|
592
|
+
</stem>
|
593
|
+
</formula>
|
594
|
+
<termsource status='identical' type='authoritative'>
|
595
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
596
|
+
<localityStack>
|
597
|
+
<locality type='section'>
|
598
|
+
<referenceFrom>3</referenceFrom>
|
599
|
+
</locality>
|
600
|
+
</localityStack>
|
601
|
+
</origin>
|
602
|
+
</termsource>
|
603
|
+
</nonverbalrepresentation>
|
604
|
+
</definition>
|
605
|
+
</term>
|
606
|
+
</terms>
|
607
|
+
</sections>
|
608
|
+
</iso-standard>
|
609
|
+
INPUT
|
610
|
+
presxml = <<~PRESXML
|
611
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
612
|
+
<sections>
|
613
|
+
<terms id='A' obligation='normative' displayorder='1'>
|
614
|
+
<title depth='1'>
|
615
|
+
1.
|
616
|
+
<tab/>
|
617
|
+
Terms and definitions
|
618
|
+
</title>
|
619
|
+
<p id='B'>For the purposes of this document, the following terms and definitions apply.</p>
|
620
|
+
<term id='term-term'>
|
621
|
+
<name>1.1.</name>
|
622
|
+
<preferred>Term</preferred>
|
623
|
+
<definition>
|
624
|
+
<p id='C'>Definition</p>
|
625
|
+
<termsource status='identical' type='authoritative'>
|
626
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
627
|
+
<localityStack>
|
628
|
+
<locality type='section'>
|
629
|
+
<referenceFrom>1</referenceFrom>
|
630
|
+
</locality>
|
631
|
+
</localityStack>
|
632
|
+
, Section 1
|
633
|
+
</origin>
|
634
|
+
</termsource>
|
635
|
+
<table id='D'>
|
636
|
+
<name>Table 1</name>
|
637
|
+
<thead>
|
638
|
+
<tr>
|
639
|
+
<th valign='top' align='left'>A</th>
|
640
|
+
<th valign='top' align='left'>B</th>
|
641
|
+
</tr>
|
642
|
+
</thead>
|
643
|
+
<tbody>
|
644
|
+
<tr>
|
645
|
+
<td valign='top' align='left'>C</td>
|
646
|
+
<td valign='top' align='left'>D</td>
|
647
|
+
</tr>
|
648
|
+
</tbody>
|
649
|
+
</table>
|
650
|
+
</definition>
|
651
|
+
<termsource status='identical' type='authoritative'>
|
652
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
653
|
+
<localityStack>
|
654
|
+
<locality type='section'>
|
655
|
+
<referenceFrom>2</referenceFrom>
|
656
|
+
</locality>
|
657
|
+
</localityStack>
|
658
|
+
, Section 2
|
659
|
+
</origin>
|
660
|
+
</termsource>
|
661
|
+
</term>
|
662
|
+
<term id='term-term-2'>
|
663
|
+
<name>1.2.</name>
|
664
|
+
<preferred>Term 2</preferred>
|
665
|
+
<definition>
|
666
|
+
<figure id='E'>
|
667
|
+
<name>Figure 1</name>
|
668
|
+
<pre id='F'>Literal</pre>
|
669
|
+
</figure>
|
670
|
+
<formula id='G'>
|
671
|
+
<name>1</name>
|
672
|
+
<stem type='MathML'>
|
673
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
674
|
+
<mi>x</mi>
|
675
|
+
<mo>=</mo>
|
676
|
+
<mi>y</mi>
|
677
|
+
</math>
|
678
|
+
<!-- x = y -->
|
679
|
+
</stem>
|
680
|
+
</formula>
|
681
|
+
<termsource status='identical' type='authoritative'>
|
682
|
+
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
683
|
+
<localityStack>
|
684
|
+
<locality type='section'>
|
685
|
+
<referenceFrom>3</referenceFrom>
|
686
|
+
</locality>
|
687
|
+
</localityStack>
|
688
|
+
, Section 3
|
689
|
+
</origin>
|
690
|
+
</termsource>
|
691
|
+
</definition>
|
692
|
+
</term>
|
693
|
+
</terms>
|
694
|
+
</sections>
|
695
|
+
</iso-standard>
|
696
|
+
PRESXML
|
697
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
698
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
699
|
+
end
|
380
700
|
end
|