metanorma-iso 2.4.3 → 2.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -284,6 +284,10 @@
284
284
  <xsl:with-param name="root-style" select="$root-style"/>
285
285
  </xsl:call-template>
286
286
 
287
+ <xsl:if test="/iso:iso-standard/iso:metanorma-extension/iso:presentation-metadata/iso:linenumbers = 'true'">
288
+ <xsl:processing-instruction name="add_line_numbers">true</xsl:processing-instruction>
289
+ </xsl:if>
290
+
287
291
  <fo:layout-master-set>
288
292
 
289
293
  <!-- cover page -->
@@ -1307,123 +1311,15 @@
1307
1311
  </fo:block>
1308
1312
  </fo:block>
1309
1313
  </fo:block-container>
1314
+ <xsl:if test="/iso:iso-standard/iso:preface/*">
1315
+ <fo:block break-after="page"/>
1316
+ </xsl:if>
1310
1317
  </xsl:if>
1311
1318
 
1312
- <xsl:choose>
1313
- <xsl:when test="$doctype = 'amendment'"/><!-- ToC shouldn't be generated in amendments. -->
1314
-
1315
- <xsl:otherwise>
1316
- <xsl:if test="/iso:iso-standard/iso:boilerplate/iso:copyright-statement">
1317
- <fo:block break-after="page"/>
1318
- </xsl:if>
1319
- <fo:block-container font-weight="bold">
1320
- <fo:block role="TOC">
1321
- <fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
1322
- <fo:inline font-size="16pt" font-weight="bold" role="H1">
1323
- <!-- Contents -->
1324
- <xsl:call-template name="getLocalizedString">
1325
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
1326
- </xsl:call-template>
1327
- </fo:inline>
1328
- <fo:inline keep-together.within-line="always">
1329
- <fo:leader leader-pattern="space"/>
1330
- <fo:inline font-weight="normal" font-size="10pt">
1331
- <!-- Page -->
1332
- <xsl:call-template name="getLocalizedString">
1333
- <xsl:with-param name="key">locality.page</xsl:with-param>
1334
- </xsl:call-template>
1335
- </fo:inline>
1336
- </fo:inline>
1337
- </fo:block>
1338
-
1339
- <xsl:if test="$debug = 'true'">
1340
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1341
- DEBUG
1342
- contents=<xsl:copy-of select="$contents"/>
1343
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1344
- </xsl:if>
1345
-
1346
- <xsl:variable name="margin-left">12</xsl:variable>
1347
- <xsl:for-each select="$contents//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1348
-
1349
- <fo:block role="TOCI">
1350
- <xsl:if test="@level = 1">
1351
- <xsl:attribute name="margin-top">5pt</xsl:attribute>
1352
- </xsl:if>
1353
- <xsl:if test="@level = 3">
1354
- <xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
1355
- </xsl:if>
1356
- <fo:list-block>
1357
- <xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
1358
- <xsl:if test="@level &gt;= 2 or @type = 'annex'">
1359
- <xsl:attribute name="font-weight">normal</xsl:attribute>
1360
- </xsl:if>
1361
- <xsl:attribute name="provisional-distance-between-starts">
1362
- <xsl:choose>
1363
- <!-- skip 0 section without subsections -->
1364
- <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
1365
- <xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
1366
- <xsl:otherwise>0mm</xsl:otherwise>
1367
- </xsl:choose>
1368
- </xsl:attribute>
1369
- <fo:list-item>
1370
- <fo:list-item-label end-indent="label-end()">
1371
- <fo:block>
1372
- <xsl:value-of select="@section"/>
1373
- </fo:block>
1374
- </fo:list-item-label>
1375
- <fo:list-item-body start-indent="body-start()">
1376
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
1377
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1378
-
1379
- <xsl:apply-templates select="title"/>
1380
-
1381
- <fo:inline keep-together.within-line="always">
1382
- <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
1383
- <fo:inline>
1384
- <xsl:if test="@level = 1 and @type = 'annex'">
1385
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1386
- </xsl:if>
1387
- <fo:page-number-citation ref-id="{@id}"/>
1388
- </fo:inline>
1389
- </fo:inline>
1390
- </fo:basic-link>
1391
- </fo:block>
1392
- </fo:list-item-body>
1393
- </fo:list-item>
1394
- </fo:list-block>
1395
- </fo:block>
1396
-
1397
- </xsl:for-each>
1398
-
1399
- <!-- List of Tables -->
1400
- <xsl:if test="$contents//tables/table">
1401
- <xsl:call-template name="insertListOf_Title">
1402
- <xsl:with-param name="title" select="$title-list-tables"/>
1403
- </xsl:call-template>
1404
- <xsl:for-each select="$contents//tables/table">
1405
- <xsl:call-template name="insertListOf_Item"/>
1406
- </xsl:for-each>
1407
- </xsl:if>
1408
-
1409
- <!-- List of Figures -->
1410
- <xsl:if test="$contents//figures/figure">
1411
- <xsl:call-template name="insertListOf_Title">
1412
- <xsl:with-param name="title" select="$title-list-figures"/>
1413
- </xsl:call-template>
1414
- <xsl:for-each select="$contents//figures/figure">
1415
- <xsl:call-template name="insertListOf_Item"/>
1416
- </xsl:for-each>
1417
- </xsl:if>
1418
-
1419
- </fo:block>
1420
- </fo:block-container>
1421
- </xsl:otherwise>
1422
- </xsl:choose>
1423
-
1424
- <!-- Foreword, Introduction -->
1319
+ <!-- ToC, Foreword, Introduction -->
1425
1320
  <xsl:call-template name="processPrefaceSectionsDefault"/>
1426
1321
 
1322
+ <fo:block/> <!-- for prevent empty preface -->
1427
1323
  </fo:flow>
1428
1324
  </fo:page-sequence>
1429
1325
 
@@ -1595,6 +1491,126 @@
1595
1491
 
1596
1492
  </xsl:template>
1597
1493
 
