isodoc 1.6.7 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/isodoc.gemspec +1 -1
  3. data/lib/isodoc-yaml/i18n-ar.yaml +19 -25
  4. data/lib/isodoc-yaml/i18n-de.yaml +1 -0
  5. data/lib/isodoc-yaml/i18n-en.yaml +1 -0
  6. data/lib/isodoc-yaml/i18n-es.yaml +1 -0
  7. data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
  8. data/lib/isodoc-yaml/i18n-ru.yaml +1 -0
  9. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  10. data/lib/isodoc.rb +1 -0
  11. data/lib/isodoc/convert.rb +1 -1
  12. data/lib/isodoc/function/blocks.rb +180 -168
  13. data/lib/isodoc/function/form.rb +39 -36
  14. data/lib/isodoc/function/inline.rb +5 -1
  15. data/lib/isodoc/function/references.rb +1 -1
  16. data/lib/isodoc/function/to_word_html.rb +206 -204
  17. data/lib/isodoc/html_convert.rb +0 -4
  18. data/lib/isodoc/html_function/form.rb +48 -45
  19. data/lib/isodoc/html_function/html.rb +2 -0
  20. data/lib/isodoc/html_function/postprocess.rb +9 -4
  21. data/lib/isodoc/presentation_function/block.rb +7 -4
  22. data/lib/isodoc/presentation_function/inline.rb +29 -12
  23. data/lib/isodoc/presentation_function/section.rb +1 -2
  24. data/lib/isodoc/presentation_xml_convert.rb +2 -2
  25. data/lib/isodoc/version.rb +1 -1
  26. data/lib/isodoc/xref.rb +8 -7
  27. data/lib/isodoc/xref/xref_anchor.rb +45 -44
  28. data/lib/isodoc/xref/xref_counter.rb +113 -103
  29. data/lib/isodoc/xref/xref_gen.rb +39 -11
  30. data/lib/metanorma/output.rb +7 -0
  31. data/lib/metanorma/output/base.rb +13 -0
  32. data/lib/metanorma/output/utils.rb +17 -0
  33. data/lib/metanorma/output/xslfo.rb +21 -0
  34. data/spec/assets/outputtest/a.xml +66 -0
  35. data/spec/assets/outputtest/iso.international-standard.xsl +3011 -0
  36. data/spec/isodoc/blocks_spec.rb +327 -243
  37. data/spec/isodoc/form_spec.rb +94 -90
  38. data/spec/isodoc/inline_spec.rb +431 -234
  39. data/spec/isodoc/postproc_spec.rb +68 -25
  40. data/spec/isodoc/terms_spec.rb +2 -2
  41. data/spec/isodoc/xref_spec.rb +274 -652
  42. metadata +8 -18
  43. data/lib/isodoc/html_function/sectionsplit.rb +0 -230
  44. data/spec/isodoc/sectionsplit_spec.rb +0 -190
