metanorma-iec 2.1.1 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1935,14 +1935,41 @@
1935
1935
  </xsl:copy>
1936
1936
  </xsl:template> -->
1937
1937
 
1938
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
1938
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:variable name="table_widths_from_if_calculated_">
1939
+ <xsl:for-each select="$table_widths_from_if//table">
1940
+ <xsl:copy>
1941
+ <xsl:copy-of select="@*"/>
1942
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
1943
+ </xsl:copy>
1944
+ </xsl:for-each>
1945
+ </xsl:variable><xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
1939
1946
  false
1940
1947
  </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
1941
1948
  <xsl:call-template name="getLang"/>
1942
- </xsl:variable><xsl:variable name="pageWidth_">
1943
- 210
1949
+ </xsl:variable><xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/><xsl:variable name="papersize_width_">
1950
+ <xsl:choose>
1951
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
1952
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
1953
+ </xsl:choose>
1954
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
1955
+ <xsl:choose>
1956
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
1957
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
1958
+ </xsl:choose>
1959
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
1960
+ <xsl:choose>
1961
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
1962
+ <xsl:otherwise>
1963
+ 210
1964
+ </xsl:otherwise>
1965
+ </xsl:choose>
1944
1966
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1945
- 297
1967
+ <xsl:choose>
1968
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
1969
+ <xsl:otherwise>
1970
+ 297
1971
+ </xsl:otherwise>
1972
+ </xsl:choose>
1946
1973
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
1947
1974
  25
1948
1975
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -2060,14 +2087,15 @@
2060
2087
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2061
2088
  </xsl:otherwise>
2062
2089
  </xsl:choose>
2063
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:attribute-set name="root-style">
2090
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable><xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable><xsl:variable name="font_noto_serif">Noto Serif, Noto Serif HK, Noto Serif JP, Noto Serif KR, Noto Serif SC, Noto Serif TC</xsl:variable><xsl:attribute-set name="root-style">
2064
2091
 
2065
2092
 
2066
2093
 
2067
2094
 
2068
2095
 
2069
2096
 
2070
- <xsl:attribute name="font-family">Arial, Times New Roman, STIX Two Math, Source Han Sans</xsl:attribute>
2097
+ <xsl:attribute name="font-family">Arial, Times New Roman, STIX Two Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
2098
+ <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
2071
2099
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2072
2100
 
2073
2101
 
@@ -2080,6 +2108,7 @@
2080
2108
 
2081
2109
 
2082
2110
 
2111
+
2083
2112
  </xsl:attribute-set><xsl:template name="insertRootStyle">
2084
2113
  <xsl:param name="root-style"/>
2085
2114
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
@@ -2091,17 +2120,60 @@
2091
2120
  </xsl:variable>
2092
2121
  <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
2093
2122
 
2123
+ <xsl:variable name="font_family_generic" select="$root-style_/root-style/@font-family-generic"/>
2124
+
2094
2125
  <xsl:for-each select="$root-style_/root-style/@*">
2126
+
2095
2127
  <xsl:choose>
2096
- <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
2128
+ <xsl:when test="local-name() = 'font-family-generic'"><!-- skip, it's using for determine 'sans' or 'serif' --></xsl:when>
2129
+ <xsl:when test="local-name() = 'font-family'">
2130
+
2131
+ <xsl:variable name="font_regional_prefix">
2132
+ <xsl:choose>
2133
+ <xsl:when test="$font_family_generic = 'Sans'">Noto Sans</xsl:when>
2134
+ <xsl:otherwise>Noto Serif</xsl:otherwise>
2135
+ </xsl:choose>
2136
+ </xsl:variable>
2137
+
2097
2138
  <xsl:attribute name="{local-name()}">
2098
- <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
2139
+
2140
+ <xsl:variable name="font_extended">
2141
+ <xsl:choose>
2142
+ <xsl:when test="$lang = 'zh'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when>
2143
+ <xsl:when test="$lang = 'hk'"><xsl:value-of select="$font_regional_prefix"/> HK</xsl:when>
2144
+ <xsl:when test="$lang = 'jp'"><xsl:value-of select="$font_regional_prefix"/> JP</xsl:when>
2145
+ <xsl:when test="$lang = 'kr'"><xsl:value-of select="$font_regional_prefix"/> KR</xsl:when>
2146
+ <xsl:when test="$lang = 'sc'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when>
2147
+ <xsl:when test="$lang = 'tc'"><xsl:value-of select="$font_regional_prefix"/> TC</xsl:when>
2148
+ </xsl:choose>
2149
+ </xsl:variable>
2150
+ <xsl:if test="normalize-space($font_extended) != ''">
2151
+ <xsl:value-of select="$font_regional_prefix"/><xsl:text>, </xsl:text>
2152
+ <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2153
+ </xsl:if>
2154
+
2155
+ <xsl:value-of select="."/>
2156
+
2157
+ <xsl:if test="$additional_fonts != ''">
2158
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2159
+ </xsl:if>
2099
2160
  </xsl:attribute>
2100
2161
  </xsl:when>
2101
2162
  <xsl:otherwise>
2102
2163
  <xsl:copy-of select="."/>
2103
2164
  </xsl:otherwise>
2104
2165
  </xsl:choose>
2166
+
2167
+ <!-- <xsl:choose>
2168
+ <xsl:when test="local-name() = 'font-family'">
2169
+ <xsl:attribute name="{local-name()}">
2170
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
2171
+ </xsl:attribute>
2172
+ </xsl:when>
2173
+ <xsl:otherwise>
2174
+ <xsl:copy-of select="."/>
2175
+ </xsl:otherwise>
2176
+ </xsl:choose> -->
2105
2177
  </xsl:for-each>
2106
2178
  </xsl:template><xsl:attribute-set name="copyright-statement-style">
2107
2179
 
@@ -2172,7 +2244,7 @@
2172
2244
 
2173
2245
 
2174
2246
 
2175
- <xsl:attribute name="font-family">Courier New</xsl:attribute>
2247
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2176
2248
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2177
2249
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
2178
2250
 
@@ -2180,6 +2252,7 @@
2180
2252
 
2181
2253
 
2182
2254
 
2255
+
2183
2256
 
2184
2257
 
2185
2258
 
@@ -2194,7 +2267,10 @@
2194
2267
 
2195
2268
  </xsl:attribute-set><xsl:attribute-set name="requirement-style">
2196
2269
 
2270
+
2197
2271
  </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
2272
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2273
+
2198
2274
 
2199
2275
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
2200
2276
 
