metanorma-itu 2.2.10 → 2.2.12

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>
@@ -3838,7 +4077,7 @@
3838
4077
  </xsl:attribute>
3839
4078
  </xsl:for-each>
3840
4079
 
3841
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
4080
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
3842
4081
  <xsl:if test="$isNoteOrFnExist = 'true'">
3843
4082
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3844
4083
  </xsl:if>
@@ -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() = 'example') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
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()='example'] 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,8 +4719,10 @@
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']"/>
4725
+ <xsl:apply-templates select="../*[local-name()='example']"/>
4482
4726
  <xsl:apply-templates select="../*[local-name()='source']"/>
4483
4727
 
4484
4728
  <xsl:variable name="isDisplayRowSeparator">
@@ -4487,7 +4731,7 @@
4487
4731
 
4488
4732
  <!-- horizontal row separator -->
4489
4733
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
4490
- <xsl:if test="../*[local-name()='note'] and normalize-space($table_fn_block) != ''">
4734
+ <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
4491
4735
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
4492
4736
 
4493
4737
  <xsl:call-template name="setBordersTableArray"/>
@@ -4608,11 +4852,7 @@
4608
4852
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4609
4853
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4610
4854
 
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>
4855
+ <xsl:call-template name="refine_table-header-row-style"/>
4616
4856
 
4617
4857
  <xsl:call-template name="setTableRowAttributes"/>
4618
4858
 
@@ -4646,6 +4886,8 @@
4646
4886
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
4647
4887
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
4648
4888
 
4889
+ <xsl:call-template name="refine_table-footer-row-style"/>
4890
+
4649
4891
  <xsl:call-template name="setTableRowAttributes"/>
4650
4892
  <xsl:apply-templates/>
4651
4893
  </fo:table-row>
@@ -4659,9 +4901,10 @@
4659
4901
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4660
4902
  </xsl:if>
4661
4903
 
4662
- <xsl:call-template name="setBordersTableArray"/>
4904
+ <xsl:call-template name="refine_table-body-row-style"/>
4663
4905
 
4664
4906
  <xsl:call-template name="setTableRowAttributes"/>
4907
+
4665
4908
  <xsl:apply-templates/>
4666
4909
  </fo:table-row>
4667
4910
  </xsl:template>
@@ -4684,24 +4927,7 @@
4684
4927
  <xsl:with-param name="default">center</xsl:with-param>
4685
4928
  </xsl:call-template>
4686
4929
 
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"/>
4930
+ <xsl:call-template name="refine_table-header-cell-style"/>
4705
4931
 
4706
4932
  <fo:block>
4707
4933
  <xsl:apply-templates/>
@@ -4743,21 +4969,7 @@
4743
4969
  <xsl:with-param name="default">left</xsl:with-param>
4744
4970
  </xsl:call-template>
4745
4971
 
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>
4972
+ <xsl:call-template name="refine_table-cell-style"/>
4761
4973
 
4762
4974
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
4763
4975
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -4784,13 +4996,17 @@
4784
4996
  </fo:table-cell>
4785
4997
  </xsl:template> <!-- td -->
4786
4998
 
4787
- <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
4999
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4788
5000
 
4789
5001
  <fo:block xsl:use-attribute-sets="table-note-style">
4790
5002
 
4791
- <!-- Table's note name (NOTE, for example) -->
5003
+ <xsl:call-template name="refine_table-note-style"/>
5004
+
5005
+ <!-- Table's note/example name (NOTE, for example) -->
4792
5006
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
4793
5007
 
5008
+ <xsl:call-template name="refine_table-note-name-style"/>
5009
+
4794
5010
  <xsl:apply-templates select="*[local-name() = 'name']"/>
4795
5011
 
4796
5012
  </fo:inline>
@@ -4800,7 +5016,7 @@
4800
5016
 
4801
5017
  </xsl:template> <!-- table/note -->
4802
5018
 
