metanorma-iso 2.4.3 → 2.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1307,123 +1307,15 @@
1307
1307
  </fo:block>
1308
1308
  </fo:block>
1309
1309
  </fo:block-container>
1310
+ <xsl:if test="/iso:iso-standard/iso:preface/*">
1311
+ <fo:block break-after="page"/>
1312
+ </xsl:if>
1310
1313
  </xsl:if>
1311
1314
 
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 -->
1315
+ <!-- ToC, Foreword, Introduction -->
1425
1316
  <xsl:call-template name="processPrefaceSectionsDefault"/>
1426
1317
 
1318
+ <fo:block/> <!-- for prevent empty preface -->
1427
1319
  </fo:flow>
1428
1320
  </fo:page-sequence>
1429
1321
 
@@ -1595,6 +1487,126 @@
1595
1487
 
1596
1488
  </xsl:template>
1597
1489
 
1490
+ <xsl:template match="iso:preface/iso:clause[@type = 'toc']" priority="3">
1491
+ <xsl:choose>
1492
+ <xsl:when test="$doctype = 'amendment'"/><!-- ToC shouldn't be generated in amendments. -->
1493
+ <xsl:otherwise>
1494
+
1495
+ <fo:block-container font-weight="bold">
1496
+ <fo:block role="TOC">
1497
+
1498
+ <xsl:apply-templates/>
1499
+
1500
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
1501
+
1502
+ <xsl:if test="$debug = 'true'">
1503
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
1504
+ DEBUG
1505
+ contents=<xsl:copy-of select="$contents"/>
1506
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1507
+ </xsl:if>
1508
+
1509
+ <xsl:variable name="margin-left">12</xsl:variable>
1510
+ <xsl:for-each select="$contents//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1511
+
1512
+ <fo:block role="TOCI">
1513
+ <xsl:if test="@level = 1">
1514
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
1515
+ </xsl:if>
1516
+ <xsl:if test="@level = 3">
1517
+ <xsl:attribute name="margin-top">-0.7pt</xsl:attribute>
1518
+ </xsl:if>
1519
+ <fo:list-block>
1520
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
1521
+ <xsl:if test="@level &gt;= 2 or @type = 'annex'">
1522
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1523
+ </xsl:if>
1524
+ <xsl:attribute name="provisional-distance-between-starts">
1525
+ <xsl:choose>
1526
+ <!-- skip 0 section without subsections -->
1527
+ <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
1528
+ <xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
1529
+ <xsl:otherwise>0mm</xsl:otherwise>
1530
+ </xsl:choose>
1531
+ </xsl:attribute>
1532
+ <fo:list-item>
1533
+ <fo:list-item-label end-indent="label-end()">
1534
+ <fo:block>
1535
+ <xsl:value-of select="@section"/>
1536
+ </fo:block>
1537
+ </fo:list-item-label>
1538
+ <fo:list-item-body start-indent="body-start()">
1539
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
1540
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1541
+
1542
+ <xsl:apply-templates select="title"/>
1543
+
1544
+ <fo:inline keep-together.within-line="always">
1545
+ <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
1546
+ <fo:inline>
1547
+ <xsl:if test="@level = 1 and @type = 'annex'">
1548
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1549
+ </xsl:if>
1550
+ <fo:page-number-citation ref-id="{@id}"/>
1551
+ </fo:inline>
1552
+ </fo:inline>
1553
+ </fo:basic-link>
1554
+ </fo:block>
1555
+ </fo:list-item-body>
1556
+ </fo:list-item>
1557
+ </fo:list-block>
1558
+ </fo:block>
1559
+
1560
+ </xsl:for-each>
1561
+
1562
+ <!-- List of Tables -->
1563
+ <xsl:if test="$contents//tables/table">
1564
+ <xsl:call-template name="insertListOf_Title">
1565
+ <xsl:with-param name="title" select="$title-list-tables"/>
1566
+ </xsl:call-template>
1567
+ <xsl:for-each select="$contents//tables/table">
1568
+ <xsl:call-template name="insertListOf_Item"/>
1569
+ </xsl:for-each>
1570
+ </xsl:if>
1571
+
1572
+ <!-- List of Figures -->
1573
+ <xsl:if test="$contents//figures/figure">
1574
+ <xsl:call-template name="insertListOf_Title">
1575
+ <xsl:with-param name="title" select="$title-list-figures"/>
1576
+ </xsl:call-template>
1577
+ <xsl:for-each select="$contents//figures/figure">
1578
+ <xsl:call-template name="insertListOf_Item"/>
1579
+ </xsl:for-each>
1580
+ </xsl:if>
1581
+
1582
+ </xsl:if>
1583
+ </fo:block>
1584
+ </fo:block-container>
1585
+ </xsl:otherwise>
1586
+ </xsl:choose>
1587
+ </xsl:template>
1588
+
1589
+ <xsl:template match="iso:preface/iso:clause[@type = 'toc']/iso:title" priority="3">
1590
+ <fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
1591
+ <fo:inline font-size="16pt" font-weight="bold" role="H1">
1592
+ <!-- Contents -->
1593
+ <!-- <xsl:call-template name="getLocalizedString">
1594
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1595
+ </xsl:call-template> -->
1596
+ <xsl:apply-templates/>
1597
+ </fo:inline>
1598
+ <fo:inline keep-together.within-line="always">
1599
+ <fo:leader leader-pattern="space"/>
1600
+ <fo:inline font-weight="normal" font-size="10pt">
1601
+ <!-- Page -->
1602
+ <xsl:call-template name="getLocalizedString">
1603
+ <xsl:with-param name="key">locality.page</xsl:with-param>
1604
+ </xsl:call-template>
1605
+ </fo:inline>
1606
+ </fo:inline>
1607
+ </fo:block>
1608
+ </xsl:template>
1609
+
1598
1610
  <xsl:template match="iso:pagebreak" priority="2">
1599
1611
  <xsl:copy-of select="."/>
1600
1612
  </xsl:template>
@@ -2685,6 +2697,10 @@
2685
2697
 
2686
2698
  </xsl:attribute-set>
2687
2699
 
2700
+ <xsl:template name="refine_link-style">
2701
+
2702
+ </xsl:template> <!-- refine_link-style -->
2703
+
2688
2704
  <xsl:attribute-set name="sourcecode-container-style">
2689
2705
 
2690
2706
  </xsl:attribute-set>
@@ -2699,6 +2715,10 @@
2699
2715
 
2700
2716
  </xsl:attribute-set>
2701
2717
 
2718
+ <xsl:template name="refine_sourcecode-style">
2719
+
2720
+ </xsl:template> <!-- refine_sourcecode-style -->
2721
+
2702
2722
  <xsl:attribute-set name="pre-style">
2703
2723
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2704
2724
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2792,6 +2812,10 @@
2792
2812
 