@@ -344,6 +344,62 @@ RSpec.describe IsoDoc do
344
344
  expect(word).to match(%r{Anta&#x16D;parolo</h1>})
345
345
  end
346
346
 
347
+ it "cleans up HTML output preface placeholder paragraphs" do
348
+ FileUtils.rm_f "test.doc"
349
+ FileUtils.rm_f "test.html"
350
+ IsoDoc::HtmlConvert.new(
351
+ { bodyfont: "Zapf",
352
+ monospacefont: "Consolas",
353
+ headerfont: "Comic Sans",
354
+ normalfontsize: "30pt",
355
+ monospacefontsize: "29pt",
356
+ smallerfontsize: "28pt",
357
+ footnotefontsize: "27pt",
358
+ htmlstylesheet: "spec/assets/html.scss",
359
+ htmlstylesheet_override: "spec/assets/html_override.css",
360
+ htmlcoverpage: "spec/assets/htmlcover.html",
361
+ htmlintropage: "spec/assets/htmlintro.html",
362
+ scripts: "spec/assets/scripts.html",
363
+ scripts_override: "spec/assets/scripts_override.html",
364
+ i18nyaml: "spec/assets/i18n.yaml",
365
+ ulstyle: "l1",
366
+ olstyle: "l2" },
367
+ ).convert("test", <<~"INPUT", false)
368
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
369
+ <preface><foreword>
370
+ <note>
371
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
372
+ </note>
373
+ </foreword></preface>
374
+ </iso-standard>
375
+ INPUT
376
+ html = Nokogiri::XML(File.read("test.html")).at("//body")
377
+ html.xpath("//script").each(&:remove)
378
+ expect(html.to_xml).to be_equivalent_to <<~OUTPUT
379
+ <body lang="en" xml:lang="en">
380
+ <div class="title-section">
381
+ /* an empty html cover page */
382
+ </div>
383
+ <br/>
384
+ <div class="prefatory-section">
385
+ /* an empty html intro page */
386
+ <ul id="toc-list"/>
387
+ </div>
388
+ <br/>
389
+ <main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
390
+ <br/>
391
+ <div>
392
+ <h1 class="ForewordTitle">Anta&#x16D;parolo</h1>
393
+ <div class="Note">
394
+ <p>&#xA0; These results are based on a study carried out on three different types of kernel.</p>
395
+ </div>
396
+ </div>
397
+ <p class="zzSTDTitle1"/>
398
+ </main>
399
+ </body>
400
+ OUTPUT
401
+ end
402
+
347
403
  it "converts definition lists to tables for Word" do
348
404
  FileUtils.rm_f "test.doc"
349
405
  FileUtils.rm_f "test.html"
@@ -1277,17 +1333,17 @@ RSpec.describe IsoDoc do
1277
1333
  it "does not lose HTML escapes in postprocessing" do
1278
1334
  FileUtils.rm_f "test.doc"
1279
1335
  FileUtils.rm_f "test.html"
1280
- IsoDoc::HtmlConvert.new(options)
1281
- .convert("test", <<~"INPUT", false)
1282
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1283
- <preface><foreword>
1284
- <sourcecode id="samplecode">
1285
- <name>XML code</name>
1286
- &lt;xml&gt; &amp;
1287
- </sourcecode>
1288
- </foreword></preface>
1289
- </iso-standard>
1290
- INPUT
1336
+ input = <<~INPUT
1337
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1338
+ <preface><foreword>
1339
+ <sourcecode id="samplecode">
1340
+ <name>XML code</name>
1341
+ &lt;xml&gt; &amp;
1342
+ </sourcecode>
1343
+ </foreword></preface>
1344
+ </iso-standard>
1345
+ INPUT
1346
+ IsoDoc::HtmlConvert.new(options).convert("test", input, false)
1291
1347
  html = File.read("test.html")
1292
1348
  .sub(/^.*<main class="main-section">/m, '<main class="main-section">')
1293
1349
  .sub(%r{</main>.*$}m, "</main>")
@@ -1303,22 +1359,10 @@ RSpec.describe IsoDoc do
1303
1359
  <p class="zzSTDTitle1"></p>
1304
1360
  </main>
1305
1361
  OUTPUT
1306
- end
1307
1362
 
1308
- it "does not lose HTML escapes in postprocessing (Word)" do
1309
1363
  FileUtils.rm_f "test.doc"
1310
1364
  FileUtils.rm_f "test.html"
1311
- IsoDoc::WordConvert.new(options)
1312
- .convert("test", <<~"INPUT", false)
1313
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1314
- <preface><foreword>
1315
- <sourcecode id="samplecode">
1316
- <name>XML code</name>
1317
- &lt;xml&gt; &amp;
1318
- </sourcecode>
1319
- </foreword></preface>
1320
- </iso-standard>
1321
- INPUT
1365
+ IsoDoc::WordConvert.new(options).convert("test", input, false)
1322
1366
  word = File.read("test.doc")
1323
1367
  .sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
1324
1368
  .sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
@@ -2227,7 +2271,6 @@ RSpec.describe IsoDoc do
2227
2271
  output = <<~OUTPUT
2228
2272
  <body lang='en' xml:lang='en'>
2229
2273
  <main class='main-section'>
2230
- <button onclick='topFunction()' id='myBtn' title='Go to top'>Top</button>
2231
2274
  <br/>
2232
2275
  <div>
2233
2276
  <h1 class='ForewordTitle'>Foreword</h1>
@@ -189,7 +189,7 @@ RSpec.describe IsoDoc do
189
189
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
190
190
  [MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
191
191
  [/TERMREF]</p>
192
- <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
192
+ <p>[TERMREF] t1 [/TERMREF]</p>
193
193
  <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
194
194
  <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>
195
195
  <p class="AltTerms" style="text-align:left;">rough rice</p>
@@ -233,7 +233,7 @@ RSpec.describe IsoDoc do
233
233
  <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
234
234
  [MODIFICATION] The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
235
235
  [/TERMREF]</p>
236
- <p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
236
+ <p>[TERMREF] t1 [/TERMREF]</p>
237
237
  <p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
238
238
  <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>
239
239
  <p class="AltTerms" style="text-align:left;">rough rice</p>
@@ -2213,110 +2213,23 @@ RSpec.describe IsoDoc do
2213
2213
  </iso-standard>
2214
2214
  INPUT
2215
2215
  output = <<~OUTPUT
2216
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2217
- <preface>
2218
- <foreword displayorder='1'>
2219
- <p>
2220
- <xref target='N1'>Introduction, List</xref>
2221
- <xref target='N2'>Preparatory, List</xref>
2222
- <xref target='N'>Clause 1, List</xref>
2223
- <xref target='note1'>Clause 3.1, List 1</xref>
2224
- <xref target='note2'>Clause 3.1, List 2</xref>
2225
- <xref target='AN'>Annex A.1, List</xref>
2226
- <xref target='Anote1'>Annex A.2, List 1</xref>
2227
- <xref target='Anote2'>Annex A.2, List 2</xref>
2228
- </p>
2229
- </foreword>
2230
- <introduction id='intro' displayorder='2'>
2231
- <ol id='N1'>
2232
- <li>
2233
- <p>A</p>
2234
- </li>
2235
- </ol>
2236
- <clause id='xyz'>
2237
- <title depth='2'>Preparatory</title>
2238
- <ol id='N2'>
2239
- <li>
2240
- <p>A</p>
2241
- </li>
2242
- </ol>
2243
- </clause>
2244
- </introduction>
2245
- </preface>
2246
- <sections>
2247
- <clause id='scope' type='scope' displayorder='3'>
2248
- <title depth='1'>
2249
- 1.
2250
- <tab/>
2251
- Scope
2252
- </title>
2253
- <ol id='N'>
2254
- <li>
2255
- <p>A</p>
2256
- </li>
2257
- </ol>
2258
- </clause>
2259
- <terms id='terms' displayorder='4'>
2260
- <title>2.</title>
2261
- </terms>
2262
- <clause id='widgets' displayorder='5'>
2263
- <title depth='1'>
2264
- 3.
2265
- <tab/>
2266
- Widgets
2267
- </title>
2268
- <clause id='widgets1'>
2269
- <title>3.1.</title>
2270
- <ol id='note1'>
2271
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
2272
- These results are based on a study carried out on three different
2273
- types of kernel.
2274
- </p>
2275
- </ol>
2276
- <ol id='note2'>
2277
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
2278
- These results are based on a study carried out on three different
2279
- types of kernel.
2280
- </p>
2281
- </ol>
2282
- </clause>
2283
- </clause>
2284
- </sections>
2285
- <annex id='annex1' displayorder='6'>
2286
- <title>
2287
- <strong>Annex A</strong>
2288
- <br/>
2289
- (informative)
2290
- </title>
2291
- <clause id='annex1a'>
2292
- <title>A.1.</title>
2293
- <ol id='AN'>
2294
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
2295
- These results are based on a study carried out on three different
2296
- types of kernel.
2297
- </p>
2298
- </ol>
2299
- </clause>
2300
- <clause id='annex1b'>
2301
- <title>A.2.</title>
2302
- <ol id='Anote1'>
2303
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
2304
- These results are based on a study carried out on three different
2305
- types of kernel.
2306
- </p>
2307
- </ol>
2308
- <ol id='Anote2'>
2309
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
2310
- These results are based on a study carried out on three different
2311
- types of kernel.
2312
- </p>
2313
- </ol>
2314
- </clause>
2315
- </annex>
2316
- </iso-standard>
2216
+ <foreword displayorder='1'>
2217
+ <p>
2218
+ <xref target='N1'>Introduction, List</xref>
2219
+ <xref target='N2'>Preparatory, List</xref>
2220
+ <xref target='N'>Clause 1, List</xref>
2221
+ <xref target='note1'>Clause 3.1, List 1</xref>
2222
+ <xref target='note2'>Clause 3.1, List 2</xref>
2223
+ <xref target='AN'>Annex A.1, List</xref>
2224
+ <xref target='Anote1'>Annex A.2, List 1</xref>
2225
+ <xref target='Anote2'>Annex A.2, List 2</xref>
2226
+ </p>
2227
+ </foreword>
2317
2228
  OUTPUT
2318
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2319
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2229
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2230
+ .convert("test", input, true))
2231
+ .at("//xmlns:foreword").to_xml))
2232
+ .to be_equivalent_to xmlpp(output)
2320
2233
  end
