metanorma-itu 2.2.10 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -974,7 +974,7 @@
974
974
 
975
975
  <fo:flow flow-name="xsl-region-body">
976
976
 
977
- <xsl:if test="/itu:itu-standard/itu:preface/* or /itu:itu-standard/itu:bibdata/itu:keyword">
977
+ <xsl:if test="/itu:itu-standard/itu:preface/*[not(@type = 'toc')] or /itu:itu-standard/itu:bibdata/itu:keyword">
978
978
  <fo:block-container font-size="14pt" font-weight="bold">
979
979
  <xsl:choose>
980
980
  <xsl:when test="$doctype = 'implementers-guide'"/>
@@ -1038,111 +1038,9 @@
1038
1038
  <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
1039
1039
  </xsl:if>
1040
1040
 
1041
- <xsl:if test="$contents//item[@display = 'true'] and $doctype != 'resolution' and $doctype != 'service-publication'">
1042
- <fo:block break-after="page"/>
1043
- <fo:block-container>
1044
- <fo:block role="TOC">
1045
- <fo:block margin-top="6pt" text-align="center" font-weight="bold" role="H1">
1046
- <xsl:call-template name="getLocalizedString">
1047
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
1048
- </xsl:call-template>
1049
- </fo:block>
1050
- <fo:block margin-top="6pt" text-align="end" font-weight="bold">
1051
- <xsl:call-template name="getLocalizedString">
1052
- <xsl:with-param name="key">Page.sg</xsl:with-param>
1053
- </xsl:call-template>
1054
- </fo:block>
1055
-
1056
- <xsl:for-each select="$contents//item[@display = 'true']">
1057
- <fo:block role="TOCI">
1058
- <xsl:if test="@level = 1">
1059
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1060
- </xsl:if>
1061
- <xsl:if test="@level &gt;= 2">
1062
- <xsl:attribute name="margin-top">4pt</xsl:attribute>
1063
- <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
1064
- </xsl:if>
1065
- <fo:list-block provisional-label-separation="3mm">
1066
- <xsl:attribute name="provisional-distance-between-starts">
1067
- <xsl:choose>
1068
- <xsl:when test="@section != ''">
1069
- <xsl:if test="@level = 1">
1070
- <xsl:choose>
1071
- <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
1072
- <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
1073
- <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
1074
- <xsl:otherwise>12mm</xsl:otherwise>
1075
- </xsl:choose>
1076
- </xsl:if>
1077
- <xsl:if test="@level &gt;= 2"><xsl:value-of select="(@level - 1) * 26"/>mm</xsl:if>
1078
- </xsl:when> <!-- -->
1079
- <xsl:otherwise>0mm</xsl:otherwise>
1080
- </xsl:choose>
1081
- </xsl:attribute>
1082
- <fo:list-item>
1083
- <fo:list-item-label end-indent="label-end()">
1084
- <xsl:if test="@level &gt;= 2">
1085
- <xsl:attribute name="start-indent"><xsl:value-of select="(@level - 1) * 12"/>mm</xsl:attribute>
1086
- </xsl:if>
1087
- <fo:block>
1088
- <xsl:if test="@section">
1089
- <xsl:value-of select="@section"/>
1090
- </xsl:if>
1091
- </fo:block>
1092
- </fo:list-item-label>
1093
- <fo:list-item-body start-indent="body-start()">
1094
- <fo:block text-align-last="justify">
1095
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1096
- <xsl:apply-templates select="title"/>
1097
- <fo:inline keep-together.within-line="always">
1098
- <fo:leader leader-pattern="dots"/>
1099
- <fo:page-number-citation ref-id="{@id}"/>
1100
- </fo:inline>
1101
- </fo:basic-link>
1102
- </fo:block>
1103
- </fo:list-item-body>
1104
- </fo:list-item>
1105
- </fo:list-block>
1106
- </fo:block>
1107
- </xsl:for-each>
1108
-
1109
- <!-- List of Tables -->
1110
- <xsl:if test="$contents//tables/table">
1111
- <xsl:call-template name="insertListOf_Title">
1112
- <xsl:with-param name="title" select="$title-list-tables"/>
1113
- </xsl:call-template>
1114
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1115
- <xsl:call-template name="getLocalizedString">
1116
- <xsl:with-param name="key">Page.sg</xsl:with-param>
1117
- </xsl:call-template>
1118
- </fo:block>
1119
- <fo:block-container>
1120
- <xsl:for-each select="$contents//tables/table">
1121
- <xsl:call-template name="insertListOf_Item"/>
1122
- </xsl:for-each>
1123
- </fo:block-container>
1124
- </xsl:if>
1125
-
1126
- <!-- List of Figures -->
1127
- <xsl:if test="$contents//figures/figure">
1128
- <xsl:call-template name="insertListOf_Title">
1129
- <xsl:with-param name="title" select="$title-list-figures"/>
1130
- </xsl:call-template>
1131
- <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1132
- <xsl:call-template name="getLocalizedString">
1133
- <xsl:with-param name="key">Page.sg</xsl:with-param>
1134
- </xsl:call-template>
1135
- </fo:block>
1136
- <fo:block-container>
1137
- <xsl:for-each select="$contents//figures/figure">
1138
- <xsl:call-template name="insertListOf_Item"/>
1139
- </xsl:for-each>
1140
- </fo:block-container>
1141
- </xsl:if>
1142
-
1143
- </fo:block>
1144
- </fo:block-container>
1145
- </xsl:if>
1041
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() = 'clause'][@type = 'toc']">
1042
+ <xsl:with-param name="process">true</xsl:with-param>
1043
+ </xsl:apply-templates>
1146
1044
 
1147
1045
  </fo:flow>
1148
1046
  </fo:page-sequence>
@@ -1258,6 +1156,127 @@
1258
1156
  </fo:block>
1259
1157
  </xsl:template>
1260
1158
 
