metanorma-bipm 2.2.9 → 2.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -342,71 +342,16 @@
342
342
  <xsl:copy-of select="."/>
343
343
  </xsl:variable>
344
344
  <xsl:for-each select="xalan:nodeset($current_document)">
345
- <xsl:variable name="docid">
346
- <xsl:call-template name="getDocumentId"/>
347
- </xsl:variable>
348
-
349
- <!-- Table of Contents -->
350
- <fo:block-container>
351
- <fo:block role="TOC">
352
- <fo:block text-align-last="justify">
353
- <fo:inline font-size="15pt" font-weight="bold" role="H1">
354
- <xsl:call-template name="getLocalizedString">
355
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
356
- </xsl:call-template>
357
- </fo:inline>
358
- <fo:inline keep-together.within-line="always">
359
- <fo:leader leader-pattern="space"/>
360
- <xsl:call-template name="getLocalizedString">
361
- <xsl:with-param name="key">Page.sg</xsl:with-param>
362
- </xsl:call-template>
363
- </fo:inline>
364
- </fo:block>
365
345
 
366
- <xsl:if test="$debug = 'true'">
367
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
368
- DEBUG
369
- contents=<xsl:copy-of select="$contents"/>
370
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
371
- </xsl:if>
372
-
373
- <xsl:variable name="annexes_title">
374
- <xsl:call-template name="getLocalizedString">
375
- <xsl:with-param name="key">Annex.pl</xsl:with-param>
376
- </xsl:call-template>
377
- </xsl:variable>
378
-
379
- <xsl:for-each select="$contents/doc[@id=$docid]//item[@display = 'true']"> <!-- and not (@type = 'annex') and not (@type = 'references') -->
380
- <xsl:if test="@type = 'annex' and not(preceding-sibling::item[@display = 'true' and @type = 'annex'])">
381
- <fo:block font-size="12pt" space-before="16pt" font-weight="bold" role="TOCI">
382
- <xsl:value-of select="$annexes_title"/>
383
- </fo:block>
384
- </xsl:if>
385
- <xsl:call-template name="print_JCGN_toc_item"/>
386
- </xsl:for-each>
387
-
388
- <!-- List of Tables -->
389
- <xsl:if test="$contents//tables/table">
390
- <xsl:call-template name="insertListOf_Title">
391
- <xsl:with-param name="title" select="$title-list-tables"/>
392
- </xsl:call-template>
393
- <xsl:for-each select="$contents//tables/table">
394
- <xsl:call-template name="insertListOf_Item"/>
395
- </xsl:for-each>
396
- </xsl:if>
397
-
398
- <!-- List of Figures -->
399
- <xsl:if test="$contents//figures/figure">
400
- <xsl:call-template name="insertListOf_Title">
401
- <xsl:with-param name="title" select="$title-list-figures"/>
402
- </xsl:call-template>
403
- <xsl:for-each select="$contents//figures/figure">
404
- <xsl:call-template name="insertListOf_Item"/>
405
- </xsl:for-each>
406
- </xsl:if>
346
+ <xsl:if test="$debug = 'true'">
347
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
348
+ DEBUG
349
+ contents=<xsl:copy-of select="$contents"/>
350
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
351
+ </xsl:if>
407
352
 
408
- </fo:block>
409
- </fo:block-container>
353
+ <!-- Table of Contents -->
354
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='clause'][@type = 'toc']"/>
410
355
 
411
356
  </xsl:for-each>
412
357
 
@@ -431,7 +376,7 @@
431
376
  </xsl:for-each>
432
377
  <xsl:for-each select="//*[local-name() = 'bipm-standard']">
433
378
  <fo:block break-after="page"/>
434
- <xsl:apply-templates select="./*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements' and local-name() != 'note' and local-name() != 'admonition']"/>
379
+ <xsl:apply-templates select="./*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements' and local-name() != 'note' and local-name() != 'admonition' and not(local-name() = 'clause' and @type = 'toc')]"/>
435
380
  </xsl:for-each>
436
381
  <xsl:for-each select="//*[local-name() = 'bipm-standard']">
437
382
  <fo:block break-after="page"/>
@@ -573,6 +518,69 @@
573
518
  </fo:block>
574
519
  </xsl:template>
575
520
 
521
+ <xsl:template match="jcgm:preface/jcgm:clause[@type = 'toc']" priority="3">
522
+ <fo:block-container>
523
+ <fo:block role="TOC">
524
+
525
+ <xsl:apply-templates/>
526
+
527
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
528
+
529
+ <xsl:variable name="docid">
530
+ <xsl:call-template name="getDocumentId"/>
531
+ </xsl:variable>
532
+
533
+ <xsl:for-each select="$contents/doc[@id=$docid]//item[@display = 'true']"> <!-- and not (@type = 'annex') and not (@type = 'references') -->
534
+ <xsl:if test="@type = 'annex' and not(preceding-sibling::item[@display = 'true' and @type = 'annex'])">
535
+ <fo:block font-size="12pt" space-before="16pt" font-weight="bold" role="TOCI">
536
+ <xsl:call-template name="getLocalizedString">
537
+ <xsl:with-param name="key">Annex.pl</xsl:with-param>
538
+ </xsl:call-template>
539
+ </fo:block>
540
+ </xsl:if>
541
+ <xsl:call-template name="print_JCGN_toc_item"/>
542
+ </xsl:for-each>
543
+
544
+ <!-- List of Tables -->
545
+ <xsl:if test="$contents//tables/table">
546
+ <xsl:call-template name="insertListOf_Title">
547
+ <xsl:with-param name="title" select="$title-list-tables"/>
548
+ </xsl:call-template>
549
+ <xsl:for-each select="$contents//tables/table">
550
+ <xsl:call-template name="insertListOf_Item"/>
551
+ </xsl:for-each>
552
+ </xsl:if>
553
+
554
+ <!-- List of Figures -->
555
+ <xsl:if test="$contents//figures/figure">
556
+ <xsl:call-template name="insertListOf_Title">
557
+ <xsl:with-param name="title" select="$title-list-figures"/>
558
+ </xsl:call-template>
559
+ <xsl:for-each select="$contents//figures/figure">
560
+ <xsl:call-template name="insertListOf_Item"/>
561
+ </xsl:for-each>
562
+ </xsl:if>
563
+ </xsl:if>
564
+ </fo:block>
565
+ </fo:block-container>
566
+ </xsl:template>
567
+
568
+ <xsl:template match="jcgm:preface/jcgm:clause[@type = 'toc']/jcgm:title" priority="3">
569
+ <fo:block text-align-last="justify">
570
+ <fo:inline font-size="15pt" font-weight="bold" role="H1">
571
+ <xsl:call-template name="getLocalizedString">
572
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
573
+ </xsl:call-template>
574
+ </fo:inline>
575
+ <fo:inline keep-together.within-line="always">
576
+ <fo:leader leader-pattern="space"/>
577
+ <xsl:call-template name="getLocalizedString">
578
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
579
+ </xsl:call-template>
580
+ </fo:inline>
581
+ </fo:block>
582
+ </xsl:template>
583
+
576
584
  <xsl:template match="node()">