2793
2813
  </xsl:attribute-set> <!-- example-style -->
2794
2814
 
2815
+ <xsl:template name="refine_example-style">
2816
+
2817
+ </xsl:template> <!-- refine_example-style -->
2818
+
2795
2819
  <xsl:attribute-set name="example-body-style">
2796
2820
 
2797
2821
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
@@ -2817,6 +2841,10 @@
2817
2841
 
2818
2842
  </xsl:attribute-set> <!-- example-p-style -->
2819
2843
 
2844
+ <xsl:template name="refine_example-p-style">
2845
+
2846
+ </xsl:template> <!-- refine_example-p-style -->
2847
+
2820
2848
  <xsl:attribute-set name="termexample-name-style">
2821
2849
 
2822
2850
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -2848,6 +2876,19 @@
2848
2876
 
2849
2877
  </xsl:attribute-set> <!-- table-container-style -->
2850
2878
 
2879
+ <xsl:template name="refine_table-container-style">
2880
+ <xsl:param name="margin-side"/>
2881
+
2882
+ <xsl:if test="not(*[local-name() = 'name'])">
2883
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2884
+ </xsl:if>
2885
+ <xsl:if test="starts-with(@id, 'array_')">
2886
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2887
+ </xsl:if>
2888
+
2889
+ <!-- end table block-container attributes -->
2890
+ </xsl:template> <!-- refine_table-container-style -->
2891
+
2851
2892
  <xsl:attribute-set name="table-style">
2852
2893
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2853
2894
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
@@ -2856,6 +2897,21 @@
2856
2897
 
2857
2898
  </xsl:attribute-set><!-- table-style -->
2858
2899
 
2900
+ <xsl:template name="refine_table-style">
2901
+ <xsl:param name="margin-side"/>
2902
+
2903
+ <xsl:if test="*[local-name()='thead']">
2904
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2905
+ </xsl:if>
2906
+ <xsl:if test="ancestor::*[local-name() = 'table']">
2907
+ <!-- for internal table in table cell -->
2908
+ <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2909
+ </xsl:if>
2910
+
2911
+ <xsl:call-template name="setBordersTableArray"/>
2912
+
2913
+ </xsl:template> <!-- refine_table-style -->
2914
+
2859
2915
  <xsl:attribute-set name="table-name-style">
2860
2916
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2861
2917
 
@@ -2866,6 +2922,15 @@
2866
2922
 
2867
2923
  </xsl:attribute-set> <!-- table-name-style -->
2868
2924
 
2925
+ <xsl:template name="refine_table-name-style">
2926
+ <xsl:param name="continued"/>
2927
+
2928
+ <xsl:if test="$continued = 'true'">
2929
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2930
+ </xsl:if>
2931
+
2932
+ </xsl:template> <!-- refine_table-name-style -->
2933
+
2869
2934
  <xsl:attribute-set name="table-row-style">
2870
2935
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2871
2936
 
@@ -2879,6 +2944,23 @@
2879
2944
 
2880
2945
  </xsl:attribute-set>
2881
2946
 
2947
+ <xsl:template name="refine_table-header-row-style">
2948
+
2949
+ <xsl:choose>
2950
+ <xsl:when test="position() = 1">
2951
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2952
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2953
+ </xsl:when>
2954
+ <xsl:when test="position() = last()">
2955
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
2956
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-border"/></xsl:attribute>
2957
+ </xsl:when>
2958
+ </xsl:choose>
2959
+
2960
+ <xsl:call-template name="setBordersTableArray"/>
2961
+
2962
+ </xsl:template> <!-- refine_table-header-row-style -->
2963
+
2882
2964
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2883
2965
 
2884
2966
  <xsl:attribute name="font-size">9pt</xsl:attribute>
@@ -2887,10 +2969,24 @@
2887
2969
 
2888
2970
  </xsl:attribute-set>
2889
2971
 
2972
+ <xsl:template name="refine_table-footer-row-style">
2973
+
2974
+ </xsl:template> <!-- refine_table-footer-row-style -->
2975
+
2890
2976
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2891
2977
 
2892
2978
  </xsl:attribute-set>
2893
2979
 
2980
+ <xsl:template name="refine_table-body-row-style">
2981
+
2982
+ <xsl:if test="position() = 1 and not(ancestor::*[local-name() = 'table']/*[local-name() = 'thead']) and ancestor::*[local-name() = 'table']/*[local-name() = 'name']">
2983
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
2984
+ </xsl:if>
2985
+
2986
+ <xsl:call-template name="setBordersTableArray"/>
2987
+
2988
+ </xsl:template> <!-- refine_table-body-row-style -->
2989
+
2894
2990
  <xsl:attribute-set name="table-header-cell-style">
2895
2991
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2896
2992
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2904,6 +3000,23 @@
2904
3000
 
2905
3001
  </xsl:attribute-set> <!-- table-header-cell-style -->
2906
3002
 
3003
+ <xsl:template name="refine_table-header-cell-style">
3004
+
3005
+ <xsl:if test="../parent::*[local-name() = 'tbody'] and (following-sibling::*[local-name() = 'td'] or preceding-sibling::*[local-name() = 'td'])">
3006
+ <xsl:attribute name="border-top"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
3007
+ <xsl:attribute name="border-bottom"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
3008
+ </xsl:if>
3009
+
3010
+ <xsl:call-template name="setBordersTableArray"/>
3011
+
3012
+ <xsl:if test="$lang = 'ar'">
3013
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3014
+ </xsl:if>
3015
+
3016
+ <xsl:call-template name="setTableCellAttributes"/>
3017
+
3018
+ </xsl:template> <!-- refine_table-header-cell-style -->
3019
+
2907
3020
  <xsl:attribute-set name="table-cell-style">
2908
3021
  <xsl:attribute name="display-align">center</xsl:attribute>
2909
3022
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2914,6 +3027,29 @@
2914
3027
 
2915
3028
  </xsl:attribute-set> <!-- table-cell-style -->
2916
3029
 
3030
+ <xsl:template name="refine_table-cell-style">
3031
+
3032
+ <xsl:if test="$lang = 'ar'">
3033
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3034
+ </xsl:if>
3035
+
3036
+ <!-- bsi -->
3037
+
3038
+ <xsl:if test="ancestor::*[local-name() = 'tfoot']">
3039
+ <xsl:attribute name="border">solid black 0</xsl:attribute>
3040
+ </xsl:if>
3041
+ <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend')">
3042
+ <xsl:attribute name="display-align">before</xsl:attribute>
3043
+ </xsl:if>
3044
+ <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 -->
3045
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3046
+ </xsl:if>
3047
+ <!-- <xsl:attribute name="page-break-inside">avoid</xsl:attribute> -->
3048
+
3049
+ <xsl:call-template name="setBordersTableArray"/>
3050
+
3051
+ </xsl:template> <!-- refine_table-cell-style -->
3052
+
2917
3053
  <xsl:attribute-set name="table-footer-cell-style">