4803
- <xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
5019
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
4804
5020
  <xsl:apply-templates/>
4805
5021
  </xsl:template>
4806
5022
 
@@ -4818,6 +5034,14 @@
4818
5034
  <!-- list of footnotes to calculate actual footnotes number -->
4819
5035
  <xsl:variable name="p_fn_">
4820
5036
  <xsl:call-template name="get_fn_list"/>
5037
+ <!-- <xsl:choose>
5038
+ <xsl:when test="$namespace = 'jis'">
5039
+ <xsl:call-template name="get_fn_list_for_element"/>
5040
+ </xsl:when>
5041
+ <xsl:otherwise>
5042
+ <xsl:call-template name="get_fn_list"/>
5043
+ </xsl:otherwise>
5044
+ </xsl:choose> -->
4821
5045
  </xsl:variable>
4822
5046
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4823
5047
 
@@ -4842,7 +5066,14 @@
4842
5066
 
4843
5067
  </xsl:variable>
4844
5068
 
4845
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5069
+ <xsl:variable name="ref_id">
5070
+ <xsl:choose>
5071
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
5072
+ <xsl:otherwise>
5073
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5074
+ </xsl:otherwise>
5075
+ </xsl:choose>
5076
+ </xsl:variable>
4846
5077
  <xsl:variable name="footnote_inline">
4847
5078
  <fo:inline>
4848
5079
 
@@ -4868,7 +5099,7 @@
4868
5099
  <xsl:call-template name="insert_basic_link">
4869
5100
  <xsl:with-param name="element">
4870
5101
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4871
- <xsl:value-of select="$current_fn_number_text"/>
5102
+ <xsl:copy-of select="$current_fn_number_text"/>
4872
5103
  </fo:basic-link>
4873
5104
  </xsl:with-param>
4874
5105
  </xsl:call-template>
@@ -4888,12 +5119,12 @@
4888
5119
 
4889
5120
  <fo:block xsl:use-attribute-sets="fn-body-style">
4890
5121
 
4891
- <xsl:if test="$doctype = 'service-publication'">
4892
- <xsl:attribute name="font-size">10pt</xsl:attribute>
4893
- </xsl:if>
5122
+ <xsl:call-template name="refine_fn-body-style"/>
4894
5123
 
4895
5124
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4896
5125
 
5126
+ <xsl:call-template name="refine_fn-body-num-style"/>
5127
+
4897
5128
  <xsl:value-of select="$current_fn_number_text"/>
4898
5129
  </fo:inline>
4899
5130
  <xsl:apply-templates/>
@@ -4945,6 +5176,28 @@
4945
5176
  </xsl:choose>
4946
5177
  </xsl:template>
4947
5178
 
5179
+ <xsl:template name="get_fn_list_for_element">
5180
+ <xsl:choose>
5181
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
5182
+ <fn gen_id="{generate-id(.)}">
5183
+ <xsl:copy-of select="@*"/>
5184
+ <xsl:copy-of select="node()"/>
5185
+ </fn>
5186
+ </xsl:when>
5187
+ <xsl:otherwise>
5188
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
5189
+ <xsl:variable name="element_id" select="@id"/>
5190
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5191
+ <!-- copy unique fn -->
5192
+ <fn gen_id="{generate-id(.)}">
5193
+ <xsl:copy-of select="@*"/>
5194
+ <xsl:copy-of select="node()"/>
5195
+ </fn>
5196
+ </xsl:for-each>
5197
+ </xsl:for-each>
5198
+ </xsl:otherwise>
5199
+ </xsl:choose>
5200
+ </xsl:template>
4948
5201
  <!-- ============================ -->
4949
5202
  <!-- table's footnotes rendering -->
4950
5203
  <!-- ============================ -->
@@ -5125,6 +5378,8 @@
5125
5378
  <xsl:template match="*[local-name()='fn']">
5126
5379
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
5127
5380
 