577
585
  <xsl:apply-templates/>
578
586
  </xsl:template>
@@ -612,6 +620,7 @@
612
620
 
613
621
  <xsl:variable name="skip">
614
622
  <xsl:choose>
623
+ <xsl:when test="@type = 'toc'">true</xsl:when>
615
624
  <xsl:when test="ancestor-or-self::*[local-name()='bibitem']">true</xsl:when>
616
625
  <xsl:when test="ancestor-or-self::*[local-name()='term']">true</xsl:when>
617
626
  <xsl:otherwise>false</xsl:otherwise>
@@ -2092,6 +2101,10 @@
2092
2101
 
2093
2102
  </xsl:attribute-set>
2094
2103
 
2104
+ <xsl:template name="refine_link-style">
2105
+
2106
+ </xsl:template> <!-- refine_link-style -->
2107
+
2095
2108
  <xsl:attribute-set name="sourcecode-container-style">
2096
2109
 
2097
2110
  </xsl:attribute-set>
@@ -2106,6 +2119,10 @@
2106
2119
 
2107
2120
  </xsl:attribute-set>
2108
2121
 
2122
+ <xsl:template name="refine_sourcecode-style">
2123
+
2124
+ </xsl:template> <!-- refine_sourcecode-style -->
2125
+
2109
2126
  <xsl:attribute-set name="pre-style">
2110
2127
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2111
2128
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2192,6 +2209,10 @@
2192
2209
 
2193
2210
  </xsl:attribute-set> <!-- example-style -->
2194
2211
 
2212
+ <xsl:template name="refine_example-style">
2213
+
2214
+ </xsl:template> <!-- refine_example-style -->
2215
+
2195
2216
  <xsl:attribute-set name="example-body-style">
2196
2217
 
2197
2218
  </xsl:attribute-set> <!-- example-body-style -->
@@ -2210,6 +2231,10 @@
2210
2231
 
2211
2232
  </xsl:attribute-set> <!-- example-p-style -->
2212
2233
 
2234
+ <xsl:template name="refine_example-p-style">
2235
+
2236
+ </xsl:template> <!-- refine_example-p-style -->
2237
+
2213
2238
  <xsl:attribute-set name="termexample-name-style">
2214
2239
 
2215
2240
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -2239,6 +2264,12 @@
2239
2264
 
2240
2265
  </xsl:attribute-set> <!-- table-container-style -->
2241
2266
 
2267
+ <xsl:template name="refine_table-container-style">
2268
+ <xsl:param name="margin-side"/>
2269
+
2270
+ <!-- end table block-container attributes -->
2271
+ </xsl:template> <!-- refine_table-container-style -->
2272
+
2242
2273
  <xsl:attribute-set name="table-style">
2243
2274
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2244
2275
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
@@ -2247,6 +2278,17 @@
2247
2278
 
2248
2279
  </xsl:attribute-set><!-- table-style -->
2249
2280
 
2281
+ <xsl:template name="refine_table-style">
2282
+ <xsl:param name="margin-side"/>
2283
+
2284
+ <xsl:call-template name="setBordersTableArray"/>
2285
+
2286
+ <xsl:if test="*[local-name()='thead']">
2287
+ <xsl:attribute name="border-top">1pt solid black</xsl:attribute>
2288
+ </xsl:if>
2289
+
2290
+ </xsl:template> <!-- refine_table-style -->
2291
+
2250
2292
  <xsl:attribute-set name="table-name-style">
2251
2293
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2252
2294
 
@@ -2257,6 +2299,11 @@
2257
2299
 
2258
2300
  </xsl:attribute-set> <!-- table-name-style -->
2259
2301
 
2302
+ <xsl:template name="refine_table-name-style">
2303
+ <xsl:param name="continued"/>
2304
+
2305
+ </xsl:template> <!-- refine_table-name-style -->
2306
+
2260
2307
  <xsl:attribute-set name="table-row-style">
2261
2308
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2262
2309
 
@@ -2270,6 +2317,23 @@
2270
2317
 
2271
2318
  </xsl:attribute-set>
2272
2319
 
2320
+ <xsl:template name="refine_table-header-row-style">
2321
+
2322
+ <xsl:call-template name="setBordersTableArray"/>
2323
+
2324
+ <xsl:choose>
2325
+ <xsl:when test="position() = 1">
2326
+ <xsl:attribute name="border-top">solid black 1.5pt</xsl:attribute>
2327
+ <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
2328
+ </xsl:when>
2329
+ <xsl:when test="position() = last()">
2330
+ <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
2331
+ <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute>
2332
+ </xsl:when>
2333
+ </xsl:choose>
2334
+
2335
+ </xsl:template> <!-- refine_table-header-row-style -->
2336
+
2273
2337
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2274
2338
 
2275
2339
  <xsl:attribute name="font-size">9pt</xsl:attribute>
@@ -2278,10 +2342,20 @@
2278
2342
 
2279
2343
  </xsl:attribute-set>
2280
2344
 
2345
+ <xsl:template name="refine_table-footer-row-style">
2346
+
2347
+ </xsl:template> <!-- refine_table-footer-row-style -->
2348
+
2281
2349
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2282
2350
 
2283
2351
  </xsl:attribute-set>
2284
2352
 
2353
+ <xsl:template name="refine_table-body-row-style">
2354
+
2355
+ <xsl:call-template name="setBordersTableArray"/>
2356
+
2357
+ </xsl:template> <!-- refine_table-body-row-style -->
2358
+
2285
2359
  <xsl:attribute-set name="table-header-cell-style">
2286
2360
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2287
2361
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2293,6 +2367,18 @@
2293
2367
 
2294
2368
  </xsl:attribute-set> <!-- table-header-cell-style -->
2295
2369
 
2370
+ <xsl:template name="refine_table-header-cell-style">
2371
+
2372
+ <xsl:call-template name="setBordersTableArray"/>
2373
+
2374
+ <xsl:if test="$lang = 'ar'">
2375
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2376
+ </xsl:if>
2377
+
2378
+ <xsl:call-template name="setTableCellAttributes"/>
2379
+
2380
+ </xsl:template> <!-- refine_table-header-cell-style -->
2381
+
2296
2382
  <xsl:attribute-set name="table-cell-style">
2297
2383
  <xsl:attribute name="display-align">center</xsl:attribute>
2298
2384
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2303,6 +2389,25 @@
2303
2389
 
2304
2390
  </xsl:attribute-set> <!-- table-cell-style -->
2305
2391
 
2392
+ <xsl:template name="refine_table-cell-style">
2393
+
2394
+ <xsl:if test="$lang = 'ar'">
2395
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2396
+ </xsl:if>
2397
+
2398
+ <!-- bsi -->
2399
+
2400
+ <xsl:call-template name="setBordersTableArray"/>
2401
+
2402
+ <xsl:if test="count(*) = 1 and (local-name(*[1]) = 'stem' or local-name(*[1]) = 'figure')">
2403
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
2404
+ </xsl:if>
2405
+ <xsl:if test="ancestor::*[local-name() = 'tfoot']">
2406
+ <xsl:attribute name="border">solid black 0</xsl:attribute>
2407
+ </xsl:if>
2408
+
2409
+ </xsl:template> <!-- refine_table-cell-style -->
2410
+
2306
2411
  <xsl:attribute-set name="table-footer-cell-style">