@@ -2223,12 +2299,14 @@
2223
2299
 
2224
2300
 
2225
2301
 
2302
+
2226
2303
 
2227
2304
  </xsl:attribute-set><xsl:attribute-set name="example-style">
2228
2305
 
2229
2306
 
2230
2307
 
2231
2308
 
2309
+
2232
2310
  <xsl:attribute name="space-before">8pt</xsl:attribute>
2233
2311
  <xsl:attribute name="space-after">8pt</xsl:attribute>
2234
2312
 
@@ -2265,6 +2343,7 @@
2265
2343
 
2266
2344
 
2267
2345
 
2346
+
2268
2347
 
2269
2348
 
2270
2349
 
@@ -2295,10 +2374,12 @@
2295
2374
 
2296
2375
 
2297
2376
 
2377
+
2298
2378
 
2299
2379
 
2300
2380
  </xsl:attribute-set><xsl:variable name="table-border_">
2301
2381
 
2382
+
2302
2383
  </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
2303
2384
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2304
2385
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -2323,6 +2404,7 @@
2323
2404
 
2324
2405
 
2325
2406
 
2407
+
2326
2408
 
2327
2409
 
2328
2410
 
@@ -2353,6 +2435,7 @@
2353
2435
 
2354
2436
 
2355
2437
 
2438
+
2356
2439
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2357
2440
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2358
2441
 
@@ -2364,6 +2447,7 @@
2364
2447
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2365
2448
  <xsl:attribute name="space-before">12pt</xsl:attribute>
2366
2449
 
2450
+
2367
2451
 
2368
2452
 
2369
2453
 
@@ -2447,6 +2531,7 @@
2447
2531
 
2448
2532
 
2449
2533
 
2534
+
2450
2535
  </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
2451
2536
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
2452
2537
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -2461,7 +2546,7 @@
2461
2546
 
2462
2547
  <xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
2463
2548
 
2464
-
2549
+
2465
2550
 
2466
2551
 
2467
2552
 
@@ -2479,6 +2564,7 @@
2479
2564
 
2480
2565
 
2481
2566
 
2567
+
2482
2568
  </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
2483
2569
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2484
2570
 
@@ -2486,12 +2572,14 @@
2486
2572
 
2487
2573
 
2488
2574
 
2575
+
2489
2576
  <xsl:attribute name="font-size">8pt</xsl:attribute>
2490
2577
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2491
2578
  <xsl:attribute name="text-indent">-6mm</xsl:attribute>
2492
2579
  <xsl:attribute name="margin-left">6mm</xsl:attribute>
2493
2580
 
2494
2581
 
2582
+
2495
2583
  </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
2496
2584
  <xsl:attribute name="font-size">80%</xsl:attribute>
2497
2585
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -2510,6 +2598,7 @@
2510
2598
 
2511
2599
 
2512
2600
 
2601
+
2513
2602
  </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style">
2514
2603
  <xsl:attribute name="text-indent">0</xsl:attribute>
2515
2604
  <xsl:attribute name="start-indent">0</xsl:attribute>
@@ -2549,6 +2638,27 @@
2549
2638
 
2550
2639
 
2551
2640
 
2641
+
2642
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
2643
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2644
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2645
+
2646
+
2647
+
2648
+
2649
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2650
+
2651
+
2652
+
2653
+
2654
+
2655
+
2656
+
2657
+
2658
+
2659
+
2660
+
2661
+
2552
2662
  </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
2553
2663
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2554
2664
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
@@ -2589,6 +2699,7 @@
2589
2699
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2590
2700
  <xsl:attribute name="margin-bottom">9pt</xsl:attribute>
2591
2701
 
2702
+
2592
2703
 
2593
2704
 
2594
2705
 
@@ -2626,9 +2737,10 @@
2626
2737
 
2627
2738
 
2628
2739
 
2629
-
2740
+
2630
2741
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2631
-
2742
+
2743
+
2632
2744
 
2633
2745
 
2634
2746
 
@@ -2641,6 +2753,7 @@
2641
2753
  </xsl:attribute-set><xsl:attribute-set name="termnote-style">
2642
2754
 
2643
2755
 
2756
+
2644
2757
 
2645
2758
  <xsl:attribute name="font-size">8pt</xsl:attribute>
2646
2759
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
@@ -2655,6 +2768,8 @@
2655
2768
 
2656
2769
 
2657
2770
 
2771
+ </xsl:attribute-set><xsl:attribute-set name="termnote-p-style">
2772
+
2658
2773
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2659
2774
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
2660
2775
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
@@ -2705,6 +2820,7 @@
2705
2820
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2706
2821
 
2707
2822
 
2823
+
2708
2824
 
2709
2825
 
2710
2826
 
@@ -2751,6 +2867,7 @@
2751
2867
 
2752
2868
 
2753
2869
 
2870
+
2754
2871
  </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
2755
2872
  <xsl:attribute name="text-align">right</xsl:attribute>
2756
2873
 
@@ -2771,20 +2888,21 @@
2771
2888
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
2772
2889
 
2773
2890
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
2891
+ <xsl:attribute name="width">100%</xsl:attribute>
2892
+ <xsl:attribute name="content-height">100%</xsl:attribute>
2893
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
2774
2894
 
2775
2895
 
2776
2896
 
2777
2897
 
2778
2898
  <xsl:attribute name="width">75%</xsl:attribute>
2779
2899
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
2780
- <xsl:attribute name="scaling">uniform</xsl:attribute>
2781
2900
 
2782
-
2783
-
2901
+
2784
2902
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2785
2903
 
2786
2904
 
2787
- <xsl:attribute name="font-family">Courier New</xsl:attribute>
2905
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2788
2906
 
2789
2907
 
2790
2908
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -2873,6 +2991,25 @@
2873
2991
 
2874
2992
 
2875
2993
 
2994
+
2995
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
2996
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2997
+
2998
+
2999
+
3000
+
3001
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3002
+
3003
+
3004
+
3005
+
3006
+
3007
+
3008
+
3009
+
3010
+
3011
+
3012
+
2876
3013
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2877
3014
 
2878
3015
 
@@ -2920,6 +3057,7 @@
2920
3057
 
2921
3058
 
2922
3059
 
3060
+
2923
3061
  </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
2924
3062
  <xsl:attribute name="font-weight">normal</xsl:attribute>
2925
3063
  <xsl:attribute name="font-style">normal</xsl:attribute>
@@ -2946,6 +3084,7 @@
2946
3084
 
2947
3085
 