2918
3054
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2919
3055
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2925,6 +3061,10 @@
2925
3061
 
2926
3062
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2927
3063
 
3064
+ <xsl:template name="refine_table-footer-cell-style">
3065
+
3066
+ </xsl:template> <!-- refine_table-footer-cell-style -->
3067
+
2928
3068
  <xsl:attribute-set name="table-note-style">
2929
3069
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2930
3070
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -2934,6 +3074,10 @@
2934
3074
 
2935
3075
  </xsl:attribute-set><!-- table-note-style -->
2936
3076
 
3077
+ <xsl:template name="refine_table-note-style">
3078
+
3079
+ </xsl:template> <!-- refine_table-note-style -->
3080
+
2937
3081
  <xsl:attribute-set name="table-fn-style">
2938
3082
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2939
3083
 
@@ -2992,11 +3136,21 @@
2992
3136
 
2993
3137
  </xsl:attribute-set>
2994
3138
 
3139
+ <xsl:template name="refine_dt-cell-style">
3140
+
3141
+ </xsl:template> <!-- refine_dt-cell-style -->
3142
+
2995
3143
  <xsl:attribute-set name="dt-block-style">
2996
3144
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2997
3145
 
3146
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
3147
+
2998
3148
  </xsl:attribute-set>
2999
3149
 
3150
+ <xsl:template name="refine_dt-block-style">
3151
+
3152
+ </xsl:template> <!-- refine_dt-block-style -->
3153
+
3000
3154
  <xsl:attribute-set name="dl-name-style">
3001
3155
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3002
3156
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -3010,6 +3164,10 @@
3010
3164
 
3011
3165
  </xsl:attribute-set>
3012
3166
 
3167
+ <xsl:template name="refine_dd-cell-style">
3168
+
3169
+ </xsl:template> <!-- refine_dd-cell-style -->
3170
+
3013
3171
  <!-- ========================== -->
3014
3172
  <!-- END Definition's list styles -->
3015
3173
  <!-- ========================== -->
@@ -3032,7 +3190,6 @@
3032
3190
  </xsl:attribute-set>
3033
3191
 
3034
3192
  <xsl:attribute-set name="xref-style">
3035
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3036
3193
 
3037
3194
  <xsl:attribute name="color">blue</xsl:attribute>
3038
3195
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -3043,6 +3200,12 @@
3043
3200
 
3044
3201
  </xsl:attribute-set>
3045
3202
 
3203
+ <xsl:template name="refine_eref-style">
3204
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
3205
+ <xsl:variable name="text" select="normalize-space()"/>
3206
+
3207
+ </xsl:template> <!-- refine_eref-style -->
3208
+
3046
3209
  <xsl:attribute-set name="note-style">
3047
3210
 
3048
3211
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -3052,6 +3215,14 @@
3052
3215
 
3053
3216
  </xsl:attribute-set>
3054
3217
 
3218
+ <xsl:template name="refine_note-style">
3219
+
3220
+ <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
3221
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
3222
+ </xsl:if>
3223
+
3224
+ </xsl:template>
3225
+
3055
3226
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
3056
3227
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
3057
3228
 
@@ -3061,11 +3232,19 @@
3061
3232
 
3062
3233
  </xsl:attribute-set>
3063
3234
 
3235
+ <xsl:template name="refine_note-name-style">
3236
+
3237
+ </xsl:template> <!-- refine_note-name-style -->
3238
+
3064
3239
  <xsl:attribute-set name="table-note-name-style">
3065
3240
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
3066
3241
 
3067
3242
  </xsl:attribute-set>
3068
3243
 
3244
+ <xsl:template name="refine_table-note-name-style">
3245
+
3246
+ </xsl:template> <!-- refine_table-note-name-style -->
3247
+
3069
3248
  <xsl:attribute-set name="note-p-style">
3070
3249
 
3071
3250
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -3082,10 +3261,22 @@
3082
3261
 
3083
3262
  </xsl:attribute-set>
3084
3263
 
3264
+ <xsl:template name="refine_termnote-style">
3265
+
3266
+ <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
3267
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
3268
+ </xsl:if>
3269
+
3270
+ </xsl:template> <!-- refine_termnote-style -->
3271
+
3085
3272
  <xsl:attribute-set name="termnote-name-style">
3086
3273
 
3087
3274
  </xsl:attribute-set>
3088
3275
 
3276
+ <xsl:template name="refine_termnote-name-style">
3277
+
3278
+ </xsl:template>
3279
+
3089
3280
  <xsl:attribute-set name="termnote-p-style">
3090
3281
 
3091
3282
  </xsl:attribute-set>
@@ -3098,6 +3289,15 @@
3098
3289
 
3099
3290
  </xsl:attribute-set>
3100
3291
 
3292
+ <xsl:template name="refine_quote-style">
3293
+
3294
+ <xsl:if test="$doctype = 'amendment' and (*[local-name() = 'note'] or *[local-name() = 'termnote'])">
3295
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
3296
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3297
+ </xsl:if>
3298
+
3299
+ </xsl:template>
3300
+
3101
3301
  <xsl:attribute-set name="quote-source-style">
3102
3302
  <xsl:attribute name="text-align">right</xsl:attribute>
3103
3303
 
@@ -3109,6 +3309,10 @@
3109
3309
 
3110
3310
  </xsl:attribute-set>
3111
3311
 
3312
+ <xsl:template name="refine_termsource-style">
3313
+
3314
+ </xsl:template> <!-- refine_termsource-style -->
3315
+
3112
3316
  <xsl:attribute-set name="termsource-text-style">
3113
3317
 
3114
3318
  </xsl:attribute-set>
@@ -3149,6 +3353,10 @@
3149
3353
 
3150
3354
  </xsl:attribute-set>
3151
3355
 
3356
+ <xsl:template name="refine_figure-name-style">
3357
+
3358
+ </xsl:template> <!-- refine_figure-name-style -->
3359
+
3152
3360
  <xsl:attribute-set name="figure-source-style">
3153
3361
 
3154
3362
  </xsl:attribute-set>
@@ -3168,6 +3376,10 @@
3168
3376
 
3169
3377
  </xsl:attribute-set> <!-- formula-stem-block-style -->
3170
3378
 
3379
+ <xsl:template name="refine_formula-stem-block-style">
3380
+
3381
+ </xsl:template> <!-- refine_formula-stem-block-style -->
3382
+
3171
3383
  <xsl:attribute-set name="formula-stem-number-style">
3172
3384
  <xsl:attribute name="text-align">right</xsl:attribute>
3173
3385
 
@@ -3179,6 +3391,10 @@
3179
3391
 
3180
3392
  </xsl:attribute-set>
3181
3393
 