5381
+ <xsl:call-template name="refine_fn-reference-style"/>
5382
+
5128
5383
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5129
5384
 
5130
5385
  <xsl:value-of select="@reference"/>
@@ -5224,7 +5479,7 @@
5224
5479
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
5225
5480
  <fo:block margin-bottom="12pt" text-align="left">
5226
5481
 
5227
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5482
+ <xsl:call-template name="refine_dl_formula_where_style"/>
5228
5483
 
5229
5484
  <!-- <xsl:variable name="title-where">
5230
5485
  <xsl:call-template name="getLocalizedString">
@@ -5239,6 +5494,8 @@
5239
5494
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
5240
5495
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
5241
5496
 
5497
+ <xsl:call-template name="refine_figure_key_style"/>
5498
+
5242
5499
  <xsl:variable name="title-key">
5243
5500
  <xsl:call-template name="getLocalizedString">
5244
5501
  <xsl:with-param name="key">key</xsl:with-param>
@@ -5253,9 +5510,7 @@
5253
5510
  <xsl:if test="$onlyOneComponent = 'false'">
5254
5511
  <fo:block>
5255
5512
 
5256
- <xsl:if test="$parent = 'figure' or $parent = 'formula'">
5257
- <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
5258
- </xsl:if>
5513
+ <xsl:call-template name="refine_multicomponent_style"/>
5259
5514
 
5260
5515
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5261
5516
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -5263,6 +5518,8 @@
5263
5518
 
5264
5519
  <fo:block>
5265
5520
 
5521
+ <xsl:call-template name="refine_multicomponent_block_style"/>
5522
+
5266
5523
  <xsl:apply-templates select="*[local-name() = 'name']">
5267
5524
  <xsl:with-param name="process">true</xsl:with-param>
5268
5525
  </xsl:apply-templates>
@@ -5420,6 +5677,30 @@
5420
5677
 
5421
5678
  </xsl:template> <!-- END: dl -->
5422
5679
 
5680
+ <xsl:template name="refine_dl_formula_where_style">
5681
+
5682
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5683
+
5684
+ </xsl:template> <!-- refine_dl_formula_where_style -->
5685
+
5686
+ <xsl:template name="refine_figure_key_style">
5687
+
5688
+ </xsl:template> <!-- refine_figure_key_style -->
5689
+
5690
+ <xsl:template name="refine_multicomponent_style">
5691
+ <xsl:variable name="parent" select="local-name(..)"/>
5692
+
5693
+ <xsl:if test="$parent = 'figure' or $parent = 'formula'">
5694
+ <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
5695
+ </xsl:if>
5696
+
5697
+ </xsl:template> <!-- refine_multicomponent_style -->
5698
+
5699
+ <xsl:template name="refine_multicomponent_block_style">
5700
+ <xsl:variable name="parent" select="local-name(..)"/>
5701
+
5702
+ </xsl:template> <!-- refine_multicomponent_block_style -->
5703
+
5423
5704
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
5424
5705
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
5425
5706
 
@@ -5639,9 +5920,7 @@
5639
5920
 
5640
5921
  </xsl:if>
5641
5922
 
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>
5923
+ <xsl:call-template name="refine_dt-cell-style"/>
5645
5924
 
5646
5925
  <fo:block xsl:use-attribute-sets="dt-block-style">
5647
5926
  <xsl:copy-of select="@id"/>
@@ -5650,9 +5929,7 @@
5650
5929
  <xsl:attribute name="margin-top">0</xsl:attribute>
5651
5930
  </xsl:if>
5652
5931
 
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>
5932
+ <xsl:call-template name="refine_dt-block-style"/>
5656
5933
 
5657
5934
  <xsl:apply-templates>
5658
5935
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5673,6 +5950,8 @@
5673
5950
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5674
5951
  </xsl:if>
5675
5952
 
5953
+ <xsl:call-template name="refine_dd-cell-style"/>
5954
+
5676
5955
  <fo:block>