2948
3086
 
3087
+
2949
3088
  </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
2950
3089
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2951
3090
 
@@ -2968,6 +3107,7 @@
2968
3107
 
2969
3108
 
2970
3109
 
3110
+
2971
3111
  </xsl:attribute-set><xsl:attribute-set name="admonition-style">
2972
3112
 
2973
3113
 
@@ -2989,12 +3129,13 @@
2989
3129
 
2990
3130
 
2991
3131
 
3132
+
2992
3133
  </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
3134
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3135
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2993
3136
 
2994
3137
 
2995
3138
 
2996
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2997
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2998
3139
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2999
3140
  <xsl:attribute name="padding">1mm</xsl:attribute>
3000
3141
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -3006,6 +3147,7 @@
3006
3147
 
3007
3148
 
3008
3149
 
3150
+
3009
3151
  </xsl:attribute-set><xsl:attribute-set name="admonition-name-style">
3010
3152
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3011
3153
 
@@ -3033,6 +3175,7 @@
3033
3175
 
3034
3176
 
3035
3177
 
3178
+
3036
3179
  </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style">
3037
3180
 
3038
3181
 
@@ -3065,6 +3208,10 @@
3065
3208
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
3066
3209
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
3067
3210
 
3211
+ <!-- <xsl:if test="$namespace = 'ieee'">
3212
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3213
+ <xsl:attribute name="provisional-distance-between-starts">9.5mm</xsl:attribute>
3214
+ </xsl:if> -->
3068
3215
 
3069
3216
 
3070
3217
 
@@ -3094,6 +3241,7 @@
3094
3241
 
3095
3242
 
3096
3243
 
3244
+
3097
3245
  </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
3098
3246
 
3099
3247
 
@@ -3123,6 +3271,7 @@
3123
3271
 
3124
3272
 
3125
3273
 
3274
+
3126
3275
  </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style">
3127
3276
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
3128
3277
 
@@ -3144,6 +3293,7 @@
3144
3293
 
3145
3294
 
3146
3295
 
3296
+
3147
3297
  </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style">
3148
3298
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3149
3299
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -3162,6 +3312,7 @@
3162
3312
 
3163
3313
 
3164
3314
 
3315
+
3165
3316
  </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style">
3166
3317
 
3167
3318
 
@@ -3281,13 +3432,13 @@
3281
3432
 
3282
3433
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
3283
3434
  <xsl:variable name="nodes_preface_">
3284
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3435
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3285
3436
  <node id="{@id}"/>
3286
3437
  </xsl:for-each>
3287
3438
  </xsl:variable>
3288
3439
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
3289
3440
 
3290
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3441
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3291
3442
  <xsl:sort select="@displayorder" data-type="number"/>
3292
3443
 
3293
3444
  <!-- process Section's title -->
@@ -3353,7 +3504,7 @@
3353
3504
  </xsl:for-each>
3354
3505
  </figures>
3355
3506
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3356
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3507
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3357
3508
  <xsl:sort select="@displayorder" data-type="number"/>
3358
3509
  <xsl:apply-templates select="."/>
3359
3510
  </xsl:for-each>
@@ -3608,6 +3759,8 @@
3608
3759
 
3609
3760
 
3610
3761
 
3762
+
3763
+
3611
3764
 
3612
3765
 
3613
3766
 
@@ -3647,6 +3800,8 @@
3647
3800
 
3648
3801
 
3649
3802
 
3803
+
3804
+
3650
3805
  </xsl:element>
3651
3806
  </xsl:variable>
3652
3807
 
@@ -3792,23 +3947,29 @@
3792
3947
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3793
3948
  <xsl:param name="continued"/>
3794
3949
  <xsl:if test="normalize-space() != ''">
3795
- <fo:block xsl:use-attribute-sets="table-name-style">
3796
-
3797
-
3798
-
3799
-
3950
+
3951
+
3800
3952
 
3801
- <xsl:choose>
3802
- <xsl:when test="$continued = 'true'">
3953
+ <fo:block xsl:use-attribute-sets="table-name-style">
3954
+
3803
3955
 
3804
- </xsl:when>
3805
- <xsl:otherwise>
3806
- <xsl:apply-templates/>
3807
- </xsl:otherwise>
3808
- </xsl:choose>
3809
-
3956
+
3957
+
3958
+
3959
+ <xsl:choose>
3960
+ <xsl:when test="$continued = 'true'">
3961
+
3962
+ </xsl:when>
3963
+ <xsl:otherwise>
3964
+ <xsl:apply-templates/>
3965
+ </xsl:otherwise>
3966
+ </xsl:choose>
3967
+
3968
+
3969
+ </fo:block>
3970
+
3810
3971
 
3811
- </fo:block>
3972
+
3812
3973
  </xsl:if>
3813
3974
  </xsl:template><xsl:template name="calculate-columns-numbers">
3814
3975
  <xsl:param name="table-row"/>
@@ -3971,8 +4132,9 @@
3971
4132
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3972
4133
  </xsl:if>
3973
4134
  </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
3974
- <xsl:param name="table"/>
3975
- <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
4135
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
4136
+
4137
+ <!-- via intermediate format -->
3976
4138
 
3977
4139
  <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
3978
4140
 
@@ -3983,9 +4145,8 @@
3983
4145
  <!-- get current table id -->
3984
4146
  <xsl:variable name="table_id" select="@id"/>
3985
4147
  <!-- find table by id in the file 'table_widths' -->
3986
- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
3987
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
3988
-
4148
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
4149
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
3989
4150
 
3990
4151
  <!-- table='<xsl:copy-of select="$table"/>' -->
3991
4152
  <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
@@ -3993,24 +4154,13 @@
3993
4154
  <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
3994
4155
 
3995
4156
  <xsl:variable name="table_with_cell_widths_">
3996
- <xsl:choose>
3997
- <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
3998
-
3999
- <!-- Example: <column>10</column>
4000
- <column>11</column>
4001
- -->
4002
- <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
4003
- </xsl:when>
4004
- <xsl:otherwise>
4005
- <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
4006
- </xsl:otherwise>
4007
- </xsl:choose>
4157
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
4008
4158
  </xsl:variable>
4009
4159
  <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
4010
4160
 
4011
- <xsl:if test="$table_if_debug = 'true'">
4161
+ <!-- <xsl:if test="$table_if_debug = 'true'">
4012
4162
  <xsl:copy-of select="$table_with_cell_widths"/>
4013
- </xsl:if>
4163
+ </xsl:if> -->
4014
4164
 