3394
+ <xsl:template name="refine_image-style">
3395
+
3396
+ </xsl:template>
3397
+
3182
3398
  <xsl:attribute-set name="figure-pseudocode-p-style">
3183
3399
 
3184
3400
  </xsl:attribute-set>
@@ -3273,6 +3489,10 @@
3273
3489
 
3274
3490
  </xsl:attribute-set>
3275
3491
 
3492
+ <xsl:template name="refine_mathml-style">
3493
+
3494
+ </xsl:template>
3495
+
3276
3496
  <xsl:attribute-set name="list-style">
3277
3497
 
3278
3498
  <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
@@ -3280,6 +3500,14 @@
3280
3500
 
3281
3501
  </xsl:attribute-set> <!-- list-style -->
3282
3502
 
3503
+ <xsl:template name="refine_list-style">
3504
+
3505
+ <xsl:if test="not(ancestor::*[local-name() = 'ul' or local-name() = 'ol'])">
3506
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
3507
+ </xsl:if>
3508
+
3509
+ </xsl:template> <!-- refine_list-style -->
3510
+
3283
3511
  <xsl:attribute-set name="list-name-style">
3284
3512
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3285
3513
 
@@ -3292,14 +3520,26 @@
3292
3520
 
3293
3521
  </xsl:attribute-set>
3294
3522
 
3523
+ <xsl:template name="refine_list-item-style">
3524
+
3525
+ </xsl:template> <!-- refine_list-item-style -->
3526
+
3295
3527
  <xsl:attribute-set name="list-item-label-style">
3296
3528
 
3297
3529
  </xsl:attribute-set>
3298
3530
 
3531
+ <xsl:template name="refine_list-item-label-style">
3532
+
3533
+ </xsl:template> <!-- refine_list-item-label-style -->
3534
+
3299
3535
  <xsl:attribute-set name="list-item-body-style">
3300
3536
 
3301
3537
  </xsl:attribute-set>
3302
3538
 
3539
+ <xsl:template name="refine_list-item-body-style">
3540
+
3541
+ </xsl:template> <!-- refine_list-item-body-style -->
3542
+
3303
3543
  <xsl:attribute-set name="toc-style">
3304
3544
  <xsl:attribute name="line-height">135%</xsl:attribute>
3305
3545
  </xsl:attribute-set>
@@ -3310,6 +3550,15 @@
3310
3550
 
3311
3551
  </xsl:attribute-set>
3312
3552
 
3553
+ <xsl:template name="refine_fn-reference-style">
3554
+
3555
+ <xsl:if test="ancestor::*[local-name()='table']">
3556
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
3557
+ <xsl:attribute name="baseline-shift">15%</xsl:attribute>
3558
+ </xsl:if>
3559
+
3560
+ </xsl:template> <!-- refine_fn-reference-style -->
3561
+
3313
3562
  <xsl:attribute-set name="fn-style">
3314
3563
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3315
3564
  </xsl:attribute-set>
@@ -3333,6 +3582,10 @@
3333
3582
 
3334
3583
  </xsl:attribute-set>
3335
3584
 
3585
+ <xsl:template name="refine_fn-body-style">
3586
+
3587
+ </xsl:template> <!-- refine_fn-body-style -->
3588
+
3336
3589
  <xsl:attribute-set name="fn-body-num-style">
3337
3590
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3338
3591
 
@@ -3340,6 +3593,10 @@
3340
3593
 
3341
3594
  </xsl:attribute-set> <!-- fn-body-num-style -->
3342
3595
 
3596
+ <xsl:template name="refine_fn-body-num-style">
3597
+
3598
+ </xsl:template> <!-- refine_fn-body-num-style -->
3599
+
3343
3600
  <!-- admonition -->
3344
3601
  <xsl:attribute-set name="admonition-style">
3345
3602
 
@@ -3986,14 +4243,9 @@
3986
4243
 
3987
4244
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3988
4245
 
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 -->
4246
+ <xsl:call-template name="refine_table-container-style">
4247
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4248
+ </xsl:call-template>
3997
4249
 
3998
4250
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3999
4251
 
@@ -4014,15 +4266,9 @@
4014
4266
 
4015
4267
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
4016
4268
 
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"/>
4269
+ <xsl:call-template name="refine_table-style">
4270
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4271
+ </xsl:call-template>
4026
4272
 
4027
4273
  </xsl:element>
4028
4274
  </xsl:variable>
@@ -4088,7 +4334,7 @@
4088
4334
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
4089
4335
  </xsl:when>
4090
4336
  <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 -->
4337
+ <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 -->
4092
4338
  </xsl:otherwise>
4093
4339
  </xsl:choose>
4094
4340
 
@@ -4183,9 +4429,9 @@
4183
4429
 
4184
4430
  <fo:block xsl:use-attribute-sets="table-name-style">
4185
4431
 
4186
- <xsl:if test="$continued = 'true'">
4187
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
4188
- </xsl:if>
4432
+ <xsl:call-template name="refine_table-name-style">
4433
+ <xsl:with-param name="continued" select="$continued"/>
4434
+ </xsl:call-template>
4189
4435
 
4190
4436
  <xsl:choose>
4191
4437
  <xsl:when test="$continued = 'true'">
@@ -4583,11 +4829,7 @@
4583
4829
  <fo:table-row>
4584
4830
  <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
4831
 
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>
4832
+ <xsl:call-template name="refine_table-header-title-style"/>
4591
4833
 
4592
4834
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4593
4835
  <xsl:with-param name="continued">true</xsl:with-param>
@@ -4605,6 +4847,16 @@
4605
4847
  </fo:table-row>
4606
4848
  </xsl:template> <!-- table-header-title -->
4607
4849
 
4850
+ <xsl:template name="refine_table-header-title-style">
4851
+
4852
+ <xsl:attribute name="border-left">1pt solid white</xsl:attribute>
4853
+ <xsl:attribute name="border-right">1pt solid white</xsl:attribute>
4854
+ <xsl:attribute name="border-top">1pt solid white</xsl:attribute>
4855
+ <!-- <xsl:attribute name="border-bottom">0.5pt solid white</xsl:attribute> -->
4856
+ <xsl:attribute name="border-bottom">none</xsl:attribute>
4857
+
4858
+ </xsl:template> <!-- refine_table-header-title-style -->
4859
+
4608
4860
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
4609
4861
  <fo:table-body>
4610
4862
  <xsl:apply-templates/>
@@ -4629,7 +4881,7 @@
4629
4881
  <xsl:param name="colwidths"/>
4630
4882
  <xsl:param name="colgroup"/>
4631
4883
 
4632
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4884
+ <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']"/>
4633
4885
 
4634
4886
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
4635
4887
 
@@ -4689,6 +4941,8 @@
4689
4941
  <fo:table-row>
4690
4942
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4691
4943
 