2321
2234
 
2322
2235
  it "cross-references list items" do
@@ -2382,105 +2295,23 @@ RSpec.describe IsoDoc do
2382
2295
  </iso-standard>
2383
2296
  INPUT
2384
2297
  output = <<~OUTPUT
2385
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2386
- <preface>
2387
- <foreword displayorder='1'>
2388
- <p>
2389
- <xref target='N1'>Introduction, a)</xref>
2390
- <xref target='N2'>Preparatory, 1)</xref>
2391
- <xref target='N'>Clause 1, i)</xref>
2392
- <xref target='note1'>Clause 3.1, List 1 a)</xref>
2393
- <xref target='note2'>Clause 3.1, List 2 I)</xref>
2394
- <xref target='AN'>Annex A.1, A)</xref>
2395
- <xref target='Anote1'>Annex A.2, List 1 iv)</xref>
2396
- <xref target='Anote2'>Annex A.2, List 2 a)</xref>
2397
- </p>
2398
- </foreword>
2399
- <introduction id='intro' displayorder='2'>
2400
- <ol id='N01'>
2401
- <li id='N1'>
2402
- <p>A</p>
2403
- </li>
2404
- </ol>
2405
- <clause id='xyz'>
2406
- <title depth='2'>Preparatory</title>
2407
- <ol id='N02' type='arabic'>
2408
- <li id='N2'>
2409
- <p>A</p>
2410
- </li>
2411
- </ol>
2412
- </clause>
2413
- </introduction>
2414
- </preface>
2415
- <sections>
2416
- <clause id='scope' type='scope' displayorder='3'>
2417
- <title depth='1'>
2418
- 1.
2419
- <tab/>
2420
- Scope
2421
- </title>
2422
- <ol id='N0' type='roman'>
2423
- <li id='N'>
2424
- <p>A</p>
2425
- </li>
2426
- </ol>
2427
- </clause>
2428
- <terms id='terms' displayorder='4'>
2429
- <title>2.</title>
2430
- </terms>
2431
- <clause id='widgets' displayorder='5'>
2432
- <title depth='1'>
2433
- 3.
2434
- <tab/>
2435
- Widgets
2436
- </title>
2437
- <clause id='widgets1'>
2438
- <title>3.1.</title>
2439
- <ol id='note1l' type='alphabet'>
2440
- <li id='note1'>
2441
- <p>A</p>
2442
- </li>
2443
- </ol>
2444
- <ol id='note2l' type='roman_upper'>
2445
- <li id='note2'>
2446
- <p>A</p>
2447
- </li>
2448
- </ol>
2449
- </clause>
2450
- </clause>
2451
- </sections>
2452
- <annex id='annex1' displayorder='6'>
2453
- <title>
2454
- <strong>Annex A</strong>
2455
- <br/>
2456
- (informative)
2457
- </title>
2458
- <clause id='annex1a'>
2459
- <title>A.1.</title>
2460
- <ol id='ANl' type='alphabet_upper'>
2461
- <li id='AN'>
2462
- <p>A</p>
2463
- </li>
2464
- </ol>
2465
- </clause>
2466
- <clause id='annex1b'>
2467
- <title>A.2.</title>
2468
- <ol id='Anote1l' type='roman' start='4'>
2469
- <li id='Anote1'>
2470
- <p>A</p>
2471
- </li>
2472
- </ol>
2473
- <ol id='Anote2l'>
2474
- <li id='Anote2'>
2475
- <p>A</p>
2476
- </li>
2477
- </ol>
2478
- </clause>
2479
- </annex>
2480
- </iso-standard>
2298
+ <foreword displayorder='1'>
2299
+ <p>
2300
+ <xref target='N1'>Introduction, a)</xref>
2301
+ <xref target='N2'>Preparatory, 1)</xref>
2302
+ <xref target='N'>Clause 1, i)</xref>
2303
+ <xref target='note1'>Clause 3.1, List 1 a)</xref>
2304
+ <xref target='note2'>Clause 3.1, List 2 I)</xref>
2305
+ <xref target='AN'>Annex A.1, A)</xref>
2306
+ <xref target='Anote1'>Annex A.2, List 1 iv)</xref>
2307
+ <xref target='Anote2'>Annex A.2, List 2 a)</xref>
2308
+ </p>
2309
+ </foreword>
2481
2310
  OUTPUT
2482
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2483
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2311
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2312
+ .convert("test", input, true))
2313
+ .at("//xmlns:foreword").to_xml))
2314
+ .to be_equivalent_to xmlpp(output)
2484
2315
  end