1494
+ <xsl:template match="iso:preface/iso:clause[@type = 'toc']" priority="3">
1495
+ <xsl:choose>
1496
+ <xsl:when test="$doctype = 'amendment'"/><!-- ToC shouldn't be generated in amendments. -->
1497
+ <xsl:otherwise>
1498
+
1499
+ <fo:block-container font-weight="bold">
1500
+ <fo:block role="TOC">
1501
+
1502
+ <xsl:apply-templates/>
1503
+
1504
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
1505
+
1506
+ <xsl:if test="$debug = 'true'">
1507
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1508
+ DEBUG
1509
+ contents=<xsl:copy-of select="$contents"/>
1510
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1511
+ </xsl:if>
1512
+
1513
+ <xsl:variable name="margin-left">12</xsl:variable>
1514
+ <xsl:for-each select="$contents//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1515
+
1516
+ <fo:block role="TOCI">
1517
+ <xsl:if test="@level = 1">
1518
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
1519
+ </xsl:if>
1520
+ <xsl:if test="@level = 3">
1521
+ <xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
1522
+ </xsl:if>
1523
+ <fo:list-block>
1524
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
1525
+ <xsl:if test="@level &gt;= 2 or @type = 'annex'">
1526
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1527
+ </xsl:if>
1528
+ <xsl:attribute name="provisional-distance-between-starts">
1529
+ <xsl:choose>
1530
+ <!-- skip 0 section without subsections -->
1531
+ <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
1532
+ <xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
1533
+ <xsl:otherwise>0mm</xsl:otherwise>
1534
+ </xsl:choose>
1535
+ </xsl:attribute>
1536
+ <fo:list-item>
1537
+ <fo:list-item-label end-indent="label-end()">
1538
+ <fo:block>
1539
+ <xsl:value-of select="@section"/>
1540
+ </fo:block>
1541
+ </fo:list-item-label>
1542
+ <fo:list-item-body start-indent="body-start()">
1543
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
1544
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1545
+
1546
+ <xsl:apply-templates select="title"/>
1547
+
1548
+ <fo:inline keep-together.within-line="always">
1549
+ <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
1550
+ <fo:inline>
1551
+ <xsl:if test="@level = 1 and @type = 'annex'">
1552
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1553
+ </xsl:if>
1554
+ <fo:page-number-citation ref-id="{@id}"/>
1555
+ </fo:inline>
1556
+ </fo:inline>
1557
+ </fo:basic-link>
1558
+ </fo:block>
1559
+ </fo:list-item-body>
1560
+ </fo:list-item>
1561
+ </fo:list-block>
1562
+ </fo:block>
1563
+
1564
+ </xsl:for-each>
1565
+
1566
+ <!-- List of Tables -->
1567
+ <xsl:if test="$contents//tables/table">
1568
+ <xsl:call-template name="insertListOf_Title">
1569
+ <xsl:with-param name="title" select="$title-list-tables"/>
1570
+ </xsl:call-template>
1571
+ <xsl:for-each select="$contents//tables/table">
1572
+ <xsl:call-template name="insertListOf_Item"/>
1573
+ </xsl:for-each>
1574
+ </xsl:if>
1575
+
1576
+ <!-- List of Figures -->
1577
+ <xsl:if test="$contents//figures/figure">
1578
+ <xsl:call-template name="insertListOf_Title">
1579
+ <xsl:with-param name="title" select="$title-list-figures"/>
1580
+ </xsl:call-template>
1581
+ <xsl:for-each select="$contents//figures/figure">
1582
+ <xsl:call-template name="insertListOf_Item"/>
1583
+ </xsl:for-each>
1584
+ </xsl:if>
1585
+
1586
+ </xsl:if>
1587
+ </fo:block>
1588
+ </fo:block-container>
1589
+ </xsl:otherwise>
1590
+ </xsl:choose>
1591
+ </xsl:template>
1592
+
1593
+ <xsl:template match="iso:preface/iso:clause[@type = 'toc']/iso:title" priority="3">
1594
+ <fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
1595
+ <fo:inline font-size="16pt" font-weight="bold" role="H1">
1596
+ <!-- Contents -->
1597
+ <!-- <xsl:call-template name="getLocalizedString">
1598
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1599
+ </xsl:call-template> -->
1600
+ <xsl:apply-templates/>
1601
+ </fo:inline>
1602
+ <fo:inline keep-together.within-line="always">
1603
+ <fo:leader leader-pattern="space"/>
1604
+ <fo:inline font-weight="normal" font-size="10pt">
1605
+ <!-- Page -->
1606
+ <xsl:call-template name="getLocalizedString">
1607
+ <xsl:with-param name="key">locality.page</xsl:with-param>
1608
+ </xsl:call-template>
1609
+ </fo:inline>
1610
+ </fo:inline>
1611
+ </fo:block>
1612
+ </xsl:template>
1613
+
1598
1614
  <xsl:template match="iso:pagebreak" priority="2">
1599
1615
  <xsl:copy-of select="."/>
1600
1616
  </xsl:template>
@@ -2685,6 +2701,10 @@
2685
2701
 
2686
2702
  </xsl:attribute-set>
2687
2703
 
2704
+ <xsl:template name="refine_link-style">
2705
+
2706
+ </xsl:template> <!-- refine_link-style -->
2707
+
2688
2708
  <xsl:attribute-set name="sourcecode-container-style">
2689
2709
 
2690
2710
  </xsl:attribute-set>
@@ -2699,6 +2719,10 @@
2699
2719
 
2700
2720
  </xsl:attribute-set>
2701
2721
 
2722
+ <xsl:template name="refine_sourcecode-style">
2723
+
2724
+ </xsl:template> <!-- refine_sourcecode-style -->
2725
+
2702
2726
  <xsl:attribute-set name="pre-style">
2703
2727
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2704
2728
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2792,6 +2816,10 @@
2792
2816
 
2793
2817
  </xsl:attribute-set> <!-- example-style -->
2794
2818
 
2819
+ <xsl:template name="refine_example-style">
2820
+
2821
+ </xsl:template> <!-- refine_example-style -->
2822
+
2795
2823
  <xsl:attribute-set name="example-body-style">
2796
2824
 
2797
2825
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
@@ -2817,6 +2845,10 @@
2817
2845
 
2818
2846
  </xsl:attribute-set> <!-- example-p-style -->
2819
2847
 
2848
+ <xsl:template name="refine_example-p-style">
2849
+
2850
+ </xsl:template> <!-- refine_example-p-style -->
2851
+
2820
2852
  <xsl:attribute-set name="termexample-name-style">
2821
2853
 
2822
2854
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -2848,6 +2880,19 @@
2848
2880
 
2849
2881
  </xsl:attribute-set> <!-- table-container-style -->
2850
2882
 
2883
+ <xsl:template name="refine_table-container-style">
2884
+ <xsl:param name="margin-side"/>
2885
+
2886
+ <xsl:if test="not(*[local-name() = 'name'])">
2887
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2888
+ </xsl:if>
2889
+ <xsl:if test="starts-with(@id, 'array_')">
2890
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2891
+ </xsl:if>
2892
+
2893
+ <!-- end table block-container attributes -->
2894
+ </xsl:template> <!-- refine_table-container-style -->
2895
+
2851
2896
  <xsl:attribute-set name="table-style">
2852
2897
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2853
2898
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
@@ -2856,6 +2901,21 @@
2856
2901
 
2857
2902
  </xsl:attribute-set><!-- table-style -->
2858
2903
 
2904
+ <xsl:template name="refine_table-style">
2905
+ <xsl:param name="margin-side"/>
2906
+
2907
+ <xsl:if test="*[local-name()='thead']">
2908
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2909
+ </xsl:if>
2910
+ <xsl:if test="ancestor::*[local-name() = 'table']">
2911
+ <!-- for internal table in table cell -->
2912
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2913
+ </xsl:if>
2914
+
2915
+ <xsl:call-template name="setBordersTableArray"/>
2916
+
2917
+ </xsl:template> <!-- refine_table-style -->
2918
+
2859
2919
  <xsl:attribute-set name="table-name-style">
2860
2920
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2861
2921
 
@@ -2866,6 +2926,15 @@
2866
2926
 
2867
2927
  </xsl:attribute-set> <!-- table-name-style -->
2868
2928
 
2929
+ <xsl:template name="refine_table-name-style">
2930
+ <xsl:param name="continued"/>
2931
+
2932
+ <xsl:if test="$continued = 'true'">
2933
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2934
+ </xsl:if>
2935
+
2936
+ </xsl:template> <!-- refine_table-name-style -->
2937
+
2869
2938
  <xsl:attribute-set name="table-row-style">
2870
2939
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2871
2940
 
@@ -2879,6 +2948,23 @@
2879
2948
 
2880
2949
  </xsl:attribute-set>
2881
2950
 
2951
+ <xsl:template name="refine_table-header-row-style">
2952
+
2953
+ <xsl:choose>
2954
+ <xsl:when test="position() = 1">
2955
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2956
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2957
+ </xsl:when>
2958
+ <xsl:when test="position() = last()">
2959
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2960
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
2961
+ </xsl:when>
2962
+ </xsl:choose>
2963
+
2964
+ <xsl:call-template name="setBordersTableArray"/>
2965
+
2966
+ </xsl:template> <!-- refine_table-header-row-style -->
2967
+
2882
2968
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2883
2969
 
2884
2970
  <xsl:attribute name="font-size">9pt</xsl:attribute>
@@ -2887,10 +2973,24 @@
2887
2973
 
2888
2974
  </xsl:attribute-set>
2889
2975
 
2976
+ <xsl:template name="refine_table-footer-row-style">
2977
+
2978
+ </xsl:template> <!-- refine_table-footer-row-style -->
2979
+
2890
2980
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2891
2981
 
2892
2982
  </xsl:attribute-set>
2893
2983
 
2984
+ <xsl:template name="refine_table-body-row-style">
2985
+
2986
+ <xsl:if test="position() = 1 and not(ancestor::*[local-name() = 'table']/*[local-name() = 'thead']) and ancestor::*[local-name() = 'table']/*[local-name() = 'name']">
2987
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2988
+ </xsl:if>
2989
+
2990
+ <xsl:call-template name="setBordersTableArray"/>
2991
+
2992
+ </xsl:template> <!-- refine_table-body-row-style -->
2993
+
2894
2994
  <xsl:attribute-set name="table-header-cell-style">
2895
2995
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2896
2996
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2904,6 +3004,23 @@
2904
3004
 
2905
3005
  </xsl:attribute-set> <!-- table-header-cell-style -->