1159
+ <xsl:template match="itu:preface/itu:clause[@type = 'toc']" priority="4">
1160
+ <xsl:param name="process">false</xsl:param>
1161
+
1162
+ <xsl:if test="$process = 'true'">
1163
+ <xsl:if test="$doctype != 'resolution' and $doctype != 'service-publication'">
1164
+ <fo:block break-after="page"/>
1165
+ <fo:block-container>
1166
+ <fo:block role="TOC">
1167
+
1168
+ <xsl:apply-templates/>
1169
+
1170
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
1171
+
1172
+ <xsl:for-each select="$contents//item[@display = 'true']">
1173
+ <fo:block role="TOCI">
1174
+ <xsl:if test="@level = 1">
1175
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1176
+ </xsl:if>
1177
+ <xsl:if test="@level &gt;= 2">
1178
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
1179
+ <!-- <xsl:attribute name="margin-left">12mm</xsl:attribute> -->
1180
+ </xsl:if>
1181
+ <fo:list-block provisional-label-separation="3mm">
1182
+ <xsl:attribute name="provisional-distance-between-starts">
1183
+ <xsl:choose>
1184
+ <xsl:when test="@section != ''">
1185
+ <xsl:if test="@level = 1">
1186
+ <xsl:choose>
1187
+ <xsl:when test="string-length(@section) &gt; 10">27mm</xsl:when>
1188
+ <xsl:when test="string-length(@section) &gt; 5">22mm</xsl:when>
1189
+ <!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
1190
+ <xsl:otherwise>12mm</xsl:otherwise>
1191
+ </xsl:choose>
1192
+ </xsl:if>
1193
+ <xsl:if test="@level &gt;= 2"><xsl:value-of select="(@level - 1) * 26"/>mm</xsl:if>
1194
+ </xsl:when> <!-- -->
1195
+ <xsl:otherwise>0mm</xsl:otherwise>
1196
+ </xsl:choose>
1197
+ </xsl:attribute>
1198
+ <fo:list-item>
1199
+ <fo:list-item-label end-indent="label-end()">
1200
+ <xsl:if test="@level &gt;= 2">
1201
+ <xsl:attribute name="start-indent"><xsl:value-of select="(@level - 1) * 12"/>mm</xsl:attribute>
1202
+ </xsl:if>
1203
+ <fo:block>
1204
+ <xsl:if test="@section">
1205
+ <xsl:value-of select="@section"/>
1206
+ </xsl:if>
1207
+ </fo:block>
1208
+ </fo:list-item-label>
1209
+ <fo:list-item-body start-indent="body-start()">
1210
+ <fo:block text-align-last="justify">
1211
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1212
+ <xsl:apply-templates select="title"/>
1213
+ <fo:inline keep-together.within-line="always">
1214
+ <fo:leader leader-pattern="dots"/>
1215
+ <fo:page-number-citation ref-id="{@id}"/>
1216
+ </fo:inline>
1217
+ </fo:basic-link>
1218
+ </fo:block>
1219
+ </fo:list-item-body>
1220
+ </fo:list-item>
1221
+ </fo:list-block>
1222
+ </fo:block>
1223
+ </xsl:for-each>
1224
+
1225
+ <!-- List of Tables -->
1226
+ <xsl:if test="$contents//tables/table">
1227
+ <xsl:call-template name="insertListOf_Title">
1228
+ <xsl:with-param name="title" select="$title-list-tables"/>
1229
+ </xsl:call-template>
1230
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1231
+ <xsl:call-template name="getLocalizedString">
1232
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
1233
+ </xsl:call-template>
1234
+ </fo:block>
1235
+ <fo:block-container>
1236
+ <xsl:for-each select="$contents//tables/table">
1237
+ <xsl:call-template name="insertListOf_Item"/>
1238
+ </xsl:for-each>
1239
+ </fo:block-container>
1240
+ </xsl:if>
1241
+
1242
+ <!-- List of Figures -->
1243
+ <xsl:if test="$contents//figures/figure">
1244
+ <xsl:call-template name="insertListOf_Title">
1245
+ <xsl:with-param name="title" select="$title-list-figures"/>
1246
+ </xsl:call-template>
1247
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
1248
+ <xsl:call-template name="getLocalizedString">
1249
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
1250
+ </xsl:call-template>
1251
+ </fo:block>
1252
+ <fo:block-container>
1253
+ <xsl:for-each select="$contents//figures/figure">
1254
+ <xsl:call-template name="insertListOf_Item"/>
1255
+ </xsl:for-each>
1256
+ </fo:block-container>
1257
+ </xsl:if>
1258
+
1259
+ </xsl:if>
1260
+ </fo:block>
1261
+ </fo:block-container>
1262
+ </xsl:if>
1263
+ </xsl:if>
1264
+ </xsl:template>
1265
+
1266
+ <xsl:template match="itu:preface/itu:clause[@type = 'toc']/itu:title" priority="4">
1267
+ <fo:block margin-top="6pt" text-align="center" font-weight="bold" role="H1">
1268
+ <!-- <xsl:call-template name="getLocalizedString">
1269
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1270
+ </xsl:call-template> -->
1271
+ <xsl:apply-templates/>
1272
+ </fo:block>
1273
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold">
1274
+ <xsl:call-template name="getLocalizedString">
1275
+ <xsl:with-param name="key">Page.sg</xsl:with-param>
1276
+ </xsl:call-template>
1277
+ </fo:block>
1278
+ </xsl:template>
1279
+
1261
1280
  <xsl:template match="node()">
1262
1281
  <xsl:apply-templates/>
1263
1282
  </xsl:template>
@@ -1295,6 +1314,7 @@
1295
1314
 
1296
1315
  <xsl:variable name="skip">
1297
1316
  <xsl:choose>
1317
+ <xsl:when test="@type = 'toc'">true</xsl:when>
1298
1318
  <xsl:when test="ancestor-or-self::itu:bibitem">true</xsl:when>
1299
1319
  <xsl:when test="ancestor-or-self::itu:term">true</xsl:when>
1300
1320
  <xsl:when test="@inline-header = 'true' and not(*[local-name() = 'title']/*[local-name() = 'tab'])">true</xsl:when>
@@ -2513,6 +2533,10 @@
2513
2533
 
2514
2534
  </xsl:attribute-set>
2515
2535
 
2536
+ <xsl:template name="refine_link-style">
2537
+
2538
+ </xsl:template> <!-- refine_link-style -->
2539
+
2516
2540
  <xsl:attribute-set name="sourcecode-container-style">
2517
2541
 
2518
2542
  </xsl:attribute-set>
@@ -2528,6 +2552,10 @@
2528
2552
 
2529
2553
  </xsl:attribute-set>
2530
2554
 
2555
+ <xsl:template name="refine_sourcecode-style">
2556
+
2557
+ </xsl:template> <!-- refine_sourcecode-style -->
2558
+
2531
2559
  <xsl:attribute-set name="pre-style">
2532
2560
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2533
2561
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2608,6 +2636,10 @@
2608
2636
 
2609
2637
  </xsl:attribute-set> <!-- example-style -->
2610
2638
 
2639
+ <xsl:template name="refine_example-style">
2640
+
2641
+ </xsl:template> <!-- refine_example-style -->
2642
+
2611
2643
  <xsl:attribute-set name="example-body-style">
2612
2644
 
2613
2645
  </xsl:attribute-set> <!-- example-body-style -->
@@ -2627,6 +2659,10 @@
2627
2659
 
2628
2660
  </xsl:attribute-set> <!-- example-p-style -->
2629
2661
 
2662
+ <xsl:template name="refine_example-p-style">
2663
+
2664
+ </xsl:template> <!-- refine_example-p-style -->
2665
+
2630
2666
  <xsl:attribute-set name="termexample-name-style">
2631
2667
 
2632
2668
  </xsl:attribute-set> <!-- termexample-name-style -->
@@ -2653,12 +2689,33 @@
2653
2689
 
2654
2690
  </xsl:attribute-set> <!-- table-container-style -->
2655
2691
 
2692
+ <xsl:template name="refine_table-container-style">
2693
+ <xsl:param name="margin-side"/>
2694
+
2695
+ <xsl:if test="$doctype = 'service-publication' and $lang != 'ar'">
2696
+ <xsl:attribute name="font-family">Calibri</xsl:attribute>
2697
+ </xsl:if>
2698
+
2699
+ <!-- end table block-container attributes -->
2700
+ </xsl:template> <!-- refine_table-container-style -->
2701
+
2656
2702
  <xsl:attribute-set name="table-style">
2657
2703
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
2658
2704
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
2659
2705
 
2660
2706
  </xsl:attribute-set><!-- table-style -->
2661
2707
 
2708
+ <xsl:template name="refine_table-style">
2709
+ <xsl:param name="margin-side"/>
2710
+
2711
+ <xsl:call-template name="setBordersTableArray"/>
2712
+
2713
+ <xsl:if test="$doctype = 'service-publication'">
2714
+ <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
2715
+ </xsl:if>
2716
+
2717
+ </xsl:template> <!-- refine_table-style -->
2718
+
2662
2719
  <xsl:attribute-set name="table-name-style">
2663
2720
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2664
2721
 
@@ -2668,6 +2725,11 @@
2668
2725
 
2669
2726
  </xsl:attribute-set> <!-- table-name-style -->
2670
2727
 
2728
+ <xsl:template name="refine_table-name-style">
2729
+ <xsl:param name="continued"/>
2730
+
2731
+ </xsl:template> <!-- refine_table-name-style -->
2732
+
2671
2733
  <xsl:attribute-set name="table-row-style">
2672
2734
  <xsl:attribute name="min-height">4mm</xsl:attribute>
2673
2735
 
@@ -2678,14 +2740,34 @@
2678
2740
 
2679
2741
  </xsl:attribute-set>
2680
2742
 