2485
2316
 
2486
2317
  it "cross-references nested list items" do
@@ -2523,65 +2354,187 @@ RSpec.describe IsoDoc do
2523
2354
  </iso-standard>
2524
2355
  INPUT
2525
2356
  output = <<~OUTPUT
2526
- <?xml version='1.0'?>
2527
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2528
- <preface>
2529
- <foreword displayorder="1">
2530
- <p>
2531
- <xref target='N'>Clause 1, a)</xref>
2532
- <xref target='note1'>Clause 1, a.1)</xref>
2533
- <xref target='note2'>Clause 1, a.1.i)</xref>
2534
- <xref target='AN'>Clause 1, a.1.i.A)</xref>
2535
- <xref target='Anote1'>Clause 1, a.1.i.A.I)</xref>
2536
- <xref target='Anote2'>Clause 1, a.1.i.A.I.a)</xref>
2537
- </p>
2357
+ <foreword displayorder="1">
2358
+ <p>
2359
+ <xref target='N'>Clause 1, a)</xref>
2360
+ <xref target='note1'>Clause 1, a.1)</xref>
2361
+ <xref target='note2'>Clause 1, a.1.i)</xref>
2362
+ <xref target='AN'>Clause 1, a.1.i.A)</xref>
2363
+ <xref target='Anote1'>Clause 1, a.1.i.A.I)</xref>
2364
+ <xref target='Anote2'>Clause 1, a.1.i.A.I.a)</xref>
2365
+ </p>
2366
+ </foreword>
2367
+ OUTPUT
2368
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2369
+ .convert("test", input, true))
2370
+ .at("//xmlns:foreword").to_xml))
2371
+ .to be_equivalent_to xmlpp(output)
2372
+ end
2373
+
2374
+ it "cross-references definition lists" do
2375
+ input = <<~INPUT
2376
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2377
+ <preface>
2378
+ <foreword>
2379
+ <p>
2380
+ <xref target="N1"/>
2381
+ <xref target="N2"/>
2382
+ <xref target="N"/>
2383
+ <xref target="note1"/>
2384
+ <xref target="note2"/>
2385
+ <xref target="AN"/>
2386
+ <xref target="Anote1"/>
2387
+ <xref target="Anote2"/>
2388
+ </p>
2538
2389
  </foreword>
2539
- </preface>
2540
- <sections>
2541
- <clause id='scope' type="scope" displayorder="2">
2542
- <title depth='1'>
2543
- 1.
2544
- <tab/>
2545
- Scope
2546
- </title>
2547
- <ol id='N1'>
2548
- <li id='N'>
2549
- <p>A</p>
2550
- <ol>
2551
- <li id='note1'>
2552
- <p>A</p>
2553
- <ol>
2554
- <li id='note2'>
2555
- <p>A</p>
2556
- <ol>
2557
- <li id='AN'>
2558
- <p>A</p>
2559
- <ol>
2560
- <li id='Anote1'>
2561
- <p>A</p>
2562
- <ol>
2563
- <li id='Anote2'>
2564
- <p>A</p>
2565
- </li>
2566
- </ol>
2567
- </li>
2568
- </ol>
2569
- </li>
2570
- </ol>
2571
- </li>
2572
- </ol>
2573
- </li>
2574
- </ol>
2575
- </li>
2576
- </ol>
2390
+ <introduction id="intro">
2391
+ <dl id="N1">
2392
+ <li><p>A</p></li>
2393
+ </dl>
2394
+ <clause id="xyz"><title>Preparatory</title>
2395
+ <dl id="N2">
2396
+ <li><p>A</p></li>
2397
+ </dl>
2398
+ </clause>
2399
+ </introduction>
2400
+ </preface>
2401
+ <sections>
2402
+ <clause id="scope" type="scope"><title>Scope</title>
2403
+ <dl id="N">
2404
+ <li><p>A</p></li>
2405
+ </dl>
2577
2406
  </clause>
2578
- </sections>
2579
- </iso-standard>
2407
+ <terms id="terms"/>
2408
+ <clause id="widgets"><title>Widgets</title>
2409
+ <clause id="widgets1">
2410
+ <dl id="note1">
2411
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
2412
+ </dl>
2413
+ <dl id="note2">
2414
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
2415
+ </dl>
2416
+ </clause>
2417
+ </clause>
2418
+ </sections>
2419
+ <annex id="annex1">
2420
+ <clause id="annex1a">
2421
+ <dl id="AN">
2422
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
2423
+ </dl>
2424
+ </clause>
2425
+ <clause id="annex1b">
2426
+ <dl id="Anote1">
2427
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
2428
+ </dl>
2429
+ <dl id="Anote2">
2430
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
2431
+ </dl>
2432
+ </clause>
2433
+ </annex>
2434
+ </iso-standard>
2435
+ INPUT
2436
+ output = <<~OUTPUT
2437
+ <foreword displayorder='1'>
2438
+ <p>
2439
+ <xref target='N1'>Introduction, Definition List</xref>
2440
+ <xref target='N2'>Preparatory, Definition List</xref>
2441
+ <xref target='N'>Clause 1, Definition List</xref>
2442
+ <xref target='note1'>Clause 3.1, Definition List 1</xref>
2443
+ <xref target='note2'>Clause 3.1, Definition List 2</xref>
2444
+ <xref target='AN'>Annex A.1, Definition List</xref>
2445
+ <xref target='Anote1'>Annex A.2, Definition List 1</xref>
2446
+ <xref target='Anote2'>Annex A.2, Definition List 2</xref>
2447
+ </p>
2448
+ </foreword>
2580
2449
  OUTPUT
2581
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2582
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2450
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2451
+ .convert("test", input, true))
2452
+ .at("//xmlns:foreword").to_xml))
2453
+ .to be_equivalent_to xmlpp(output)
2583
2454
  end
2584
2455
 