2307
2412
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2308
2413
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2313,6 +2418,10 @@
2313
2418
 
2314
2419
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2315
2420
 
2421
+ <xsl:template name="refine_table-footer-cell-style">
2422
+
2423
+ </xsl:template> <!-- refine_table-footer-cell-style -->
2424
+
2316
2425
  <xsl:attribute-set name="table-note-style">
2317
2426
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2318
2427
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2322,6 +2431,10 @@
2322
2431
 
2323
2432
  </xsl:attribute-set><!-- table-note-style -->
2324
2433
 
2434
+ <xsl:template name="refine_table-note-style">
2435
+
2436
+ </xsl:template> <!-- refine_table-note-style -->
2437
+
2325
2438
  <xsl:attribute-set name="table-fn-style">
2326
2439
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2327
2440
 
@@ -2380,11 +2493,19 @@
2380
2493
 
2381
2494
  </xsl:attribute-set>
2382
2495
 
2496
+ <xsl:template name="refine_dt-cell-style">
2497
+
2498
+ </xsl:template> <!-- refine_dt-cell-style -->
2499
+
2383
2500
  <xsl:attribute-set name="dt-block-style">
2384
2501
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2385
2502
 
2386
2503
  </xsl:attribute-set>
2387
2504
 
2505
+ <xsl:template name="refine_dt-block-style">
2506
+
2507
+ </xsl:template> <!-- refine_dt-block-style -->
2508
+
2388
2509
  <xsl:attribute-set name="dl-name-style">
2389
2510
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2390
2511
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2398,6 +2519,10 @@
2398
2519
 
2399
2520
  </xsl:attribute-set>
2400
2521
 
2522
+ <xsl:template name="refine_dd-cell-style">
2523
+
2524
+ </xsl:template> <!-- refine_dd-cell-style -->
2525
+
2401
2526
  <!-- ========================== -->
2402
2527
  <!-- END Definition's list styles -->
2403
2528
  <!-- ========================== -->
@@ -2420,7 +2545,6 @@
2420
2545
  </xsl:attribute-set>
2421
2546
 
2422
2547
  <xsl:attribute-set name="xref-style">
2423
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2424
2548
 
2425
2549
  <xsl:attribute name="color">blue</xsl:attribute>
2426
2550
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2431,6 +2555,12 @@
2431
2555
 
2432
2556
  </xsl:attribute-set>
2433
2557
 
2558
+ <xsl:template name="refine_eref-style">
2559
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
2560
+ <xsl:variable name="text" select="normalize-space()"/>
2561
+
2562
+ </xsl:template> <!-- refine_eref-style -->
2563
+
2434
2564
  <xsl:attribute-set name="note-style">
2435
2565
 
2436
2566
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -2440,6 +2570,10 @@
2440
2570
 
2441
2571
  </xsl:attribute-set>
2442
2572
 
2573
+ <xsl:template name="refine_note-style">
2574
+
2575
+ </xsl:template>
2576
+
2443
2577
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
2444
2578
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
2445
2579
 
@@ -2449,11 +2583,19 @@
2449
2583
 
2450
2584
  </xsl:attribute-set>
2451
2585
 
2586
+ <xsl:template name="refine_note-name-style">
2587
+
2588
+ </xsl:template> <!-- refine_note-name-style -->
2589
+
2452
2590
  <xsl:attribute-set name="table-note-name-style">
2453
2591
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
2454
2592
 
2455
2593
  </xsl:attribute-set>
2456
2594
 
2595
+ <xsl:template name="refine_table-note-name-style">
2596
+
2597
+ </xsl:template> <!-- refine_table-note-name-style -->
2598
+
2457
2599
  <xsl:attribute-set name="note-p-style">
2458
2600
 
2459
2601
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -2470,10 +2612,18 @@
2470
2612
 
2471
2613
  </xsl:attribute-set>
2472
2614
 
2615
+ <xsl:template name="refine_termnote-style">
2616
+
2617
+ </xsl:template> <!-- refine_termnote-style -->
2618
+
2473
2619
  <xsl:attribute-set name="termnote-name-style">
2474
2620
 
2475
2621
  </xsl:attribute-set>
2476
2622
 
2623
+ <xsl:template name="refine_termnote-name-style">
2624
+
2625
+ </xsl:template>
2626
+
2477
2627
  <xsl:attribute-set name="termnote-p-style">
2478
2628
 
2479
2629
  </xsl:attribute-set>
@@ -2488,6 +2638,16 @@
2488
2638
 
2489
2639
  </xsl:attribute-set>
2490
2640
 
2641
+ <xsl:template name="refine_quote-style">
2642
+
2643
+ <xsl:if test="ancestor::*[local-name() = 'boilerplate']">
2644
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
2645
+ <xsl:attribute name="margin-right">7mm</xsl:attribute>
2646
+ <xsl:attribute name="font-style">normal</xsl:attribute>
2647
+ </xsl:if>
2648
+
2649
+ </xsl:template>
2650
+
2491
2651
  <xsl:attribute-set name="quote-source-style">
2492
2652
  <xsl:attribute name="text-align">right</xsl:attribute>
2493
2653
 
@@ -2499,6 +2659,10 @@
2499
2659
 
2500
2660
  </xsl:attribute-set>
2501
2661
 
2662
+ <xsl:template name="refine_termsource-style">
2663
+
2664
+ </xsl:template> <!-- refine_termsource-style -->
2665
+
2502
2666
  <xsl:attribute-set name="termsource-text-style">
2503
2667
 
2504
2668
  </xsl:attribute-set>
@@ -2539,6 +2703,10 @@
2539
2703
 
2540
2704
  </xsl:attribute-set>
2541
2705
 
2706
+ <xsl:template name="refine_figure-name-style">
2707
+
2708
+ </xsl:template> <!-- refine_figure-name-style -->
2709
+
2542
2710
  <xsl:attribute-set name="figure-source-style">
2543
2711
 
2544
2712
  </xsl:attribute-set>
@@ -2558,6 +2726,10 @@
2558
2726
 
2559
2727
  </xsl:attribute-set> <!-- formula-stem-block-style -->
2560
2728
 
2729
+ <xsl:template name="refine_formula-stem-block-style">
2730
+
2731
+ </xsl:template> <!-- refine_formula-stem-block-style -->
2732
+
2561
2733
  <xsl:attribute-set name="formula-stem-number-style">
2562
2734
  <xsl:attribute name="text-align">right</xsl:attribute>
2563
2735
 
@@ -2569,6 +2741,10 @@
2569
2741
 
2570
2742
  </xsl:attribute-set>
2571
2743
 
2744
+ <xsl:template name="refine_image-style">
2745
+
2746
+ </xsl:template>
2747
+
2572
2748
  <xsl:attribute-set name="figure-pseudocode-p-style">
2573
2749
 
2574
2750
  </xsl:attribute-set>
@@ -2665,6 +2841,10 @@
2665
2841
 