2743
+ <xsl:template name="refine_table-header-row-style">
2744
+
2745
+ <xsl:call-template name="setBordersTableArray"/>
2746
+
2747
+ <xsl:if test="$doctype = 'service-publication'">
2748
+ <xsl:attribute name="border-bottom">1.1pt solid black</xsl:attribute>
2749
+ </xsl:if>
2750
+
2751
+ </xsl:template> <!-- refine_table-header-row-style -->
2752
+
2681
2753
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
2682
2754
 
2683
2755
  </xsl:attribute-set>
2684
2756
 
2757
+ <xsl:template name="refine_table-footer-row-style">
2758
+
2759
+ </xsl:template> <!-- refine_table-footer-row-style -->
2760
+
2685
2761
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
2686
2762
 
2687
2763
  </xsl:attribute-set>
2688
2764
 
2765
+ <xsl:template name="refine_table-body-row-style">
2766
+
2767
+ <xsl:call-template name="setBordersTableArray"/>
2768
+
2769
+ </xsl:template> <!-- refine_table-body-row-style -->
2770
+
2689
2771
  <xsl:attribute-set name="table-header-cell-style">
2690
2772
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2691
2773
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2694,6 +2776,29 @@
2694
2776
 
2695
2777
  </xsl:attribute-set> <!-- table-header-cell-style -->
2696
2778
 
2779
+ <xsl:template name="refine_table-header-cell-style">
2780
+
2781
+ <xsl:call-template name="setBordersTableArray"/>
2782
+
2783
+ <xsl:if test="ancestor::*[local-name()='preface']">
2784
+ <xsl:if test="$doctype != 'service-publication'">
2785
+ <xsl:attribute name="border">solid black 0pt</xsl:attribute>
2786
+ </xsl:if>
2787
+ </xsl:if>
2788
+ <xsl:if test="$doctype = 'service-publication'">
2789
+ <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
2790
+ <xsl:attribute name="border-bottom">1pt solid black</xsl:attribute>
2791
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2792
+ </xsl:if>
2793
+
2794
+ <xsl:if test="$lang = 'ar'">
2795
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2796
+ </xsl:if>
2797
+
2798
+ <xsl:call-template name="setTableCellAttributes"/>
2799
+
2800
+ </xsl:template> <!-- refine_table-header-cell-style -->
2801
+
2697
2802
  <xsl:attribute-set name="table-cell-style">
2698
2803
  <xsl:attribute name="display-align">center</xsl:attribute>
2699
2804
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2704,6 +2809,26 @@
2704
2809
 
2705
2810
  </xsl:attribute-set> <!-- table-cell-style -->
2706
2811
 
2812
+ <xsl:template name="refine_table-cell-style">
2813
+
2814
+ <xsl:if test="$lang = 'ar'">
2815
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2816
+ </xsl:if>
2817
+
2818
+ <!-- bsi -->
2819
+
2820
+ <xsl:call-template name="setBordersTableArray"/>
2821
+
2822
+ <xsl:if test="ancestor::*[local-name()='preface']">
2823
+ <xsl:attribute name="border">solid black 0pt</xsl:attribute>
2824
+ </xsl:if>
2825
+ <xsl:if test="$doctype = 'service-publication'">
2826
+ <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
2827
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2828
+ </xsl:if>
2829
+
2830
+ </xsl:template> <!-- refine_table-cell-style -->
2831
+
2707
2832
  <xsl:attribute-set name="table-footer-cell-style">
2708
2833
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2709
2834
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2712,12 +2837,29 @@
2712
2837
 
2713
2838
  </xsl:attribute-set> <!-- table-footer-cell-style -->
2714
2839
 
2840
+ <xsl:template name="refine_table-footer-cell-style">
2841
+
2842
+ <xsl:if test="ancestor::*[local-name()='preface']">
2843
+ <xsl:if test="$doctype != 'service-publication'">
2844
+ <xsl:attribute name="border">solid black 0pt</xsl:attribute>
2845
+ </xsl:if>
2846
+ </xsl:if>
2847
+ <xsl:if test="$doctype = 'service-publication'">
2848
+ <xsl:attribute name="border">none</xsl:attribute>
2849
+ </xsl:if>
2850
+
2851
+ </xsl:template> <!-- refine_table-footer-cell-style -->
2852
+
2715
2853
  <xsl:attribute-set name="table-note-style">
2716
2854
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2717
2855
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2718
2856
 
2719
2857
  </xsl:attribute-set><!-- table-note-style -->
2720
2858
 
2859
+ <xsl:template name="refine_table-note-style">
2860
+
2861
+ </xsl:template> <!-- refine_table-note-style -->
2862
+
2721
2863
  <xsl:attribute-set name="table-fn-style">
2722
2864
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2723
2865
 
@@ -2780,6 +2922,14 @@
2780
2922
 
2781
2923
  </xsl:attribute-set>
2782
2924
 
2925
+ <xsl:template name="refine_dt-cell-style">
2926
+
2927
+ <xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
2928
+ <xsl:attribute name="padding-right">3mm</xsl:attribute>
2929
+ </xsl:if>
2930
+
2931
+ </xsl:template> <!-- refine_dt-cell-style -->
2932
+
2783
2933
  <xsl:attribute-set name="dt-block-style">
2784
2934
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
2785
2935
 
@@ -2787,6 +2937,14 @@
2787
2937
 
2788
2938
  </xsl:attribute-set>
2789
2939
 
2940
+ <xsl:template name="refine_dt-block-style">
2941
+
2942
+ <xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
2943
+ <xsl:attribute name="text-align">right</xsl:attribute>
2944
+ </xsl:if>
2945
+
2946
+ </xsl:template> <!-- refine_dt-block-style -->
2947
+
2790
2948
  <xsl:attribute-set name="dl-name-style">
2791
2949
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2792
2950
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -2800,6 +2958,10 @@
2800
2958
 
2801
2959
  </xsl:attribute-set>
2802
2960
 
2961
+ <xsl:template name="refine_dd-cell-style">
2962
+
2963
+ </xsl:template> <!-- refine_dd-cell-style -->
2964
+
2803
2965
  <!-- ========================== -->
2804
2966
  <!-- END Definition's list styles -->
2805
2967
  <!-- ========================== -->
@@ -2813,7 +2975,6 @@
2813
2975
  </xsl:attribute-set>
2814
2976
 
2815
2977
  <xsl:attribute-set name="xref-style">
2816
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2817
2978
 
2818
2979
  <xsl:attribute name="color">blue</xsl:attribute>
2819
2980
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2827,6 +2988,12 @@
2827
2988
 
2828
2989
  </xsl:attribute-set>
2829
2990
 
2991
+ <xsl:template name="refine_eref-style">
2992
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
2993
+ <xsl:variable name="text" select="normalize-space()"/>
2994
+
2995
+ </xsl:template> <!-- refine_eref-style -->
2996
+
2830
2997
  <xsl:attribute-set name="note-style">
2831
2998
 
2832
2999
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -2835,6 +3002,10 @@
2835
3002
 
2836
3003
  </xsl:attribute-set>
2837
3004
 
3005
+ <xsl:template name="refine_note-style">
3006
+
3007
+ </xsl:template>
3008
+
2838
3009
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
2839
3010
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
2840
3011
 
@@ -2842,11 +3013,19 @@
2842
3013
 
2843
3014
  </xsl:attribute-set>
2844
3015
 
3016
+ <xsl:template name="refine_note-name-style">
3017
+
3018
+ </xsl:template> <!-- refine_note-name-style -->
3019
+
2845
3020
  <xsl:attribute-set name="table-note-name-style">
2846
3021
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
2847
3022
 
2848
3023
  </xsl:attribute-set>
2849
3024
 
3025
+ <xsl:template name="refine_table-note-name-style">
3026
+
3027
+ </xsl:template> <!-- refine_table-note-name-style -->
3028
+
2850
3029
  <xsl:attribute-set name="note-p-style">
2851
3030
 