4944
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4945
+
4692
4946
  <xsl:call-template name="setBordersTableArray"/>
4693
4947
 
4694
4948
  <!-- fn will be processed inside 'note' processing -->
@@ -4697,6 +4951,7 @@
4697
4951
 
4698
4952
  <!-- except gb and bsi -->
4699
4953
 
4954
+ <xsl:apply-templates select="../*[local-name()='p']"/>
4700
4955
  <xsl:apply-templates select="../*[local-name()='dl']"/>
4701
4956
  <xsl:apply-templates select="../*[local-name()='note']"/>
4702
4957
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -4872,18 +5127,7 @@
4872
5127
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4873
5128
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4874
5129
 
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"/>
5130
+ <xsl:call-template name="refine_table-header-row-style"/>
4887
5131
 
4888
5132
  <xsl:call-template name="setTableRowAttributes"/>
4889
5133
 
@@ -4917,6 +5161,8 @@
4917
5161
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4918
5162
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4919
5163
 
5164
+ <xsl:call-template name="refine_table-footer-row-style"/>
5165
+
4920
5166
  <xsl:call-template name="setTableRowAttributes"/>
4921
5167
  <xsl:apply-templates/>
4922
5168
  </fo:table-row>
@@ -4930,13 +5176,10 @@
4930
5176
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4931
5177
  </xsl:if>
4932
5178
 
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"/>
5179
+ <xsl:call-template name="refine_table-body-row-style"/>
4938
5180
 
4939
5181
  <xsl:call-template name="setTableRowAttributes"/>
5182
+
4940
5183
  <xsl:apply-templates/>
4941
5184
  </fo:table-row>
4942
5185
  </xsl:template>
@@ -4955,18 +5198,7 @@
4955
5198
  <xsl:with-param name="default">center</xsl:with-param>
4956
5199
  </xsl:call-template>
4957
5200
 
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"/>
5201
+ <xsl:call-template name="refine_table-header-cell-style"/>
4970
5202
 
4971
5203
  <fo:block>
4972
5204
  <xsl:apply-templates/>
@@ -5008,24 +5240,7 @@
5008
5240
  <xsl:with-param name="default">left</xsl:with-param>
5009
5241
  </xsl:call-template>
5010
5242
 
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"/>
5243
+ <xsl:call-template name="refine_table-cell-style"/>
5029
5244
 
5030
5245
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
5031
5246
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -5056,9 +5271,13 @@
5056
5271
 
5057
5272
  <fo:block xsl:use-attribute-sets="table-note-style">
5058
5273
 
5274
+ <xsl:call-template name="refine_table-note-style"/>
5275
+
5059
5276
  <!-- Table's note name (NOTE, for example) -->
5060
5277
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
5061
5278
 
5279
+ <xsl:call-template name="refine_table-note-name-style"/>
5280
+
5062
5281
  <xsl:apply-templates select="*[local-name() = 'name']"/>
5063
5282
 
5064
5283
  </fo:inline>
@@ -5086,6 +5305,14 @@
5086
5305
  <!-- list of footnotes to calculate actual footnotes number -->
5087
5306
  <xsl:variable name="p_fn_">
5088
5307
  <xsl:call-template name="get_fn_list"/>
5308
+ <!-- <xsl:choose>
5309
+ <xsl:when test="$namespace = 'jis'">
5310
+ <xsl:call-template name="get_fn_list_for_element"/>
5311
+ </xsl:when>
5312
+ <xsl:otherwise>
5313
+ <xsl:call-template name="get_fn_list"/>
5314
+ </xsl:otherwise>
5315
+ </xsl:choose> -->
5089
5316
  </xsl:variable>
5090
5317
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
5091
5318
 
@@ -5112,7 +5339,14 @@
5112
5339
 
5113
5340
  </xsl:variable>
5114
5341
 
5115
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5342
+ <xsl:variable name="ref_id">
5343
+ <xsl:choose>
5344
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
5345
+ <xsl:otherwise>
5346
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5347
+ </xsl:otherwise>
5348
+ </xsl:choose>
5349
+ </xsl:variable>
5116
5350
  <xsl:variable name="footnote_inline">
5117
5351
  <fo:inline>
5118
5352
 
@@ -5138,7 +5372,7 @@
5138
5372
  <xsl:call-template name="insert_basic_link">
5139
5373
  <xsl:with-param name="element">
5140
5374
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
5141
- <xsl:value-of select="$current_fn_number_text"/>
5375
+ <xsl:copy-of select="$current_fn_number_text"/>
5142
5376
  </fo:basic-link>
5143
5377
  </xsl:with-param>
5144
5378
  </xsl:call-template>
@@ -5158,8 +5392,12 @@
5158
5392
 
5159
5393
  <fo:block xsl:use-attribute-sets="fn-body-style">
5160
5394
 
5395
+ <xsl:call-template name="refine_fn-body-style"/>
5396
+
5161
5397
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
5162
5398
 
5399
+ <xsl:call-template name="refine_fn-body-num-style"/>
5400
+
5163
5401
  <xsl:value-of select="$current_fn_number_text"/>
5164
5402
  </fo:inline>
5165
5403
  <xsl:apply-templates/>
@@ -5211,6 +5449,28 @@
5211
5449
  </xsl:choose>
5212
5450
  </xsl:template>
5213
5451
 
5452
+ <xsl:template name="get_fn_list_for_element">
5453
+ <xsl:choose>
5454
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
5455
+ <fn gen_id="{generate-id(.)}">
5456
+ <xsl:copy-of select="@*"/>
5457
+ <xsl:copy-of select="node()"/>
5458
+ </fn>
5459
+ </xsl:when>
5460
+ <xsl:otherwise>
5461
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
5462
+ <xsl:variable name="element_id" select="@id"/>
5463
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5464
+ <!-- copy unique fn -->
5465
+ <fn gen_id="{generate-id(.)}">
5466
+ <xsl:copy-of select="@*"/>
5467
+ <xsl:copy-of select="node()"/>
5468
+ </fn>
5469
+ </xsl:for-each>
5470
+ </xsl:for-each>
5471
+ </xsl:otherwise>
5472
+ </xsl:choose>
5473
+ </xsl:template>
5214
5474
  <!-- ============================ -->
5215
5475
  <!-- table's footnotes rendering -->
5216
5476
  <!-- ============================ -->
@@ -5385,10 +5645,7 @@
5385
5645
  <xsl:template match="*[local-name()='fn']">
5386
5646
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
5387
5647
 
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>
5648
+ <xsl:call-template name="refine_fn-reference-style"/>
5392
5649
 
5393
5650
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5394
5651
 
@@ -5493,7 +5750,7 @@
5493
5750
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
5494
5751
  <fo:block margin-bottom="12pt" text-align="left">
5495
5752
 