5677
5956
 
5678
5957
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -5817,20 +6096,31 @@
5817
6096
  <!-- ========================= -->
5818
6097
  <xsl:template match="*[local-name()='em']">
5819
6098
  <fo:inline font-style="italic">
6099
+ <xsl:call-template name="refine_italic_style"/>
5820
6100
  <xsl:apply-templates/>
5821
6101
  </fo:inline>
5822
6102
  </xsl:template>
5823
6103
 
6104
+ <xsl:template name="refine_italic_style">
6105
+
6106
+ </xsl:template>
6107
+
5824
6108
  <xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
5825
6109
  <xsl:param name="split_keep-within-line"/>
5826
6110
  <fo:inline font-weight="bold">
5827
6111
 
6112
+ <xsl:call-template name="refine_strong_style"/>
6113
+
5828
6114
  <xsl:apply-templates>
5829
6115
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5830
6116
  </xsl:apply-templates>
5831
6117
  </fo:inline>
5832
6118
  </xsl:template>
5833
6119
 
6120
+ <xsl:template name="refine_strong_style">
6121
+
6122
+ </xsl:template>
6123
+
5834
6124
  <xsl:template match="*[local-name()='padding']">
5835
6125
  <fo:inline padding-right="{@value}"> </fo:inline>
5836
6126
  </xsl:template>
@@ -6297,7 +6587,10 @@
6297
6587
  </xsl:choose>
6298
6588
  </xsl:variable>
6299
6589
 
6300
- <xsl:value-of select="$text9"/>
6590
+ <!-- replace sequence #x200B and space TO space -->
6591
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
6592
+
6593
+ <xsl:value-of select="$text10"/>
6301
6594
  </xsl:template>
6302
6595
 
6303
6596
  <xsl:template name="add-zero-spaces-link-java">
@@ -6972,6 +7265,11 @@
6972
7265
 
6973
7266
  <fo:inline xsl:use-attribute-sets="mathml-style">
6974
7267
 
7268
+ <!-- DEBUG -->
7269
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
7270
+
7271
+ <xsl:call-template name="refine_mathml-style"/>
7272
+
6975
7273
  <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
7274
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6977
7275
  </xsl:if>
@@ -7076,6 +7374,8 @@
7076
7374
 
7077
7375
  <fo:instream-foreign-object fox:alt-text="Math">
7078
7376
 
7377
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
7378
+
7079
7379
  <!-- put MathML in Actual Text -->
7080
7380
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
7081
7381
  <xsl:attribute name="fox:actual-text">
@@ -7096,6 +7396,10 @@
7096
7396
  </fo:instream-foreign-object>
7097
7397
  </xsl:template>
7098
7398
 
7399
+ <xsl:template name="refine_mathml_insteam_object_style">
7400
+
7401
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
7402
+
7099
7403
  <xsl:template match="mathml:*" mode="mathml_actual_text">
7100
7404
  <!-- <xsl:text>a+b</xsl:text> -->
7101
7405
  <xsl:text>&lt;</xsl:text>
@@ -7240,6 +7544,8 @@
7240
7544
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
7241
7545
  <fo:inline xsl:use-attribute-sets="mathml-style">
7242
7546
 
7547
+ <xsl:call-template name="refine_mathml-style"/>
7548
+
7243
7549
  <xsl:choose>
7244
7550
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7245
7551
  <xsl:otherwise>
@@ -7284,6 +7590,8 @@
7284
7590
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7285
7591
  </xsl:if>
7286
7592
 
7593
+ <xsl:call-template name="refine_link-style"/>
7594
+
7287
7595
  <xsl:choose>
7288
7596
  <xsl:when test="$target_text = ''">
7289
7597
  <xsl:apply-templates/>
@@ -7371,6 +7679,9 @@
7371
7679
  <xsl:call-template name="insert_basic_link">
7372
7680
  <xsl:with-param name="element">
