isodoc 2.1.0.2 → 2.1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/isodoc.gemspec +6 -3
  3. data/lib/isodoc/base_style/all.css +227 -0
  4. data/lib/isodoc/base_style/blocks.css +0 -0
  5. data/lib/isodoc/base_style/blocks.scss +7 -0
  6. data/lib/isodoc/base_style/coverpage.css +0 -0
  7. data/lib/isodoc/base_style/defaults.css +0 -0
  8. data/lib/isodoc/base_style/metanorma_word.css +47 -0
  9. data/lib/isodoc/base_style/nav.css +0 -0
  10. data/lib/isodoc/base_style/reset.css +125 -0
  11. data/lib/isodoc/base_style/typography.css +0 -0
  12. data/lib/isodoc/class_utils.rb +1 -1
  13. data/lib/isodoc/function/blocks.rb +1 -1
  14. data/lib/isodoc/function/cleanup.rb +1 -1
  15. data/lib/isodoc/function/inline.rb +4 -2
  16. data/lib/isodoc/function/lists.rb +24 -9
  17. data/lib/isodoc/function/table.rb +1 -1
  18. data/lib/isodoc/function/to_word_html.rb +3 -2
  19. data/lib/isodoc/function/utils.rb +18 -8
  20. data/lib/isodoc/gem_tasks.rb +19 -10
  21. data/lib/isodoc/html_function/html.rb +2 -2
  22. data/lib/isodoc/i18n.rb +19 -0
  23. data/lib/isodoc/metadata.rb +2 -2
  24. data/lib/isodoc/presentation_function/block.rb +3 -3
  25. data/lib/isodoc/presentation_function/image.rb +1 -1
  26. data/lib/isodoc/presentation_function/inline.rb +13 -6
  27. data/lib/isodoc/presentation_function/section.rb +3 -1
  28. data/lib/isodoc/presentation_function/xrefs.rb +22 -6
  29. data/lib/isodoc/presentation_xml_convert.rb +1 -0
  30. data/lib/isodoc/version.rb +1 -1
  31. data/lib/isodoc/word_function/body.rb +9 -6
  32. data/lib/isodoc/word_function/postprocess.rb +1 -1
  33. data/lib/isodoc/word_function/postprocess_cover.rb +5 -5
  34. data/lib/isodoc/xref/xref_gen.rb +6 -6
  35. metadata +16 -69
  36. data/.github/workflows/rake.yml +0 -15
  37. data/.github/workflows/release.yml +0 -24
  38. data/.hound.yml +0 -5
  39. data/.oss-guides.rubocop.yml +0 -1077
  40. data/.rubocop.yml +0 -10
  41. data/Rakefile +0 -8
  42. data/bin/rspec +0 -17
  43. data/spec/assets/header.html +0 -7
  44. data/spec/assets/html.scss +0 -20
  45. data/spec/assets/html_override.css +0 -1
  46. data/spec/assets/htmlcover.html +0 -4
  47. data/spec/assets/htmlintro.html +0 -5
  48. data/spec/assets/i18n.yaml +0 -41
  49. data/spec/assets/iso.xml +0 -8
  50. data/spec/assets/odf.emf +0 -0
  51. data/spec/assets/odf.svg +0 -1
  52. data/spec/assets/odf1.svg +0 -4
  53. data/spec/assets/outputtest/a.xml +0 -66
  54. data/spec/assets/outputtest/iso.international-standard.xsl +0 -3011
  55. data/spec/assets/rice_image1 +0 -0
  56. data/spec/assets/rice_image1.png +0 -0
  57. data/spec/assets/scripts.html +0 -3
  58. data/spec/assets/scripts_override.html +0 -3
  59. data/spec/assets/std.css +0 -2
  60. data/spec/assets/word.css +0 -2
  61. data/spec/assets/word_override.css +0 -1
  62. data/spec/assets/wordcover.html +0 -3
  63. data/spec/assets/wordintro.html +0 -4
  64. data/spec/isodoc/blocks_spec.rb +0 -2934
  65. data/spec/isodoc/cleanup_spec.rb +0 -1056
  66. data/spec/isodoc/footnotes_spec.rb +0 -264
  67. data/spec/isodoc/form_spec.rb +0 -160
  68. data/spec/isodoc/i18n_spec.rb +0 -1201
  69. data/spec/isodoc/inline_spec.rb +0 -2301
  70. data/spec/isodoc/lists_spec.rb +0 -469
  71. data/spec/isodoc/metadata_spec.rb +0 -401
  72. data/spec/isodoc/postproc_spec.rb +0 -2941
  73. data/spec/isodoc/presentation_xml_spec.rb +0 -1476
  74. data/spec/isodoc/ref_spec.rb +0 -955
  75. data/spec/isodoc/section_spec.rb +0 -2123
  76. data/spec/isodoc/table_spec.rb +0 -588
  77. data/spec/isodoc/terms_spec.rb +0 -712
  78. data/spec/isodoc/utils_spec.rb +0 -57
  79. data/spec/isodoc/xref_numbering_spec.rb +0 -378
  80. data/spec/isodoc/xref_spec.rb +0 -1837
  81. data/spec/isodoc/xslfo_convert_spec.rb +0 -103
  82. data/spec/spec_helper.rb +0 -81