5496
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5753
+ <xsl:call-template name="refine_dl_formula_where_style"/>
5497
5754
 
5498
5755
  <!-- <xsl:variable name="title-where">
5499
5756
  <xsl:call-template name="getLocalizedString">
@@ -5508,8 +5765,7 @@
5508
5765
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
5509
5766
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5510
5767
 
5511
- <xsl:attribute name="font-size">10pt</xsl:attribute>
5512
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
5768
+ <xsl:call-template name="refine_figure_key_style"/>
5513
5769
 
5514
5770
  <xsl:variable name="title-key">
5515
5771
  <xsl:call-template name="getLocalizedString">
@@ -5525,10 +5781,7 @@
5525
5781
  <xsl:if test="$onlyOneComponent = 'false'">
5526
5782
  <fo:block>
5527
5783
 
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>
5784
+ <xsl:call-template name="refine_multicomponent_style"/>
5532
5785
 
5533
5786
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5534
5787
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -5536,6 +5789,8 @@
5536
5789
 
5537
5790
  <fo:block>
5538
5791
 
5792
+ <xsl:call-template name="refine_multicomponent_block_style"/>
5793
+
5539
5794
  <xsl:apply-templates select="*[local-name() = 'name']">
5540
5795
  <xsl:with-param name="process">true</xsl:with-param>
5541
5796
  </xsl:apply-templates>
@@ -5697,6 +5952,34 @@
5697
5952
 
5698
5953
  </xsl:template> <!-- END: dl -->
5699
5954
 
5955
+ <xsl:template name="refine_dl_formula_where_style">
5956
+
5957
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5958
+
5959
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5960
+
5961
+ <xsl:template name="refine_figure_key_style">
5962
+
5963
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
5964
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5965
+
5966
+ </xsl:template> <!-- refine_figure_key_style -->
5967
+
5968
+ <xsl:template name="refine_multicomponent_style">
5969
+ <xsl:variable name="parent" select="local-name(..)"/>
5970
+
5971
+ <xsl:if test="$parent = 'formula'">
5972
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
5973
+ </xsl:if>
5974
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
5975
+
5976
+ </xsl:template> <!-- refine_multicomponent_style -->
5977
+
5978
+ <xsl:template name="refine_multicomponent_block_style">
5979
+ <xsl:variable name="parent" select="local-name(..)"/>
5980
+
5981
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5982
+
5700
5983
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
5701
5984
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
5702
5985
 
@@ -5916,6 +6199,8 @@
5916
6199
 
5917
6200
  </xsl:if>
5918
6201
 
6202
+ <xsl:call-template name="refine_dt-cell-style"/>
6203
+
5919
6204
  <fo:block xsl:use-attribute-sets="dt-block-style">
5920
6205
  <xsl:copy-of select="@id"/>
5921
6206
 
@@ -5923,6 +6208,8 @@
5923
6208
  <xsl:attribute name="margin-top">0</xsl:attribute>
5924
6209
  </xsl:if>
5925
6210
 
6211
+ <xsl:call-template name="refine_dt-block-style"/>
6212
+
5926
6213
  <xsl:apply-templates>
5927
6214
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5928
6215
  </xsl:apply-templates>
@@ -5942,6 +6229,8 @@
5942
6229
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5943
6230
  </xsl:if>
5944
6231
 
6232
+ <xsl:call-template name="refine_dd-cell-style"/>
6233
+
5945
6234
  <fo:block>
5946
6235
 
5947
6236
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -6092,12 +6381,18 @@
6092
6381
  <xsl:param name="split_keep-within-line"/>
6093
6382
  <fo:inline font-weight="bold">
6094
6383
 
6384
+ <xsl:call-template name="refine_strong_style"/>
6385
+
6095
6386
  <xsl:apply-templates>
6096
6387
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
6097
6388
  </xsl:apply-templates>
6098
6389
  </fo:inline>
6099
6390
  </xsl:template>
6100
6391
 
6392
+ <xsl:template name="refine_strong_style">
6393
+
6394
+ </xsl:template>
6395
+
6101
6396
  <xsl:template match="*[local-name()='padding']">
6102
6397
  <fo:inline padding-right="{@value}"> </fo:inline>
6103
6398
  </xsl:template>
@@ -6635,7 +6930,10 @@
6635
6930
  </xsl:choose>
6636
6931
  </xsl:variable>
6637
6932
 
6638
- <xsl:value-of select="$text9"/>
6933
+ <!-- replace sequence #x200B and space TO space -->
6934
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6935
+
6936
+ <xsl:value-of select="$text10"/>
6639
6937
  </xsl:template>
6640
6938
 
6641
6939
  <xsl:template name="add-zero-spaces-link-java">
@@ -7310,6 +7608,11 @@
7310
7608
 
7311
7609
  <fo:inline xsl:use-attribute-sets="mathml-style">
7312
7610
 
7611
+ <!-- DEBUG -->
7612
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
7613
+
7614
+ <xsl:call-template name="refine_mathml-style"/>
7615
+
7313
7616
  <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
7617
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
7315
7618
  </xsl:if>
@@ -7414,12 +7717,7 @@
7414
7717
 
7415
7718
  <fo:instream-foreign-object fox:alt-text="Math">
7416
7719
 
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>
7720
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
7423
7721
 
7424
7722
  <!-- put MathML in Actual Text -->
7425
7723
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
@@ -7441,6 +7739,17 @@
7441
7739
  </fo:instream-foreign-object>
7442
7740
  </xsl:template>
7443
7741
 
7742
+ <xsl:template name="refine_mathml_insteam_object_style">
7743
+
7744
+ <xsl:if test="count(ancestor::*[local-name() = 'table']) &gt; 1">
7745
+ <xsl:attribute name="width">95%</xsl:attribute>
7746
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7747
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7748
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
7749
+ </xsl:if>
7750
+
7751
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
7752
+
7444
7753
  <xsl:template match="mathml:*" mode="mathml_actual_text">
7445
7754
  <!-- <xsl:text>a+b</xsl:text> -->
7446
7755
  <xsl:text>&lt;</xsl:text>
@@ -7585,6 +7894,8 @@
7585
7894
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
7586
7895
  <fo:inline xsl:use-attribute-sets="mathml-style">
7587
7896
 
7897
+ <xsl:call-template name="refine_mathml-style"/>
7898
+
7588
7899
  <xsl:choose>
7589
7900
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7590
7901
  <xsl:otherwise>
@@ -7629,6 +7940,8 @@
7629
7940
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7630
7941
  </xsl:if>
7631
7942
 
7943
+ <xsl:call-template name="refine_link-style"/>
7944
+
7632
7945
  <xsl:choose>
7633
7946
  <xsl:when test="$target_text = ''">
7634
7947
  <xsl:apply-templates/>
@@ -7716,6 +8029,9 @@
7716
8029
  <xsl:call-template name="insert_basic_link">