2852
3031
  <xsl:attribute name="space-before">4pt</xsl:attribute>
@@ -2859,10 +3038,18 @@
2859
3038
 
2860
3039
  </xsl:attribute-set>
2861
3040
 
3041
+ <xsl:template name="refine_termnote-style">
3042
+
3043
+ </xsl:template> <!-- refine_termnote-style -->
3044
+
2862
3045
  <xsl:attribute-set name="termnote-name-style">
2863
3046
 
2864
3047
  </xsl:attribute-set>
2865
3048
 
3049
+ <xsl:template name="refine_termnote-name-style">
3050
+
3051
+ </xsl:template>
3052
+
2866
3053
  <xsl:attribute-set name="termnote-p-style">
2867
3054
 
2868
3055
  </xsl:attribute-set>
@@ -2875,6 +3062,10 @@
2875
3062
 
2876
3063
  </xsl:attribute-set>
2877
3064
 
3065
+ <xsl:template name="refine_quote-style">
3066
+
3067
+ </xsl:template>
3068
+
2878
3069
  <xsl:attribute-set name="quote-source-style">
2879
3070
  <xsl:attribute name="text-align">right</xsl:attribute>
2880
3071
 
@@ -2884,6 +3075,10 @@
2884
3075
 
2885
3076
  </xsl:attribute-set>
2886
3077
 
3078
+ <xsl:template name="refine_termsource-style">
3079
+
3080
+ </xsl:template> <!-- refine_termsource-style -->
3081
+
2887
3082
  <xsl:attribute-set name="termsource-text-style">
2888
3083
 
2889
3084
  </xsl:attribute-set>
@@ -2922,6 +3117,10 @@
2922
3117
 
2923
3118
  </xsl:attribute-set>
2924
3119
 
3120
+ <xsl:template name="refine_figure-name-style">
3121
+
3122
+ </xsl:template> <!-- refine_figure-name-style -->
3123
+
2925
3124
  <xsl:attribute-set name="figure-source-style">
2926
3125
 
2927
3126
  </xsl:attribute-set>
@@ -2942,6 +3141,10 @@
2942
3141
 
2943
3142
  </xsl:attribute-set> <!-- formula-stem-block-style -->
2944
3143
 
3144
+ <xsl:template name="refine_formula-stem-block-style">
3145
+
3146
+ </xsl:template> <!-- refine_formula-stem-block-style -->
3147
+
2945
3148
  <xsl:attribute-set name="formula-stem-number-style">
2946
3149
  <xsl:attribute name="text-align">right</xsl:attribute>
2947
3150
 
@@ -2955,6 +3158,10 @@
2955
3158
 
2956
3159
  </xsl:attribute-set>
2957
3160
 
3161
+ <xsl:template name="refine_image-style">
3162
+
3163
+ </xsl:template>
3164
+
2958
3165
  <xsl:attribute-set name="figure-pseudocode-p-style">
2959
3166
 
2960
3167
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -3048,10 +3255,18 @@
3048
3255
 
3049
3256
  </xsl:attribute-set>
3050
3257
 
3258
+ <xsl:template name="refine_mathml-style">
3259
+
3260
+ </xsl:template>
3261
+
3051
3262
  <xsl:attribute-set name="list-style">
3052
3263
 
3053
3264
  </xsl:attribute-set> <!-- list-style -->
3054
3265
 
3266
+ <xsl:template name="refine_list-style">
3267
+
3268
+ </xsl:template> <!-- refine_list-style -->
3269
+
3055
3270
  <xsl:attribute-set name="list-name-style">
3056
3271
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3057
3272
 
@@ -3063,14 +3278,26 @@
3063
3278
 
3064
3279
  </xsl:attribute-set>
3065
3280
 
3281
+ <xsl:template name="refine_list-item-style">
3282
+
3283
+ </xsl:template> <!-- refine_list-item-style -->
3284
+
3066
3285
  <xsl:attribute-set name="list-item-label-style">
3067
3286
 
3068
3287
  </xsl:attribute-set>
3069
3288
 
3289
+ <xsl:template name="refine_list-item-label-style">
3290
+
3291
+ </xsl:template> <!-- refine_list-item-label-style -->
3292
+
3070
3293
  <xsl:attribute-set name="list-item-body-style">
3071
3294
 
3072
3295
  </xsl:attribute-set>
3073
3296
 
3297
+ <xsl:template name="refine_list-item-body-style">
3298
+
3299
+ </xsl:template> <!-- refine_list-item-body-style -->
3300
+
3074
3301
  <xsl:attribute-set name="toc-style">
3075
3302
  <xsl:attribute name="line-height">135%</xsl:attribute>
3076
3303
  </xsl:attribute-set>
@@ -3084,6 +3311,10 @@
3084
3311
 
3085
3312
  </xsl:attribute-set>
3086
3313
 
3314
+ <xsl:template name="refine_fn-reference-style">
3315
+
3316
+ </xsl:template> <!-- refine_fn-reference-style -->
3317
+
3087
3318
  <xsl:attribute-set name="fn-style">
3088
3319
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3089
3320
  </xsl:attribute-set>
@@ -3108,6 +3339,14 @@
3108
3339
 
3109
3340
  </xsl:attribute-set>
3110
3341
 
3342
+ <xsl:template name="refine_fn-body-style">
3343
+
3344
+ <xsl:if test="$doctype = 'service-publication'">
3345
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
3346
+ </xsl:if>
3347
+
3348
+ </xsl:template> <!-- refine_fn-body-style -->
3349
+
3111
3350
  <xsl:attribute-set name="fn-body-num-style">
3112
3351
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3113
3352
 
@@ -3117,6 +3356,10 @@
3117
3356
 
3118
3357
  </xsl:attribute-set> <!-- fn-body-num-style -->
3119
3358
 
3359
+ <xsl:template name="refine_fn-body-num-style">
3360
+
3361
+ </xsl:template> <!-- refine_fn-body-num-style -->
3362
+
3120
3363
  <!-- admonition -->
3121
3364
  <xsl:attribute-set name="admonition-style">
3122
3365
 
@@ -3787,11 +4030,9 @@
3787
4030
 
3788
4031
  <fo:block-container xsl:use-attribute-sets="table-container-style">
3789
4032
 
3790
- <xsl:if test="$doctype = 'service-publication' and $lang != 'ar'">
3791
- <xsl:attribute name="font-family">Calibri</xsl:attribute>
3792
- </xsl:if>
3793
-
3794
- <!-- end table block-container attributes -->
4033
+ <xsl:call-template name="refine_table-container-style">
4034
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4035
+ </xsl:call-template>
3795
4036
 
3796
4037
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3797
4038
 
@@ -3812,11 +4053,9 @@
3812
4053
 
3813
4054
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3814
4055
 
3815
- <xsl:call-template name="setBordersTableArray"/>
3816
-
3817
- <xsl:if test="$doctype = 'service-publication'">
3818
- <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
3819
- </xsl:if>
4056
+ <xsl:call-template name="refine_table-style">
4057
+ <xsl:with-param name="margin-side" select="$margin-side"/>
4058
+ </xsl:call-template>
3820
4059
 
3821
4060
  </xsl:element>
3822
4061
  </xsl:variable>
@@ -3882,7 +4121,7 @@
3882
4121
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3883
4122
  </xsl:when>
3884
4123
  <xsl:otherwise>
3885
- <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 -->
4124
+ <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 -->
3886
4125
  </xsl:otherwise>
3887
4126
  </xsl:choose>
3888
4127
 
@@ -3972,6 +4211,10 @@
3972
4211
 
3973
4212
  <fo:block xsl:use-attribute-sets="table-name-style">
3974
4213
 
4214
+ <xsl:call-template name="refine_table-name-style">
4215
+ <xsl:with-param name="continued" select="$continued"/>
4216
+ </xsl:call-template>
4217
+
3975
4218
  <xsl:choose>
3976
4219
  <xsl:when test="$continued = 'true'">