4015
4165
 
4016
4166
  <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
@@ -4056,8 +4206,12 @@
4056
4206
 
4057
4207
  <xsl:variable name="page_width">
4058
4208
  <xsl:choose>
4059
- <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
4060
- <xsl:otherwise>75</xsl:otherwise>
4209
+ <xsl:when test="$parent_table_page-width != ''">
4210
+ <xsl:value-of select="$parent_table_page-width"/>
4211
+ </xsl:when>
4212
+ <xsl:otherwise>
4213
+ <xsl:value-of select="@page-width"/>
4214
+ </xsl:otherwise>
4061
4215
  </xsl:choose>
4062
4216
  </xsl:variable>
4063
4217
 
@@ -4065,9 +4219,6 @@
4065
4219
  <table_width>
4066
4220
  <xsl:copy-of select="$table_widths"/>
4067
4221
  </table_width>
4068
- <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
4069
- <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
4070
- -->
4071
4222
  <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
4072
4223
  </xsl:if>
4073
4224
 
@@ -4078,11 +4229,11 @@
4078
4229
  <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4079
4230
  <!-- call old algorithm -->
4080
4231
  <case1/>
4081
- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
4232
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
4082
4233
  <xsl:call-template name="calculate-column-widths-proportional">
4083
4234
  <xsl:with-param name="cols-count" select="$cols-count"/>
4084
4235
  <xsl:with-param name="table" select="$table"/>
4085
- </xsl:call-template>
4236
+ </xsl:call-template> -->
4086
4237
  </xsl:when>
4087
4238
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
4088
4239
  <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
@@ -4126,95 +4277,49 @@
4126
4277
  <xsl:otherwise><unknown_case/></xsl:otherwise>
4127
4278
  </xsl:choose>
4128
4279
 
4280
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
4129
4281
 
4130
- </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
4131
- <xsl:copy>
4132
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
4133
- </xsl:copy>
4134
- </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
4135
- <xsl:copy>
4136
- <xsl:copy-of select="@*"/>
4282
+ <!-- if nested 'dl' or 'table' -->
4283
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
4284
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
4137
4285
 
4138
- <!-- The maximum width is given by the widest line. -->
4139
- <xsl:variable name="widths_max">
4140
- <xsl:for-each select=".//*[local-name() = 'p']">
4141
- <xsl:call-template name="add_width"/>
4142
- </xsl:for-each>
4143
- <xsl:if test="not(*[local-name() = 'p'])">
4144
- <xsl:call-template name="add_width"/>
4145
- </xsl:if>
4146
- </xsl:variable>
4147
- <xsl:variable name="width_max">
4148
- <xsl:for-each select="xalan:nodeset($widths_max)//width">
4149
- <xsl:sort select="." data-type="number" order="descending"/>
4150
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4151
- </xsl:for-each>
4152
- </xsl:variable>
4153
- <xsl:attribute name="width_max">
4154
- <xsl:value-of select="$width_max"/>
4155
- </xsl:attribute>
4286
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
4156
4287
 
4157
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
4158
- <!-- To do: image width -->
4159
- <xsl:variable name="td_text">
4160
- <xsl:apply-templates select="." mode="td_text"/>
4161
- </xsl:variable>
4162
- <xsl:variable name="words">
4163
- <xsl:variable name="string_with_added_zerospaces">
4164
- <xsl:call-template name="add-zero-spaces-java">
4165
- <xsl:with-param name="text" select="$td_text"/>
4166
- </xsl:call-template>
4288
+ <xsl:variable name="parent_table_page-width_">
4289
+ <xsl:if test="$parent_table_id != ''">
4290
+ <!-- determine column number in the parent table -->
4291
+ <xsl:variable name="parent_table_column_number">
4292
+ <xsl:choose>
4293
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
4294
+ <xsl:otherwise> <!-- parent is table -->
4295
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
4296
+ </xsl:otherwise>
4297
+ </xsl:choose>
4167
4298
  </xsl:variable>
4168
- <xsl:call-template name="tokenize">
4169
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4170
- </xsl:call-template>
4171
- </xsl:variable>
4172
-
4173
- <xsl:variable name="max_word_length">
4174
- <xsl:call-template name="max_length">
4175
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
4176
- </xsl:call-template>
4177
- </xsl:variable>
4178
- <xsl:variable name="width_min">
4179
- <xsl:value-of select="$max_word_length"/>
4180
- </xsl:variable>
4181
- <xsl:attribute name="width_min">
4182
- <xsl:value-of select="$width_min"/>
4183
- </xsl:attribute>
4184
- <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
4185
- <xsl:if test="$width_min &gt; $width_max">
4186
- <xsl:attribute name="width_max">
4187
- <xsl:value-of select="$width_min"/>
4188
- </xsl:attribute>
4299
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
4300
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4189
4301
  </xsl:if>
4190
- <xsl:if test="$width_min = 0">
4191
- <xsl:attribute name="width_min">1</xsl:attribute>
4192
- </xsl:if>
4193
-
4194
- <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
4195
-
4196
- </xsl:copy>
4197
- </xsl:template><xsl:template name="add_width">
4198
- <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
4199
- <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
4200
-
4201
- <xsl:variable name="p_text_len">
4202
- <xsl:choose>
4203
- <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
4204
- <xsl:value-of select="$p_text_len_ * 1.5"/>
4205
- </xsl:when>
4206
- <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
4207
- </xsl:choose>
4208
4302
  </xsl:variable>
4303
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
4209
4304
 
4210
- <xsl:variable name="math_addon_text">
4211
- <xsl:for-each select=".//*[local-name() = 'math']">
4212
- <xsl:apply-templates mode="td_text"/>
4213
- </xsl:for-each>
4214
- </xsl:variable>
4215
- <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
4305
+ <!-- get current table id -->
4306
+ <xsl:variable name="table_id" select="@id"/>
4307
+
4308
+ <xsl:choose>
4309
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
4310
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
4311
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
4312
+ </xsl:when>
4313
+ <xsl:otherwise>
4314
+ <!-- recalculate columns width based on parent table width -->
4315
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
4316
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
4317
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
4318
+ </xsl:call-template>
4319
+ </xsl:for-each>
4320
+ </xsl:otherwise>
4321
+ </xsl:choose>
4216
4322
 
4217
- <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
4218
4323
  </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
4219
4324
  <xsl:copy>
4220
4325
  <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
@@ -4262,12 +4367,18 @@
4262
4367
  <fo:table-row>
4263
4368
  <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">