7717
8030
  <xsl:with-param name="element">
7718
8031
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8032
+ <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'])">
8033
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8034
+ </xsl:if>
7719
8035
  <xsl:if test="parent::*[local-name() = 'add']">
7720
8036
  <xsl:call-template name="append_add-style"/>
7721
8037
  </xsl:if>
@@ -7777,6 +8093,8 @@
7777
8093
  <fo:table-cell display-align="center">
7778
8094
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7779
8095
 
8096
+ <xsl:call-template name="refine_formula-stem-block-style"/>
8097
+
7780
8098
  <xsl:apply-templates/>
7781
8099
  </fo:block>
7782
8100
  </fo:table-cell>
@@ -7818,16 +8136,18 @@
7818
8136
 
7819
8137
  <xsl:call-template name="setBlockSpanAll"/>
7820
8138
 
7821
- <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
7822
- <xsl:attribute name="font-size">inherit</xsl:attribute>
7823
- </xsl:if>
8139
+ <xsl:call-template name="refine_note-style"/>
7824
8140
 
7825
8141
  <fo:block-container margin-left="0mm" margin-right="0mm">
7826
8142
 
7827
8143
  <fo:block>
7828
8144
 
8145
+ <xsl:call-template name="refine_note_block_style"/>
8146
+
7829
8147
  <fo:inline xsl:use-attribute-sets="note-name-style">
7830
8148
 
8149
+ <xsl:call-template name="refine_note-name-style"/>
8150
+
7831
8151
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7832
8152
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7833
8153
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7853,6 +8173,10 @@
7853
8173
 
7854
8174
  </xsl:template>
7855
8175
 
8176
+ <xsl:template name="refine_note_block_style">
8177
+
8178
+ </xsl:template>
8179
+
7856
8180
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7857
8181
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7858
8182
  <xsl:choose>
@@ -7874,9 +8198,7 @@
7874
8198
 
7875
8199
  <xsl:call-template name="setBlockSpanAll"/>
7876
8200
 
7877
- <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
7878
- <xsl:attribute name="font-size">inherit</xsl:attribute>
7879
- </xsl:if>
8201
+ <xsl:call-template name="refine_termnote-style"/>
7880
8202
 
7881
8203
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7882
8204
 
@@ -7884,6 +8206,8 @@
7884
8206
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
7885
8207
  </xsl:if>
7886
8208
 
8209
+ <xsl:call-template name="refine_termnote-name-style"/>
8210
+
7887
8211
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7888
8212
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7889
8213
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -8057,6 +8381,8 @@
8057
8381
  <xsl:otherwise>
8058
8382
  <fo:block xsl:use-attribute-sets="image-style">
8059
8383
 
8384
+ <xsl:call-template name="refine_image-style"/>
8385
+
8060
8386
  <xsl:variable name="src">
8061
8387
  <xsl:call-template name="image_src"/>
8062
8388
  </xsl:variable>
@@ -8906,6 +9232,8 @@
8906
9232
  <xsl:if test="normalize-space() != ''">
8907
9233
  <fo:block xsl:use-attribute-sets="figure-name-style">
8908
9234
 
9235
+ <xsl:call-template name="refine_figure-name-style"/>
9236
+
8909
9237
  <xsl:apply-templates/>
8910
9238
  </fo:block>
8911
9239
  </xsl:if>
@@ -9169,6 +9497,8 @@
9169
9497
  </xsl:attribute>
9170
9498
  </xsl:for-each>
9171
9499
 
9500
+ <xsl:call-template name="refine_sourcecode-style"/>
9501
+
9172
9502
  <!-- remove margin between rows in the table with sourcecode line numbers -->
9173
9503
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
9174
9504
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -9875,6 +10205,8 @@
9875
10205
 
9876
10206
  <xsl:call-template name="setBlockSpanAll"/>
9877
10207
 
10208
+ <xsl:call-template name="refine_example-style"/>
10209
+
9878
10210
  <xsl:variable name="fo_element">
9879
10211
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9880
10212
  inline
@@ -10007,6 +10339,8 @@
10007
10339
  </xsl:if>
10008
10340
  <fo:block xsl:use-attribute-sets="example-p-style">
10009
10341
 
10342
+ <xsl:call-template name="refine_example-p-style"/>
10343
+
10010
10344
  <xsl:apply-templates/>
10011
10345
  </fo:block>
10012
10346
  </fo:block-container>
@@ -10023,6 +10357,7 @@
10023
10357
  </xsl:otherwise>
10024
10358
  </xsl:choose>
10025
10359
  </xsl:template> <!-- example/p -->
10360
+
10026
10361
  <!-- ====== -->
10027
10362
  <!-- ====== -->
10028
10363
 
@@ -10034,6 +10369,8 @@
10034
10369
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
10035
10370
  <fo:block xsl:use-attribute-sets="termsource-style">
10036
10371
 
10372
+ <xsl:call-template name="refine_termsource-style"/>
10373
+
10037
10374
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
10038
10375
  <xsl:variable name="termsource_text">
10039
10376
  <xsl:apply-templates/>
@@ -10149,10 +10486,7 @@
10149
10486
  <fo:block-container margin-left="0mm">
10150
10487
  <fo:block-container xsl:use-attribute-sets="quote-style">
10151
10488
 
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>
10489
+ <xsl:call-template name="refine_quote-style"/>
10156
10490
 
10157
10491
  <fo:block-container margin-left="0mm" margin-right="0mm">
10158
10492
  <fo:block role="BlockQuote">
@@ -10228,8 +10562,7 @@
10228
10562
 
10229
10563
  </xsl:if>
10230
10564
 
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()"/>
10565
+ <xsl:call-template name="refine_eref-style"/>
10233
10566
 
10234
10567
  <xsl:call-template name="insert_basic_link">
10235
10568
  <xsl:with-param name="element">
@@ -10239,6 +10572,8 @@
10239
10572
  </xsl:if>
10240
10573
  <xsl:if test="@type = 'inline'">
10241
10574
 
10575
+ <xsl:call-template name="refine_basic_link_style"/>
10576
+
10242
10577
  </xsl:if>
10243
10578
 
10244
10579
  <xsl:choose>
@@ -10271,6 +10606,11 @@
10271
10606
  </xsl:otherwise>
10272
10607
  </xsl:choose>
10273
10608
  </xsl:template>
10609
+
10610
+ <xsl:template name="refine_basic_link_style">
10611
+
10612
+ </xsl:template> <!-- refine_basic_link_style -->
10613
+
10274
10614
  <!-- ====== -->
10275
10615
  <!-- END eref -->
10276
10616
  <!-- ====== -->
@@ -10413,16 +10753,22 @@
10413
10753
  <fo:block>
10414
10754
  <xsl:call-template name="setId"/>