2456
+ it "cross-references definition list terms" do
2457
+ input = <<~INPUT
2458
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2459
+ <preface>
2460
+ <foreword>
2461
+ <p>
2462
+ <xref target="N1"/>
2463
+ <xref target="N2"/>
2464
+ <xref target="N"/>
2465
+ <xref target="note1"/>
2466
+ <xref target="note2"/>
2467
+ <xref target="AN"/>
2468
+ <xref target="Anote1"/>
2469
+ <xref target="Anote2"/>
2470
+ </p>
2471
+ </foreword>
2472
+ <introduction id="intro">
2473
+ <dl id="N01">
2474
+ <dt id="N1"><p>A</p></dt>
2475
+ </dl>
2476
+ <clause id="xyz"><title>Preparatory</title>
2477
+ <dl id="N02" type="arabic">
2478
+ <dt id="N2"><p>A</p></dt>
2479
+ </dl>
2480
+ </clause>
2481
+ </introduction>
2482
+ </preface>
2483
+ <sections>
2484
+ <clause id="scope" type="scope"><title>Scope</title>
2485
+ <dl id="N0" type="roman">
2486
+ <dt id="N"><p>A</p></dt>
2487
+ </dl>
2488
+ </clause>
2489
+ <terms id="terms"/>
2490
+ <clause id="widgets"><title>Widgets</title>
2491
+ <clause id="widgets1">
2492
+ <dl id="note1l" type="alphabet">
2493
+ <dt id="note1"><p>A</p></dt>
2494
+ </dl>
2495
+ <dl id="note2l" type="roman_upper">
2496
+ <dt id="note2"><p>A</p></dt>
2497
+ </dl>
2498
+ </clause>
2499
+ </clause>
2500
+ </sections>
2501
+ <annex id="annex1">
2502
+ <clause id="annex1a">
2503
+ <dl id="ANl" type="alphabet_upper">
2504
+ <dt id="AN"><p>A</p></dt>
2505
+ </dl>
2506
+ </clause>
2507
+ <clause id="annex1b">
2508
+ <dl id="Anote1l" type="roman" start="4">
2509
+ <dt id="Anote1"><p>A</p></dt>
2510
+ </dl>
2511
+ <dl id="Anote2l">
2512
+ <dt id="Anote2"><p>A</p></dt>
2513
+ </dl>
2514
+ </clause>
2515
+ </annex>
2516
+ </iso-standard>
2517
+ INPUT
2518
+ output = <<~OUTPUT
2519
+ <foreword displayorder='1'>
2520
+ <p>
2521
+ <xref target='N1'>Introduction, Definition List: A</xref>
2522
+ <xref target='N2'>Preparatory, Definition List: A</xref>
2523
+ <xref target='N'>Clause 1, Definition List: A</xref>
2524
+ <xref target='note1'>Clause 3.1, Definition List 1: A</xref>
2525
+ <xref target='note2'>Clause 3.1, Definition List 2: A</xref>
2526
+ <xref target='AN'>Annex A.1, Definition List: A</xref>
2527
+ <xref target='Anote1'>Annex A.2, Definition List 1: A</xref>
2528
+ <xref target='Anote2'>Annex A.2, Definition List 2: A</xref>
2529
+ </p>
2530
+ </foreword>
2531
+ OUTPUT
2532
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2533
+ .convert("test", input, true))
2534
+ .at("//xmlns:foreword").to_xml))
2535
+ .to be_equivalent_to xmlpp(output)
2536
+ end
2537
+
2585
2538
  it "cross-references bookmarks" do
2586
2539
  input = <<~INPUT
2587
2540
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -2646,94 +2599,23 @@ RSpec.describe IsoDoc do
2646
2599
  </iso-standard>
2647
2600
  INPUT
2648
2601
  output = <<~OUTPUT
2649
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2650
- <preface>
2651
- <foreword displayorder='1'>
2652
- <p>
2653
- <xref target='N1'>Introduction</xref>
2654
- <xref target='N2'>Preparatory</xref>
2655
- <xref target='N'>Clause 1</xref>
2656
- <xref target='note1'>Note 2</xref>
2657
- <xref target='note2'>Clause 3.1</xref>
2658
- <xref target='AN'>Annex A.1</xref>
2659
- <xref target='Anote1'>Figure A.1</xref>
2660
- <xref target='Anote2'>Annex A.2</xref>
2661
- </p>
2662
- </foreword>
2663
- <introduction id='intro' displayorder='2'>
2664
- <p id='N01'>
2665
- <bookmark id='N1'/>
2666
- </p>
2667
- <clause id='xyz'>
2668
- <title depth='2'>Preparatory</title>
2669
- <p id='N02' type='arabic'>
2670
- <bookmark id='N2'/>
2671
- </p>
2672
- </clause>
2673
- </introduction>
2674
- </preface>
2675
- <sections>
2676
- <clause id='scope' type='scope' displayorder='3'>
2677
- <title depth='1'>
2678
- 1.
2679
- <tab/>
2680
- Scope
2681
- </title>
2682
- <p id='N0' type='roman'>
2683
- <bookmark id='N'/>
2684
- </p>
2685
- </clause>
2686
- <terms id='terms' displayorder='4'>
2687
- <title>2.</title>
2688
- </terms>
2689
- <clause id='widgets' displayorder='5'>
2690
- <title depth='1'>
2691
- 3.
2692
- <tab/>
2693
- Widgets
2694
- </title>
2695
- <clause id='widgets1'>
2696
- <title>3.1.</title>
2697
- <note id='note0'>
2698
- <name>NOTE 1</name>
2699
- </note>
2700
- <note id='note1l' type='alphabet'>
2701
- <name>NOTE 2</name>
2702
- <bookmark id='note1'/>
2703
- </note>
2704
- <p id='note2l' type='roman_upper'>
2705
- <bookmark id='note2'/>
2706
- </p>
2707
- </clause>
2708
- </clause>
2709
- </sections>
2710
- <annex id='annex1' displayorder='6'>
2711
- <title>
2712
- <strong>Annex A</strong>
2713
- <br/>
2714
- (informative)
2715
- </title>
2716
- <clause id='annex1a'>
2717
- <title>A.1.</title>
2718
- <p id='ANl' type='alphabet_upper'>
2719
- <bookmark id='AN'/>
2720
- </p>
2721
- </clause>
2722
- <clause id='annex1b'>
2723
- <title>A.2.</title>
2724
- <figure id='Anote1l' type='roman' start='4'>
2725
- <name>Figure A.1</name>
2726
- <bookmark id='Anote1'/>
2727
- </figure>
2728
- <p id='Anote2l'>
2729
- <bookmark id='Anote2'/>
2730
- </p>
2731
- </clause>
2732
- </annex>
2733
- </iso-standard>
2602
+ <foreword displayorder='1'>
2603
+ <p>
2604
+ <xref target='N1'>Introduction</xref>
2605
+ <xref target='N2'>Preparatory</xref>
2606
+ <xref target='N'>Clause 1</xref>
2607
+ <xref target='note1'>Note 2</xref>
2608
+ <xref target='note2'>Clause 3.1</xref>
2609
+ <xref target='AN'>Annex A.1</xref>
2610
+ <xref target='Anote1'>Figure A.1</xref>
2611
+ <xref target='Anote2'>Annex A.2</xref>
2612
+ </p>
2613
+ </foreword>
2734
2614
  OUTPUT