7373
7681
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
7682
+ <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'])">
7683
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7684
+ </xsl:if>
7374
7685
  <xsl:if test="parent::*[local-name() = 'add']">
7375
7686
  <xsl:call-template name="append_add-style"/>
7376
7687
  </xsl:if>
@@ -7432,6 +7743,8 @@
7432
7743
  <fo:table-cell display-align="center">
7433
7744
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7434
7745
 
7746
+ <xsl:call-template name="refine_formula-stem-block-style"/>
7747
+
7435
7748
  <xsl:apply-templates/>
7436
7749
  </fo:block>
7437
7750
  </fo:table-cell>
@@ -7473,16 +7786,18 @@
7473
7786
 
7474
7787
  <xsl:call-template name="setBlockSpanAll"/>
7475
7788
 
7789
+ <xsl:call-template name="refine_note-style"/>
7790
+
7476
7791
  <fo:block-container margin-left="0mm" margin-right="0mm">
7477
7792
 
7478
7793
  <fo:block>
7479
7794
 
7480
- <xsl:if test="ancestor::itu:figure">
7481
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7482
- </xsl:if>
7795
+ <xsl:call-template name="refine_note_block_style"/>
7483
7796
 
7484
7797
  <fo:inline xsl:use-attribute-sets="note-name-style">
7485
7798
 
7799
+ <xsl:call-template name="refine_note-name-style"/>
7800
+
7486
7801
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7487
7802
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7488
7803
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7508,6 +7823,14 @@
7508
7823
 
7509
7824
  </xsl:template>
7510
7825
 
7826
+ <xsl:template name="refine_note_block_style">
7827
+
7828
+ <xsl:if test="ancestor::itu:figure">
7829
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
7830
+ </xsl:if>
7831
+
7832
+ </xsl:template>
7833
+
7511
7834
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
7512
7835
  <xsl:variable name="num"><xsl:number/></xsl:variable>
7513
7836
  <xsl:choose>
@@ -7529,12 +7852,16 @@
7529
7852
 
7530
7853
  <xsl:call-template name="setBlockSpanAll"/>
7531
7854
 
7855
+ <xsl:call-template name="refine_termnote-style"/>
7856
+
7532
7857
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7533
7858
 
7534
7859
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
7535
7860
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
7536
7861
  </xsl:if>
7537
7862
 
7863
+ <xsl:call-template name="refine_termnote-name-style"/>
7864
+
7538
7865
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7539
7866
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7540
7867
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -7708,6 +8035,8 @@
7708
8035
  <xsl:otherwise>
7709
8036
  <fo:block xsl:use-attribute-sets="image-style">
7710
8037
 
8038
+ <xsl:call-template name="refine_image-style"/>
8039
+
7711
8040
  <xsl:variable name="src">
7712
8041
  <xsl:call-template name="image_src"/>
7713
8042
  </xsl:variable>
@@ -8557,6 +8886,8 @@
8557
8886
  <xsl:if test="normalize-space() != ''">
8558
8887
  <fo:block xsl:use-attribute-sets="figure-name-style">
8559
8888
 
8889
+ <xsl:call-template name="refine_figure-name-style"/>
8890
+
8560
8891
  <xsl:apply-templates/>
8561
8892
  </fo:block>
8562
8893
  </xsl:if>
@@ -8822,6 +9153,8 @@
8822
9153
  </xsl:attribute>
8823
9154
  </xsl:for-each>
8824
9155
 
9156
+ <xsl:call-template name="refine_sourcecode-style"/>
9157
+
8825
9158
  <!-- remove margin between rows in the table with sourcecode line numbers -->
8826
9159
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8827
9160
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -9526,6 +9859,8 @@
9526
9859
 
9527
9860
  <xsl:call-template name="setBlockSpanAll"/>
9528
9861
 
9862
+ <xsl:call-template name="refine_example-style"/>
9863
+
9529
9864
  <xsl:variable name="fo_element">