@@ -1,712 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe IsoDoc do
4
- it "processes IsoXML terms" do
5
- input = <<~"INPUT"
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <sections>
8
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
9
- <p>For the purposes of this document, the following terms and definitions apply.</p>
10
- <term id="paddy1"><preferred><expression><name>paddy</name></expression>
11
- <field-of-application>in agriculture</field-of-application>
12
- <usage-info>dated</usage-info>
13
- <termsource status="modified">
14
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
15
- <modification>
16
- <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>
17
- </modification>
18
- </termsource>
19
- </preferred>
20
- <domain>rice</domain>
21
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
22
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
23
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
24
- <ul>
25
- <li>A</li>
26
- </ul>
27
- </termexample>
28
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
29
- <ul>
30
- <li>A</li>
31
- </ul>
32
- </termexample>
33
- <termsource status='identical'>
34
- <origin citeas=''>
35
- <termref base='IEV' target='xyz'>t1</termref>
36
- </origin>
37
- <modification>
38
- <p id='_'/>
39
- </modification>
40
- </termsource>
41
- <termsource status='modified'>
42
- <origin citeas=''>
43
- <termref base='IEV' target='xyz'/>
44
- </origin>
45
- <modification>
46
- <p id='_'>with adjustments</p>
47
- </modification>
48
- </termsource>
49
- </term>
50
- <term id="paddy"><preferred><expression><name>paddy</name></expression></preferred>
51
- <admitted><letter-symbol><name>paddy rice</name></letter-symbol>
52
- <field-of-application>in agriculture</field-of-application>
53
- </admitted>
54
- <admitted><expression><name>rough rice</name></expression></admitted>
55
- <deprecates><expression><name>cargo rice</name></expression></deprecates>
56
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
57
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
58
- <ul>
59
- <li>A</li>
60
- </ul>
61
- </termexample>
62
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true">
63
- <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>
64
- </termnote>
65
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
66
- <ul><li>A</li></ul>
67
- <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>
68
- </termnote>
69
- <termsource status="identical">
70
- <origin bibitemid="ISO7301" type="inline" droploc="true" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
71
- <origin bibitemid="ISO7301" type="inline" case="lowercase" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
72
- </termsource></term>
73
- </terms>
74
- </sections>
75
- </iso-standard>
76
- INPUT
77
-
78
- presxml = <<~"PRESXML"
79
- <?xml version='1.0'?>
80
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
81
- <sections>
82
- <terms id="_terms_and_definitions" obligation="normative" displayorder="1"><title depth="1">1.<tab/>Terms and Definitions</title>
83
- <p>For the purposes of this document, the following terms and definitions apply.</p>
84
- <term id="paddy1"><name>1.1.</name><preferred><strong>paddy</strong>, &#x3c;in agriculture, dated&#x3e;</preferred><termsource status="modified">[SOURCE: <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>, modified
87
- &#x2013;
88
- The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</termsource>
89
- <domain>rice</domain>
90
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
91
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true"><name>EXAMPLE 1</name>
92
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
93
- <ul>
94
- <li>A</li>
95
- </ul>
96
- </termexample>
97
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894"><name>EXAMPLE 2</name>
98
- <ul>
99
- <li>A</li>
100
- </ul>
101
- </termexample>
102
- <termsource status="identical">[SOURCE: <origin citeas="">
103
- <termref base="IEV" target="xyz">t1</termref>
104
- </origin>, modified ;
105
- <origin citeas="">
106
- <termref base="IEV" target="xyz"/>
107
- </origin>, modified
108
- &#x2013;
109
- with adjustments]</termsource>
110
- </term>
111
- <term id="paddy"><name>1.2.</name><preferred><strong>paddy</strong></preferred>
112
- <admitted>paddy rice, &#x3c;in agriculture&#x3e;</admitted>
113
- <admitted>rough rice</admitted>
114
- <deprecates>cargo rice</deprecates>
115
- <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
116
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893"><name>EXAMPLE</name>
117
- <ul>
118
- <li>A</li>
119
- </ul>
120
- </termexample>
121
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e" keep-with-next="true" keep-lines-together="true"><name>Note 1 to entry</name>
122
- <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>
123
- </termnote>
124
- <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f"><name>Note 2 to entry</name>
125
- <ul><li>A</li></ul>
126
- <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>
127
- </termnote>
128
- <termsource status="identical">[SOURCE: <origin bibitemid="ISO7301" type="inline" droploc="true" citeas="ISO 7301:2011"><locality type="clause">
129
- <referenceFrom>3.1</referenceFrom>
130
- </locality>ISO 7301:2011, 3.1</origin>
131
- <origin bibitemid="ISO7301" type="inline" case="lowercase" citeas="ISO 7301:2011"><locality type="clause">
132
- <referenceFrom>3.1</referenceFrom>
133
- </locality>ISO 7301:2011, clause 3.1</origin>]</termsource></term>
134
- </terms>
135
- </sections>
136
- </iso-standard>
137
- PRESXML
138
-
139
- html = <<~"OUTPUT"
140
- #{HTML_HDR}
141
- <p class="zzSTDTitle1"/>
142
- <div id="_terms_and_definitions"><h1>1.&#160; Terms and Definitions</h1><p>For the purposes of this document, the following terms and definitions apply.</p><p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy</b>, &lt;in agriculture, dated&gt;</p><p>[SOURCE: ISO 7301:2011, Clause 3.1, modified
143
- &#8211;
144
- The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
145
-
146
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
147
- <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>
148
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
149
- <ul>
150
- <li>A</li>
151
- </ul>
152
- </div>
153
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
154
- <ul>
155
- <li>A</li>
156
- </ul>
157
- </div>
158
- <p>[SOURCE: t1, modified ;
159
- Termbase IEV, term ID xyz, modified
160
- &#8211;
161
- with adjustments]</p>
162
- <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
163
- <p class="AltTerms" style="text-align:left;">paddy rice, &lt;in agriculture&gt;</p>
164
- <p class="AltTerms" style="text-align:left;">rough rice</p>
165
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
166
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
167
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
168
- <ul>
169
- <li>A</li>
170
- </ul>
171
- </div>
172
- <div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note" style="page-break-after: avoid;page-break-inside: avoid;"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
173
- <div id="_671a1994-4783-40d0-bc81-987d06ffb74f" class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><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></p></div>
174
- <p>[SOURCE: ISO 7301:2011, 3.1
175
- ISO 7301:2011, clause 3.1]</p></div>
176
- </div>
177
- </body>
178
- </html>
179
- OUTPUT
180
-
181
- word = <<~"WORD"
182
- #{WORD_HDR}
183
- <p class="zzSTDTitle1"/>
184
- <div id="_terms_and_definitions"><h1>1.<span style="mso-tab-count:1">&#160; </span>Terms and Definitions</h1><p>For the purposes of this document, the following terms and definitions apply.</p><p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;"><b>paddy</b>, &lt;in agriculture, dated&gt;</p><p>[SOURCE: ISO 7301:2011, Clause 3.1, modified
185
- &#8211;
186
- The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
187
-
188
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">&lt;rice&gt; rice retaining its husk after threshing</p>
189
- <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>
190
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
191
- <ul>
192
- <li>A</li>
193
- </ul>
194
- </div>
195
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
196
- <ul>
197
- <li>A</li>
198
- </ul>
199
- </div>
200
- <p>[SOURCE: t1, modified ;
201
- Termbase IEV, term ID xyz, modified
202
- &#8211;
203
- with adjustments]</p>
204
- <p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;"><b>paddy</b></p>
205
- <p class="AltTerms" style="text-align:left;">paddy rice, &lt;in agriculture&gt;</p>
206
- <p class="AltTerms" style="text-align:left;">rough rice</p>
207
- <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
208
- <p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
209
- <div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
210
- <ul>
211
- <li>A</li>
212
- </ul>
213
- </div>
214
- <div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note" style="page-break-after: avoid;page-break-inside: avoid;"><p class="Note">Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
215
- <div id="_671a1994-4783-40d0-bc81-987d06ffb74f" class="Note"><p class="Note">Note 2 to entry: <ul><li>A</li></ul><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></p></div>
216
- <p>[SOURCE: ISO 7301:2011, 3.1
217
- ISO 7301:2011, clause 3.1]</p></div>
218
- </div>
219
- </body>
220
- </html>
221
- WORD
222
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
223
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
224
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
225
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
226
- expect(xmlpp(IsoDoc::WordConvert.new({})
227
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
228
- end
229
-
230
- it "processes IsoXML term with multiple definitions" do
231
- input = <<~"INPUT"
232
- <iso-standard xmlns="http://riboseinc.com/isoxml">
233
- <sections>
234
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
235
- <p>For the purposes of this document, the following terms and definitions apply.</p>
236
- <term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
237
- <domain>rice</domain>
238
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
239
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747e">rice retaining its husk after threshing, mark 2</p>
240
- <termsource status="modified">
241
- <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
242
- <modification>
243
- <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>
244
- </modification>
245
- </termsource>
246
- </verbal-definition>
247
- </definition>
248
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" keep-with-next="true" keep-lines-together="true">
249
- <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
250
- <ul>
251
- <li>A</li>
252
- </ul>
253
- </termexample>
254
- <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
255
- <ul>
256
- <li>A</li>
257
- </ul>
258
- </termexample>
259
- <termsource status='identical'>
260
- <origin citeas=''>
261
- <termref base='IEV' target='xyz'>t1</termref>
262
- </origin>
263
- </termsource>
264
- <termsource status='modified'>
265
- <origin citeas=''>
266
- <termref base='IEV' target='xyz'/>
267
- </origin>
268
- <modification>
269
- <p id='_'>with adjustments</p>
270
- </modification>
271
- </termsource>
272
- </term>
273
- INPUT
274
- presxml = <<~PRESXML
275
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
276
- <sections>
277
- <terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
278
- <title depth='1'>
279
- 1.
280
- <tab/>
281
- Terms and Definitions
282
- </title>
283
- <p>For the purposes of this document, the following terms and definitions apply.</p>
284
- <term id='paddy1'>
285
- <name>1.1.</name>
286
- <preferred><strong>paddy</strong></preferred>
287
- <domain>rice</domain>
288
- <definition>
289
- <ol>
290
- <li>
291
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
292
- </li>
293
- <li>
294
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747e'>rice retaining its husk after threshing, mark 2</p>
295
- <termsource status='modified'>[SOURCE:
296
- <origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
297
- <locality type='clause'>
298
- <referenceFrom>3.1</referenceFrom>
299
- </locality>
300
- ISO 7301:2011, Clause 3.1
301
- </origin>, modified &#x2013;
302
- The term "cargo rice" is shown as deprecated, and Note 1 to
303
- entry is not included here]
304
- </termsource>
305
- </li>
306
- </ol>
307
- </definition>
308
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' keep-with-next='true' keep-lines-together='true'>
309
- <name>EXAMPLE 1</name>
310
- <p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
311
- <ul>
312
- <li>A</li>
313
- </ul>
314
- </termexample>
315
- <termexample id='_bd57bbf1-f948-4bae-b0ce-73c00431f894'>
316
- <name>EXAMPLE 2</name>
317
- <ul>
318
- <li>A</li>
319
- </ul>
320
- </termexample>
321
- <termsource status='identical'>[SOURCE:
322
- <origin citeas=''>
323
- <termref base='IEV' target='xyz'>t1</termref>
324
- </origin>;
325
- <origin citeas=''>
326
- <termref base='IEV' target='xyz'/>
327
- </origin>, modified &#x2013; with adjustments]
328
- </termsource>
329
- </term>
330
- </terms>
331
- </sections>
332
- </iso-standard>
333
- PRESXML
334
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
335
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
336
- end
337
-
338
- it "processes IsoXML term with multiple preferred terms" do
339
- input = <<~"INPUT"
340
- <iso-standard xmlns="http://riboseinc.com/isoxml">
341
- <sections>
342
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
343
- <term id="paddy1">
344
- <preferred><expression><name>paddy</name></expression></preferred>
345
- <preferred><expression><name>muddy rice</name></expression></preferred>
346
- <domain>rice</domain>
347
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
348
- </term>
349
- <term id="paddy2">
350
- <preferred><expression><name language="eng">paddy</name></expression></preferred>
351
- <preferred><expression><name language="eng">muddy rice</name></expression></preferred>
352
- <domain>rice</domain>
353
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747a">rice retaining its husk after threshing</p></verbal-definition></definition>
354
- </term>
355
- <term id="paddy3">
356
- <preferred geographic-area="US"><expression><name>paddy</name></expression></preferred>
357
- <preferred><expression><name>muddy rice</name></expression></preferred>
358
- <domain>rice</domain>
359
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747b">rice retaining its husk after threshing</p></verbal-definition></definition>
360
- </term>
361
- <term id="paddy4">
362
- <preferred><expression language="eng"><name>paddy</name></expression></preferred>
363
- <preferred><expression language="fra"><name>muddy rice</name></expression></preferred>
364
- <domain>rice</domain>
365
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747c">rice retaining its husk after threshing</p></verbal-definition></definition>
366
- </term>
367
- </terms>
368
- </sections>
369
- </iso-standard>
370
- INPUT
371
- presxml = <<~PRESXML
372
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
373
- <sections>
374
- <terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
375
- <title depth='1'>
376
- 1.
377
- <tab/>
378
- Terms and Definitions
379
- </title>
380
- <term id='paddy1'>
381
- <name>1.1.</name>
382
- <preferred><strong>paddy; muddy rice</strong></preferred>
383
- <domain>rice</domain>
384
- <definition>
385
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
386
- </definition>
387
- </term>
388
- <term id='paddy2'>
389
- <name>1.2.</name>
390
- <preferred>
391
- <strong>paddy; muddy rice</strong>
392
- </preferred>
393
- <domain>rice</domain>
394
- <definition>
395
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747a'>rice retaining its husk after threshing</p>
396
- </definition>
397
- </term>
398
- <term id='paddy3'>
399
- <name>1.3.</name>
400
- <preferred geographic-area="US">
401
- <strong>paddy</strong>, US
402
- </preferred>
403
- <preferred>
404
- <strong>muddy rice</strong>
405
- </preferred>
406
- <domain>rice</domain>
407
- <definition>
408
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747b'>rice retaining its husk after threshing</p>
409
- </definition>
410
- </term>
411
- <term id='paddy4'>
412
- <name>1.4.</name>
413
- <preferred>
414
- <strong>paddy</strong>, eng
415
- </preferred>
416
- <preferred>
417
- <strong>muddy rice</strong>, fra
418
- </preferred>
419
- <domain>rice</domain>
420
- <definition>
421
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747c'>rice retaining its husk after threshing</p>
422
- </definition>
423
- </term>
424
- </terms>
425
- </sections>
426
- </iso-standard>
427
- PRESXML
428
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
429
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
430
- end
431
-
432
- it "processes IsoXML term with grammatical information" do
433
- input = <<~"INPUT"
434
- <iso-standard xmlns="http://riboseinc.com/isoxml">
435
- <sections>
436
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
437
- <term id="paddy1">
438
- <preferred geographic-area="US"><expression language="en" script="Latn"><name>paddy</name>
439
- <pronunciation>pædiː</pronunciation>
440
- <grammar>
441
- <gender>masculine</gender>
442
- <gender>feminine</gender>
443
- <number>singular</number>
444
- <isPreposition>false</isPreposition>
445
- <isNoun>true</isNoun>
446
- <grammar-value>irregular declension</grammar-value>
447
- </grammar>
448
- </expression></preferred>
449
- <preferred><expression><name>muddy rice</name>
450
- <grammar>
451
- <gender>neuter</gender>
452
- <isNoun>true</isNoun>
453
- <grammar-value>irregular declension</grammar-value>
454
- </grammar>
455
- </expression></preferred>
456
- <domain>rice</domain>
457
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
458
- </term>
459
- </terms>
460
- </sections>
461
- </iso-standard>
462
- INPUT
463
- presxml = <<~PRESXML
464
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
465
- <sections>
466
- <terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
467
- <title depth='1'>
468
- 1.
469
- <tab/>
470
- Terms and Definitions
471
- </title>
472
- <term id='paddy1'>
473
- <name>1.1.</name>
474
- <preferred geographic-area='US'><strong>paddy</strong>, m, f, sg, noun, en Latn US, /p&#xE6;di&#x2D0;/</preferred>
475
- <preferred><strong>muddy rice</strong>, n, noun</preferred>
476
- <domain>rice</domain>
477
- <definition>
478
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
479
- </definition>
480
- </term>
481
- </terms>
482
- </sections>
483
- </iso-standard>
484
- PRESXML
485
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
486
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
487
- end
488
-
489
- it "processes IsoXML term with empty or graphical designations" do
490
- input = <<~"INPUT"
491
- <iso-standard xmlns="http://riboseinc.com/isoxml">
492
- <sections>
493
- <terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
494
- <term id="paddy1">
495
- <preferred><expression><name/></expression></preferred>
496
- <preferred isInternational='true'><graphical-symbol><figure id='_'><pre id='_'>&lt;LITERAL&gt; FIGURATIVE</pre></figure>
497
- </graphical-symbol>
498
- </preferred>
499
- <domain>rice</domain>
500
- <definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
501
- </term>
502
- </terms>
503
- </sections>
504
- </iso-standard>
505
- INPUT
506
- presxml = <<~PRESXML
507
- <?xml version='1.0'?>
508
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
509
- <sections>
510
- <terms id='_terms_and_definitions' obligation='normative' displayorder='1'>
511
- <title depth='1'>1.<tab/>Terms and Definitions</title>
512
- <term id='paddy1'>
513
- <name>1.1.</name>
514
- <preferred><strong/></preferred>
515
- <preferred isInternational='true'><figure id='_'>
516
- <name>Figure 1</name>
517
- <pre id='_'>&#x3c;LITERAL&#x3e; FIGURATIVE</pre>
518
- </figure>
519
- </preferred>
520
- <domain>rice</domain>
521
- <definition>
522
- <p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
523
- </definition>
524
- </term>
525
- </terms>
526
- </sections>
527
- </iso-standard>
528
- PRESXML
529
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
530
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
531
- end
532
-
533
- it "processes IsoXML term with nonverbal definitions" do
534
- input = <<~"INPUT"
535
- <iso-standard xmlns="http://riboseinc.com/isoxml">
536
- <sections>
537
- <terms id='A' obligation='normative'>
538
- <title>Terms and definitions</title>
539
- <p id='B'>For the purposes of this document, the following terms and definitions apply.</p>
540
- <term id='term-term'>
541
- <preferred>
542
- <expression>
543
- <name>Term</name>
544
- </expression>
545
- </preferred>
546
- <definition>
547
- <verbal-definition>
548
- <p id='C'>Definition</p>
549
- <termsource status='identical' type='authoritative'>
550
- <origin bibitemid='ISO2191' type='inline' citeas=''>
551
- <localityStack>
552
- <locality type='section'>
553
- <referenceFrom>1</referenceFrom>
554
- </locality>
555
- </localityStack>
556
- </origin>
557
- </termsource>
558
- </verbal-definition>
559
- <non-verbal-representation>
560
- <table id='D'>
561
- <thead>
562
- <tr>
563
- <th valign='top' align='left'>A</th>
564
- <th valign='top' align='left'>B</th>
565
- </tr>
566
- </thead>
567
- <tbody>
568
- <tr>
569
- <td valign='top' align='left'>C</td>
570
- <td valign='top' align='left'>D</td>
571
- </tr>
572
- </tbody>
573
- </table>
574
- </non-verbal-representation>
575
- </definition>
576
- <termsource status='identical' type='authoritative'>
577
- <origin bibitemid='ISO2191' type='inline' citeas=''>
578
- <localityStack>
579
- <locality type='section'>
580
- <referenceFrom>2</referenceFrom>
581
- </locality>
582
- </localityStack>
583
- </origin>
584
- </termsource>
585
- </term>
586
- <term id='term-term-2'>
587
- <preferred>
588
- <expression>
589
- <name>Term 2</name>
590
- </expression>
591
- </preferred>
592
- <definition>
593
- <non-verbal-representation>
594
- <figure id='E'>
595
- <pre id='F'>Literal</pre>
596
- </figure>
597
- <formula id='G'>
598
- <stem type='MathML'>
599
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
600
- <mi>x</mi>
601
- <mo>=</mo>
602
- <mi>y</mi>
603
- </math>
604
- </stem>
605
- </formula>
606
- <termsource status='identical' type='authoritative'>
607
- <origin bibitemid='ISO2191' type='inline' citeas=''>
608
- <localityStack>
609
- <locality type='section'>
610
- <referenceFrom>3</referenceFrom>
611
- </locality>
612
- </localityStack>
613
- </origin>
614
- </termsource>
615
- </non-verbal-representation>
616
- </definition>
617
- </term>
618
- </terms>
619
- </sections>
620
- </iso-standard>
621
- INPUT
622
- presxml = <<~PRESXML
623
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
624
- <sections>
625
- <terms id='A' obligation='normative' displayorder='1'>
626
- <title depth='1'>
627
- 1.
628
- <tab/>
629
- Terms and definitions
630
- </title>
631
- <p id='B'>For the purposes of this document, the following terms and definitions apply.</p>
632
- <term id='term-term'>
633
- <name>1.1.</name>
634
- <preferred><strong>Term</strong></preferred>
635
- <definition>
636
- <p id='C'>Definition</p>
637
- <termsource status='identical' type='authoritative'>[SOURCE:
638
- <origin bibitemid='ISO2191' type='inline' citeas=''>
639
- <localityStack>
640
- <locality type='section'>
641
- <referenceFrom>1</referenceFrom>
642
- </locality>
643
- </localityStack>
644
- , Section 1
645
- </origin>]
646
- </termsource>
647
- <table id='D'>
648
- <name>Table 1</name>
649
- <thead>
650
- <tr>
651
- <th valign='top' align='left'>A</th>
652
- <th valign='top' align='left'>B</th>
653
- </tr>
654
- </thead>
655
- <tbody>
656
- <tr>
657
- <td valign='top' align='left'>C</td>
658
- <td valign='top' align='left'>D</td>
659
- </tr>
660
- </tbody>
661
- </table>
662
- </definition>
663
- <termsource status='identical' type='authoritative'>[SOURCE:
664
- <origin bibitemid='ISO2191' type='inline' citeas=''>
665
- <localityStack>
666
- <locality type='section'>
667
- <referenceFrom>2</referenceFrom>
668
- </locality>
669
- </localityStack>
670
- , Section 2
671
- </origin>]
672
- </termsource>
673
- </term>
674
- <term id='term-term-2'>
675
- <name>1.2.</name>
676
- <preferred><strong>Term 2</strong></preferred>
677
- <definition>
678
- <figure id='E'>
679
- <name>Figure 1</name>
680
- <pre id='F'>Literal</pre>
681
- </figure>
682
- <formula id='G'>
683
- <name>1</name>
684
- <stem type='MathML'>
685
- <math xmlns='http://www.w3.org/1998/Math/MathML'>
686
- <mi>x</mi>
687
- <mo>=</mo>
688
- <mi>y</mi>
689
- </math>
690
- <!-- x = y -->
691
- </stem>
692
- </formula>
693
- <termsource status='identical' type='authoritative'>[SOURCE:
694
- <origin bibitemid='ISO2191' type='inline' citeas=''>
695
- <localityStack>
696
- <locality type='section'>
697
- <referenceFrom>3</referenceFrom>
698
- </locality>
699
- </localityStack>
700
- , Section 3
701
- </origin>]
702
- </termsource>
703
- </definition>
704
- </term>
705
- </terms>
706
- </sections>
707
- </iso-standard>
708
- PRESXML
709
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
710
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
711
- end
712
- end