2906
3006
 
3007
+ <xsl:template name="refine_table-header-cell-style">
3008
+
3009
+ <xsl:if test="../parent::*[local-name() = 'tbody'] and (following-sibling::*[local-name() = 'td'] or preceding-sibling::*[local-name() = 'td'])">
3010
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
3011
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
3012
+ </xsl:if>
3013
+
3014
+ <xsl:call-template name="setBordersTableArray"/>
3015
+
3016
+ <xsl:if test="$lang = 'ar'">
3017
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3018
+ </xsl:if>
3019
+
3020
+ <xsl:call-template name="setTableCellAttributes"/>
3021
+
3022
+ </xsl:template> <!-- refine_table-header-cell-style -->
3023
+
2907
3024
  <xsl:attribute-set name="table-cell-style">
2908
3025
  <xsl:attribute name="display-align">center</xsl:attribute>
2909
3026
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2914,6 +3031,29 @@
2914
3031
 
2915
3032
  </xsl:attribute-set> <!-- table-cell-style -->
2916
3033
 
3034
+ <xsl:template name="refine_table-cell-style">
3035
+
3036
+ <xsl:if test="$lang = 'ar'">
3037
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3038
+ </xsl:if>
3039
+
3040
+ <!-- bsi -->
3041
+
3042
+ <xsl:if test="ancestor::*[local-name() = 'tfoot']">
3043
+ <xsl:attribute name="border">solid black 0</xsl:attribute>
3044
+ </xsl:if>
3045
+ <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend')">
3046
+ <xsl:attribute name="display-align">before</xsl:attribute>
3047
+ </xsl:if>
3048
+ <xsl:if test="ancestor::*[local-name() = 'tbody'] and not(../preceding-sibling::*[local-name() = 'tr']) and ancestor::*[local-name() = 'table'][1]/*[local-name() = 'thead']"> <!-- cells in 1st row in the table body, and if thead exists -->
3049
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3050
+ </xsl:if>
3051
+ <!-- <xsl:attribute name="page-break-inside">avoid</xsl:attribute> -->
3052
+
3053
+ <xsl:call-template name="setBordersTableArray"/>
3054
+
3055
+ </xsl:template> <!-- refine_table-cell-style -->
3056
+
2917
3057
  <xsl:attribute-set name="table-footer-cell-style">
2918
3058
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2919
3059
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2925,6 +3065,10 @@
2925
3065
 
2926
3066
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2927
3067
 
3068
+ <xsl:template name="refine_table-footer-cell-style">
3069
+
3070
+ </xsl:template> <!-- refine_table-footer-cell-style -->
3071
+
2928
3072
  <xsl:attribute-set name="table-note-style">
2929
3073
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2930
3074
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2934,6 +3078,10 @@
2934
3078
 
2935
3079
  </xsl:attribute-set><!-- table-note-style -->
2936
3080
 
3081
+ <xsl:template name="refine_table-note-style">
3082
+
3083
+ </xsl:template> <!-- refine_table-note-style -->
3084
+
2937
3085
  <xsl:attribute-set name="table-fn-style">
2938
3086
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2939
3087
 
@@ -2992,11 +3140,21 @@
2992
3140
 
2993
3141
  </xsl:attribute-set>
2994
3142
 
3143
+ <xsl:template name="refine_dt-cell-style">
3144
+
3145
+ </xsl:template> <!-- refine_dt-cell-style -->
3146
+
2995
3147
  <xsl:attribute-set name="dt-block-style">
2996
3148
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2997
3149
 
3150
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
3151
+
2998
3152
  </xsl:attribute-set>
2999
3153
 
3154
+ <xsl:template name="refine_dt-block-style">
3155
+
3156
+ </xsl:template> <!-- refine_dt-block-style -->
3157
+
3000
3158
  <xsl:attribute-set name="dl-name-style">
3001
3159
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3002
3160
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -3010,6 +3168,10 @@
3010
3168
 
3011
3169
  </xsl:attribute-set>
3012
3170
 
3171
+ <xsl:template name="refine_dd-cell-style">
3172
+
3173
+ </xsl:template> <!-- refine_dd-cell-style -->
3174
+
3013
3175
  <!-- ========================== -->
3014
3176
  <!-- END Definition's list styles -->
3015
3177
  <!-- ========================== -->
@@ -3032,7 +3194,6 @@
3032
3194
  </xsl:attribute-set>
3033
3195
 
3034
3196
  <xsl:attribute-set name="xref-style">
3035
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3036
3197
 
3037
3198
  <xsl:attribute name="color">blue</xsl:attribute>
3038
3199
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -3043,6 +3204,12 @@
3043
3204
 
3044
3205
  </xsl:attribute-set>
3045
3206
 
3207
+ <xsl:template name="refine_eref-style">
3208
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
3209
+ <xsl:variable name="text" select="normalize-space()"/>
3210
+
3211
+ </xsl:template> <!-- refine_eref-style -->
3212
+
3046
3213
  <xsl:attribute-set name="note-style">
3047
3214
 
3048
3215
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -3052,6 +3219,14 @@
3052
3219
 
3053
3220
  </xsl:attribute-set>
3054
3221
 
3222
+ <xsl:template name="refine_note-style">
3223
+
3224
+ <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
3225
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
3226
+ </xsl:if>
3227
+
3228
+ </xsl:template>
3229
+
3055
3230
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
3056
3231
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
3057
3232
 
@@ -3061,11 +3236,19 @@
3061
3236
 
3062
3237
  </xsl:attribute-set>
3063
3238
 
3239
+ <xsl:template name="refine_note-name-style">
3240
+
3241
+ </xsl:template> <!-- refine_note-name-style -->
3242
+
3064
3243
  <xsl:attribute-set name="table-note-name-style">
3065
3244
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
3066
3245
 
3067
3246
  </xsl:attribute-set>
3068
3247
 
3248
+ <xsl:template name="refine_table-note-name-style">
3249
+
3250
+ </xsl:template> <!-- refine_table-note-name-style -->
3251
+
3069
3252
  <xsl:attribute-set name="note-p-style">
3070
3253
 
3071
3254
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -3082,10 +3265,22 @@
3082
3265
 
3083
3266
  </xsl:attribute-set>
3084
3267
 
3268
+ <xsl:template name="refine_termnote-style">
3269
+
3270
+ <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
3271
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
3272
+ </xsl:if>
3273
+
3274
+ </xsl:template> <!-- refine_termnote-style -->
3275
+
3085
3276
  <xsl:attribute-set name="termnote-name-style">
3086
3277
 
3087
3278
  </xsl:attribute-set>
3088
3279
 
3280
+ <xsl:template name="refine_termnote-name-style">
3281
+
3282
+ </xsl:template>
3283
+
3089
3284
  <xsl:attribute-set name="termnote-p-style">
3090
3285
 
3091
3286
  </xsl:attribute-set>
@@ -3098,6 +3293,15 @@
3098
3293
 
3099
3294
  </xsl:attribute-set>
3100
3295
 
3296
+ <xsl:template name="refine_quote-style">
3297
+
3298
+ <xsl:if test="$doctype = 'amendment' and (*[local-name() = 'note'] or *[local-name() = 'termnote'])">
3299
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
3300
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3301
+ </xsl:if>
3302
+
3303
+ </xsl:template>
3304
+
3101
3305
  <xsl:attribute-set name="quote-source-style">
3102
3306
  <xsl:attribute name="text-align">right</xsl:attribute>
3103
3307
 
@@ -3109,6 +3313,10 @@
3109
3313
 
3110
3314
  </xsl:attribute-set>
3111
3315
 
3316
+ <xsl:template name="refine_termsource-style">
3317
+
3318
+ </xsl:template> <!-- refine_termsource-style -->
3319
+
3112
3320
  <xsl:attribute-set name="termsource-text-style">
3113
3321
 
3114
3322
  </xsl:attribute-set>
@@ -3149,6 +3357,10 @@
3149
3357
 
3150
3358
  </xsl:attribute-set>
3151
3359
 
3360
+ <xsl:template name="refine_figure-name-style">
3361
+
3362
+ </xsl:template> <!-- refine_figure-name-style -->
3363
+
3152
3364
  <xsl:attribute-set name="figure-source-style">
3153
3365
 
3154
3366
  </xsl:attribute-set>