2666
2842
  </xsl:attribute-set>
2667
2843
 
2844
+ <xsl:template name="refine_mathml-style">
2845
+
2846
+ </xsl:template>
2847
+
2668
2848
  <xsl:attribute-set name="list-style">
2669
2849
 
2670
2850
  <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
@@ -2672,6 +2852,10 @@
2672
2852
 
2673
2853
  </xsl:attribute-set> <!-- list-style -->
2674
2854
 
2855
+ <xsl:template name="refine_list-style">
2856
+
2857
+ </xsl:template> <!-- refine_list-style -->
2858
+
2675
2859
  <xsl:attribute-set name="list-name-style">
2676
2860
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2677
2861
 
@@ -2684,14 +2868,26 @@
2684
2868
 
2685
2869
  </xsl:attribute-set>
2686
2870
 
2871
+ <xsl:template name="refine_list-item-style">
2872
+
2873
+ </xsl:template> <!-- refine_list-item-style -->
2874
+
2687
2875
  <xsl:attribute-set name="list-item-label-style">
2688
2876
 
2689
2877
  </xsl:attribute-set>
2690
2878
 
2879
+ <xsl:template name="refine_list-item-label-style">
2880
+
2881
+ </xsl:template> <!-- refine_list-item-label-style -->
2882
+
2691
2883
  <xsl:attribute-set name="list-item-body-style">
2692
2884
 
2693
2885
  </xsl:attribute-set>
2694
2886
 
2887
+ <xsl:template name="refine_list-item-body-style">
2888
+
2889
+ </xsl:template> <!-- refine_list-item-body-style -->
2890
+
2695
2891
  <xsl:attribute-set name="toc-style">
2696
2892
  <xsl:attribute name="line-height">135%</xsl:attribute>
2697
2893
  </xsl:attribute-set>
@@ -2702,6 +2898,15 @@
2702
2898
 
2703
2899
  </xsl:attribute-set>
2704
2900
 
2901
+ <xsl:template name="refine_fn-reference-style">
2902
+
2903
+ <xsl:if test="ancestor::*[local-name()='table']">
2904
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2905
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
2906
+ </xsl:if>
2907
+
2908
+ </xsl:template> <!-- refine_fn-reference-style -->
2909
+
2705
2910
  <xsl:attribute-set name="fn-style">
2706
2911
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2707
2912
  </xsl:attribute-set>
@@ -2727,6 +2932,10 @@
2727
2932
 
2728
2933
  </xsl:attribute-set>
2729
2934
 
2935
+ <xsl:template name="refine_fn-body-style">
2936
+
2937
+ </xsl:template> <!-- refine_fn-body-style -->
2938
+
2730
2939
  <xsl:attribute-set name="fn-body-num-style">
2731
2940
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2732
2941
 
@@ -2736,6 +2945,10 @@
2736
2945
 
2737
2946
  </xsl:attribute-set> <!-- fn-body-num-style -->
2738
2947
 
2948
+ <xsl:template name="refine_fn-body-num-style">
2949
+
2950
+ </xsl:template> <!-- refine_fn-body-num-style -->
2951
+
2739
2952
  <!-- admonition -->
2740
2953
  <xsl:attribute-set name="admonition-style">
2741
2954
 
@@ -3379,7 +3592,9 @@
3379
3592
 
3380
3593
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3381
3594
 
3382
- <!-- end table block-container attributes -->
3595
+ <xsl:call-template name="refine_table-container-style">
3596
+ <xsl:with-param name="margin-side" select="$margin-side"/>
3597
+ </xsl:call-template>
3383
3598
 
3384
3599
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3385
3600
 
@@ -3400,11 +3615,9 @@
3400
3615
 
3401
3616
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3402
3617
 
3403
- <xsl:call-template name="setBordersTableArray"/>
3404
-
3405
- <xsl:if test="*[local-name()='thead']">
3406
- <xsl:attribute name="border-top">1pt solid black</xsl:attribute>
3407
- </xsl:if>
3618
+ <xsl:call-template name="refine_table-style">
3619
+ <xsl:with-param name="margin-side" select="$margin-side"/>
3620
+ </xsl:call-template>
3408
3621
 
3409
3622
  </xsl:element>
3410
3623
  </xsl:variable>
@@ -3470,7 +3683,7 @@
3470
3683
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3471
3684
  </xsl:when>
3472
3685
  <xsl:otherwise>
3473
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3686
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3474
3687
  </xsl:otherwise>
3475
3688
  </xsl:choose>
3476
3689
 
@@ -3560,6 +3773,10 @@
3560
3773
 
3561
3774
  <fo:block xsl:use-attribute-sets="table-name-style">
3562
3775
 
3776
+ <xsl:call-template name="refine_table-name-style">
3777
+ <xsl:with-param name="continued" select="$continued"/>
3778
+ </xsl:call-template>
3779
+
3563
3780
  <xsl:choose>
3564
3781
  <xsl:when test="$continued = 'true'">
3565
3782
  <!-- $namespace = 'iso' or -->
@@ -3948,6 +4165,8 @@
3948
4165
  <fo:table-row>
3949
4166
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3950
4167
 
4168
+ <xsl:call-template name="refine_table-header-title-style"/>
4169
+
3951
4170
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3952
4171
  <xsl:with-param name="continued">true</xsl:with-param>
3953
4172
  </xsl:apply-templates>
@@ -3969,6 +4188,10 @@
3969
4188
  </fo:table-row>
3970
4189
  </xsl:template> <!-- table-header-title -->
3971
4190
 
4191
+ <xsl:template name="refine_table-header-title-style">
4192
+
4193
+ </xsl:template> <!-- refine_table-header-title-style -->
4194
+
3972
4195
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3973
4196
  <fo:table-body>
3974
4197
  <xsl:apply-templates/>
@@ -3993,7 +4216,7 @@
3993
4216
  <xsl:param name="colwidths"/>
3994
4217
  <xsl:param name="colgroup"/>
3995
4218
 
3996
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4219
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3997
4220
 
3998
4221
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3999
4222
 
@@ -4053,6 +4276,8 @@
4053
4276
  <fo:table-row>
4054
4277
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4055
4278
 
4279
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4280
+
4056
4281
  <xsl:call-template name="setBordersTableArray"/>
4057
4282
 
4058
4283
  <!-- fn will be processed inside 'note' processing -->
@@ -4061,6 +4286,7 @@
4061
4286
 
4062
4287
  <!-- except gb and bsi -->
4063
4288
 
4289
+ <xsl:apply-templates select="../*[local-name()='p']"/>
4064
4290
  <xsl:apply-templates select="../*[local-name()='dl']"/>
4065
4291
  <xsl:apply-templates select="../*[local-name()='note']"/>
4066
4292
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -4233,18 +4459,7 @@
4233
4459
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4234
4460
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4235
4461
 