9530
9865
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
9531
9866
  block
@@ -9636,6 +9971,12 @@
9636
9971
 
9637
9972
  </xsl:template>
9638
9973
 
9974
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
9975
+ <fo:inline xsl:use-attribute-sets="example-name-style">
9976
+ <xsl:apply-templates/>
9977
+ </fo:inline>
9978
+ </xsl:template>
9979
+
9639
9980
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
9640
9981
  <xsl:param name="fo_element">block</xsl:param>
9641
9982
 
@@ -9653,6 +9994,8 @@
9653
9994
  </xsl:if>
9654
9995
  <fo:block xsl:use-attribute-sets="example-p-style">
9655
9996
 
9997
+ <xsl:call-template name="refine_example-p-style"/>
9998
+
9656
9999
  <xsl:apply-templates/>
9657
10000
  </fo:block>
9658
10001
  </fo:block-container>
@@ -9669,6 +10012,7 @@
9669
10012
  </xsl:otherwise>
9670
10013
  </xsl:choose>
9671
10014
  </xsl:template> <!-- example/p -->
10015
+
9672
10016
  <!-- ====== -->
9673
10017
  <!-- ====== -->
9674
10018
 
@@ -9680,6 +10024,8 @@
9680
10024
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
9681
10025
  <fo:block xsl:use-attribute-sets="termsource-style">
9682
10026
 
10027
+ <xsl:call-template name="refine_termsource-style"/>
10028
+
9683
10029
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
9684
10030
  <xsl:variable name="termsource_text">
9685
10031
  <xsl:apply-templates/>
@@ -9795,6 +10141,8 @@
9795
10141
  <fo:block-container margin-left="0mm">
9796
10142
  <fo:block-container xsl:use-attribute-sets="quote-style">
9797
10143
 
10144
+ <xsl:call-template name="refine_quote-style"/>
10145
+
9798
10146
  <fo:block-container margin-left="0mm" margin-right="0mm">
9799
10147
  <fo:block role="BlockQuote">
9800
10148
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -9869,8 +10217,7 @@
9869
10217
 
9870
10218
  </xsl:if>
9871
10219
 
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()"/>
10220
+ <xsl:call-template name="refine_eref-style"/>
9874
10221
 
9875
10222
  <xsl:call-template name="insert_basic_link">
9876
10223
  <xsl:with-param name="element">
@@ -9880,6 +10227,8 @@
9880
10227
  </xsl:if>
9881
10228
  <xsl:if test="@type = 'inline'">
9882
10229
 
10230
+ <xsl:call-template name="refine_basic_link_style"/>
10231
+
9883
10232
  </xsl:if>
9884
10233
 
9885
10234
  <xsl:choose>
@@ -9912,6 +10261,11 @@
9912
10261
  </xsl:otherwise>
9913
10262
  </xsl:choose>
9914
10263
  </xsl:template>
10264
+
10265
+ <xsl:template name="refine_basic_link_style">
10266
+
10267
+ </xsl:template> <!-- refine_basic_link_style -->
10268
+
9915
10269
  <!-- ====== -->
9916
10270
  <!-- END eref -->
9917
10271
  <!-- ====== -->
@@ -10057,18 +10411,24 @@
10057
10411
  <fo:block>
10058
10412
  <xsl:call-template name="setId"/>
10059
10413
 
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>
10414
+ <xsl:call-template name="sections_element_style"/>
10066
10415
 
10067
10416
  <xsl:apply-templates/>
10068
10417
  </fo:block>
10069
10418
 
10070
10419
  </xsl:template>
10071
10420
 
10421
+ <xsl:template name="sections_element_style">
10422
+
10423
+ <xsl:if test="*[1][@class='supertitle']">
10424
+ <xsl:attribute name="space-before">36pt</xsl:attribute>
10425
+ </xsl:if>
10426
+ <xsl:if test="@inline-header='true'">
10427
+ <xsl:attribute name="text-align">justify</xsl:attribute>
10428
+ </xsl:if>
10429
+
10430
+ </xsl:template> <!-- sections_element_style -->
10431
+
10072
10432
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
10073
10433
  <fo:block break-after="page"/>