@@ -3168,6 +3380,10 @@
3168
3380
 
3169
3381
  </xsl:attribute-set> <!-- formula-stem-block-style -->
3170
3382
 
3383
+ <xsl:template name="refine_formula-stem-block-style">
3384
+
3385
+ </xsl:template> <!-- refine_formula-stem-block-style -->
3386
+
3171
3387
  <xsl:attribute-set name="formula-stem-number-style">
3172
3388
  <xsl:attribute name="text-align">right</xsl:attribute>
3173
3389
 
@@ -3179,6 +3395,10 @@
3179
3395
 
3180
3396
  </xsl:attribute-set>
3181
3397
 
3398
+ <xsl:template name="refine_image-style">
3399
+
3400
+ </xsl:template>
3401
+
3182
3402
  <xsl:attribute-set name="figure-pseudocode-p-style">
3183
3403
 
3184
3404
  </xsl:attribute-set>
@@ -3273,6 +3493,10 @@
3273
3493
 
3274
3494
  </xsl:attribute-set>
3275
3495
 
3496
+ <xsl:template name="refine_mathml-style">
3497
+
3498
+ </xsl:template>
3499
+
3276
3500
  <xsl:attribute-set name="list-style">
3277
3501
 
3278
3502
  <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
@@ -3280,6 +3504,14 @@
3280
3504
 
3281
3505
  </xsl:attribute-set> <!-- list-style -->
3282
3506
 
3507
+ <xsl:template name="refine_list-style">
3508
+
3509
+ <xsl:if test="not(ancestor::*[local-name() = 'ul' or local-name() = 'ol'])">
3510
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
3511
+ </xsl:if>
3512
+
3513
+ </xsl:template> <!-- refine_list-style -->
3514
+
3283
3515
  <xsl:attribute-set name="list-name-style">
3284
3516
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3285
3517
 
@@ -3292,14 +3524,26 @@
3292
3524
 
3293
3525
  </xsl:attribute-set>
3294
3526
 
3527
+ <xsl:template name="refine_list-item-style">
3528
+
3529
+ </xsl:template> <!-- refine_list-item-style -->
3530
+
3295
3531
  <xsl:attribute-set name="list-item-label-style">
3296
3532
 
3297
3533
  </xsl:attribute-set>
3298
3534
 
3535
+ <xsl:template name="refine_list-item-label-style">
3536
+
3537
+ </xsl:template> <!-- refine_list-item-label-style -->
3538
+
3299
3539
  <xsl:attribute-set name="list-item-body-style">
3300
3540
 
3301
3541
  </xsl:attribute-set>
3302
3542
 
3543
+ <xsl:template name="refine_list-item-body-style">
3544
+
3545
+ </xsl:template> <!-- refine_list-item-body-style -->
3546
+
3303
3547
  <xsl:attribute-set name="toc-style">
3304
3548
  <xsl:attribute name="line-height">135%</xsl:attribute>
3305
3549
  </xsl:attribute-set>
@@ -3310,6 +3554,15 @@
3310
3554
 
3311
3555
  </xsl:attribute-set>
3312
3556
 
3557
+ <xsl:template name="refine_fn-reference-style">
3558
+
3559
+ <xsl:if test="ancestor::*[local-name()='table']">
3560
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3561
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3562
+ </xsl:if>
3563
+
3564
+ </xsl:template> <!-- refine_fn-reference-style -->
3565
+
3313
3566
  <xsl:attribute-set name="fn-style">
3314
3567
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3315
3568
  </xsl:attribute-set>
@@ -3333,6 +3586,10 @@
3333
3586
 
3334
3587
  </xsl:attribute-set>
3335
3588
 
3589
+ <xsl:template name="refine_fn-body-style">
3590
+
3591
+ </xsl:template> <!-- refine_fn-body-style -->
3592
+
3336
3593
  <xsl:attribute-set name="fn-body-num-style">
3337
3594
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3338
3595
 
@@ -3340,6 +3597,10 @@
3340
3597
 
3341
3598
  </xsl:attribute-set> <!-- fn-body-num-style -->
3342
3599
 
3600
+ <xsl:template name="refine_fn-body-num-style">
3601
+
3602
+ </xsl:template> <!-- refine_fn-body-num-style -->
3603
+
3343
3604
  <!-- admonition -->
3344
3605
  <xsl:attribute-set name="admonition-style">
3345
3606
 
@@ -3986,14 +4247,9 @@
3986
4247
 
3987
4248
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3988
4249
 
3989
- <xsl:if test="not(*[local-name() = 'name'])">
3990
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
3991
- </xsl:if>
3992
- <xsl:if test="starts-with(@id, 'array_')">
3993
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
3994
- </xsl:if>
3995
-
3996
- <!-- end table block-container attributes -->
4250
+ <xsl:call-template name="refine_table-container-style">
4251
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4252
+ </xsl:call-template>
3997
4253
 
3998
4254
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3999
4255
 
@@ -4014,15 +4270,9 @@
4014
4270
 
4015
4271
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
4016
4272
 
4017
- <xsl:if test="*[local-name()='thead']">
4018
- <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
4019
- </xsl:if>
4020
- <xsl:if test="ancestor::*[local-name() = 'table']">
4021
- <!-- for internal table in table cell -->
4022
- <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4023
- </xsl:if>
4024
-
4025
- <xsl:call-template name="setBordersTableArray"/>
4273
+ <xsl:call-template name="refine_table-style">
4274
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4275
+ </xsl:call-template>
4026
4276
 
4027
4277
  </xsl:element>
4028
4278
  </xsl:variable>
@@ -4044,7 +4294,7 @@
4044
4294
  </xsl:attribute>
4045
4295
  </xsl:for-each>
4046
4296
 
4047
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
4297
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
4048
4298
  <xsl:if test="$isNoteOrFnExist = 'true'">
4049
4299
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
4050
4300
  </xsl:if>
@@ -4088,7 +4338,7 @@
4088
4338
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
4089
4339
  </xsl:when>
4090
4340
  <xsl:otherwise>
4091
- <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 -->
4341
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'example') 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 -->
4092
4342
  </xsl:otherwise>
4093
4343
  </xsl:choose>
4094
4344
 
@@ -4183,9 +4433,9 @@
4183
4433
 
4184
4434
  <fo:block xsl:use-attribute-sets="table-name-style">
4185
4435
 
4186
- <xsl:if test="$continued = 'true'">
4187
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
4188
- </xsl:if>
4436
+ <xsl:call-template name="refine_table-name-style">
4437
+ <xsl:with-param name="continued" select="$continued"/>
4438
+ </xsl:call-template>
4189
4439
 
4190
4440
  <xsl:choose>
4191
4441
  <xsl:when test="$continued = 'true'">
@@ -4583,11 +4833,7 @@
4583
4833
  <fo:table-row>
4584
4834
  <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">
4585
4835
 
4586
- <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
4587
- <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
4588
- <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
4589
- <!-- <xsl:attribute name="border-bottom">0.5pt solid white</xsl:attribute> -->
4590
- <xsl:attribute name="border-bottom">none</xsl:attribute>
4836
+ <xsl:call-template name="refine_table-header-title-style"/>
4591
4837
 
4592
4838
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4593
4839
  <xsl:with-param name="continued">true</xsl:with-param>
@@ -4605,6 +4851,16 @@
4605
4851
  </fo:table-row>
4606
4852
  </xsl:template> <!-- table-header-title -->
4607
4853
 
4854
+ <xsl:template name="refine_table-header-title-style">
4855
+
4856
+ <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
4857
+ <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
4858
+ <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
4859
+ <!-- <xsl:attribute name="border-bottom">0.5pt solid white</xsl:attribute> -->
4860
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
4861
+
4862
+ </xsl:template> <!-- refine_table-header-title-style -->
4863
+
4608
4864
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
4609
4865
  <fo:table-body>
4610
4866
  <xsl:apply-templates/>
@@ -4629,7 +4885,7 @@
4629
4885
  <xsl:param name="colwidths"/>
4630
4886
  <xsl:param name="colgroup"/>
4631
4887
 
4632
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4888
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
4633
4889
 
4634
4890
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
4635
4891
 
@@ -4689,6 +4945,8 @@
4689
4945
  <fo:table-row>