4236
- <xsl:call-template name="setBordersTableArray"/>
4237
-
4238
- <xsl:choose>
4239
- <xsl:when test="position() = 1">
4240
- <xsl:attribute name="border-top">solid black 1.5pt</xsl:attribute>
4241
- <xsl:attribute name="border-bottom">solid black 1pt</xsl:attribute>
4242
- </xsl:when>
4243
- <xsl:when test="position() = last()">
4244
- <xsl:attribute name="border-top">solid black 1pt</xsl:attribute>
4245
- <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute>
4246
- </xsl:when>
4247
- </xsl:choose>
4462
+ <xsl:call-template name="refine_table-header-row-style"/>
4248
4463
 
4249
4464
  <xsl:call-template name="setTableRowAttributes"/>
4250
4465
 
@@ -4278,6 +4493,8 @@
4278
4493
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4279
4494
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4280
4495
 
4496
+ <xsl:call-template name="refine_table-footer-row-style"/>
4497
+
4281
4498
  <xsl:call-template name="setTableRowAttributes"/>
4282
4499
  <xsl:apply-templates/>
4283
4500
  </fo:table-row>
@@ -4291,9 +4508,10 @@
4291
4508
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4292
4509
  </xsl:if>
4293
4510
 
4294
- <xsl:call-template name="setBordersTableArray"/>
4511
+ <xsl:call-template name="refine_table-body-row-style"/>
4295
4512
 
4296
4513
  <xsl:call-template name="setTableRowAttributes"/>
4514
+
4297
4515
  <xsl:apply-templates/>
4298
4516
  </fo:table-row>
4299
4517
  </xsl:template>
@@ -4312,13 +4530,7 @@
4312
4530
  <xsl:with-param name="default">center</xsl:with-param>
4313
4531
  </xsl:call-template>
4314
4532
 
4315
- <xsl:call-template name="setBordersTableArray"/>
4316
-
4317
- <xsl:if test="$lang = 'ar'">
4318
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4319
- </xsl:if>
4320
-
4321
- <xsl:call-template name="setTableCellAttributes"/>
4533
+ <xsl:call-template name="refine_table-header-cell-style"/>
4322
4534
 
4323
4535
  <fo:block>
4324
4536
  <xsl:apply-templates/>
@@ -4360,20 +4572,7 @@
4360
4572
  <xsl:with-param name="default">left</xsl:with-param>
4361
4573
  </xsl:call-template>
4362
4574
 
4363
- <xsl:if test="$lang = 'ar'">
4364
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4365
- </xsl:if>
4366
-
4367
- <!-- bsi -->
4368
-
4369
- <xsl:call-template name="setBordersTableArray"/>
4370
-
4371
- <xsl:if test="count(*) = 1 and (local-name(*[1]) = 'stem' or local-name(*[1]) = 'figure')">
4372
- <xsl:attribute name="padding-left">0mm</xsl:attribute>
4373
- </xsl:if>
4374
- <xsl:if test="ancestor::*[local-name() = 'tfoot']">
4375
- <xsl:attribute name="border">solid black 0</xsl:attribute>
4376
- </xsl:if>
4575
+ <xsl:call-template name="refine_table-cell-style"/>
4377
4576
 
4378
4577
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4379
4578
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -4404,9 +4603,13 @@
4404
4603
 
4405
4604
  <fo:block xsl:use-attribute-sets="table-note-style">
4406
4605
 
4606
+ <xsl:call-template name="refine_table-note-style"/>
4607
+
4407
4608
  <!-- Table's note name (NOTE, for example) -->
4408
4609
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
4409
4610
 
4611
+ <xsl:call-template name="refine_table-note-name-style"/>
4612
+
4410
4613
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4411
4614
 
4412
4615
  </fo:inline>
@@ -4434,6 +4637,14 @@
4434
4637
  <!-- list of footnotes to calculate actual footnotes number -->
4435
4638
  <xsl:variable name="p_fn_">
4436
4639
  <xsl:call-template name="get_fn_list"/>
4640
+ <!-- <xsl:choose>
4641
+ <xsl:when test="$namespace = 'jis'">
4642
+ <xsl:call-template name="get_fn_list_for_element"/>
4643
+ </xsl:when>
4644
+ <xsl:otherwise>
4645
+ <xsl:call-template name="get_fn_list"/>
4646
+ </xsl:otherwise>
4647
+ </xsl:choose> -->
4437
4648
  </xsl:variable>
4438
4649
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4439
4650
 
@@ -4458,7 +4669,14 @@
4458
4669
 
4459
4670
  </xsl:variable>
4460
4671
 
4461
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4672
+ <xsl:variable name="ref_id">
4673
+ <xsl:choose>
4674
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
4675
+ <xsl:otherwise>
4676
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4677
+ </xsl:otherwise>
4678
+ </xsl:choose>
4679
+ </xsl:variable>
4462
4680
  <xsl:variable name="footnote_inline">
4463
4681
  <fo:inline>
4464
4682
 
@@ -4484,7 +4702,7 @@
4484
4702
  <xsl:call-template name="insert_basic_link">
4485
4703
  <xsl:with-param name="element">
4486
4704
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4487
- <xsl:value-of select="$current_fn_number_text"/>
4705
+ <xsl:copy-of select="$current_fn_number_text"/>
4488
4706
  </fo:basic-link>
4489
4707
  </xsl:with-param>
4490
4708
  </xsl:call-template>
@@ -4504,8 +4722,12 @@
4504
4722
 
4505
4723
  <fo:block xsl:use-attribute-sets="fn-body-style">
4506
4724
 
4725
+ <xsl:call-template name="refine_fn-body-style"/>
4726
+
4507
4727
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4508
4728
 
4729
+ <xsl:call-template name="refine_fn-body-num-style"/>
4730
+
4509
4731
  <xsl:value-of select="$current_fn_number_text"/>
4510
4732
  </fo:inline>
4511
4733
  <xsl:apply-templates/>
@@ -4557,6 +4779,28 @@
4557
4779
  </xsl:choose>
4558
4780
  </xsl:template>
4559
4781
 
4782
+ <xsl:template name="get_fn_list_for_element">
4783
+ <xsl:choose>
4784
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
4785
+ <fn gen_id="{generate-id(.)}">
4786
+ <xsl:copy-of select="@*"/>
4787
+ <xsl:copy-of select="node()"/>
4788
+ </fn>
4789
+ </xsl:when>
4790
+ <xsl:otherwise>
4791
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
4792
+ <xsl:variable name="element_id" select="@id"/>
4793
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4794
+ <!-- copy unique fn -->
4795
+ <fn gen_id="{generate-id(.)}">
4796
+ <xsl:copy-of select="@*"/>
4797
+ <xsl:copy-of select="node()"/>
4798
+ </fn>
4799
+ </xsl:for-each>
4800
+ </xsl:for-each>
4801
+ </xsl:otherwise>
4802
+ </xsl:choose>
4803
+ </xsl:template>
4560
4804
  <!-- ============================ -->
4561
4805
  <!-- table's footnotes rendering -->
4562
4806
  <!-- ============================ -->
@@ -4731,10 +4975,7 @@
4731
4975
  <xsl:template match="*[local-name()='fn']">
4732
4976
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
4733
4977
 
4734
- <xsl:if test="ancestor::*[local-name()='table']">
4735
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4736
- <xsl:attribute name="baseline-shift">15%</xsl:attribute>
4737
- </xsl:if>
4978
+ <xsl:call-template name="refine_fn-reference-style"/>
4738
4979
 