10074
10434
  <fo:block>
@@ -10083,14 +10443,20 @@
10083
10443
 
10084
10444
  <xsl:call-template name="setBlockSpanAll"/>
10085
10445
 
10086
- <xsl:if test="@inline-header='true'">
10087
- <xsl:attribute name="text-align">justify</xsl:attribute>
10088
- </xsl:if>
10446
+ <xsl:call-template name="refine_clause_style"/>
10089
10447
 
10090
10448
  <xsl:apply-templates/>
10091
10449
  </fo:block>
10092
10450
  </xsl:template>
10093
10451
 
10452
+ <xsl:template name="refine_clause_style">
10453
+
10454
+ <xsl:if test="@inline-header='true'">
10455
+ <xsl:attribute name="text-align">justify</xsl:attribute>
10456
+ </xsl:if>
10457
+
10458
+ </xsl:template> <!-- refine_clause_style -->
10459
+
10094
10460
  <xsl:template match="*[local-name() = 'definitions']">
10095
10461
  <fo:block id="{@id}">
10096
10462
  <xsl:apply-templates/>
@@ -10103,10 +10469,16 @@
10103
10469
 
10104
10470
  <xsl:call-template name="setBlockSpanAll"/>
10105
10471
 
10472
+ <xsl:call-template name="refine_annex_style"/>
10473
+
10106
10474
  </fo:block>
10107
10475
  <xsl:apply-templates/>
10108
10476
  </xsl:template>
10109
10477
 
10478
+ <xsl:template name="refine_annex_style">
10479
+
10480
+ </xsl:template>
10481
+
10110
10482
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
10111
10483
  <!-- comment 2019-11-29 -->
10112
10484
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -10185,6 +10557,9 @@
10185
10557
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
10186
10558
  </xsl:choose>
10187
10559
  </xsl:when>
10560
+ <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10561
+ <xsl:value-of select="@label"/>
10562
+ </xsl:when>
10188
10563
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
10189
10564
 
10190
10565
  <!-- Example: for BSI <?list-start 2?> -->
@@ -10242,10 +10617,10 @@
10242
10617
  <xsl:when test="$type = 'arabic'">
10243
10618
  1)
10244
10619
  </xsl:when>
10245
- <xsl:when test="$type = 'alphabet'">
10620
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
10246
10621
  a)
10247
10622
  </xsl:when>
10248
- <xsl:when test="$type = 'alphabet_upper'">
10623
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
10249
10624
  A.
10250
10625
  </xsl:when>
10251
10626
  <xsl:when test="$type = 'roman'">
@@ -10273,6 +10648,8 @@
10273
10648
  </xsl:choose>
10274
10649
  </xsl:attribute>
10275
10650
 
10651
+ <xsl:call-template name="refine_list_container_style"/>
10652
+
10276
10653
  <fo:block-container margin-left="0mm">
10277
10654
  <fo:block>
10278
10655
  <xsl:apply-templates select="." mode="list"/>
@@ -10290,6 +10667,10 @@
10290
10667
  </xsl:choose>
10291
10668
  </xsl:template>
10292
10669
 
10670
+ <xsl:template name="refine_list_container_style">
10671
+
10672
+ </xsl:template> <!-- refine_list_container_style -->
10673
+
10293
10674
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
10294
10675
 
10295
10676
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -10300,7 +10681,7 @@
10300
10681
 
10301
10682
  <xsl:variable name="provisional_distance_between_starts_">
10302
10683
  <attributes xsl:use-attribute-sets="list-style">
10303
-
10684
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
10304
10685
  </attributes>
10305
10686
  </xsl:variable>