4264
4369
 
4265
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4266
- <xsl:with-param name="continued">true</xsl:with-param>
4267
- </xsl:apply-templates>
4268
4370
 
4269
4371
 
4270
4372
 
4373
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4374
+ <xsl:with-param name="continued">true</xsl:with-param>
4375
+ </xsl:apply-templates>
4376
+
4377
+
4378
+
4379
+
4380
+
4381
+
4271
4382
  </fo:table-cell>
4272
4383
  </fo:table-row>
4273
4384
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -4307,87 +4418,101 @@
4307
4418
  </xsl:choose>
4308
4419
  </xsl:variable>
4309
4420
 
4310
- <fo:table keep-with-previous="always">
4311
- <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
4312
- <xsl:variable name="name" select="local-name()"/>
4421
+
4422
+ <xsl:variable name="tableWithNotesAndFootnotes">
4423
+
4424
+ <fo:table keep-with-previous="always">
4425
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
4426
+ <xsl:variable name="name" select="local-name()"/>
4427
+ <xsl:choose>
4428
+ <xsl:when test="$name = 'border-top'">
4429
+ <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
4430
+ </xsl:when>
4431
+ <xsl:when test="$name = 'border'">
4432
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
4433
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
4434
+ </xsl:when>
4435
+ <xsl:otherwise>
4436
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
4437
+ </xsl:otherwise>
4438
+ </xsl:choose>
4439
+ </xsl:for-each>
4440
+
4441
+
4442
+
4313
4443
  <xsl:choose>
4314
- <xsl:when test="$name = 'border-top'">
4315
- <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
4316
- </xsl:when>
4317
- <xsl:when test="$name = 'border'">
4318
- <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
4319
- <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
4444
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
4445
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
4446
+ <fo:table-column column-width="{@width}"/>
4447
+ </xsl:for-each>
4320
4448
  </xsl:when>
4321
4449
  <xsl:otherwise>
4322
- <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
4450
+ <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
4451
+ <xsl:call-template name="insertTableColumnWidth">
4452
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4453
+ </xsl:call-template>
4323
4454
  </xsl:otherwise>
4324
4455
  </xsl:choose>
4325
- </xsl:for-each>
4326
-
4327
-
4328
-
4329
- <xsl:choose>
4330
- <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
4331
- <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
4332
- <fo:table-column column-width="{@width}"/>
4333
- </xsl:for-each>
4334
- </xsl:when>
4335
- <xsl:otherwise>
4336
- <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
4337
- <xsl:call-template name="insertTableColumnWidth">
4338
- <xsl:with-param name="colwidths" select="$colwidths"/>
4339
- </xsl:call-template>
4340
- </xsl:otherwise>
4341
- </xsl:choose>
4342
-
4343
- <fo:table-body>
4344
- <fo:table-row>
4345
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4346
-
4347
-
4456
+
4457
+ <fo:table-body>
4458
+ <fo:table-row>
4459
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4460
+
4461
+
4348
4462
 
4349
-
4350
-
4351
- <!-- fn will be processed inside 'note' processing -->
4352
-
4353
- <xsl:if test="../*[local-name()='note']">
4354
- <fo:block margin-bottom="6pt"> </fo:block>
4355
- </xsl:if>
4356
-
4357
-
4358
-
4359
-
4360
-
4361
-
4362
- <!-- for BSI (not PAS) display Notes before footnotes -->
4363
-
4364
-
4365
- <!-- except gb and bsi -->
4366
-
4367
- <xsl:apply-templates select="../*[local-name()='note']"/>
4368
4463
 
4369
-
4370
-
4371
- <!-- horizontal row separator -->
4372
-
4373
- <xsl:if test="../*[local-name()='note']">
4374
- <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
4375
- <fo:block font-size="1pt"> </fo:block>
4376
- </fo:block-container>
4377
- </xsl:if>
4378
-
4379
-
4380
- <!-- fn processing -->
4381
- <xsl:call-template name="table_fn_display"/>
4382
-
4383
- <!-- for PAS display Notes after footnotes -->
4384
-
4385
-
4386
- </fo:table-cell>
4387
- </fo:table-row>
4388
- </fo:table-body>
4389
-
4390
- </fo:table>
4464
+
4465
+ <!-- fn will be processed inside 'note' processing -->
4466
+
4467
+ <xsl:if test="../*[local-name()='note']">
4468
+ <fo:block margin-bottom="6pt"> </fo:block>
4469
+ </xsl:if>
4470
+
4471
+
4472
+
4473
+
4474
+
4475
+
4476
+ <!-- for BSI (not PAS) display Notes before footnotes -->
4477
+
4478
+
4479
+ <!-- except gb and bsi -->
4480
+
4481
+ <xsl:apply-templates select="../*[local-name()='note']"/>
4482
+
4483
+
4484
+
4485
+ <!-- horizontal row separator -->
4486
+
4487
+ <xsl:if test="../*[local-name()='note']">
4488
+ <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
4489
+ <fo:block font-size="1pt"> </fo:block>
4490
+ </fo:block-container>
4491
+ </xsl:if>
4492
+
4493
+
4494
+ <!-- fn processing -->
4495
+
4496
+ <xsl:call-template name="table_fn_display"/>
4497
+
4498
+
4499
+
4500
+ <!-- for PAS display Notes after footnotes -->
4501
+
4502
+
4503
+ </fo:table-cell>
4504
+ </fo:table-row>
4505
+ </fo:table-body>
4506
+
4507
+ </fo:table>
4508
+ </xsl:variable>
4509
+
4510
+ <xsl:if test="normalize-space($tableWithNotesAndFootnotes) != ''">
4511
+ <xsl:copy-of select="$tableWithNotesAndFootnotes"/>
4512
+ </xsl:if>
4513
+
4514
+
4515
+
4391
4516
  </xsl:if>
4392
4517
  </xsl:template><xsl:template match="*[local-name()='tbody']">
4393
4518
 
@@ -4476,6 +4601,9 @@
4476
4601
 
4477
4602
 
4478
4603
 
4604
+
4605
+
4606
+
4479
4607
 
4480
4608
 
4481
4609
  <xsl:call-template name="setTableRowAttributes"/>
@@ -4495,6 +4623,8 @@
4495
4623
 
4496
4624
 
4497
4625
 
4626
+
4627
+
4498
4628
  <xsl:call-template name="setTableRowAttributes"/>
4499
4629
  <xsl:apply-templates/>
4500
4630
  </fo:table-row>