4739
4980
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4740
4981
 
@@ -4839,7 +5080,7 @@
4839
5080
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
4840
5081
  <fo:block margin-bottom="12pt" text-align="left">
4841
5082
 
4842
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5083
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4843
5084
 
4844
5085
  <!-- <xsl:variable name="title-where">
4845
5086
  <xsl:call-template name="getLocalizedString">
@@ -4854,8 +5095,7 @@
4854
5095
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4855
5096
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4856
5097
 
4857
- <xsl:attribute name="font-size">10pt</xsl:attribute>
4858
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
5098
+ <xsl:call-template name="refine_figure_key_style"/>
4859
5099
 
4860
5100
  <xsl:variable name="title-key">
4861
5101
  <xsl:call-template name="getLocalizedString">
@@ -4871,10 +5111,7 @@
4871
5111
  <xsl:if test="$onlyOneComponent = 'false'">
4872
5112
  <fo:block>
4873
5113
 
4874
- <xsl:if test="$parent = 'formula'">
4875
- <xsl:attribute name="margin-left">4mm</xsl:attribute>
4876
- </xsl:if>
4877
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
5114
+ <xsl:call-template name="refine_multicomponent_style"/>
4878
5115
 
4879
5116
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
4880
5117
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -4882,6 +5119,8 @@
4882
5119
 
4883
5120
  <fo:block>
4884
5121
 
5122
+ <xsl:call-template name="refine_multicomponent_block_style"/>
5123
+
4885
5124
  <xsl:apply-templates select="*[local-name() = 'name']">
4886
5125
  <xsl:with-param name="process">true</xsl:with-param>
4887
5126
  </xsl:apply-templates>
@@ -5039,6 +5278,34 @@
5039
5278
 
5040
5279
  </xsl:template> <!-- END: dl -->
5041
5280
 
5281
+ <xsl:template name="refine_dl_formula_where_style">
5282
+
5283
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5284
+
5285
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5286
+
5287
+ <xsl:template name="refine_figure_key_style">
5288
+
5289
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
5290
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5291
+
5292
+ </xsl:template> <!-- refine_figure_key_style -->
5293
+
5294
+ <xsl:template name="refine_multicomponent_style">
5295
+ <xsl:variable name="parent" select="local-name(..)"/>
5296
+
5297
+ <xsl:if test="$parent = 'formula'">
5298
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
5299
+ </xsl:if>
5300
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
5301
+
5302
+ </xsl:template> <!-- refine_multicomponent_style -->
5303
+
5304
+ <xsl:template name="refine_multicomponent_block_style">
5305
+ <xsl:variable name="parent" select="local-name(..)"/>
5306
+
5307
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5308
+
5042
5309
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
5043
5310
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
5044
5311
 
@@ -5258,6 +5525,8 @@
5258
5525
 
5259
5526
  </xsl:if>
5260
5527
 
5528
+ <xsl:call-template name="refine_dt-cell-style"/>
5529
+
5261
5530
  <fo:block xsl:use-attribute-sets="dt-block-style">
5262
5531
  <xsl:copy-of select="@id"/>
5263
5532
 
@@ -5265,6 +5534,8 @@
5265
5534
  <xsl:attribute name="margin-top">0</xsl:attribute>
5266
5535
  </xsl:if>
5267
5536
 
5537
+ <xsl:call-template name="refine_dt-block-style"/>
5538
+
5268
5539
  <xsl:apply-templates>
5269
5540
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5270
5541
  </xsl:apply-templates>
@@ -5284,6 +5555,8 @@
5284
5555
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5285
5556
  </xsl:if>
5286
5557
 
5558
+ <xsl:call-template name="refine_dd-cell-style"/>
5559
+
5287
5560
  <fo:block>
5288
5561
 
5289
5562
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -5434,12 +5707,18 @@
5434
5707
  <xsl:param name="split_keep-within-line"/>
5435
5708
  <fo:inline font-weight="bold">
5436
5709
 
5710
+ <xsl:call-template name="refine_strong_style"/>
5711
+
5437
5712
  <xsl:apply-templates>
5438
5713
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5439
5714
  </xsl:apply-templates>
5440
5715
  </fo:inline>
5441
5716
  </xsl:template>
5442
5717
 
5718
+ <xsl:template name="refine_strong_style">
5719
+
5720
+ </xsl:template>
5721
+
5443
5722
  <xsl:template match="*[local-name()='padding']">
5444
5723
  <fo:inline padding-right="{@value}"> </fo:inline>
5445
5724
  </xsl:template>
@@ -6584,6 +6863,11 @@
6584
6863
 
6585
6864
  <fo:inline xsl:use-attribute-sets="mathml-style">
6586
6865
 
6866
+ <!-- DEBUG -->
6867
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
6868
+
6869
+ <xsl:call-template name="refine_mathml-style"/>
6870
+
6587
6871
  <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
6588
6872
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6589
6873
  </xsl:if>
@@ -6688,12 +6972,7 @@
6688
6972
 
6689
6973
  <fo:instream-foreign-object fox:alt-text="Math">
6690
6974
 
6691
- <xsl:if test="local-name(../..) = 'formula' or (local-name(../..) = 'td' and count(../../*) = 1)">
6692
- <xsl:attribute name="width">95%</xsl:attribute>
6693
- <xsl:attribute name="content-height">100%</xsl:attribute>
6694
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6695
- <xsl:attribute name="scaling">uniform</xsl:attribute>
6696
- </xsl:if>
6975
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6697
6976
 
6698
6977
  <!-- put MathML in Actual Text -->
6699
6978
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
@@ -6715,6 +6994,17 @@
6715
6994
  </fo:instream-foreign-object>
6716
6995
  </xsl:template>
6717
6996
 
6997
+ <xsl:template name="refine_mathml_insteam_object_style">
6998
+
6999
+ <xsl:if test="local-name(../..) = 'formula' or (local-name(../..) = 'td' and count(../../*) = 1)">
7000
+ <xsl:attribute name="width">95%</xsl:attribute>
7001
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7002
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7003
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
7004
+ </xsl:if>
7005
+
7006
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
7007
+
6718
7008
  <xsl:template match="mathml:*" mode="mathml_actual_text">
6719
7009
  <!-- <xsl:text>a+b</xsl:text> -->
6720
7010
  <xsl:text>&lt;</xsl:text>
@@ -6859,6 +7149,8 @@
6859
7149
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6860
7150
  <fo:inline xsl:use-attribute-sets="mathml-style">
6861
7151
 
7152
+ <xsl:call-template name="refine_mathml-style"/>
7153
+
6862
7154
  <xsl:choose>
6863
7155
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6864
7156
  <xsl:otherwise>
@@ -6903,6 +7195,8 @@
6903
7195
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6904
7196
  </xsl:if>
6905
7197
 
7198
+ <xsl:call-template name="refine_link-style"/>
7199
+
6906
7200
  <xsl:choose>
6907
7201
  <xsl:when test="$target_text = ''">