4690
4946
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4691
4947
 
4948
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4949
+
4692
4950
  <xsl:call-template name="setBordersTableArray"/>
4693
4951
 
4694
4952
  <!-- fn will be processed inside 'note' processing -->
@@ -4697,8 +4955,10 @@
4697
4955
 
4698
4956
  <!-- except gb and bsi -->
4699
4957
 
4958
+ <xsl:apply-templates select="../*[local-name()='p']"/>
4700
4959
  <xsl:apply-templates select="../*[local-name()='dl']"/>
4701
4960
  <xsl:apply-templates select="../*[local-name()='note']"/>
4961
+ <xsl:apply-templates select="../*[local-name()='example']"/>
4702
4962
  <xsl:apply-templates select="../*[local-name()='source']"/>
4703
4963
 
4704
4964
  <xsl:variable name="isDisplayRowSeparator">
@@ -4707,7 +4967,7 @@
4707
4967
 
4708
4968
  <!-- horizontal row separator -->
4709
4969
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
4710
- <xsl:if test="../*[local-name()='note'] and normalize-space($table_fn_block) != ''">
4970
+ <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
4711
4971
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
4712
4972
 
4713
4973
  <xsl:call-template name="setBordersTableArray"/>
@@ -4872,18 +5132,7 @@
4872
5132
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4873
5133
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4874
5134
 
4875
- <xsl:choose>
4876
- <xsl:when test="position() = 1">
4877
- <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
4878
- <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4879
- </xsl:when>
4880
- <xsl:when test="position() = last()">
4881
- <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4882
- <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
4883
- </xsl:when>
4884
- </xsl:choose>
4885
-
4886
- <xsl:call-template name="setBordersTableArray"/>
5135
+ <xsl:call-template name="refine_table-header-row-style"/>
4887
5136
 
4888
5137
  <xsl:call-template name="setTableRowAttributes"/>
4889
5138
 
@@ -4917,6 +5166,8 @@
4917
5166
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4918
5167
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4919
5168
 
5169
+ <xsl:call-template name="refine_table-footer-row-style"/>
5170
+
4920
5171
  <xsl:call-template name="setTableRowAttributes"/>
4921
5172
  <xsl:apply-templates/>
4922
5173
  </fo:table-row>
@@ -4930,13 +5181,10 @@
4930
5181
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4931
5182
  </xsl:if>
4932
5183
 
4933
- <xsl:if test="position() = 1 and not(ancestor::*[local-name() = 'table']/*[local-name() = 'thead']) and ancestor::*[local-name() = 'table']/*[local-name() = 'name']">
4934
- <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
4935
- </xsl:if>
4936
-
4937
- <xsl:call-template name="setBordersTableArray"/>
5184
+ <xsl:call-template name="refine_table-body-row-style"/>
4938
5185
 
4939
5186
  <xsl:call-template name="setTableRowAttributes"/>
5187
+
4940
5188
  <xsl:apply-templates/>
4941
5189
  </fo:table-row>
4942
5190
  </xsl:template>
@@ -4955,18 +5203,7 @@
4955
5203
  <xsl:with-param name="default">center</xsl:with-param>
4956
5204
  </xsl:call-template>
4957
5205
 
4958
- <xsl:if test="../parent::*[local-name() = 'tbody'] and (following-sibling::*[local-name() = 'td'] or preceding-sibling::*[local-name() = 'td'])">
4959
- <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4960
- <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
4961
- </xsl:if>
4962
-
4963
- <xsl:call-template name="setBordersTableArray"/>
4964
-
4965
- <xsl:if test="$lang = 'ar'">
4966
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4967
- </xsl:if>
4968
-
4969
- <xsl:call-template name="setTableCellAttributes"/>
5206
+ <xsl:call-template name="refine_table-header-cell-style"/>
4970
5207
 
4971
5208
  <fo:block>
4972
5209
  <xsl:apply-templates/>
@@ -5008,24 +5245,7 @@
5008
5245
  <xsl:with-param name="default">left</xsl:with-param>
5009
5246
  </xsl:call-template>
5010
5247
 
5011
- <xsl:if test="$lang = 'ar'">
5012
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
5013
- </xsl:if>
5014
-
5015
- <!-- bsi -->
5016
-
5017
- <xsl:if test="ancestor::*[local-name() = 'tfoot']">
5018
- <xsl:attribute name="border">solid black 0</xsl:attribute>
5019
- </xsl:if>
5020
- <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend')">
5021
- <xsl:attribute name="display-align">before</xsl:attribute>
5022
- </xsl:if>
5023
- <xsl:if test="ancestor::*[local-name() = 'tbody'] and not(../preceding-sibling::*[local-name() = 'tr']) and ancestor::*[local-name() = 'table'][1]/*[local-name() = 'thead']"> <!-- cells in 1st row in the table body, and if thead exists -->
5024
- <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
5025
- </xsl:if>
5026
- <!-- <xsl:attribute name="page-break-inside">avoid</xsl:attribute> -->
5027
-
5028
- <xsl:call-template name="setBordersTableArray"/>
5248
+ <xsl:call-template name="refine_table-cell-style"/>
5029
5249
 
5030
5250
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
5031
5251
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -5052,13 +5272,17 @@
5052
5272
  </fo:table-cell>
5053
5273
  </xsl:template> <!-- td -->
5054
5274
 
5055
- <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
5275
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
5056
5276
 
5057
5277
  <fo:block xsl:use-attribute-sets="table-note-style">
5058
5278
 
5059
- <!-- Table's note name (NOTE, for example) -->
5279
+ <xsl:call-template name="refine_table-note-style"/>
5280
+
5281
+ <!-- Table's note/example name (NOTE, for example) -->
5060
5282
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
5061
5283
 
5284
+ <xsl:call-template name="refine_table-note-name-style"/>
5285
+
5062
5286
  <xsl:apply-templates select="*[local-name() = 'name']"/>
5063
5287
 
5064
5288
  </fo:inline>
@@ -5068,7 +5292,7 @@
5068
5292
 
5069
5293
  </xsl:template> <!-- table/note -->
5070
5294
 
5071
- <xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
5295
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
5072
5296
  <xsl:apply-templates/>
5073
5297
  </xsl:template>
5074
5298
 
@@ -5086,6 +5310,14 @@
5086
5310
  <!-- list of footnotes to calculate actual footnotes number -->
5087
5311
  <xsl:variable name="p_fn_">
5088
5312
  <xsl:call-template name="get_fn_list"/>
5313
+ <!-- <xsl:choose>
5314
+ <xsl:when test="$namespace = 'jis'">
5315
+ <xsl:call-template name="get_fn_list_for_element"/>
5316
+ </xsl:when>
5317
+ <xsl:otherwise>
5318
+ <xsl:call-template name="get_fn_list"/>
5319
+ </xsl:otherwise>
5320
+ </xsl:choose> -->
5089
5321
  </xsl:variable>
5090
5322
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
5091
5323
 
@@ -5112,7 +5344,14 @@
5112
5344
 
5113
5345
  </xsl:variable>
5114
5346
 
5115
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5347
+ <xsl:variable name="ref_id">
5348
+ <xsl:choose>
5349
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
5350
+ <xsl:otherwise>
5351
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5352
+ </xsl:otherwise>
5353
+ </xsl:choose>
5354
+ </xsl:variable>
5116
5355
  <xsl:variable name="footnote_inline">
5117
5356
  <fo:inline>
5118
5357
 
@@ -5138,7 +5377,7 @@
5138
5377
  <xsl:call-template name="insert_basic_link">
5139
5378
  <xsl:with-param name="element">
5140
5379
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
5141
- <xsl:value-of select="$current_fn_number_text"/>
5380
+ <xsl:copy-of select="$current_fn_number_text"/>
5142
5381
  </fo:basic-link>
5143
5382
  </xsl:with-param>
5144
5383
  </xsl:call-template>
@@ -5158,8 +5397,12 @@
5158
5397
 
5159
5398
  <fo:block xsl:use-attribute-sets="fn-body-style">
5160
5399
 
5400
+ <xsl:call-template name="refine_fn-body-style"/>
5401
+
5161
5402
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
5162
5403
 
5404
+ <xsl:call-template name="refine_fn-body-num-style"/>
5405
+
5163
5406
  <xsl:value-of select="$current_fn_number_text"/>