@@ -4585,6 +4715,8 @@
4585
4715
 
4586
4716
 
4587
4717
 
4718
+
4719
+
4588
4720
 
4589
4721
 
4590
4722
 
@@ -4656,7 +4788,11 @@
4656
4788
 
4657
4789
  <xsl:variable name="gen_id" select="generate-id(.)"/>
4658
4790
  <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
4659
- <xsl:variable name="reference" select="@reference"/>
4791
+ <xsl:variable name="reference_">
4792
+ <xsl:value-of select="@reference"/>
4793
+ <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
4794
+ </xsl:variable>
4795
+ <xsl:variable name="reference" select="normalize-space($reference_)"/>
4660
4796
  <!-- fn sequence number in document -->
4661
4797
  <xsl:variable name="current_fn_number">
4662
4798
  <xsl:choose>
@@ -4676,6 +4812,7 @@
4676
4812
  <xsl:variable name="footnote_inline">
4677
4813
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4678
4814
 
4815
+
4679
4816
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4680
4817
  <xsl:value-of select="$current_fn_number_text"/>
4681
4818
  </fo:basic-link>
@@ -4697,8 +4834,12 @@
4697
4834
  <fo:block xsl:use-attribute-sets="fn-body-style">
4698
4835
 
4699
4836
 
4837
+
4700
4838
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
4701
4839
 
4840
+
4841
+
4842
+
4702
4843
  <xsl:value-of select="$current_fn_number_text"/>
4703
4844
  </fo:inline>
4704
4845
  <xsl:apply-templates/>
@@ -4731,7 +4872,7 @@
4731
4872
  <xsl:copy-of select="node()"/>
4732
4873
  </fn>
4733
4874
  </xsl:for-each>
4734
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
4875
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
4735
4876
  <xsl:sort select="@displayorder" data-type="number"/>
4736
4877
  <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4737
4878
  <!-- copy unique fn -->
@@ -5030,11 +5171,19 @@
5030
5171
 
5031
5172
 
5032
5173
 
5174
+
5175
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
5176
+ <xsl:attribute name="margin-top">0</xsl:attribute>
5177
+ </xsl:if>
5178
+
5033
5179
  <fo:block>
5034
5180
 
5035
5181
 
5036
5182
 
5037
5183
 
5184
+ <xsl:apply-templates select="*[local-name() = 'name']">
5185
+ <xsl:with-param name="process">true</xsl:with-param>
5186
+ </xsl:apply-templates>
5038
5187
 
5039
5188
  <xsl:if test="$isGenerateTableIF = 'true'">
5040
5189
  <!-- to determine start of table -->
@@ -5059,6 +5208,7 @@
5059
5208
  </xsl:choose>
5060
5209
 
5061
5210
 
5211
+
5062
5212
  <xsl:choose>
5063
5213
  <xsl:when test="$isGenerateTableIF = 'true'">
5064
5214
  <!-- generate IF for table widths -->
@@ -5187,6 +5337,18 @@
5187
5337
  </xsl:if> <!-- END: a few components -->
5188
5338
  </fo:block-container>
5189
5339
  </fo:block-container>
5340
+
5341
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
5342
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
5343
+ </xsl:if>
5344
+
5345
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
5346
+ <xsl:param name="process">false</xsl:param>
5347
+ <xsl:if test="$process = 'true'">
5348
+ <fo:block xsl:use-attribute-sets="dl-name-style">
5349
+ <xsl:apply-templates/>
5350
+ </fo:block>
5351
+ </xsl:if>
5190
5352
  </xsl:template><xsl:template name="setColumnWidth_dl">
5191
5353
  <xsl:param name="colwidths"/>
5192
5354
  <xsl:param name="maxlength_dt"/>
@@ -5195,6 +5357,11 @@
5195
5357
  <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
5196
5358
 
5197
5359
  <xsl:choose>
5360
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
5361
+ <xsl:call-template name="insertTableColumnWidth">
5362
+ <xsl:with-param name="colwidths" select="$colwidths"/>
5363
+ </xsl:call-template>
5364
+ </xsl:when>
5198
5365
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
5199
5366
  <fo:table-column column-width="50%"/>
5200
5367
  <fo:table-column column-width="50%"/>
@@ -5447,12 +5614,24 @@
5447
5614
  </td>
5448
5615
  <td>
5449
5616
 
5450
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
5617
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5618
+
5619
+ <!-- get paragraphs from nested 'dl' -->
5620
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5621
+
5451
5622
 
5452
5623
  </td>
5453
5624
  </tr>
5454
5625
 
5455
- </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
5626
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
5627
+ <xsl:for-each select="*[local-name() = 'dt']">
5628
+ <p>
5629
+ <xsl:copy-of select="node()"/>
5630
+ <xsl:text> </xsl:text>
5631
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
5632
+ </p>
5633
+ </xsl:for-each>
5634
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
5456
5635
  <fo:inline font-style="italic">
5457
5636
  <xsl:apply-templates/>
5458
5637
  </fo:inline>
@@ -5483,7 +5662,7 @@
5483
5662
 
5484
5663
  10
5485
5664
 
5486
-
5665
+ <!-- 10 -->
5487
5666
 
5488
5667
 
5489
5668
 
@@ -6355,6 +6534,12 @@
6355
6534
  </xsl:variable>
6356
6535
  <fo:inline xsl:use-attribute-sets="link-style">
6357
6536
 
6537
+ <xsl:if test="starts-with(normalize-space(@target), 'mailto:')">
6538
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6539
+ </xsl:if>
6540
+
6541
+
6542
+
6358
6543
 
6359
6544
 
6360
6545
 
@@ -6365,6 +6550,7 @@
6365
6550
 
6366
6551
 
6367
6552
 
6553
+
6368
6554
  <xsl:choose>
6369
6555
  <xsl:when test="$target_text = ''">
6370
6556
  <xsl:apply-templates/>
@@ -6572,6 +6758,7 @@
6572
6758
 
6573
6759
 
6574
6760
 
6761
+
6575
6762
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6576
6763
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6577
6764
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6594,6 +6781,7 @@
6594
6781
  <xsl:otherwise>
6595
6782
 
6596
6783
 
6784
+
6597
6785
  </xsl:otherwise>
6598
6786
  </xsl:choose>
6599
6787
  </xsl:variable>
@@ -6610,6 +6798,7 @@
6610
6798
  </xsl:when>
6611
6799
  <xsl:otherwise>
6612
6800
 
6801
+
6613
6802
  <xsl:text>:</xsl:text>