6908
7202
  <xsl:apply-templates/>
@@ -6990,6 +7284,9 @@
6990
7284
  <xsl:call-template name="insert_basic_link">
6991
7285
  <xsl:with-param name="element">
6992
7286
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7287
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://'))">
7288
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7289
+ </xsl:if>
6993
7290
  <xsl:if test="parent::*[local-name() = 'add']">
6994
7291
  <xsl:call-template name="append_add-style"/>
6995
7292
  </xsl:if>
@@ -7051,6 +7348,8 @@
7051
7348
  <fo:table-cell display-align="center">
7052
7349
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7053
7350
 
7351
+ <xsl:call-template name="refine_formula-stem-block-style"/>
7352
+
7054
7353
  <xsl:apply-templates/>
7055
7354
  </fo:block>
7056
7355
  </fo:table-cell>
@@ -7092,12 +7391,18 @@
7092
7391
 
7093
7392
  <xsl:call-template name="setBlockSpanAll"/>
7094
7393
 
7394
+ <xsl:call-template name="refine_note-style"/>
7395
+
7095
7396
  <fo:block-container margin-left="0mm" margin-right="0mm">
7096
7397
 
7097
7398
  <fo:block>
7098
7399
 
7400
+ <xsl:call-template name="refine_note_block_style"/>
7401
+
7099
7402
  <fo:inline xsl:use-attribute-sets="note-name-style">
7100
7403
 
7404
+ <xsl:call-template name="refine_note-name-style"/>
7405
+
7101
7406
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7102
7407
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7103
7408
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7123,6 +7428,10 @@
7123
7428
 
7124
7429
  </xsl:template>
7125
7430
 
7431
+ <xsl:template name="refine_note_block_style">
7432
+
7433
+ </xsl:template>
7434
+
7126
7435
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7127
7436
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7128
7437
  <xsl:choose>
@@ -7144,12 +7453,16 @@
7144
7453
 
7145
7454
  <xsl:call-template name="setBlockSpanAll"/>
7146
7455
 
7456
+ <xsl:call-template name="refine_termnote-style"/>
7457
+
7147
7458
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7148
7459
 
7149
7460
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
7150
7461
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
7151
7462
  </xsl:if>
7152
7463
 
7464
+ <xsl:call-template name="refine_termnote-name-style"/>
7465
+
7153
7466
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7154
7467
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7155
7468
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7321,6 +7634,8 @@
7321
7634
  <xsl:otherwise>
7322
7635
  <fo:block xsl:use-attribute-sets="image-style">
7323
7636
 
7637
+ <xsl:call-template name="refine_image-style"/>
7638
+
7324
7639
  <xsl:variable name="src">
7325
7640
  <xsl:call-template name="image_src"/>
7326
7641
  </xsl:variable>
@@ -8170,6 +8485,8 @@
8170
8485
  <xsl:if test="normalize-space() != ''">
8171
8486
  <fo:block xsl:use-attribute-sets="figure-name-style">
8172
8487
 
8488
+ <xsl:call-template name="refine_figure-name-style"/>
8489
+
8173
8490
  <xsl:apply-templates/>
8174
8491
  </fo:block>
8175
8492
  </xsl:if>
@@ -8434,6 +8751,8 @@
8434
8751
  </xsl:attribute>
8435
8752
  </xsl:for-each>
8436
8753
 
8754
+ <xsl:call-template name="refine_sourcecode-style"/>
8755
+
8437
8756
  <!-- remove margin between rows in the table with sourcecode line numbers -->
8438
8757
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8439
8758
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -9138,6 +9457,8 @@
9138
9457
 
9139
9458
  <xsl:call-template name="setBlockSpanAll"/>
9140
9459
 
9460
+ <xsl:call-template name="refine_example-style"/>
9461
+
9141
9462
  <xsl:variable name="fo_element">
9142
9463
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9143
9464
  inline
@@ -9270,6 +9591,8 @@
9270
9591
  </xsl:if>
9271
9592
  <fo:block xsl:use-attribute-sets="example-p-style">
9272
9593
 
9594
+ <xsl:call-template name="refine_example-p-style"/>
9595
+
9273
9596
  <xsl:apply-templates/>
9274
9597
  </fo:block>
9275
9598
  </fo:block-container>
@@ -9286,6 +9609,7 @@
9286
9609
  </xsl:otherwise>
9287
9610
  </xsl:choose>
9288
9611
  </xsl:template> <!-- example/p -->
9612
+
9289
9613
  <!-- ====== -->
9290
9614
  <!-- ====== -->
9291
9615
 
@@ -9297,6 +9621,8 @@
9297
9621
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
9298
9622
  <fo:block xsl:use-attribute-sets="termsource-style">
9299
9623
 
9624
+ <xsl:call-template name="refine_termsource-style"/>
9625
+
9300
9626
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
9301
9627
  <xsl:variable name="termsource_text">
9302
9628
  <xsl:apply-templates/>
@@ -9416,11 +9742,7 @@
9416
9742
  <fo:block-container margin-left="0mm">
9417
9743
  <fo:block-container xsl:use-attribute-sets="quote-style">
9418
9744
 
9419
- <xsl:if test="ancestor::*[local-name() = 'boilerplate']">
9420
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
9421
- <xsl:attribute name="margin-right">7mm</xsl:attribute>
9422
- <xsl:attribute name="font-style">normal</xsl:attribute>
9423
- </xsl:if>
9745
+ <xsl:call-template name="refine_quote-style"/>
9424
9746
 
9425
9747
  <fo:block-container margin-left="0mm" margin-right="0mm">
9426
9748
  <fo:block role="BlockQuote">
@@ -9496,8 +9818,7 @@
9496
9818
 
9497
9819
  </xsl:if>
9498
9820
 
9499
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9500
- <xsl:variable name="text" select="normalize-space()"/>
9821
+ <xsl:call-template name="refine_eref-style"/>
9501
9822
 
9502
9823
  <xsl:call-template name="insert_basic_link">
9503
9824
  <xsl:with-param name="element">
@@ -9507,6 +9828,8 @@
9507
9828
  </xsl:if>
9508
9829
  <xsl:if test="@type = 'inline'">
9509
9830
 
9831
+ <xsl:call-template name="refine_basic_link_style"/>
9832
+
9510
9833
  </xsl:if>
9511
9834
 
9512
9835
  <xsl:choose>
@@ -9539,6 +9862,11 @@
9539
9862
  </xsl:otherwise>
9540
9863
  </xsl:choose>
9541
9864
  </xsl:template>
9865
+
9866
+ <xsl:template name="refine_basic_link_style">
9867
+
9868
+ </xsl:template> <!-- refine_basic_link_style -->
9869
+
9542
9870
  <!-- ====== -->
9543
9871
  <!-- END eref -->
9544
9872
  <!-- ====== -->
@@ -9681,16 +10009,22 @@
9681
10009
  <fo:block>
9682
10010
  <xsl:call-template name="setId"/>
9683
10011
 
9684
- <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
9685
- <xsl:if test="$pos &gt;= 2">
9686
- <xsl:attribute name="space-before">18pt</xsl:attribute>
9687
- </xsl:if>
10012
+ <xsl:call-template name="sections_element_style"/>
9688
10013
 