10306
10687
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -10336,6 +10717,8 @@
10336
10717
  <addon><xsl:value-of select="$addon"/></addon> -->
10337
10718
  </xsl:if>
10338
10719
 
10720
+ <xsl:call-template name="refine_list-style"/>
10721
+
10339
10722
  <xsl:if test="*[local-name() = 'name']">
10340
10723
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
10341
10724
  </xsl:if>
@@ -10348,6 +10731,10 @@
10348
10731
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
10349
10732
  </xsl:template>
10350
10733
 
10734
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
10735
+
10736
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
10737
+
10351
10738
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
10352
10739
  <xsl:param name="process">false</xsl:param>
10353
10740
  <xsl:if test="$process = 'true'">
@@ -10361,20 +10748,27 @@
10361
10748
  <fo:list-item xsl:use-attribute-sets="list-item-style">
10362
10749
  <xsl:copy-of select="@id"/>
10363
10750
 
10751
+ <xsl:call-template name="refine_list-item-style"/>
10752
+
10364
10753
  <fo:list-item-label end-indent="label-end()">
10365
10754
  <fo:block xsl:use-attribute-sets="list-item-label-style">
10366
10755
 
10756
+ <xsl:call-template name="refine_list-item-label-style"/>
10757
+
10367
10758
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10368
10759
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10369
10760
  <xsl:call-template name="append_add-style"/>
10370
10761
  </xsl:if>
10371
10762
 
10372
10763
  <xsl:call-template name="getListItemFormat"/>
10764
+
10373
10765
  </fo:block>
10374
10766
  </fo:list-item-label>
10375
10767
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
10376
10768
  <fo:block>
10377
10769
 
10770
+ <xsl:call-template name="refine_list-item-body-style"/>
10771
+
10378
10772
  <xsl:apply-templates/>
10379
10773
 
10380
10774
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -10692,6 +11086,7 @@
10692
11086
 
10693
11087
  <fo:block id="{@id}">
10694
11088
  <xsl:apply-templates/>
11089
+
10695
11090
  </fo:block>
10696
11091
  </xsl:template>
10697
11092
 
@@ -10711,6 +11106,7 @@
10711
11106
 
10712
11107
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
10713
11108
  <xsl:apply-templates/>
11109
+
10714
11110
  </fo:block>
10715
11111
 
10716
11112
  </xsl:template> <!-- references -->
@@ -11317,6 +11713,9 @@
11317
11713
  </xsl:copy>
11318
11714
  </xsl:template>
11319
11715
 
11716
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
11717
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
11718
+
11320
11719
  <xsl:template name="add_id">
11321
11720
  <xsl:if test="not(@id)">
11322
11721
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -11601,6 +12000,14 @@
11601
12000
  <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
12001
  <xsl:variable name="p_fn_">
11603
12002
  <xsl:call-template name="get_fn_list"/>
12003
+ <!-- <xsl:choose>
12004
+ <xsl:when test="$namespace = 'jis'">
12005
+ <xsl:call-template name="get_fn_list_for_element"/>
12006
+ </xsl:when>
12007
+ <xsl:otherwise>
12008
+ <xsl:call-template name="get_fn_list"/>
12009
+ </xsl:otherwise>
12010
+ </xsl:choose> -->
11604
12011
  </xsl:variable>
11605
12012
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
11606
12013
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -11615,8 +12022,14 @@
11615
12022
  <xsl:attribute name="current_fn_number">
11616
12023
  <xsl:value-of select="$current_fn_number"/>
11617
12024
  </xsl:attribute>
12025
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11618
12026
  <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))"/>
12027
+
12028
+ <xsl:value-of select="$skip_footnote_body_"/>
12029
+
12030
+ </xsl:attribute>
12031
+ <xsl:attribute name="ref_id">
12032
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
11620
12033
  </xsl:attribute>
11621
12034
  <xsl:apply-templates select="node()" mode="linear_xml"/>
11622
12035
  </xsl:copy>