2735
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2736
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2615
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2616
+ .convert("test", input, true))
2617
+ .at("//xmlns:foreword").to_xml))
2618
+ .to be_equivalent_to xmlpp(output)
2737
2619
  end
2738
2620
 
2739
2621
  it "realises subsequences" do
@@ -2781,9 +2663,6 @@ RSpec.describe IsoDoc do
2781
2663
  </iso-standard>
2782
2664
  INPUT
2783
2665
  output = <<~OUTPUT
2784
- <?xml version='1.0'?>
2785
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2786
- <preface>
2787
2666
  <foreword id='fwd' displayorder="1">
2788
2667
  <p>
2789
2668
  <xref target='N1'>Figure 1</xref>
@@ -2796,45 +2675,11 @@ RSpec.describe IsoDoc do
2796
2675
  <xref target='N8'>Figure 5</xref>
2797
2676
  </p>
2798
2677
  </foreword>
2799
- <introduction id='intro' displayorder="2">
2800
- <figure id='N1'>
2801
- <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
2802
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2803
- </figure>
2804
- <figure id='N2' subsequence='A'>
2805
- <name>Figure 2a&#xA0;&#x2014; Split-it-right sample divider</name>
2806
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2807
- </figure>
2808
- <figure id='N3' subsequence='A'>
2809
- <name>Figure 2b&#xA0;&#x2014; Split-it-right sample divider</name>
2810
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2811
- </figure>
2812
- <figure id='N4' subsequence='B'>
2813
- <name>Figure 3a&#xA0;&#x2014; Split-it-right sample divider</name>
2814
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2815
- </figure>
2816
- <figure id='N5' subsequence='B'>
2817
- <name>Figure 3b&#xA0;&#x2014; Split-it-right sample divider</name>
2818
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2819
- </figure>
2820
- <figure id='N6' subsequence='B'>
2821
- <name>Figure 3c&#xA0;&#x2014; Split-it-right sample divider</name>
2822
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2823
- </figure>
2824
- <figure id='N7'>
2825
- <name>Figure 4&#xA0;&#x2014; Split-it-right sample divider</name>
2826
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2827
- </figure>
2828
- <figure id='N8'>
2829
- <name>Figure 5&#xA0;&#x2014; Split-it-right sample divider</name>
2830
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
2831
- </figure>
2832
- </introduction>
2833
- </preface>
2834
- </iso-standard>
2835
2678
  OUTPUT
2836
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2837
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2679
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2680
+ .convert("test", input, true))
2681
+ .at("//xmlns:foreword").to_xml))
2682
+ .to be_equivalent_to xmlpp(output)
2838
2683
  end
2839
2684
 
2840
2685
  it "realises numbering overrides" do
@@ -3004,276 +2849,53 @@ RSpec.describe IsoDoc do
3004
2849
  </iso-standard>
3005
2850
  INPUT
3006
2851
  output = <<~OUTPUT