3977
4220
 
@@ -4354,6 +4597,8 @@
4354
4597
  <fo:table-row>
4355
4598
  <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">
4356
4599
 
4600
+ <xsl:call-template name="refine_table-header-title-style"/>
4601
+
4357
4602
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4358
4603
  <xsl:with-param name="continued">true</xsl:with-param>
4359
4604
  </xsl:apply-templates>
@@ -4366,6 +4611,10 @@
4366
4611
  </fo:table-row>
4367
4612
  </xsl:template> <!-- table-header-title -->
4368
4613
 
4614
+ <xsl:template name="refine_table-header-title-style">
4615
+
4616
+ </xsl:template> <!-- refine_table-header-title-style -->
4617
+
4369
4618
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
4370
4619
  <fo:table-body>
4371
4620
  <xsl:apply-templates/>
@@ -4390,7 +4639,7 @@
4390
4639
  <xsl:param name="colwidths"/>
4391
4640
  <xsl:param name="colgroup"/>
4392
4641
 
4393
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
4642
+ <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']"/>
4394
4643
 
4395
4644
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
4396
4645
 
@@ -4456,14 +4705,7 @@
4456
4705
  <fo:table-row>
4457
4706
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4458
4707
 
4459
- <xsl:if test="ancestor::*[local-name()='preface']">
4460
- <xsl:if test="$doctype != 'service-publication'">
4461
- <xsl:attribute name="border">solid black 0pt</xsl:attribute>
4462
- </xsl:if>
4463
- </xsl:if>
4464
- <xsl:if test="$doctype = 'service-publication'">
4465
- <xsl:attribute name="border">none</xsl:attribute>
4466
- </xsl:if>
4708
+ <xsl:call-template name="refine_table-footer-cell-style"/>
4467
4709
 
4468
4710
  <xsl:call-template name="setBordersTableArray"/>
4469
4711
 
@@ -4477,6 +4719,7 @@
4477
4719
 
4478
4720
  <!-- except gb and bsi -->
4479
4721
 
4722
+ <xsl:apply-templates select="../*[local-name()='p']"/>
4480
4723
  <xsl:apply-templates select="../*[local-name()='dl']"/>
4481
4724
  <xsl:apply-templates select="../*[local-name()='note']"/>
4482
4725
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -4608,11 +4851,7 @@
4608
4851
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4609
4852
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4610
4853
 
4611
- <xsl:call-template name="setBordersTableArray"/>
4612
-
4613
- <xsl:if test="$doctype = 'service-publication'">
4614
- <xsl:attribute name="border-bottom">1.1pt solid black</xsl:attribute>
4615
- </xsl:if>
4854
+ <xsl:call-template name="refine_table-header-row-style"/>
4616
4855
 
4617
4856
  <xsl:call-template name="setTableRowAttributes"/>
4618
4857
 
@@ -4646,6 +4885,8 @@
4646
4885
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4647
4886
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4648
4887
 
4888
+ <xsl:call-template name="refine_table-footer-row-style"/>
4889
+
4649
4890
  <xsl:call-template name="setTableRowAttributes"/>
4650
4891
  <xsl:apply-templates/>
4651
4892
  </fo:table-row>
@@ -4659,9 +4900,10 @@
4659
4900
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4660
4901
  </xsl:if>
4661
4902
 
4662
- <xsl:call-template name="setBordersTableArray"/>
4903
+ <xsl:call-template name="refine_table-body-row-style"/>
4663
4904
 
4664
4905
  <xsl:call-template name="setTableRowAttributes"/>
4906
+
4665
4907
  <xsl:apply-templates/>
4666
4908
  </fo:table-row>
4667
4909
  </xsl:template>
@@ -4684,24 +4926,7 @@
4684
4926
  <xsl:with-param name="default">center</xsl:with-param>
4685
4927
  </xsl:call-template>
4686
4928
 
4687
- <xsl:call-template name="setBordersTableArray"/>
4688
-
4689
- <xsl:if test="ancestor::*[local-name()='preface']">
4690
- <xsl:if test="$doctype != 'service-publication'">
4691
- <xsl:attribute name="border">solid black 0pt</xsl:attribute>
4692
- </xsl:if>
4693
- </xsl:if>
4694
- <xsl:if test="$doctype = 'service-publication'">
4695
- <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
4696
- <xsl:attribute name="border-bottom">1pt solid black</xsl:attribute>
4697
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
4698
- </xsl:if>
4699
-
4700
- <xsl:if test="$lang = 'ar'">
4701
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4702
- </xsl:if>
4703
-
4704
- <xsl:call-template name="setTableCellAttributes"/>
4929
+ <xsl:call-template name="refine_table-header-cell-style"/>
4705
4930
 
4706
4931
  <fo:block>
4707
4932
  <xsl:apply-templates/>
@@ -4743,21 +4968,7 @@
4743
4968
  <xsl:with-param name="default">left</xsl:with-param>
4744
4969
  </xsl:call-template>
4745
4970
 
4746
- <xsl:if test="$lang = 'ar'">
4747
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
4748
- </xsl:if>
4749
-
4750
- <!-- bsi -->
4751
-
4752
- <xsl:call-template name="setBordersTableArray"/>
4753
-
4754
- <xsl:if test="ancestor::*[local-name()='preface']">
4755
- <xsl:attribute name="border">solid black 0pt</xsl:attribute>
4756
- </xsl:if>
4757
- <xsl:if test="$doctype = 'service-publication'">
4758
- <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
4759
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
4760
- </xsl:if>
4971
+ <xsl:call-template name="refine_table-cell-style"/>
4761
4972
 
4762
4973
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4763
4974
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -4788,9 +4999,13 @@
4788
4999
 
4789
5000
  <fo:block xsl:use-attribute-sets="table-note-style">
4790
5001
 
5002
+ <xsl:call-template name="refine_table-note-style"/>
5003
+
4791
5004
  <!-- Table's note name (NOTE, for example) -->
4792
5005
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
4793
5006
 
5007
+ <xsl:call-template name="refine_table-note-name-style"/>
5008
+
4794
5009
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4795
5010
 
4796
5011
  </fo:inline>
@@ -4818,6 +5033,14 @@
4818
5033
  <!-- list of footnotes to calculate actual footnotes number -->
4819
5034
  <xsl:variable name="p_fn_">
4820
5035
  <xsl:call-template name="get_fn_list"/>
5036
+ <!-- <xsl:choose>
5037
+ <xsl:when test="$namespace = 'jis'">
5038
+ <xsl:call-template name="get_fn_list_for_element"/>
5039
+ </xsl:when>
5040
+ <xsl:otherwise>
5041
+ <xsl:call-template name="get_fn_list"/>
5042
+ </xsl:otherwise>
5043
+ </xsl:choose> -->
4821
5044
  </xsl:variable>
4822
5045
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4823
5046
 
@@ -4842,7 +5065,14 @@
4842
5065
 
4843
5066
  </xsl:variable>
4844
5067
 
4845
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5068
+ <xsl:variable name="ref_id">
5069
+ <xsl:choose>
5070
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
5071
+ <xsl:otherwise>
5072
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5073
+ </xsl:otherwise>
5074
+ </xsl:choose>
5075
+ </xsl:variable>
4846
5076
  <xsl:variable name="footnote_inline">
4847
5077
  <fo:inline>
4848
5078
 
@@ -4868,7 +5098,7 @@
4868
5098
  <xsl:call-template name="insert_basic_link">
4869
5099
  <xsl:with-param name="element">
4870
5100
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4871
- <xsl:value-of select="$current_fn_number_text"/>
5101
+ <xsl:copy-of select="$current_fn_number_text"/>
4872
5102
  </fo:basic-link>
4873
5103
  </xsl:with-param>
4874
5104
  </xsl:call-template>
@@ -4888,12 +5118,12 @@
4888
5118
 
4889
5119
  <fo:block xsl:use-attribute-sets="fn-body-style">