9689
10014
  <xsl:apply-templates/>
9690
10015
  </fo:block>
9691
10016
 
9692
10017
  </xsl:template>
9693
10018
 
10019
+ <xsl:template name="sections_element_style">
10020
+
10021
+ <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
10022
+ <xsl:if test="$pos &gt;= 2">
10023
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
10024
+ </xsl:if>
10025
+
10026
+ </xsl:template> <!-- sections_element_style -->
10027
+
9694
10028
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
9695
10029
  <fo:block break-after="page"/>
9696
10030
  <fo:block>
@@ -9705,14 +10039,20 @@
9705
10039
 
9706
10040
  <xsl:call-template name="setBlockSpanAll"/>
9707
10041
 
9708
- <xsl:if test="@inline-header='true'">
9709
- <xsl:attribute name="text-align">justify</xsl:attribute>
9710
- </xsl:if>
10042
+ <xsl:call-template name="refine_clause_style"/>
9711
10043
 
9712
10044
  <xsl:apply-templates/>
9713
10045
  </fo:block>
9714
10046
  </xsl:template>
9715
10047
 
10048
+ <xsl:template name="refine_clause_style">
10049
+
10050
+ <xsl:if test="@inline-header='true'">
10051
+ <xsl:attribute name="text-align">justify</xsl:attribute>
10052
+ </xsl:if>
10053
+
10054
+ </xsl:template> <!-- refine_clause_style -->
10055
+
9716
10056
  <xsl:template match="*[local-name() = 'definitions']">
9717
10057
  <fo:block id="{@id}">
9718
10058
  <xsl:apply-templates/>
@@ -9725,10 +10065,16 @@
9725
10065
 
9726
10066
  <xsl:call-template name="setBlockSpanAll"/>
9727
10067
 
10068
+ <xsl:call-template name="refine_annex_style"/>
10069
+
9728
10070
  </fo:block>
9729
10071
  <xsl:apply-templates/>
9730
10072
  </xsl:template>
9731
10073
 
10074
+ <xsl:template name="refine_annex_style">
10075
+
10076
+ </xsl:template>
10077
+
9732
10078
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
9733
10079
  <!-- comment 2019-11-29 -->
9734
10080
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -9895,6 +10241,8 @@
9895
10241
  </xsl:choose>
9896
10242
  </xsl:attribute>
9897
10243
 
10244
+ <xsl:call-template name="refine_list_container_style"/>
10245
+
9898
10246
  <fo:block-container margin-left="0mm">
9899
10247
  <fo:block>
9900
10248
  <xsl:apply-templates select="." mode="list"/>
@@ -9912,6 +10260,10 @@
9912
10260
  </xsl:choose>
9913
10261
  </xsl:template>
9914
10262
 
10263
+ <xsl:template name="refine_list_container_style">
10264
+
10265
+ </xsl:template> <!-- refine_list_container_style -->
10266
+
9915
10267
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
9916
10268
 
9917
10269
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -9922,7 +10274,7 @@
9922
10274
 
9923
10275
  <xsl:variable name="provisional_distance_between_starts_">
9924
10276
  <attributes xsl:use-attribute-sets="list-style">
9925
-
10277
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
9926
10278
  </attributes>
9927
10279
  </xsl:variable>
9928
10280
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -9958,6 +10310,8 @@
9958
10310
  <addon><xsl:value-of select="$addon"/></addon> -->
9959
10311
  </xsl:if>
9960
10312
 
10313
+ <xsl:call-template name="refine_list-style"/>
10314
+
9961
10315
  <xsl:if test="*[local-name() = 'name']">
9962
10316
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9963
10317
  </xsl:if>
@@ -9970,6 +10324,10 @@
9970
10324
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9971
10325
  </xsl:template>
9972
10326
 
10327
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
10328
+
10329
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10330
+
9973
10331
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9974
10332
  <xsl:param name="process">false</xsl:param>
9975
10333
  <xsl:if test="$process = 'true'">
@@ -9983,20 +10341,27 @@
9983
10341
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9984
10342
  <xsl:copy-of select="@id"/>
9985
10343
 
10344
+ <xsl:call-template name="refine_list-item-style"/>
10345
+
9986
10346
  <fo:list-item-label end-indent="label-end()">
9987
10347
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9988
10348
 
10349
+ <xsl:call-template name="refine_list-item-label-style"/>
10350
+
9989
10351
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9990
10352
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9991
10353
  <xsl:call-template name="append_add-style"/>
9992
10354
  </xsl:if>
9993
10355
 
9994
- <xsl:call-template name="getListItemFormat"/>
10356
+ <xsl:call-template name="getListItemFormat"/>
10357
+
9995
10358
  </fo:block>
9996
10359
  </fo:list-item-label>
9997
10360
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9998
10361
  <fo:block>
9999
10362
 
10363
+ <xsl:call-template name="refine_list-item-body-style"/>
10364
+
10000
10365
  <xsl:apply-templates/>
10001
10366
 
10002
10367
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -10314,6 +10679,7 @@
10314
10679
 
10315
10680
  <fo:block id="{@id}">
10316
10681
  <xsl:apply-templates/>
10682
+
10317
10683
  </fo:block>
10318
10684
  </xsl:template>
10319
10685
 
@@ -10333,6 +10699,7 @@
10333
10699
 
10334
10700
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
10335
10701
  <xsl:apply-templates/>
10702
+
10336
10703
  </fo:block>
10337
10704
 
10338
10705
  </xsl:template> <!-- references -->
@@ -10920,6 +11287,9 @@
10920
11287
  </xsl:copy>
10921
11288
  </xsl:template>
10922
11289
 
11290
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
11291
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
11292
+
10923
11293
  <xsl:template name="add_id">
10924
11294
  <xsl:if test="not(@id)">
10925
11295
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -11204,6 +11574,14 @@
11204
11574
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
11205
11575
  <xsl:variable name="p_fn_">
11206
11576
  <xsl:call-template name="get_fn_list"/>
11577
+ <!-- <xsl:choose>
11578
+ <xsl:when test="$namespace = 'jis'">
11579
+ <xsl:call-template name="get_fn_list_for_element"/>
11580
+ </xsl:when>
11581
+ <xsl:otherwise>
11582
+ <xsl:call-template name="get_fn_list"/>
11583
+ </xsl:otherwise>
11584
+ </xsl:choose> -->
11207
11585
  </xsl:variable>
11208
11586
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
11209
11587
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -11218,8 +11596,14 @@
11218
11596
  <xsl:attribute name="current_fn_number">
11219
11597
  <xsl:value-of select="$current_fn_number"/>
11220
11598
  </xsl:attribute>
11599
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11221
11600
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
11222
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11601
+
11602
+ <xsl:value-of select="$skip_footnote_body_"/>
11603
+
11604
+ </xsl:attribute>
11605
+ <xsl:attribute name="ref_id">
11606
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
11223
11607
  </xsl:attribute>
11224
11608
  <xsl:apply-templates select="node()" mode="linear_xml"/>
11225
11609
  </xsl:copy>