5164
5407
  </fo:inline>
5165
5408
  <xsl:apply-templates/>
@@ -5211,6 +5454,28 @@
5211
5454
  </xsl:choose>
5212
5455
  </xsl:template>
5213
5456
 
5457
+ <xsl:template name="get_fn_list_for_element">
5458
+ <xsl:choose>
5459
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
5460
+ <fn gen_id="{generate-id(.)}">
5461
+ <xsl:copy-of select="@*"/>
5462
+ <xsl:copy-of select="node()"/>
5463
+ </fn>
5464
+ </xsl:when>
5465
+ <xsl:otherwise>
5466
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
5467
+ <xsl:variable name="element_id" select="@id"/>
5468
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5469
+ <!-- copy unique fn -->
5470
+ <fn gen_id="{generate-id(.)}">
5471
+ <xsl:copy-of select="@*"/>
5472
+ <xsl:copy-of select="node()"/>
5473
+ </fn>
5474
+ </xsl:for-each>
5475
+ </xsl:for-each>
5476
+ </xsl:otherwise>
5477
+ </xsl:choose>
5478
+ </xsl:template>
5214
5479
  <!-- ============================ -->
5215
5480
  <!-- table's footnotes rendering -->
5216
5481
  <!-- ============================ -->
@@ -5385,10 +5650,7 @@
5385
5650
  <xsl:template match="*[local-name()='fn']">
5386
5651
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
5387
5652
 
5388
- <xsl:if test="ancestor::*[local-name()='table']">
5389
- <xsl:attribute name="font-weight">normal</xsl:attribute>
5390
- <xsl:attribute name="baseline-shift">15%</xsl:attribute>
5391
- </xsl:if>
5653
+ <xsl:call-template name="refine_fn-reference-style"/>
5392
5654
 
5393
5655
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5394
5656
 
@@ -5493,7 +5755,7 @@
5493
5755
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
5494
5756
  <fo:block margin-bottom="12pt" text-align="left">
5495
5757
 
5496
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5758
+ <xsl:call-template name="refine_dl_formula_where_style"/>
5497
5759
 
5498
5760
  <!-- <xsl:variable name="title-where">
5499
5761
  <xsl:call-template name="getLocalizedString">
@@ -5508,8 +5770,7 @@
5508
5770
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
5509
5771
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5510
5772
 
5511
- <xsl:attribute name="font-size">10pt</xsl:attribute>
5512
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
5773
+ <xsl:call-template name="refine_figure_key_style"/>
5513
5774
 
5514
5775
  <xsl:variable name="title-key">
5515
5776
  <xsl:call-template name="getLocalizedString">
@@ -5525,10 +5786,7 @@
5525
5786
  <xsl:if test="$onlyOneComponent = 'false'">
5526
5787
  <fo:block>
5527
5788
 
5528
- <xsl:if test="$parent = 'formula'">
5529
- <xsl:attribute name="margin-left">4mm</xsl:attribute>
5530
- </xsl:if>
5531
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
5789
+ <xsl:call-template name="refine_multicomponent_style"/>
5532
5790
 
5533
5791
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5534
5792
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -5536,6 +5794,8 @@
5536
5794
 
5537
5795
  <fo:block>
5538
5796
 
5797
+ <xsl:call-template name="refine_multicomponent_block_style"/>
5798
+
5539
5799
  <xsl:apply-templates select="*[local-name() = 'name']">
5540
5800
  <xsl:with-param name="process">true</xsl:with-param>
5541
5801
  </xsl:apply-templates>
@@ -5697,6 +5957,34 @@
5697
5957
 
5698
5958
  </xsl:template> <!-- END: dl -->
5699
5959
 
5960
+ <xsl:template name="refine_dl_formula_where_style">
5961
+
5962
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5963
+
5964
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5965
+
5966
+ <xsl:template name="refine_figure_key_style">
5967
+
5968
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
5969
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5970
+
5971
+ </xsl:template> <!-- refine_figure_key_style -->
5972
+
5973
+ <xsl:template name="refine_multicomponent_style">
5974
+ <xsl:variable name="parent" select="local-name(..)"/>
5975
+
5976
+ <xsl:if test="$parent = 'formula'">
5977
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
5978
+ </xsl:if>
5979
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
5980
+
5981
+ </xsl:template> <!-- refine_multicomponent_style -->
5982
+
5983
+ <xsl:template name="refine_multicomponent_block_style">
5984
+ <xsl:variable name="parent" select="local-name(..)"/>
5985
+
5986
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5987
+
5700
5988
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
5701
5989
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
5702
5990
 
@@ -5916,6 +6204,8 @@
5916
6204
 
5917
6205
  </xsl:if>
5918
6206
 
6207
+ <xsl:call-template name="refine_dt-cell-style"/>
6208
+
5919
6209
  <fo:block xsl:use-attribute-sets="dt-block-style">
5920
6210
  <xsl:copy-of select="@id"/>
5921
6211
 
@@ -5923,6 +6213,8 @@
5923
6213
  <xsl:attribute name="margin-top">0</xsl:attribute>
5924
6214
  </xsl:if>
5925
6215
 
6216
+ <xsl:call-template name="refine_dt-block-style"/>
6217
+
5926
6218
  <xsl:apply-templates>
5927
6219
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5928
6220
  </xsl:apply-templates>
@@ -5942,6 +6234,8 @@
5942
6234
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5943
6235
  </xsl:if>
5944
6236
 
6237
+ <xsl:call-template name="refine_dd-cell-style"/>
6238
+
5945
6239
  <fo:block>
5946
6240
 
5947
6241
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -6092,12 +6386,18 @@
6092
6386
  <xsl:param name="split_keep-within-line"/>
6093
6387
  <fo:inline font-weight="bold">
6094
6388
 
6389
+ <xsl:call-template name="refine_strong_style"/>
6390
+
6095
6391
  <xsl:apply-templates>
6096
6392
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
6097
6393
  </xsl:apply-templates>
6098
6394
  </fo:inline>
6099
6395
  </xsl:template>
6100
6396
 
6397
+ <xsl:template name="refine_strong_style">
6398
+
6399
+ </xsl:template>
6400
+
6101
6401
  <xsl:template match="*[local-name()='padding']">
6102
6402
  <fo:inline padding-right="{@value}"> </fo:inline>
6103
6403
  </xsl:template>
@@ -6635,7 +6935,10 @@
6635
6935
  </xsl:choose>
6636
6936
  </xsl:variable>
6637
6937
 
6638
- <xsl:value-of select="$text9"/>
6938
+ <!-- replace sequence #x200B and space TO space -->
6939
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6940
+
6941
+ <xsl:value-of select="$text10"/>
6639
6942
  </xsl:template>
6640
6943
 
6641
6944
  <xsl:template name="add-zero-spaces-link-java">
@@ -7310,6 +7613,11 @@
7310
7613
 
7311
7614
  <fo:inline xsl:use-attribute-sets="mathml-style">
7312
7615
 
7616
+ <!-- DEBUG -->
7617
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
7618
+
7619
+ <xsl:call-template name="refine_mathml-style"/>
7620
+
7313
7621
  <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 -->
7314
7622
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
7315
7623
  </xsl:if>
@@ -7414,12 +7722,7 @@
7414
7722
 
7415
7723
  <fo:instream-foreign-object fox:alt-text="Math">
7416
7724
 
7417
- <xsl:if test="count(ancestor::*[local-name() = 'table']) &gt; 1">
7418
- <xsl:attribute name="width">95%</xsl:attribute>
7419
- <xsl:attribute name="content-height">100%</xsl:attribute>
7420
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7421
- <xsl:attribute name="scaling">uniform</xsl:attribute>
7422
- </xsl:if>
7725
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
7423
7726
 
7424
7727
  <!-- put MathML in Actual Text -->
7425
7728
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
@@ -7441,6 +7744,17 @@
7441
7744
  </fo:instream-foreign-object>
7442
7745
  </xsl:template>
7443
7746
 
7747
+ <xsl:template name="refine_mathml_insteam_object_style">
7748
+
7749
+ <xsl:if test="count(ancestor::*[local-name() = 'table']) &gt; 1">
7750
+ <xsl:attribute name="width">95%</xsl:attribute>
7751
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7752
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7753
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
7754
+ </xsl:if>
7755
+
7756
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
7757
+
7444
7758
  <xsl:template match="mathml:*" mode="mathml_actual_text">