4890
5120
 
4891
- <xsl:if test="$doctype = 'service-publication'">
4892
- <xsl:attribute name="font-size">10pt</xsl:attribute>
4893
- </xsl:if>
5121
+ <xsl:call-template name="refine_fn-body-style"/>
4894
5122
 
4895
5123
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4896
5124
 
5125
+ <xsl:call-template name="refine_fn-body-num-style"/>
5126
+
4897
5127
  <xsl:value-of select="$current_fn_number_text"/>
4898
5128
  </fo:inline>
4899
5129
  <xsl:apply-templates/>
@@ -4945,6 +5175,28 @@
4945
5175
  </xsl:choose>
4946
5176
  </xsl:template>
4947
5177
 
5178
+ <xsl:template name="get_fn_list_for_element">
5179
+ <xsl:choose>
5180
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
5181
+ <fn gen_id="{generate-id(.)}">
5182
+ <xsl:copy-of select="@*"/>
5183
+ <xsl:copy-of select="node()"/>
5184
+ </fn>
5185
+ </xsl:when>
5186
+ <xsl:otherwise>
5187
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
5188
+ <xsl:variable name="element_id" select="@id"/>
5189
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5190
+ <!-- copy unique fn -->
5191
+ <fn gen_id="{generate-id(.)}">
5192
+ <xsl:copy-of select="@*"/>
5193
+ <xsl:copy-of select="node()"/>
5194
+ </fn>
5195
+ </xsl:for-each>
5196
+ </xsl:for-each>
5197
+ </xsl:otherwise>
5198
+ </xsl:choose>
5199
+ </xsl:template>
4948
5200
  <!-- ============================ -->
4949
5201
  <!-- table's footnotes rendering -->
4950
5202
  <!-- ============================ -->
@@ -5125,6 +5377,8 @@
5125
5377
  <xsl:template match="*[local-name()='fn']">
5126
5378
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
5127
5379
 
5380
+ <xsl:call-template name="refine_fn-reference-style"/>
5381
+
5128
5382
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5129
5383
 
5130
5384
  <xsl:value-of select="@reference"/>
@@ -5224,7 +5478,7 @@
5224
5478
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
5225
5479
  <fo:block margin-bottom="12pt" text-align="left">
5226
5480
 
5227
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5481
+ <xsl:call-template name="refine_dl_formula_where_style"/>
5228
5482
 
5229
5483
  <!-- <xsl:variable name="title-where">
5230
5484
  <xsl:call-template name="getLocalizedString">
@@ -5239,6 +5493,8 @@
5239
5493
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
5240
5494
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5241
5495
 
5496
+ <xsl:call-template name="refine_figure_key_style"/>
5497
+
5242
5498
  <xsl:variable name="title-key">
5243
5499
  <xsl:call-template name="getLocalizedString">
5244
5500
  <xsl:with-param name="key">key</xsl:with-param>
@@ -5253,9 +5509,7 @@
5253
5509
  <xsl:if test="$onlyOneComponent = 'false'">
5254
5510
  <fo:block>
5255
5511
 
5256
- <xsl:if test="$parent = 'figure' or $parent = 'formula'">
5257
- <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
5258
- </xsl:if>
5512
+ <xsl:call-template name="refine_multicomponent_style"/>
5259
5513
 
5260
5514
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5261
5515
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -5263,6 +5517,8 @@
5263
5517
 
5264
5518
  <fo:block>
5265
5519
 
5520
+ <xsl:call-template name="refine_multicomponent_block_style"/>
5521
+
5266
5522
  <xsl:apply-templates select="*[local-name() = 'name']">
5267
5523
  <xsl:with-param name="process">true</xsl:with-param>
5268
5524
  </xsl:apply-templates>
@@ -5420,6 +5676,30 @@
5420
5676
 
5421
5677
  </xsl:template> <!-- END: dl -->
5422
5678
 
5679
+ <xsl:template name="refine_dl_formula_where_style">
5680
+
5681
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5682
+
5683
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5684
+
5685
+ <xsl:template name="refine_figure_key_style">
5686
+
5687
+ </xsl:template> <!-- refine_figure_key_style -->
5688
+
5689
+ <xsl:template name="refine_multicomponent_style">
5690
+ <xsl:variable name="parent" select="local-name(..)"/>
5691
+
5692
+ <xsl:if test="$parent = 'figure' or $parent = 'formula'">
5693
+ <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
5694
+ </xsl:if>
5695
+
5696
+ </xsl:template> <!-- refine_multicomponent_style -->
5697
+
5698
+ <xsl:template name="refine_multicomponent_block_style">
5699
+ <xsl:variable name="parent" select="local-name(..)"/>
5700
+
5701
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5702
+
5423
5703
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
5424
5704
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
5425
5705
 
@@ -5639,9 +5919,7 @@
5639
5919
 
5640
5920
  </xsl:if>
5641
5921
 
5642
- <xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
5643
- <xsl:attribute name="padding-right">3mm</xsl:attribute>
5644
- </xsl:if>
5922
+ <xsl:call-template name="refine_dt-cell-style"/>
5645
5923
 
5646
5924
  <fo:block xsl:use-attribute-sets="dt-block-style">
5647
5925
  <xsl:copy-of select="@id"/>
@@ -5650,9 +5928,7 @@
5650
5928
  <xsl:attribute name="margin-top">0</xsl:attribute>
5651
5929
  </xsl:if>
5652
5930
 
5653
- <xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
5654
- <xsl:attribute name="text-align">right</xsl:attribute>
5655
- </xsl:if>
5931
+ <xsl:call-template name="refine_dt-block-style"/>
5656
5932
 
5657
5933
  <xsl:apply-templates>
5658
5934
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5673,6 +5949,8 @@
5673
5949
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5674
5950
  </xsl:if>
5675
5951
 
5952
+ <xsl:call-template name="refine_dd-cell-style"/>
5953
+
5676
5954
  <fo:block>
5677
5955
 
5678
5956
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -5825,12 +6103,18 @@
5825
6103
  <xsl:param name="split_keep-within-line"/>
5826
6104
  <fo:inline font-weight="bold">
5827
6105
 
6106
+ <xsl:call-template name="refine_strong_style"/>
6107
+
5828
6108
  <xsl:apply-templates>
5829
6109
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5830
6110
  </xsl:apply-templates>
5831
6111
  </fo:inline>
5832
6112
  </xsl:template>
5833
6113
 
6114
+ <xsl:template name="refine_strong_style">
6115
+
6116
+ </xsl:template>
6117
+
5834
6118
  <xsl:template match="*[local-name()='padding']">
5835
6119
  <fo:inline padding-right="{@value}"> </fo:inline>
5836
6120
  </xsl:template>
@@ -6297,7 +6581,10 @@
6297
6581
  </xsl:choose>
6298
6582
  </xsl:variable>
6299
6583
 
6300
- <xsl:value-of select="$text9"/>
6584
+ <!-- replace sequence #x200B and space TO space -->
6585
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6586
+
6587
+ <xsl:value-of select="$text10"/>
6301
6588
  </xsl:template>
6302
6589
 
6303
6590
  <xsl:template name="add-zero-spaces-link-java">
@@ -6972,6 +7259,11 @@
6972
7259
 
6973
7260
  <fo:inline xsl:use-attribute-sets="mathml-style">
6974
7261
 
7262
+ <!-- DEBUG -->
7263
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
7264
+
7265
+ <xsl:call-template name="refine_mathml-style"/>
7266
+
6975
7267
  <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 -->
6976
7268
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6977
7269
  </xsl:if>
@@ -7076,6 +7368,8 @@
7076
7368
 
7077
7369
  <fo:instream-foreign-object fox:alt-text="Math">
7078
7370
 
7371
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
7372
+
7079
7373
  <!-- put MathML in Actual Text -->
7080
7374
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
7081
7375
  <xsl:attribute name="fox:actual-text">