6614
6803
 
6615
6804
 
@@ -6621,7 +6810,19 @@
6621
6810
  <xsl:value-of select="$suffix"/>
6622
6811
  </xsl:if>
6623
6812
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
6624
- <fo:inline><xsl:apply-templates/></fo:inline>
6813
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
6814
+ <xsl:choose>
6815
+ <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
6816
+ <fo:inline xsl:use-attribute-sets="termnote-p-style">
6817
+ <xsl:apply-templates/>
6818
+ </fo:inline>
6819
+ </xsl:when>
6820
+ <xsl:otherwise>
6821
+ <fo:block xsl:use-attribute-sets="termnote-p-style">
6822
+ <xsl:apply-templates/>
6823
+ </fo:block>
6824
+ </xsl:otherwise>
6825
+ </xsl:choose>
6625
6826
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
6626
6827
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
6627
6828
  <fo:block id="{@id}">
@@ -7385,6 +7586,9 @@
7385
7586
  <fo:block xsl:use-attribute-sets="figure-name-style">
7386
7587
 
7387
7588
 
7589
+
7590
+
7591
+
7388
7592
  <xsl:apply-templates/>
7389
7593
  </fo:block>
7390
7594
  </xsl:if>
@@ -7445,9 +7649,9 @@
7445
7649
  <xsl:apply-templates/>
7446
7650
  </xsl:otherwise>
7447
7651
  </xsl:choose>
7448
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref']" mode="contents">
7652
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref'] | *[local-name() = 'eref']" mode="contents">
7449
7653
  <xsl:value-of select="."/>
7450
- </xsl:template><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
7654
+ </xsl:template><xsl:template match="*[local-name() = 'review']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
7451
7655
  <xsl:text> </xsl:text>
7452
7656
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
7453
7657
  <xsl:copy>
@@ -7518,9 +7722,12 @@
7518
7722
 
7519
7723
  9
7520
7724
 
7725
+ <!-- 9 -->
7521
7726
 
7522
7727
 
7523
-
7728
+ <!-- <xsl:if test="$namespace = 'ieee'">
7729
+ <xsl:if test="$doctype = 'standard' and $stage = 'published'">8</xsl:if>
7730
+ </xsl:if> -->
7524
7731
 
7525
7732
 
7526
7733
 
@@ -7602,7 +7809,7 @@
7602
7809
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
7603
7810
  <xsl:choose>
7604
7811
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
7605
- <xsl:call-template name="interspers">
7812
+ <xsl:call-template name="interspers-java">
7606
7813
  <xsl:with-param name="str" select="."/>
7607
7814
  </xsl:call-template>
7608
7815
  </xsl:when>
@@ -7652,6 +7859,10 @@
7652
7859
  <xsl:with-param name="char" select="$char"/>
7653
7860
  </xsl:call-template>
7654
7861
  </xsl:if>
7862
+ </xsl:template><xsl:template name="interspers-java">
7863
+ <xsl:param name="str"/>
7864
+ <xsl:param name="char" select="$zero_width_space"/>
7865
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
7655
7866
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
7656
7867
  <xsl:apply-templates mode="syntax_highlight"/>
7657
7868
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -7961,10 +8172,14 @@
7961
8172
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
7962
8173
  <xsl:variable name="element">inline
7963
8174
 
8175
+
7964
8176
  </xsl:variable>
7965
8177
  <xsl:choose>
7966
8178
  <xsl:when test="contains($element, 'block')">
7967
8179
  <fo:block xsl:use-attribute-sets="example-p-style">
8180
+
8181
+
8182
+
7968
8183
  <xsl:apply-templates/>
7969
8184
  </fo:block>
7970
8185
  </xsl:when>
@@ -8078,6 +8293,7 @@
8078
8293
  </xsl:if>
8079
8294
  <fo:block xsl:use-attribute-sets="example-p-style">
8080
8295
 
8296
+
8081
8297
  <xsl:apply-templates/>
8082
8298
  </fo:block>
8083
8299
  </fo:block-container>
@@ -8234,6 +8450,8 @@
8234
8450
 
8235
8451
 
8236
8452
 
8453
+
8454
+
8237
8455
  <fo:basic-link fox:alt-text="{@citeas}">
8238
8456
  <xsl:if test="normalize-space(@citeas) = ''">
8239
8457
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
@@ -8306,6 +8524,7 @@
8306
8524
 
8307
8525
 
8308
8526
 
8527
+
8309
8528
  </xsl:variable>
8310
8529
 
8311
8530
  <xsl:variable name="padding-right">
@@ -8609,6 +8828,11 @@
8609
8828
  </xsl:otherwise>
8610
8829
  </xsl:choose>
8611
8830
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8831
+
8832
+ <xsl:apply-templates select="*[local-name() = 'name']">
8833
+ <xsl:with-param name="process">true</xsl:with-param>
8834
+ </xsl:apply-templates>
8835
+
8612
8836
  <fo:list-block xsl:use-attribute-sets="list-style">
8613
8837
 
8614
8838
 
@@ -8626,12 +8850,23 @@
8626
8850
 
8627
8851
 
8628
8852
 
8853
+ <xsl:if test="*[local-name() = 'name']">
8854
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8855
+ </xsl:if>
8856
+
8629
8857
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
8630
8858
  </fo:list-block>
8631
8859
  <!-- <xsl:for-each select="./iho:note">
8632
8860
  <xsl:call-template name="note"/>
8633
8861
  </xsl:for-each> -->
8634
8862
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
8863
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
8864
+ <xsl:param name="process">false</xsl:param>
8865
+ <xsl:if test="$process = 'true'">
8866
+ <fo:block xsl:use-attribute-sets="list-name-style">
8867
+ <xsl:apply-templates/>
8868
+ </fo:block>
8869
+ </xsl:if>
8635
8870
  </xsl:template><xsl:template match="*[local-name()='li']">
8636
8871
  <fo:list-item xsl:use-attribute-sets="list-item-style">
8637
8872
  <xsl:copy-of select="@id"/>
@@ -8643,6 +8878,8 @@
8643
8878
 
8644
8879
 
8645
8880
 
8881
+
8882
+
8646
8883
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8647
8884
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8648
8885
  <xsl:call-template name="append_add-style"/>
@@ -8905,9 +9142,9 @@
8905
9142
  </fo:block>
8906
9143
 
8907
9144
 
8908
- </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
9145
+ </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2">
8909
9146
 
8910
- <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
9147
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
8911
9148
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
8912
9149
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
8913
9150
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
@@ -8918,7 +9155,7 @@
8918
9155
 