3007
- <?xml version='1.0'?>
3008
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
3009
- <preface>
3010
- <foreword id='fwd' displayorder='1'>
3011
- <p>
3012
- <xref target='N1'>Figure 1</xref>
3013
- <xref target='N2'>Figure A</xref>
3014
- <xref target='N3'>Figure B</xref>
3015
- <xref target='N4'>Figure 7</xref>
3016
- <xref target='N5'>Figure 8</xref>
3017
- <xref target='N6'>Figure 9a</xref>
3018
- <xref target='N7'>Figure 9c</xref>
3019
- <xref target='N8'>Figure 9d</xref>
3020
- <xref target='N9'>Figure 20f</xref>
3021
- <xref target='N10'>Figure 20g</xref>
3022
- <xref target='N11'>Figure A.1</xref>
3023
- <xref target='N12'>Figure A.2</xref>
3024
- <xref target='N13'>Figure 100</xref>
3025
- </p>
3026
- <p>
3027
- <xref target='S1'>Clause 1bis</xref>
3028
- <xref target='S2'>Clause 2bis</xref>
3029
- <xref target='S3'>Clause 3bis</xref>
3030
- <xref target='S4'>Clause 3bis.4bis</xref>
3031
- <xref target='S12'>Clause 12bis</xref>
3032
- <xref target='S13'>Clause 13bis</xref>
3033
- <xref target='S14'>Clause 13bis.14bis</xref>
3034
- <xref target='S15'>Clause 13bis.14bit</xref>
3035
- <xref target='S16'>Clause 13bis.14biu</xref>
3036
- <xref target='S17'>Clause 13bis.0</xref>
3037
- <xref target='S18'>Clause 13bis.1</xref>
3038
- <xref target='S19'>Clause 13bis.2</xref>
3039
- <xref target='S20'>Clause 13bis.a</xref>
3040
- <xref target='S21'>Clause 13bis.b</xref>
3041
- <xref target='S22'>Clause 13bis.B</xref>
3042
- <xref target='S23'>Clause 13bis.C</xref>
3043
- <xref target='S24'>Clause 16bis</xref>
3044
- <xref target='S25'>Annex A</xref>
3045
- <xref target='S26'>Annex 17bis</xref>
3046
- <xref target='S27'>Annex 17bis.18bis</xref>
3047
- <xref target='S28'>Annex 17bit</xref>
3048
- <xref target='S29'>Bibliography</xref>
3049
- <xref target='S30'>Bibliography Subsection</xref>
3050
- </p>
3051
- </foreword>
3052
- <introduction id='intro' displayorder='2'>
3053
- <figure id='N1'>
3054
- <name>Figure 1&#xA0;&#x2014; Split-it-right sample divider</name>
3055
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3056
- </figure>
3057
- <figure id='N2' number='A'>
3058
- <name>Figure A&#xA0;&#x2014; Split-it-right sample divider</name>
3059
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3060
- </figure>
3061
- <figure id='N3'>
3062
- <name>Figure B&#xA0;&#x2014; Split-it-right sample divider</name>
3063
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3064
- </figure>
3065
- <figure id='N4' number='7'>
3066
- <name>Figure 7&#xA0;&#x2014; Split-it-right sample divider</name>
3067
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3068
- </figure>
3069
- <figure id='N5'>
3070
- <name>Figure 8&#xA0;&#x2014; Split-it-right sample divider</name>
3071
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3072
- </figure>
3073
- <figure id='N6' subsequence='B'>
3074
- <name>Figure 9a&#xA0;&#x2014; Split-it-right sample divider</name>
3075
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3076
- </figure>
3077
- <figure id='N7' subsequence='B' number='c'>
3078
- <name>Figure 9c&#xA0;&#x2014; Split-it-right sample divider</name>
3079
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3080
- </figure>
3081
- <figure id='N8' subsequence='B'>
3082
- <name>Figure 9d&#xA0;&#x2014; Split-it-right sample divider</name>
3083
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3084
- </figure>
3085
- <figure id='N9' subsequence='C' number='20f'>
3086
- <name>Figure 20f&#xA0;&#x2014; Split-it-right sample divider</name>
3087
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3088
- </figure>
3089
- <figure id='N10' subsequence='C'>
3090
- <name>Figure 20g&#xA0;&#x2014; Split-it-right sample divider</name>
3091
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3092
- </figure>
3093
- <figure id='N11' number='A.1'>
3094
- <name>Figure A.1&#xA0;&#x2014; Split-it-right sample divider</name>
3095
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3096
- </figure>
3097
- <figure id='N12'>
3098
- <name>Figure A.2&#xA0;&#x2014; Split-it-right sample divider</name>
3099
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3100
- </figure>
3101
- <figure id='N13' number='100'>
3102
- <name>Figure 100&#xA0;&#x2014; Split-it-right sample divider</name>
3103
- <image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
3104
- </figure>
3105
- </introduction>
3106
- </preface>
3107
- <sections>
3108
- <clause id='S1' number='1bis' type='scope' inline-header='false' obligation='normative' displayorder='3'>
3109
- <title depth='1'>
3110
- 1bis.
3111
- <tab/>
3112
- Scope
3113
- </title>
3114
- <p id='_'>Text</p>
3115
- </clause>
3116
- <terms id='S3' number='3bis' obligation='normative' displayorder='5'>
3117
- <title depth='1'>
3118
- 3bis.
3119
- <tab/>
3120
- Terms and definitions
3121
- </title>
3122
- <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
3123
- <term id='S4' number='4bis'>
3124
- <name>3bis.4bis.</name>
3125
- <preferred>Term1</preferred>
3126
- </term>
3127
- </terms>
3128
- <definitions id='S12' number='12bis' type='abbreviated_terms' obligation='normative' displayorder='6'>
3129
- <title depth='1'>
3130
- 12bis.
3131
- <tab/>
3132
- Abbreviated terms
3133
- </title>
3134
- </definitions>
3135
- <clause id='S13' number='13bis' inline-header='false' obligation='normative' displayorder='7'>
3136
- <title depth='1'>
3137
- 13bis.
3138
- <tab/>
3139
- Clause 4
3140
- </title>
3141
- <clause id='S14' number='14bis' inline-header='false' obligation='normative'>
3142
- <title depth='2'>
3143
- 13bis.14bis.
3144
- <tab/>
3145
- Introduction
3146
- </title>
3147
- </clause>
3148
- <clause id='S15' inline-header='false' obligation='normative'>
3149
- <title depth='2'>
3150
- 13bis.14bit.
3151
- <tab/>
3152
- Clause A
3153
- </title>
3154
- </clause>
3155
- <clause id='S16' inline-header='false' obligation='normative'>
3156
- <title depth='2'>
3157
- 13bis.14biu.
3158
- <tab/>
3159
- Clause B
3160
- </title>
3161
- </clause>
3162
- <clause id='S17' number='0' inline-header='false' obligation='normative'>
3163
- <title depth='2'>
3164
- 13bis.0.
3165
- <tab/>
3166
- Clause C
3167
- </title>
3168
- </clause>
3169
- <clause id='S18' inline-header='false' obligation='normative'>
3170
- <title depth='2'>
3171
- 13bis.1.
3172
- <tab/>
3173
- Clause D
3174
- </title>
3175
- </clause>
3176
- <clause id='S19' inline-header='false' obligation='normative'>
3177
- <title depth='2'>
3178
- 13bis.2.
3179
- <tab/>
3180
- Clause E
3181
- </title>
3182
- </clause>
3183
- <clause id='S20' number='a' inline-header='false' obligation='normative'>
3184
- <title depth='2'>
3185
- 13bis.a.
3186
- <tab/>
3187
- Clause F
3188
- </title>
3189
- </clause>
3190
- <clause id='S21' inline-header='false' obligation='normative'>
3191
- <title depth='2'>
3192
- 13bis.b.
3193
- <tab/>
3194
- Clause G
3195
- </title>
3196
- </clause>
3197
- <clause id='S22' number='B' inline-header='false' obligation='normative'>
3198
- <title depth='2'>
3199
- 13bis.B.
3200
- <tab/>
3201
- Clause H
3202
- </title>
3203
- </clause>
3204
- <clause id='S23' inline-header='false' obligation='normative'>
3205
- <title depth='2'>
3206
- 13bis.C.
3207
- <tab/>
3208
- Clause I
3209
- </title>
3210
- </clause>
3211
- </clause>
3212
- <clause id='S24' number='16bis' inline-header='false' obligation='normative' displayorder='8'>
3213
- <title depth='1'>
3214
- 16bis.
3215
- <tab/>
3216
- Terms and Definitions
3217
- </title>
3218
- </clause>
3219
- </sections>
3220
- <annex id='S25' obligation='normative' displayorder='9'>
3221
- <title>
3222
- <strong>Annex A</strong>
3223
- <br/>
3224
- (normative)
3225
- <br/>
3226
- <br/>
3227
- <strong>First Annex</strong>
3228
- </title>
3229
- </annex>
3230
- <annex id='S26' number='17bis' inline-header='false' obligation='normative' displayorder='10'>
3231
- <title>
3232
- <strong>Annex 17bis</strong>
3233
- <br/>
3234
- (normative)
3235
- <br/>
3236
- <br/>
3237
- <strong>Annex</strong>
3238
- </title>
3239
- <clause id='S27' number='18bis' inline-header='false' obligation='normative'>
3240
- <title depth='2'>
3241
- 17bis.18bis.
3242
- <tab/>
3243
- Annex A.1
3244
- </title>
3245
- </clause>
3246
- </annex>
3247
- <annex id='S28' inline-header='false' obligation='normative' displayorder='11'>
3248
- <title>
3249
- <strong>Annex 17bit</strong>
3250
- <br/>
3251
- (normative)
3252
- <br/>
3253
- <br/>
3254
- <strong>Another Annex</strong>
3255
- </title>
3256
- </annex>
3257
- <bibliography>
3258
- <references id='S2' number='2bis' normative='true' obligation='informative' displayorder='4'>
3259
- <title depth='1'>
3260
- 2bis.
3261
- <tab/>
3262
- Normative references
3263
- </title>
3264
- <p id='_'>There are no normative references in this document.</p>
3265
- </references>
3266
- <clause id='S29' number='19bis' obligation='informative' displayorder='12'>
3267
- <title depth='1'>Bibliography</title>
3268
- <references id='S30' number='20bis' normative='false' obligation='informative'>
3269
- <title depth='2'>Bibliography Subsection</title>
3270
- </references>
3271
- </clause>
3272
- </bibliography>
3273
- </iso-standard>
2852
+ <foreword id='fwd' displayorder='1'>
2853
+ <p>
2854
+ <xref target='N1'>Figure 1</xref>
2855
+ <xref target='N2'>Figure A</xref>
2856
+ <xref target='N3'>Figure B</xref>
2857
+ <xref target='N4'>Figure 7</xref>
2858
+ <xref target='N5'>Figure 8</xref>
2859
+ <xref target='N6'>Figure 9a</xref>
2860
+ <xref target='N7'>Figure 9c</xref>
2861
+ <xref target='N8'>Figure 9d</xref>
2862
+ <xref target='N9'>Figure 20f</xref>
2863
+ <xref target='N10'>Figure 20g</xref>
2864
+ <xref target='N11'>Figure A.1</xref>
2865
+ <xref target='N12'>Figure A.2</xref>
2866
+ <xref target='N13'>Figure 100</xref>
2867
+ </p>
2868
+ <p>
2869
+ <xref target='S1'>Clause 1bis</xref>
2870
+ <xref target='S2'>Clause 2bis</xref>
2871
+ <xref target='S3'>Clause 3bis</xref>
2872
+ <xref target='S4'>Clause 3bis.4bis</xref>
2873
+ <xref target='S12'>Clause 12bis</xref>
2874
+ <xref target='S13'>Clause 13bis</xref>
2875
+ <xref target='S14'>Clause 13bis.14bis</xref>
2876
+ <xref target='S15'>Clause 13bis.14bit</xref>
2877
+ <xref target='S16'>Clause 13bis.14biu</xref>
2878
+ <xref target='S17'>Clause 13bis.0</xref>
2879
+ <xref target='S18'>Clause 13bis.1</xref>
2880
+ <xref target='S19'>Clause 13bis.2</xref>
2881
+ <xref target='S20'>Clause 13bis.a</xref>
2882
+ <xref target='S21'>Clause 13bis.b</xref>
2883
+ <xref target='S22'>Clause 13bis.B</xref>
2884
+ <xref target='S23'>Clause 13bis.C</xref>
2885
+ <xref target='S24'>Clause 16bis</xref>
2886
+ <xref target='S25'>Annex A</xref>
2887
+ <xref target='S26'>Annex 17bis</xref>
2888
+ <xref target='S27'>Annex 17bis.18bis</xref>
2889
+ <xref target='S28'>Annex 17bit</xref>
2890
+ <xref target='S29'>Bibliography</xref>
2891
+ <xref target='S30'>Bibliography Subsection</xref>
2892
+ </p>
2893
+ </foreword>
3274
2894
  OUTPUT
3275
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
3276
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
2895
+ expect(xmlpp(Nokogiri::XML(IsoDoc::PresentationXMLConvert.new({})
2896
+ .convert("test", input, true))
2897
+ .at("//xmlns:foreword").to_xml))
2898
+ .to be_equivalent_to xmlpp(output)
3277
2899
  end
3278
2900
 
3279
2901
  it "realises roman counter for xrefs" do