7445
7759
  <!-- <xsl:text>a+b</xsl:text> -->
7446
7760
  <xsl:text>&lt;</xsl:text>
@@ -7585,6 +7899,8 @@
7585
7899
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
7586
7900
  <fo:inline xsl:use-attribute-sets="mathml-style">
7587
7901
 
7902
+ <xsl:call-template name="refine_mathml-style"/>
7903
+
7588
7904
  <xsl:choose>
7589
7905
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7590
7906
  <xsl:otherwise>
@@ -7629,6 +7945,8 @@
7629
7945
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7630
7946
  </xsl:if>
7631
7947
 
7948
+ <xsl:call-template name="refine_link-style"/>
7949
+
7632
7950
  <xsl:choose>
7633
7951
  <xsl:when test="$target_text = ''">
7634
7952
  <xsl:apply-templates/>
@@ -7716,6 +8034,9 @@
7716
8034
  <xsl:call-template name="insert_basic_link">
7717
8035
  <xsl:with-param name="element">
7718
8036
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8037
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
8038
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8039
+ </xsl:if>
7719
8040
  <xsl:if test="parent::*[local-name() = 'add']">
7720
8041
  <xsl:call-template name="append_add-style"/>
7721
8042
  </xsl:if>
@@ -7777,6 +8098,8 @@
7777
8098
  <fo:table-cell display-align="center">
7778
8099
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7779
8100
 
8101
+ <xsl:call-template name="refine_formula-stem-block-style"/>
8102
+
7780
8103
  <xsl:apply-templates/>
7781
8104
  </fo:block>
7782
8105
  </fo:table-cell>
@@ -7818,16 +8141,18 @@
7818
8141
 
7819
8142
  <xsl:call-template name="setBlockSpanAll"/>
7820
8143
 
7821
- <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
7822
- <xsl:attribute name="font-size">inherit</xsl:attribute>
7823
- </xsl:if>
8144
+ <xsl:call-template name="refine_note-style"/>
7824
8145
 
7825
8146
  <fo:block-container margin-left="0mm" margin-right="0mm">
7826
8147
 
7827
8148
  <fo:block>
7828
8149
 
8150
+ <xsl:call-template name="refine_note_block_style"/>
8151
+
7829
8152
  <fo:inline xsl:use-attribute-sets="note-name-style">
7830
8153
 
8154
+ <xsl:call-template name="refine_note-name-style"/>
8155
+
7831
8156
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7832
8157
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7833
8158
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7853,6 +8178,10 @@
7853
8178
 
7854
8179
  </xsl:template>
7855
8180
 
8181
+ <xsl:template name="refine_note_block_style">
8182
+
8183
+ </xsl:template>
8184
+
7856
8185
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7857
8186
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7858
8187
  <xsl:choose>
@@ -7874,9 +8203,7 @@
7874
8203
 
7875
8204
  <xsl:call-template name="setBlockSpanAll"/>
7876
8205
 
7877
- <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
7878
- <xsl:attribute name="font-size">inherit</xsl:attribute>
7879
- </xsl:if>
8206
+ <xsl:call-template name="refine_termnote-style"/>
7880
8207
 
7881
8208
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7882
8209
 
@@ -7884,6 +8211,8 @@
7884
8211
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
7885
8212
  </xsl:if>
7886
8213
 
8214
+ <xsl:call-template name="refine_termnote-name-style"/>
8215
+
7887
8216
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7888
8217
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7889
8218
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -8057,6 +8386,8 @@
8057
8386
  <xsl:otherwise>
8058
8387
  <fo:block xsl:use-attribute-sets="image-style">
8059
8388
 
8389
+ <xsl:call-template name="refine_image-style"/>
8390
+
8060
8391
  <xsl:variable name="src">
8061
8392
  <xsl:call-template name="image_src"/>
8062
8393
  </xsl:variable>
@@ -8906,6 +9237,8 @@
8906
9237
  <xsl:if test="normalize-space() != ''">
8907
9238
  <fo:block xsl:use-attribute-sets="figure-name-style">
8908
9239
 
9240
+ <xsl:call-template name="refine_figure-name-style"/>
9241
+
8909
9242
  <xsl:apply-templates/>
8910
9243
  </fo:block>
8911
9244
  </xsl:if>
@@ -9169,6 +9502,8 @@
9169
9502
  </xsl:attribute>
9170
9503
  </xsl:for-each>
9171
9504
 
9505
+ <xsl:call-template name="refine_sourcecode-style"/>
9506
+
9172
9507
  <!-- remove margin between rows in the table with sourcecode line numbers -->
9173
9508
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
9174
9509
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -9875,6 +10210,8 @@
9875
10210
 
9876
10211
  <xsl:call-template name="setBlockSpanAll"/>
9877
10212
 
10213
+ <xsl:call-template name="refine_example-style"/>
10214
+
9878
10215
  <xsl:variable name="fo_element">
9879
10216
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9880
10217
  inline
@@ -9985,6 +10322,12 @@
9985
10322
 
9986
10323
  </xsl:template>
9987
10324
 
10325
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
10326
+ <fo:inline xsl:use-attribute-sets="example-name-style">
10327
+ <xsl:apply-templates/>
10328
+ </fo:inline>
10329
+ </xsl:template>
10330
+
9988
10331
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
9989
10332
  <xsl:param name="fo_element">block</xsl:param>
9990
10333
 
@@ -10007,6 +10350,8 @@
10007
10350
  </xsl:if>
10008
10351
  <fo:block xsl:use-attribute-sets="example-p-style">
10009
10352
 
10353
+ <xsl:call-template name="refine_example-p-style"/>
10354
+
10010
10355
  <xsl:apply-templates/>
10011
10356
  </fo:block>
10012
10357
  </fo:block-container>
@@ -10023,6 +10368,7 @@
10023
10368
  </xsl:otherwise>
10024
10369
  </xsl:choose>
10025
10370
  </xsl:template> <!-- example/p -->
10371
+
10026
10372
  <!-- ====== -->
10027
10373
  <!-- ====== -->
10028
10374
 
@@ -10034,6 +10380,8 @@
10034
10380
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
10035
10381
  <fo:block xsl:use-attribute-sets="termsource-style">
10036
10382
 
10383
+ <xsl:call-template name="refine_termsource-style"/>
10384
+
10037
10385
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
10038
10386
  <xsl:variable name="termsource_text">
10039
10387
  <xsl:apply-templates/>
@@ -10149,10 +10497,7 @@
10149
10497
  <fo:block-container margin-left="0mm">
10150
10498
  <fo:block-container xsl:use-attribute-sets="quote-style">
10151
10499
 
10152
- <xsl:if test="$doctype = 'amendment' and (*[local-name() = 'note'] or *[local-name() = 'termnote'])">
10153
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
10154
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
10155
- </xsl:if>
10500
+ <xsl:call-template name="refine_quote-style"/>
10156
10501
 
10157
10502
  <fo:block-container margin-left="0mm" margin-right="0mm">
10158
10503
  <fo:block role="BlockQuote">
@@ -10228,8 +10573,7 @@
10228
10573
 
10229
10574
  </xsl:if>
10230
10575
 
10231
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
10232
- <xsl:variable name="text" select="normalize-space()"/>
10576
+ <xsl:call-template name="refine_eref-style"/>
10233
10577
 
10234
10578
  <xsl:call-template name="insert_basic_link">
10235
10579
  <xsl:with-param name="element">
@@ -10239,6 +10583,8 @@
10239
10583
  </xsl:if>
10240
10584
  <xsl:if test="@type = 'inline'">
10241
10585
 
10586
+ <xsl:call-template name="refine_basic_link_style"/>
10587
+
10242
10588
  </xsl:if>
10243
10589
 
10244
10590
  <xsl:choose>
@@ -10271,6 +10617,11 @@
10271
10617
  </xsl:otherwise>
10272
10618
  </xsl:choose>
10273
10619
  </xsl:template>
10620
+
10621
+ <xsl:template name="refine_basic_link_style">
10622
+
10623
+ </xsl:template> <!-- refine_basic_link_style -->
10624
+
10274
10625
  <!-- ====== -->