@@ -7096,6 +7390,10 @@
7096
7390
  </fo:instream-foreign-object>
7097
7391
  </xsl:template>
7098
7392
 
7393
+ <xsl:template name="refine_mathml_insteam_object_style">
7394
+
7395
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
7396
+
7099
7397
  <xsl:template match="mathml:*" mode="mathml_actual_text">
7100
7398
  <!-- <xsl:text>a+b</xsl:text> -->
7101
7399
  <xsl:text>&lt;</xsl:text>
@@ -7240,6 +7538,8 @@
7240
7538
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
7241
7539
  <fo:inline xsl:use-attribute-sets="mathml-style">
7242
7540
 
7541
+ <xsl:call-template name="refine_mathml-style"/>
7542
+
7243
7543
  <xsl:choose>
7244
7544
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7245
7545
  <xsl:otherwise>
@@ -7284,6 +7584,8 @@
7284
7584
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7285
7585
  </xsl:if>
7286
7586
 
7587
+ <xsl:call-template name="refine_link-style"/>
7588
+
7287
7589
  <xsl:choose>
7288
7590
  <xsl:when test="$target_text = ''">
7289
7591
  <xsl:apply-templates/>
@@ -7371,6 +7673,9 @@
7371
7673
  <xsl:call-template name="insert_basic_link">
7372
7674
  <xsl:with-param name="element">
7373
7675
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7676
+ <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'])">
7677
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7678
+ </xsl:if>
7374
7679
  <xsl:if test="parent::*[local-name() = 'add']">
7375
7680
  <xsl:call-template name="append_add-style"/>
7376
7681
  </xsl:if>
@@ -7432,6 +7737,8 @@
7432
7737
  <fo:table-cell display-align="center">
7433
7738
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7434
7739
 
7740
+ <xsl:call-template name="refine_formula-stem-block-style"/>
7741
+
7435
7742
  <xsl:apply-templates/>
7436
7743
  </fo:block>
7437
7744
  </fo:table-cell>
@@ -7473,16 +7780,18 @@
7473
7780
 
7474
7781
  <xsl:call-template name="setBlockSpanAll"/>
7475
7782
 
7783
+ <xsl:call-template name="refine_note-style"/>
7784
+
7476
7785
  <fo:block-container margin-left="0mm" margin-right="0mm">
7477
7786
 
7478
7787
  <fo:block>
7479
7788
 
7480
- <xsl:if test="ancestor::itu:figure">
7481
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7482
- </xsl:if>
7789
+ <xsl:call-template name="refine_note_block_style"/>
7483
7790
 
7484
7791
  <fo:inline xsl:use-attribute-sets="note-name-style">
7485
7792
 
7793
+ <xsl:call-template name="refine_note-name-style"/>
7794
+
7486
7795
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7487
7796
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7488
7797
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7508,6 +7817,14 @@
7508
7817
 
7509
7818
  </xsl:template>
7510
7819
 
7820
+ <xsl:template name="refine_note_block_style">
7821
+
7822
+ <xsl:if test="ancestor::itu:figure">
7823
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7824
+ </xsl:if>
7825
+
7826
+ </xsl:template>
7827
+
7511
7828
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7512
7829
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7513
7830
  <xsl:choose>
@@ -7529,12 +7846,16 @@
7529
7846
 
7530
7847
  <xsl:call-template name="setBlockSpanAll"/>
7531
7848
 
7849
+ <xsl:call-template name="refine_termnote-style"/>
7850
+
7532
7851
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7533
7852
 
7534
7853
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
7535
7854
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
7536
7855
  </xsl:if>
7537
7856
 
7857
+ <xsl:call-template name="refine_termnote-name-style"/>
7858
+
7538
7859
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7539
7860
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7540
7861
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7708,6 +8029,8 @@
7708
8029
  <xsl:otherwise>
7709
8030
  <fo:block xsl:use-attribute-sets="image-style">
7710
8031
 
8032
+ <xsl:call-template name="refine_image-style"/>
8033
+
7711
8034
  <xsl:variable name="src">
7712
8035
  <xsl:call-template name="image_src"/>
7713
8036
  </xsl:variable>
@@ -8557,6 +8880,8 @@
8557
8880
  <xsl:if test="normalize-space() != ''">
8558
8881
  <fo:block xsl:use-attribute-sets="figure-name-style">
8559
8882
 
8883
+ <xsl:call-template name="refine_figure-name-style"/>
8884
+
8560
8885
  <xsl:apply-templates/>
8561
8886
  </fo:block>
8562
8887
  </xsl:if>
@@ -8822,6 +9147,8 @@
8822
9147
  </xsl:attribute>
8823
9148
  </xsl:for-each>
8824
9149
 
9150
+ <xsl:call-template name="refine_sourcecode-style"/>
9151
+
8825
9152
  <!-- remove margin between rows in the table with sourcecode line numbers -->
8826
9153
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8827
9154
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -9526,6 +9853,8 @@
9526
9853
 
9527
9854
  <xsl:call-template name="setBlockSpanAll"/>
9528
9855
 
9856
+ <xsl:call-template name="refine_example-style"/>
9857
+
9529
9858
  <xsl:variable name="fo_element">
9530
9859
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9531
9860
  block
@@ -9653,6 +9982,8 @@
9653
9982
  </xsl:if>
9654
9983
  <fo:block xsl:use-attribute-sets="example-p-style">
9655
9984
 
9985
+ <xsl:call-template name="refine_example-p-style"/>
9986
+
9656
9987
  <xsl:apply-templates/>
9657
9988
  </fo:block>
9658
9989
  </fo:block-container>
@@ -9669,6 +10000,7 @@
9669
10000
  </xsl:otherwise>
9670
10001
  </xsl:choose>
9671
10002
  </xsl:template> <!-- example/p -->
10003
+
9672
10004
  <!-- ====== -->
9673
10005
  <!-- ====== -->
9674
10006
 
@@ -9680,6 +10012,8 @@
9680
10012
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
9681
10013
  <fo:block xsl:use-attribute-sets="termsource-style">
9682
10014
 
10015
+ <xsl:call-template name="refine_termsource-style"/>
10016
+
9683
10017
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
9684
10018
  <xsl:variable name="termsource_text">
9685
10019
  <xsl:apply-templates/>
@@ -9795,6 +10129,8 @@
9795
10129
  <fo:block-container margin-left="0mm">
9796
10130
  <fo:block-container xsl:use-attribute-sets="quote-style">
9797
10131
 
10132
+ <xsl:call-template name="refine_quote-style"/>
10133
+
9798
10134
  <fo:block-container margin-left="0mm" margin-right="0mm">
9799
10135
  <fo:block role="BlockQuote">
9800
10136
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -9869,8 +10205,7 @@
9869
10205
 
9870
10206
  </xsl:if>
9871
10207
 
9872
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9873
- <xsl:variable name="text" select="normalize-space()"/>
10208
+ <xsl:call-template name="refine_eref-style"/>
9874
10209
 
9875
10210
  <xsl:call-template name="insert_basic_link">
9876
10211
  <xsl:with-param name="element">
@@ -9880,6 +10215,8 @@
9880
10215
  </xsl:if>
9881
10216
  <xsl:if test="@type = 'inline'">
9882
10217
 
10218
+ <xsl:call-template name="refine_basic_link_style"/>
10219
+
9883
10220
  </xsl:if>
9884
10221
 
9885
10222
  <xsl:choose>
@@ -9912,6 +10249,11 @@
9912
10249
  </xsl:otherwise>
9913
10250
  </xsl:choose>
9914
10251
  </xsl:template>
10252
+
10253
+ <xsl:template name="refine_basic_link_style">
10254
+
10255
+ </xsl:template> <!-- refine_basic_link_style -->
10256
+
9915
10257
  <!-- ====== -->
9916
10258
  <!-- END eref -->
9917
10259
  <!-- ====== -->