10415
10755
 
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>
10756
+ <xsl:call-template name="sections_element_style"/>
10420
10757
 
10421
10758
  <xsl:apply-templates/>
10422
10759
  </fo:block>
10423
10760
 
10424
10761
  </xsl:template>
10425
10762
 
10763
+ <xsl:template name="sections_element_style">
10764
+
10765
+ <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
10766
+ <xsl:if test="$pos &gt;= 2">
10767
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
10768
+ </xsl:if>
10769
+
10770
+ </xsl:template> <!-- sections_element_style -->
10771
+
10426
10772
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
10427
10773
  <fo:block break-after="page"/>
10428
10774
  <fo:block>
@@ -10437,10 +10783,16 @@
10437
10783
 
10438
10784
  <xsl:call-template name="setBlockSpanAll"/>
10439
10785
 
10786
+ <xsl:call-template name="refine_clause_style"/>
10787
+
10440
10788
  <xsl:apply-templates/>
10441
10789
  </fo:block>
10442
10790
  </xsl:template>
10443
10791
 
10792
+ <xsl:template name="refine_clause_style">
10793
+
10794
+ </xsl:template> <!-- refine_clause_style -->
10795
+
10444
10796
  <xsl:template match="*[local-name() = 'definitions']">
10445
10797
  <fo:block id="{@id}">
10446
10798
  <xsl:apply-templates/>
@@ -10453,10 +10805,16 @@
10453
10805
 
10454
10806
  <xsl:call-template name="setBlockSpanAll"/>
10455
10807
 
10808
+ <xsl:call-template name="refine_annex_style"/>
10809
+
10456
10810
  </fo:block>
10457
10811
  <xsl:apply-templates/>
10458
10812
  </xsl:template>
10459
10813
 
10814
+ <xsl:template name="refine_annex_style">
10815
+
10816
+ </xsl:template>
10817
+
10460
10818
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
10461
10819
  <!-- comment 2019-11-29 -->
10462
10820
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -10621,6 +10979,8 @@
10621
10979
  </xsl:choose>
10622
10980
  </xsl:attribute>
10623
10981
 
10982
+ <xsl:call-template name="refine_list_container_style"/>
10983
+
10624
10984
  <fo:block-container margin-left="0mm">
10625
10985
  <fo:block>
10626
10986
  <xsl:apply-templates select="." mode="list"/>
@@ -10638,6 +10998,10 @@
10638
10998
  </xsl:choose>
10639
10999
  </xsl:template>
10640
11000
 
11001
+ <xsl:template name="refine_list_container_style">
11002
+
11003
+ </xsl:template> <!-- refine_list_container_style -->
11004
+
10641
11005
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
10642
11006
 
10643
11007
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -10648,7 +11012,7 @@
10648
11012
 
10649
11013
  <xsl:variable name="provisional_distance_between_starts_">
10650
11014
  <attributes xsl:use-attribute-sets="list-style">
10651
-
11015
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
10652
11016
  </attributes>
10653
11017
  </xsl:variable>
10654
11018
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -10684,9 +11048,7 @@
10684
11048
  <addon><xsl:value-of select="$addon"/></addon> -->
10685
11049
  </xsl:if>
10686
11050
 
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>
11051
+ <xsl:call-template name="refine_list-style"/>
10690
11052
 
10691
11053
  <xsl:if test="*[local-name() = 'name']">
10692
11054
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -10700,6 +11062,10 @@
10700
11062
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
10701
11063
  </xsl:template>
10702
11064
 
11065
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
11066
+
11067
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
11068
+
10703
11069
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
10704
11070
  <xsl:param name="process">false</xsl:param>
10705
11071
  <xsl:if test="$process = 'true'">
@@ -10713,20 +11079,27 @@
10713
11079
  <fo:list-item xsl:use-attribute-sets="list-item-style">
10714
11080
  <xsl:copy-of select="@id"/>
10715
11081
 
11082
+ <xsl:call-template name="refine_list-item-style"/>
11083
+
10716
11084
  <fo:list-item-label end-indent="label-end()">
10717
11085
  <fo:block xsl:use-attribute-sets="list-item-label-style">
10718
11086
 
11087
+ <xsl:call-template name="refine_list-item-label-style"/>
11088
+
10719
11089
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10720
11090
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10721
11091
  <xsl:call-template name="append_add-style"/>
10722
11092
  </xsl:if>
10723
11093
 
10724
11094
  <xsl:call-template name="getListItemFormat"/>
11095
+
10725
11096
  </fo:block>
10726
11097
  </fo:list-item-label>
10727
11098
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
10728
11099
  <fo:block>
10729
11100
 
11101
+ <xsl:call-template name="refine_list-item-body-style"/>
11102
+
10730
11103
  <xsl:apply-templates/>
10731
11104
 
10732
11105
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -11044,6 +11417,7 @@
11044
11417
 
11045
11418
  <fo:block id="{@id}">
11046
11419
  <xsl:apply-templates/>
11420
+
11047
11421
  </fo:block>
11048
11422
  </xsl:template>
11049
11423
 
@@ -11063,6 +11437,7 @@
11063
11437
 
11064
11438
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
11065
11439
  <xsl:apply-templates/>
11440
+
11066
11441
  </fo:block>
11067
11442
 
11068
11443
  </xsl:template> <!-- references -->
@@ -11644,6 +12019,9 @@
11644
12019
  </xsl:copy>
11645
12020
  </xsl:template>
11646
12021
 
12022
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
12023
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
12024
+
11647
12025
  <xsl:template name="add_id">
11648
12026
  <xsl:if test="not(@id)">
11649
12027
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -12040,6 +12418,14 @@
12040
12418
  <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
12419
  <xsl:variable name="p_fn_">
12042
12420
  <xsl:call-template name="get_fn_list"/>
12421
+ <!-- <xsl:choose>
12422
+ <xsl:when test="$namespace = 'jis'">
12423
+ <xsl:call-template name="get_fn_list_for_element"/>
12424
+ </xsl:when>
12425
+ <xsl:otherwise>
12426
+ <xsl:call-template name="get_fn_list"/>
12427
+ </xsl:otherwise>
12428
+ </xsl:choose> -->
12043
12429
  </xsl:variable>
12044
12430
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
12045
12431
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -12054,8 +12440,14 @@
12054
12440
  <xsl:attribute name="current_fn_number">
12055
12441
  <xsl:value-of select="$current_fn_number"/>
12056
12442
  </xsl:attribute>
12443
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
12057
12444
  <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))"/>
12445
+
12446
+ <xsl:value-of select="$skip_footnote_body_"/>
12447
+
12448
+ </xsl:attribute>
12449
+ <xsl:attribute name="ref_id">
12450
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
12059
12451
  </xsl:attribute>
12060
12452
  <xsl:apply-templates select="node()" mode="linear_xml"/>
12061
12453
  </xsl:copy>