10275
10626
  <!-- END eref -->
10276
10627
  <!-- ====== -->
@@ -10413,16 +10764,22 @@
10413
10764
  <fo:block>
10414
10765
  <xsl:call-template name="setId"/>
10415
10766
 
10416
- <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
10417
- <xsl:if test="$pos &gt;= 2">
10418
- <xsl:attribute name="space-before">18pt</xsl:attribute>
10419
- </xsl:if>
10767
+ <xsl:call-template name="sections_element_style"/>
10420
10768
 
10421
10769
  <xsl:apply-templates/>
10422
10770
  </fo:block>
10423
10771
 
10424
10772
  </xsl:template>
10425
10773
 
10774
+ <xsl:template name="sections_element_style">
10775
+
10776
+ <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
10777
+ <xsl:if test="$pos &gt;= 2">
10778
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
10779
+ </xsl:if>
10780
+
10781
+ </xsl:template> <!-- sections_element_style -->
10782
+
10426
10783
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
10427
10784
  <fo:block break-after="page"/>
10428
10785
  <fo:block>
@@ -10437,10 +10794,16 @@
10437
10794
 
10438
10795
  <xsl:call-template name="setBlockSpanAll"/>
10439
10796
 
10797
+ <xsl:call-template name="refine_clause_style"/>
10798
+
10440
10799
  <xsl:apply-templates/>
10441
10800
  </fo:block>
10442
10801
  </xsl:template>
10443
10802
 
10803
+ <xsl:template name="refine_clause_style">
10804
+
10805
+ </xsl:template> <!-- refine_clause_style -->
10806
+
10444
10807
  <xsl:template match="*[local-name() = 'definitions']">
10445
10808
  <fo:block id="{@id}">
10446
10809
  <xsl:apply-templates/>
@@ -10453,10 +10816,16 @@
10453
10816
 
10454
10817
  <xsl:call-template name="setBlockSpanAll"/>
10455
10818
 
10819
+ <xsl:call-template name="refine_annex_style"/>
10820
+
10456
10821
  </fo:block>
10457
10822
  <xsl:apply-templates/>
10458
10823
  </xsl:template>
10459
10824
 
10825
+ <xsl:template name="refine_annex_style">
10826
+
10827
+ </xsl:template>
10828
+
10460
10829
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
10461
10830
  <!-- comment 2019-11-29 -->
10462
10831
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -10533,6 +10902,9 @@
10533
10902
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
10534
10903
  </xsl:choose>
10535
10904
  </xsl:when>
10905
+ <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10906
+ <xsl:value-of select="@label"/>
10907
+ </xsl:when>
10536
10908
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
10537
10909
 
10538
10910
  <!-- Example: for BSI <?list-start 2?> -->
@@ -10590,10 +10962,10 @@
10590
10962
  <xsl:when test="$type = 'arabic'">
10591
10963
  1)
10592
10964
  </xsl:when>
10593
- <xsl:when test="$type = 'alphabet'">
10965
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
10594
10966
  a)
10595
10967
  </xsl:when>
10596
- <xsl:when test="$type = 'alphabet_upper'">
10968
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
10597
10969
  A.
10598
10970
  </xsl:when>
10599
10971
  <xsl:when test="$type = 'roman'">
@@ -10621,6 +10993,8 @@
10621
10993
  </xsl:choose>
10622
10994
  </xsl:attribute>
10623
10995
 
10996
+ <xsl:call-template name="refine_list_container_style"/>
10997
+
10624
10998
  <fo:block-container margin-left="0mm">
10625
10999
  <fo:block>
10626
11000
  <xsl:apply-templates select="." mode="list"/>
@@ -10638,6 +11012,10 @@
10638
11012
  </xsl:choose>
10639
11013
  </xsl:template>
10640
11014
 
11015
+ <xsl:template name="refine_list_container_style">
11016
+
11017
+ </xsl:template> <!-- refine_list_container_style -->
11018
+
10641
11019
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
10642
11020
 
10643
11021
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -10648,7 +11026,7 @@
10648
11026
 
10649
11027
  <xsl:variable name="provisional_distance_between_starts_">
10650
11028
  <attributes xsl:use-attribute-sets="list-style">
10651
-
11029
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
10652
11030
  </attributes>
10653
11031
  </xsl:variable>
10654
11032
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -10684,9 +11062,7 @@
10684
11062
  <addon><xsl:value-of select="$addon"/></addon> -->
10685
11063
  </xsl:if>
10686
11064
 
10687
- <xsl:if test="not(ancestor::*[local-name() = 'ul' or local-name() = 'ol'])">
10688
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
10689
- </xsl:if>
11065
+ <xsl:call-template name="refine_list-style"/>
10690
11066
 
10691
11067
  <xsl:if test="*[local-name() = 'name']">
10692
11068
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -10700,6 +11076,10 @@
10700
11076
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
10701
11077
  </xsl:template>
10702
11078
 
11079
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
11080
+
11081
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
11082
+
10703
11083
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
10704
11084
  <xsl:param name="process">false</xsl:param>
10705
11085
  <xsl:if test="$process = 'true'">
@@ -10713,20 +11093,27 @@
10713
11093
  <fo:list-item xsl:use-attribute-sets="list-item-style">
10714
11094
  <xsl:copy-of select="@id"/>
10715
11095
 
11096
+ <xsl:call-template name="refine_list-item-style"/>
11097
+
10716
11098
  <fo:list-item-label end-indent="label-end()">
10717
11099
  <fo:block xsl:use-attribute-sets="list-item-label-style">
10718
11100
 
11101
+ <xsl:call-template name="refine_list-item-label-style"/>
11102
+
10719
11103
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10720
11104
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10721
11105
  <xsl:call-template name="append_add-style"/>
10722
11106
  </xsl:if>
10723
11107
 
10724
11108
  <xsl:call-template name="getListItemFormat"/>
11109
+
10725
11110
  </fo:block>
10726
11111
  </fo:list-item-label>
10727
11112
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
10728
11113
  <fo:block>
10729
11114
 
11115
+ <xsl:call-template name="refine_list-item-body-style"/>
11116
+
10730
11117
  <xsl:apply-templates/>
10731
11118
 
10732
11119
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -11044,6 +11431,7 @@
11044
11431
 
11045
11432
  <fo:block id="{@id}">
11046
11433
  <xsl:apply-templates/>
11434
+
11047
11435
  </fo:block>
11048
11436
  </xsl:template>
11049
11437
 
@@ -11063,6 +11451,7 @@
11063
11451
 
11064
11452
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
11065
11453
  <xsl:apply-templates/>
11454
+
11066
11455
  </fo:block>
11067
11456
 
11068
11457
  </xsl:template> <!-- references -->
@@ -11644,6 +12033,9 @@
11644
12033
  </xsl:copy>
11645
12034
  </xsl:template>
11646
12035
 
12036
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
12037
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
12038
+
11647
12039
  <xsl:template name="add_id">
11648
12040
  <xsl:if test="not(@id)">
11649
12041
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -12040,6 +12432,14 @@
12040
12432
  <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">
12041
12433
  <xsl:variable name="p_fn_">
12042
12434
  <xsl:call-template name="get_fn_list"/>
12435
+ <!-- <xsl:choose>
12436
+ <xsl:when test="$namespace = 'jis'">
12437
+ <xsl:call-template name="get_fn_list_for_element"/>
12438
+ </xsl:when>
12439
+ <xsl:otherwise>
12440
+ <xsl:call-template name="get_fn_list"/>
12441
+ </xsl:otherwise>
12442
+ </xsl:choose> -->
12043
12443
  </xsl:variable>
12044
12444
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
12045
12445
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -12054,8 +12454,14 @@
12054
12454
  <xsl:attribute name="current_fn_number">
12055
12455
  <xsl:value-of select="$current_fn_number"/>
12056
12456
  </xsl:attribute>
12457
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
12057
12458
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
12058
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
12459
+
12460
+ <xsl:value-of select="$skip_footnote_body_"/>
12461
+
12462
+ </xsl:attribute>
12463
+ <xsl:attribute name="ref_id">
12464
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
12059
12465
  </xsl:attribute>
12060
12466
  <xsl:apply-templates select="node()" mode="linear_xml"/>
12061
12467
  </xsl:copy>