@@ -10057,18 +10399,24 @@
10057
10399
  <fo:block>
10058
10400
  <xsl:call-template name="setId"/>
10059
10401
 
10060
- <xsl:if test="*[1][@class='supertitle']">
10061
- <xsl:attribute name="space-before">36pt</xsl:attribute>
10062
- </xsl:if>
10063
- <xsl:if test="@inline-header='true'">
10064
- <xsl:attribute name="text-align">justify</xsl:attribute>
10065
- </xsl:if>
10402
+ <xsl:call-template name="sections_element_style"/>
10066
10403
 
10067
10404
  <xsl:apply-templates/>
10068
10405
  </fo:block>
10069
10406
 
10070
10407
  </xsl:template>
10071
10408
 
10409
+ <xsl:template name="sections_element_style">
10410
+
10411
+ <xsl:if test="*[1][@class='supertitle']">
10412
+ <xsl:attribute name="space-before">36pt</xsl:attribute>
10413
+ </xsl:if>
10414
+ <xsl:if test="@inline-header='true'">
10415
+ <xsl:attribute name="text-align">justify</xsl:attribute>
10416
+ </xsl:if>
10417
+
10418
+ </xsl:template> <!-- sections_element_style -->
10419
+
10072
10420
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
10073
10421
  <fo:block break-after="page"/>
10074
10422
  <fo:block>
@@ -10083,14 +10431,20 @@
10083
10431
 
10084
10432
  <xsl:call-template name="setBlockSpanAll"/>
10085
10433
 
10086
- <xsl:if test="@inline-header='true'">
10087
- <xsl:attribute name="text-align">justify</xsl:attribute>
10088
- </xsl:if>
10434
+ <xsl:call-template name="refine_clause_style"/>
10089
10435
 
10090
10436
  <xsl:apply-templates/>
10091
10437
  </fo:block>
10092
10438
  </xsl:template>
10093
10439
 
10440
+ <xsl:template name="refine_clause_style">
10441
+
10442
+ <xsl:if test="@inline-header='true'">
10443
+ <xsl:attribute name="text-align">justify</xsl:attribute>
10444
+ </xsl:if>
10445
+
10446
+ </xsl:template> <!-- refine_clause_style -->
10447
+
10094
10448
  <xsl:template match="*[local-name() = 'definitions']">
10095
10449
  <fo:block id="{@id}">
10096
10450
  <xsl:apply-templates/>
@@ -10103,10 +10457,16 @@
10103
10457
 
10104
10458
  <xsl:call-template name="setBlockSpanAll"/>
10105
10459
 
10460
+ <xsl:call-template name="refine_annex_style"/>
10461
+
10106
10462
  </fo:block>
10107
10463
  <xsl:apply-templates/>
10108
10464
  </xsl:template>
10109
10465
 
10466
+ <xsl:template name="refine_annex_style">
10467
+
10468
+ </xsl:template>
10469
+
10110
10470
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
10111
10471
  <!-- comment 2019-11-29 -->
10112
10472
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -10273,6 +10633,8 @@
10273
10633
  </xsl:choose>
10274
10634
  </xsl:attribute>
10275
10635
 
10636
+ <xsl:call-template name="refine_list_container_style"/>
10637
+
10276
10638
  <fo:block-container margin-left="0mm">
10277
10639
  <fo:block>
10278
10640
  <xsl:apply-templates select="." mode="list"/>
@@ -10290,6 +10652,10 @@
10290
10652
  </xsl:choose>
10291
10653
  </xsl:template>
10292
10654
 
10655
+ <xsl:template name="refine_list_container_style">
10656
+
10657
+ </xsl:template> <!-- refine_list_container_style -->
10658
+
10293
10659
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
10294
10660
 
10295
10661
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -10300,7 +10666,7 @@
10300
10666
 
10301
10667
  <xsl:variable name="provisional_distance_between_starts_">
10302
10668
  <attributes xsl:use-attribute-sets="list-style">
10303
-
10669
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
10304
10670
  </attributes>
10305
10671
  </xsl:variable>
10306
10672
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -10336,6 +10702,8 @@
10336
10702
  <addon><xsl:value-of select="$addon"/></addon> -->
10337
10703
  </xsl:if>
10338
10704
 
10705
+ <xsl:call-template name="refine_list-style"/>
10706
+
10339
10707
  <xsl:if test="*[local-name() = 'name']">
10340
10708
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
10341
10709
  </xsl:if>
@@ -10348,6 +10716,10 @@
10348
10716
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
10349
10717
  </xsl:template>
10350
10718
 
10719
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
10720
+
10721
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10722
+
10351
10723
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
10352
10724
  <xsl:param name="process">false</xsl:param>
10353
10725
  <xsl:if test="$process = 'true'">
@@ -10361,20 +10733,27 @@
10361
10733
  <fo:list-item xsl:use-attribute-sets="list-item-style">
10362
10734
  <xsl:copy-of select="@id"/>
10363
10735
 
10736
+ <xsl:call-template name="refine_list-item-style"/>
10737
+
10364
10738
  <fo:list-item-label end-indent="label-end()">
10365
10739
  <fo:block xsl:use-attribute-sets="list-item-label-style">
10366
10740
 
10741
+ <xsl:call-template name="refine_list-item-label-style"/>
10742
+
10367
10743
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10368
10744
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10369
10745
  <xsl:call-template name="append_add-style"/>
10370
10746
  </xsl:if>
10371
10747
 
10372
10748
  <xsl:call-template name="getListItemFormat"/>
10749
+
10373
10750
  </fo:block>
10374
10751
  </fo:list-item-label>
10375
10752
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
10376
10753
  <fo:block>
10377
10754
 
10755
+ <xsl:call-template name="refine_list-item-body-style"/>
10756
+
10378
10757
  <xsl:apply-templates/>
10379
10758
 
10380
10759
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -10692,6 +11071,7 @@
10692
11071
 
10693
11072
  <fo:block id="{@id}">
10694
11073
  <xsl:apply-templates/>
11074
+
10695
11075
  </fo:block>
10696
11076
  </xsl:template>
10697
11077
 
@@ -10711,6 +11091,7 @@
10711
11091
 
10712
11092
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
10713
11093
  <xsl:apply-templates/>
11094
+
10714
11095
  </fo:block>
10715
11096
 
10716
11097
  </xsl:template> <!-- references -->
@@ -11317,6 +11698,9 @@
11317
11698
  </xsl:copy>
11318
11699
  </xsl:template>
11319
11700
 
11701
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
11702
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
11703
+
11320
11704
  <xsl:template name="add_id">
11321
11705
  <xsl:if test="not(@id)">
11322
11706
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -11601,6 +11985,14 @@
11601
11985
  <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">
11602
11986
  <xsl:variable name="p_fn_">
11603
11987
  <xsl:call-template name="get_fn_list"/>
11988
+ <!-- <xsl:choose>
11989
+ <xsl:when test="$namespace = 'jis'">
11990
+ <xsl:call-template name="get_fn_list_for_element"/>
11991
+ </xsl:when>
11992
+ <xsl:otherwise>
11993
+ <xsl:call-template name="get_fn_list"/>
11994
+ </xsl:otherwise>
11995
+ </xsl:choose> -->
11604
11996
  </xsl:variable>
11605
11997
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
11606
11998
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -11615,8 +12007,14 @@
11615
12007
  <xsl:attribute name="current_fn_number">
11616
12008
  <xsl:value-of select="$current_fn_number"/>
11617
12009
  </xsl:attribute>
12010
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11618
12011
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
11619
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
12012
+
12013
+ <xsl:value-of select="$skip_footnote_body_"/>
12014
+
12015
+ </xsl:attribute>
12016
+ <xsl:attribute name="ref_id">
12017
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
11620
12018
  </xsl:attribute>
11621
12019
  <xsl:apply-templates select="node()" mode="linear_xml"/>
11622
12020
  </xsl:copy>