8919
9156
  <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
8920
9157
  <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
8921
- <xsl:number format="[1]"/>
9158
+ <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
8922
9159
  </xsl:if>
8923
9160
 
8924
9161
  </fo:inline>
@@ -8940,26 +9177,23 @@
8940
9177
  <xsl:if test=".//*[local-name() = 'fn']">
8941
9178
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
8942
9179
  </xsl:if>
9180
+
9181
+ <!-- display document identifier, not number [1] -->
8943
9182
  <xsl:variable name="docidentifier">
8944
9183
  <xsl:choose>
8945
9184
  <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
8946
9185
  <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
8947
9186
  </xsl:choose>
8948
9187
  </xsl:variable>
8949
- <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
9188
+ <xsl:value-of select="$docidentifier"/>
9189
+
8950
9190
  <xsl:apply-templates select="*[local-name() = 'note']"/>
8951
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
8952
- <xsl:choose>
8953
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
8954
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
8955
- </xsl:when>
8956
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
8957
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
8958
- </xsl:when>
8959
- <xsl:otherwise>
8960
- <xsl:apply-templates select="*[local-name() = 'title']"/>
8961
- </xsl:otherwise>
8962
- </xsl:choose>
9191
+
9192
+ <xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
9193
+ <xsl:text>,</xsl:text>
9194
+ <xsl:text> </xsl:text>
9195
+ </xsl:if>
9196
+
8963
9197
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8964
9198
  <!-- end bibitem processing -->
8965
9199
 
@@ -9263,16 +9497,21 @@
9263
9497
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
9264
9498
 
9265
9499
 
9500
+
9501
+
9266
9502
 
9267
9503
 
9268
9504
 
9269
9505
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
9270
9506
 
9271
9507
 
9508
+
9509
+
9272
9510
  <fo:block text-align="justify">
9273
9511
  <fo:inline>
9274
- <xsl:call-template name="displayAdmonitionName"/>
9275
- <xsl:text> – </xsl:text>
9512
+ <xsl:call-template name="displayAdmonitionName">
9513
+ <xsl:with-param name="sep"> – </xsl:with-param>
9514
+ </xsl:call-template>
9276
9515
  </fo:inline>
9277
9516
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9278
9517
  </fo:block>
@@ -9282,25 +9521,32 @@
9282
9521
  </fo:block-container>
9283
9522
 
9284
9523
  </xsl:template><xsl:template name="displayAdmonitionName">
9285
-
9524
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
9525
+ <!-- <xsl:choose>
9526
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
9527
+ <xsl:choose>
9528
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
9529
+ <xsl:otherwise>
9530
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9531
+ </xsl:otherwise>
9532
+ </xsl:choose>
9533
+ </xsl:when>
9534
+ <xsl:otherwise>
9286
9535
  <xsl:apply-templates select="*[local-name() = 'name']"/>
9287
9536
  <xsl:if test="not(*[local-name() = 'name'])">
9288
9537
  <xsl:apply-templates select="@type"/>
9289
9538
  </xsl:if>
9290
-
9291
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9292
- <xsl:apply-templates/>
9293
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
9294
- <xsl:variable name="admonition_type_">
9295
- <xsl:call-template name="getLocalizedString">
9296
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
9297
- </xsl:call-template>
9539
+ </xsl:otherwise>
9540
+ </xsl:choose> -->
9541
+ <xsl:variable name="name">
9542
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9298
9543
  </xsl:variable>
9299
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
9300
- <xsl:value-of select="$admonition_type"/>
9301
- <xsl:if test="$admonition_type = ''">
9302
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
9544
+ <xsl:copy-of select="$name"/>
9545
+ <xsl:if test="normalize-space($name) != ''">
9546
+ <xsl:value-of select="$sep"/>
9303
9547
  </xsl:if>
9548
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9549
+ <xsl:apply-templates/>
9304
9550
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
9305
9551
  <!-- processing for admonition/p found in the template for 'p' -->
9306
9552
  <xsl:call-template name="paragraph"/>
@@ -9466,6 +9712,8 @@
9466
9712
  </xsl:when>
9467
9713
  <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
9468
9714
  </xsl:choose>
9715
+ </xsl:template><xsl:template match="*[local-name() = 'lang_none']">
9716
+ <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
9469
9717
  </xsl:template><xsl:template name="printEdition">
9470
9718
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
9471
9719
  <xsl:text> </xsl:text>
@@ -9572,6 +9820,27 @@
9572
9820
  </xsl:when>
9573
9821
  <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
9574
9822
  </xsl:choose>
9823
+ </xsl:template><xsl:template name="getMonthLocalizedByNum">
9824
+ <xsl:param name="num"/>
9825
+ <xsl:variable name="monthStr">
9826
+ <xsl:choose>
9827
+ <xsl:when test="$num = '01'">january</xsl:when>
9828
+ <xsl:when test="$num = '02'">february</xsl:when>
9829
+ <xsl:when test="$num = '03'">march</xsl:when>
9830
+ <xsl:when test="$num = '04'">april</xsl:when>
9831
+ <xsl:when test="$num = '05'">may</xsl:when>
9832
+ <xsl:when test="$num = '06'">june</xsl:when>
9833
+ <xsl:when test="$num = '07'">july</xsl:when>
9834
+ <xsl:when test="$num = '08'">august</xsl:when>
9835
+ <xsl:when test="$num = '09'">september</xsl:when>
9836
+ <xsl:when test="$num = '10'">october</xsl:when>
9837
+ <xsl:when test="$num = '11'">november</xsl:when>
9838
+ <xsl:when test="$num = '12'">december</xsl:when>
9839
+ </xsl:choose>
9840
+ </xsl:variable>
9841
+ <xsl:call-template name="getLocalizedString">
9842
+ <xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param>
9843
+ </xsl:call-template>
9575
9844
  </xsl:template><xsl:template name="insertKeywords">
9576
9845
  <xsl:param name="sorting" select="'true'"/>
9577
9846
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -9643,7 +9912,7 @@
9643
9912
  <dc:description>
9644
9913
  <xsl:variable name="abstract">
9645
9914
 
9646
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
9915
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
9647
9916
 
9648
9917
  </xsl:variable>
9649
9918
  <xsl:value-of select="normalize-space($abstract)"/>
@@ -9773,6 +10042,7 @@
9773
10042
 
9774
10043
 
9775
10044
 
10045
+
9776
10046
 
9777
10047
 
9778
10048