metanorma-itu 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
-
5
- <xsl:param name="svg_images"/>
6
- <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
7
- <xsl:variable name="images" select="document($svg_images)"/>
8
- <xsl:param name="basepath"/>
9
4
 
10
5
 
11
6
 
@@ -15,11 +10,6 @@
15
10
 
16
11
  <xsl:variable name="debug">false</xsl:variable>
17
12
 
18
- <xsl:variable name="marginLeftRight1" select="20"/>
19
- <xsl:variable name="marginLeftRight2" select="20"/>
20
- <xsl:variable name="marginTop" select="20"/>
21
- <xsl:variable name="marginBottom" select="20"/>
22
-
23
13
  <!-- Rec. ITU-T G.650.1 (03/2018) -->
24
14
  <xsl:variable name="footerprefix" select="'Rec. '"/>
25
15
  <xsl:variable name="docname">
@@ -65,10 +55,6 @@
65
55
 
66
56
  </contents>
67
57
  </xsl:variable>
68
-
69
- <xsl:variable name="lang">
70
- <xsl:call-template name="getLang"/>
71
- </xsl:variable>
72
58
 
73
59
  <xsl:variable name="doctypeTitle">
74
60
  <xsl:choose>
@@ -1296,46 +1282,6 @@
1296
1282
  <xsl:template match="itu:references" mode="contents">
1297
1283
  <xsl:apply-templates mode="contents"/>
1298
1284
  </xsl:template>
1299
-
1300
-
1301
-
1302
- <xsl:template name="getListItemFormat">
1303
- <xsl:variable name="level">
1304
- <xsl:variable name="numtmp">
1305
- <xsl:number level="multiple" count="itu:ol"/>
1306
- </xsl:variable>
1307
- <!-- level example: 1.1
1308
- calculate counts of '.' in numtmp value - level of nested lists
1309
- -->
1310
- <xsl:value-of select="string-length($numtmp) - string-length(translate($numtmp, '.', '')) + 1"/>
1311
- </xsl:variable>
1312
- <xsl:choose>
1313
- <xsl:when test="local-name(..) = 'ul' and itu:ul and local-name(../../..) != 'ul'">•</xsl:when> <!-- dash &#x2014; -->
1314
- <xsl:when test="local-name(..) = 'ul'">–</xsl:when> <!-- dash &#x2014; -->
1315
- <xsl:otherwise>
1316
- <!-- for Ordered Lists -->
1317
- <xsl:choose>
1318
- <xsl:when test="../@type = 'arabic'">
1319
- <xsl:number format="a)" lang="en"/>
1320
- </xsl:when>
1321
- <xsl:when test="../@class = 'steps'">
1322
- <xsl:number format="1)"/>
1323
- </xsl:when>
1324
- <xsl:when test="$level = 1">
1325
- <xsl:number format="a)" lang="en"/>
1326
- </xsl:when>
1327
- <xsl:when test="$level = 2">
1328
- <xsl:number format="i)"/>
1329
- </xsl:when>
1330
- <xsl:otherwise>
1331
- <!-- <xsl:number format="1.)"/> -->
1332
- <!-- https://github.com/metanorma/mn-native-pdf/issues/156 -->
1333
- <xsl:number format="1)"/>
1334
- </xsl:otherwise>
1335
- </xsl:choose>
1336
- </xsl:otherwise>
1337
- </xsl:choose>
1338
- </xsl:template>
1339
1285
 
1340
1286
 
1341
1287
  <!-- ============================= -->
@@ -1622,7 +1568,7 @@
1622
1568
  </xsl:template>
1623
1569
 
1624
1570
 
1625
- <xsl:template match="itu:preferred">
1571
+ <xsl:template match="itu:preferred" priority="2">
1626
1572
  <!-- DEBUG need -->
1627
1573
  <xsl:variable name="level">
1628
1574
  <xsl:call-template name="getLevel"/>
@@ -1768,7 +1714,7 @@
1768
1714
  <xsl:template match="itu:docidentifier"/>
1769
1715
 
1770
1716
 
1771
- <xsl:template match="itu:ul | itu:ol | itu:sections/itu:ul | itu:sections/itu:ol" mode="ul_ol">
1717
+ <xsl:template match="itu:ul | itu:ol | itu:sections/itu:ul | itu:sections/itu:ol" mode="list" priority="2">
1772
1718
  <xsl:if test="preceding-sibling::*[1][local-name() = 'title'] and $doctype != 'service-publication'">
1773
1719
  <fo:block padding-top="-8pt" font-size="1pt"> </fo:block>
1774
1720
  </xsl:if>
@@ -1804,7 +1750,7 @@
1804
1750
  </fo:block>
1805
1751
  </xsl:template>
1806
1752
 
1807
- <xsl:template match="itu:li">
1753
+ <xsl:template match="itu:li" priority="2">
1808
1754
  <xsl:choose>
1809
1755
  <xsl:when test="$doctype = 'service-publication'">
1810
1756
  <fo:block id="{@id}">
@@ -1838,24 +1784,15 @@
1838
1784
  <xsl:attribute name="{$attribute-margin}">18mm</xsl:attribute>
1839
1785
  </xsl:if>
1840
1786
  <xsl:if test="local-name(..) = 'ul'">
1841
- <xsl:attribute name="{$attribute-margin}">7mm</xsl:attribute><!-- 15mm -->
1787
+ <xsl:attribute name="{$attribute-margin}">7mm</xsl:attribute>
1842
1788
  <xsl:if test="ancestor::itu:table">
1843
1789
  <xsl:attribute name="{$attribute-margin}">4.5mm</xsl:attribute>
1844
1790
  </xsl:if>
1845
- <!-- <xsl:if test="count(ancestor::itu:ol) + count(ancestor::itu:ul) &gt; 1">
1846
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
1847
- </xsl:if> -->
1848
1791
  </xsl:if>
1849
- <!-- <xsl:if test="$doctype = 'service-publication'">
1850
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1851
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1852
- </xsl:if> -->
1792
+
1853
1793
  <fo:block-container margin-left="0mm" margin-right="0mm">
1854
1794
  <fo:block>
1855
- <!-- <xsl:if test="$doctype = 'service-publication'">
1856
- <xsl:attribute name="start-indent">7mm</xsl:attribute>
1857
- <xsl:attribute name="text-indent">7mm</xsl:attribute>
1858
- </xsl:if> -->
1795
+
1859
1796
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
1860
1797
  <xsl:apply-templates select="./itu:note"/>
1861
1798
  </fo:block>
@@ -1921,27 +1858,7 @@
1921
1858
  <xsl:apply-templates />
1922
1859
  </xsl:template> -->
1923
1860
 
1924
-
1925
- <xsl:template match="itu:formula/itu:stem">
1926
- <fo:table table-layout="fixed" width="100%">
1927
- <fo:table-column column-width="95%"/>
1928
- <fo:table-column column-width="5%"/>
1929
- <fo:table-body>
1930
- <fo:table-row>
1931
- <fo:table-cell display-align="center">
1932
- <fo:block text-align="center" margin-left="0mm">
1933
- <xsl:apply-templates/>
1934
- </fo:block>
1935
- </fo:table-cell>
1936
- <fo:table-cell display-align="center">
1937
- <fo:block text-align="right" margin-left="0mm">
1938
- <xsl:apply-templates select="../itu:name" mode="formula_number"/>
1939
- </fo:block>
1940
- </fo:table-cell>
1941
- </fo:table-row>
1942
- </fo:table-body>
1943
- </fo:table>
1944
- </xsl:template>
1861
+
1945
1862
 
1946
1863
 
1947
1864
  <xsl:template name="insertHeaderFooter">
@@ -2147,11 +2064,21 @@
2147
2064
  </xsl:if>
2148
2065
  </xsl:template>
2149
2066
 
2150
- <xsl:variable name="pageWidth_">
2067
+ <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:variable name="lang">
2068
+ <xsl:call-template name="getLang"/>
2069
+ </xsl:variable><xsl:variable name="pageWidth_">
2151
2070
  210
2152
2071
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
2153
2072
  297
2154
- </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
2073
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
2074
+ 20
2075
+ </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
2076
+ 20
2077
+ </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_">
2078
+ 20
2079
+ </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
2080
+ 20
2081
+ </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
2155
2082
 
2156
2083
  <title-edition lang="en">
2157
2084
 
@@ -2211,7 +2138,7 @@
2211
2138
  </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
2212
2139
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2213
2140
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2214
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2141
+ </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
2215
2142
  <xsl:param name="name"/>
2216
2143
  <xsl:param name="lang"/>
2217
2144
  <xsl:variable name="lang_">
@@ -2234,7 +2161,7 @@
2234
2161
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2235
2162
  </xsl:otherwise>
2236
2163
  </xsl:choose>
2237
- </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="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
2164
+ </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">
2238
2165
 
2239
2166
 
2240
2167
 
@@ -2398,13 +2325,14 @@
2398
2325
 
2399
2326
 
2400
2327
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
2401
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2402
2328
 
2403
2329
 
2404
2330
 
2405
2331
 
2406
2332
 
2407
2333
 
2334
+
2335
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2408
2336
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2409
2337
 
2410
2338
 
@@ -2769,7 +2697,8 @@
2769
2697
 
2770
2698
 
2771
2699
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2772
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
2700
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
2701
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
2773
2702
 
2774
2703
 
2775
2704
 
@@ -2777,15 +2706,11 @@
2777
2706
 
2778
2707
 
2779
2708
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
2780
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
2781
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
2782
2709
 
2783
2710
 
2784
2711
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2712
+ <xsl:attribute name="text-align">right</xsl:attribute>
2785
2713
 
2786
-
2787
- <xsl:attribute name="text-align">right</xsl:attribute>
2788
-
2789
2714
 
2790
2715
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
2791
2716
 
@@ -2805,6 +2730,9 @@
2805
2730
 
2806
2731
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2807
2732
 
2733
+ </xsl:attribute-set><xsl:attribute-set name="term-name-style">
2734
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2735
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2808
2736
  </xsl:attribute-set><xsl:attribute-set name="figure-style">
2809
2737
 
2810
2738
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -2835,9 +2763,39 @@
2835
2763
 
2836
2764
 
2837
2765
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
2766
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2767
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2768
+
2769
+
2770
+
2771
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2772
+
2773
+
2774
+
2775
+
2776
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style">
2777
+ <xsl:attribute name="text-align">center</xsl:attribute>
2778
+
2779
+
2780
+
2781
+
2782
+
2783
+
2784
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2785
+
2786
+
2787
+
2788
+
2789
+
2790
+
2791
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
2792
+ <xsl:attribute name="text-align">right</xsl:attribute>
2793
+
2794
+
2795
+
2796
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2797
+
2838
2798
 
2839
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
2840
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2841
2799
 
2842
2800
  </xsl:attribute-set><xsl:attribute-set name="image-style">
2843
2801
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2876,6 +2834,18 @@
2876
2834
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2877
2835
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2878
2836
 
2837
+ </xsl:attribute-set><xsl:attribute-set name="preferred-block-style">
2838
+
2839
+
2840
+
2841
+
2842
+
2843
+
2844
+ </xsl:attribute-set><xsl:attribute-set name="preferred-term-style">
2845
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2846
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2847
+
2848
+
2879
2849
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
2880
2850
 
2881
2851
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -2911,6 +2881,33 @@
2911
2881
 
2912
2882
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2913
2883
 
2884
+
2885
+
2886
+
2887
+
2888
+
2889
+
2890
+
2891
+
2892
+
2893
+
2894
+
2895
+
2896
+
2897
+
2898
+
2899
+
2900
+ </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2901
+
2902
+
2903
+ </xsl:attribute-set><xsl:attribute-set name="list-item-label-style">
2904
+
2905
+
2906
+
2907
+ </xsl:attribute-set><xsl:attribute-set name="list-item-body-style">
2908
+
2909
+
2910
+
2914
2911
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2915
2912
  <xsl:attribute name="line-height">135%</xsl:attribute>
2916
2913
  </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
@@ -3192,6 +3189,111 @@
3192
3189
 
3193
3190
 
3194
3191
 
3192
+ </xsl:attribute-set><xsl:attribute-set name="hljs-doctag">
3193
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3194
+ </xsl:attribute-set><xsl:attribute-set name="hljs-keyword">
3195
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3196
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword">
3197
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3198
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag">
3199
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3200
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable">
3201
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3202
+ </xsl:attribute-set><xsl:attribute-set name="hljs-type">
3203
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3204
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_">
3205
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3206
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title">
3207
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3208
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_">
3209
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3210
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__">
3211
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3212
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_">
3213
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3214
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attr">
3215
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3216
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attribute">
3217
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3218
+ </xsl:attribute-set><xsl:attribute-set name="hljs-literal">
3219
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3220
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta">
3221
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3222
+ </xsl:attribute-set><xsl:attribute-set name="hljs-number">
3223
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3224
+ </xsl:attribute-set><xsl:attribute-set name="hljs-operator">
3225
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3226
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable">
3227
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3228
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr">
3229
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3230
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class">
3231
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3232
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id">
3233
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3234
+ </xsl:attribute-set><xsl:attribute-set name="hljs-regexp">
3235
+ <xsl:attribute name="color">#032f62</xsl:attribute>
3236
+ </xsl:attribute-set><xsl:attribute-set name="hljs-string">
3237
+ <xsl:attribute name="color">#032f62</xsl:attribute>
3238
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string">
3239
+ <xsl:attribute name="color">#032f62</xsl:attribute>
3240
+ </xsl:attribute-set><xsl:attribute-set name="hljs-built_in">
3241
+ <xsl:attribute name="color">#e36209</xsl:attribute>
3242
+ </xsl:attribute-set><xsl:attribute-set name="hljs-symbol">
3243
+ <xsl:attribute name="color">#e36209</xsl:attribute>
3244
+ </xsl:attribute-set><xsl:attribute-set name="hljs-comment">
3245
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
3246
+ </xsl:attribute-set><xsl:attribute-set name="hljs-code">
3247
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
3248
+ </xsl:attribute-set><xsl:attribute-set name="hljs-formula">
3249
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
3250
+ </xsl:attribute-set><xsl:attribute-set name="hljs-name">
3251
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3252
+ </xsl:attribute-set><xsl:attribute-set name="hljs-quote">
3253
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3254
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag">
3255
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3256
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo">
3257
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3258
+ </xsl:attribute-set><xsl:attribute-set name="hljs-subst">
3259
+ <xsl:attribute name="color">#24292e</xsl:attribute>
3260
+ </xsl:attribute-set><xsl:attribute-set name="hljs-section">
3261
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3262
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3263
+ </xsl:attribute-set><xsl:attribute-set name="hljs-bullet">
3264
+ <xsl:attribute name="color">#735c0f</xsl:attribute>
3265
+ </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis">
3266
+ <xsl:attribute name="color">#24292e</xsl:attribute>
3267
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3268
+ </xsl:attribute-set><xsl:attribute-set name="hljs-strong">
3269
+ <xsl:attribute name="color">#24292e</xsl:attribute>
3270
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3271
+ </xsl:attribute-set><xsl:attribute-set name="hljs-addition">
3272
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3273
+ <xsl:attribute name="background-color">#f0fff4</xsl:attribute>
3274
+ </xsl:attribute-set><xsl:attribute-set name="hljs-deletion">
3275
+ <xsl:attribute name="color">#b31d28</xsl:attribute>
3276
+ <xsl:attribute name="background-color">#ffeef0</xsl:attribute>
3277
+ </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_">
3278
+ </xsl:attribute-set><xsl:attribute-set name="hljs-link">
3279
+ </xsl:attribute-set><xsl:attribute-set name="hljs-params">
3280
+ </xsl:attribute-set><xsl:attribute-set name="hljs-property">
3281
+ </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation">
3282
+ </xsl:attribute-set><xsl:attribute-set name="hljs-tag">
3283
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style">
3284
+ <xsl:attribute name="role">H1</xsl:attribute>
3285
+
3286
+
3287
+
3288
+
3289
+
3290
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style">
3291
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3292
+
3293
+
3294
+
3295
+
3296
+
3195
3297
  </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">
3196
3298
  <xsl:for-each select="/*/*[local-name()='preface']/*">
3197
3299
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -3287,9 +3389,12 @@
3287
3389
 
3288
3390
 
3289
3391
  </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
3392
+ <xsl:param name="margin"/>
3290
3393
 
3291
3394
  <!-- process in the template 'paragraph' -->
3292
- <xsl:call-template name="paragraph"/>
3395
+ <xsl:call-template name="paragraph">
3396
+ <xsl:with-param name="margin" select="$margin"/>
3397
+ </xsl:call-template>
3293
3398
 
3294
3399
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
3295
3400
  <fo:block xsl:use-attribute-sets="feedback-statement-style">
@@ -3301,9 +3406,12 @@
3301
3406
  <xsl:call-template name="title"/>
3302
3407
 
3303
3408
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
3409
+ <xsl:param name="margin"/>
3304
3410
 
3305
3411
  <!-- process in the template 'paragraph' -->
3306
- <xsl:call-template name="paragraph"/>
3412
+ <xsl:call-template name="paragraph">
3413
+ <xsl:with-param name="margin" select="$margin"/>
3414
+ </xsl:call-template>
3307
3415
 
3308
3416
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3309
3417
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
@@ -3655,8 +3763,7 @@
3655
3763
  </xsl:call-template>
3656
3764
  </xsl:if>
3657
3765
  </xsl:template><xsl:template match="text()" mode="td_text">
3658
- <xsl:variable name="zero-space">​</xsl:variable>
3659
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3766
+ <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
3660
3767
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
3661
3768
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
3662
3769
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
@@ -4698,20 +4805,44 @@
4698
4805
  <fo:inline text-decoration="underline">
4699
4806
  <xsl:apply-templates/>
4700
4807
  </fo:inline>
4701
- </xsl:template><xsl:template match="*[local-name()='add']">
4808
+ </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add">
4702
4809
  <xsl:param name="skip">true</xsl:param>
4810
+ <xsl:param name="block">false</xsl:param>
4811
+ <xsl:param name="type"/>
4812
+ <xsl:param name="text-align"/>
4703
4813
  <xsl:choose>
4704
4814
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4705
4815
  <xsl:choose>
4706
- <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab'])) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4816
+ <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4707
4817
  <xsl:otherwise>
4708
- <fo:inline>
4818
+ <xsl:variable name="tag">
4709
4819
  <xsl:call-template name="insertTag">
4710
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
4820
+ <xsl:with-param name="type">
4821
+ <xsl:choose>
4822
+ <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4823
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4824
+ </xsl:choose>
4825
+ </xsl:with-param>
4711
4826
  <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4712
4827
  <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4713
4828
  </xsl:call-template>
4714
- </fo:inline>
4829
+ </xsl:variable>
4830
+ <xsl:choose>
4831
+ <xsl:when test="$block = 'false'">
4832
+ <fo:inline>
4833
+ <xsl:copy-of select="$tag"/>
4834
+ </fo:inline>
4835
+ </xsl:when>
4836
+ <xsl:otherwise>
4837
+ <fo:block> <!-- for around figures -->
4838
+ <xsl:if test="$text-align != ''">
4839
+ <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
4840
+ </xsl:if>
4841
+ <xsl:copy-of select="$tag"/>
4842
+ </fo:block>
4843
+ </xsl:otherwise>
4844
+ </xsl:choose>
4845
+
4715
4846
  </xsl:otherwise>
4716
4847
  </xsl:choose>
4717
4848
  </xsl:when>
@@ -5070,17 +5201,21 @@
5070
5201
  </xsl:apply-templates>
5071
5202
  </xsl:template><xsl:template name="getLang">
5072
5203
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5073
- <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5074
5204
  <xsl:variable name="language">
5075
5205
  <xsl:choose>
5076
5206
  <xsl:when test="$language_current != ''">
5077
5207
  <xsl:value-of select="$language_current"/>
5078
5208
  </xsl:when>
5079
- <xsl:when test="$language_current_2 != ''">
5080
- <xsl:value-of select="$language_current_2"/>
5081
- </xsl:when>
5082
5209
  <xsl:otherwise>
5083
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
5210
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5211
+ <xsl:choose>
5212
+ <xsl:when test="$language_current_2 != ''">
5213
+ <xsl:value-of select="$language_current_2"/>
5214
+ </xsl:when>
5215
+ <xsl:otherwise>
5216
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
5217
+ </xsl:otherwise>
5218
+ </xsl:choose>
5084
5219
  </xsl:otherwise>
5085
5220
  </xsl:choose>
5086
5221
  </xsl:variable>
@@ -5297,8 +5432,8 @@
5297
5432
 
5298
5433
  </xsl:if>
5299
5434
  <fo:block-container margin-left="0mm">
5300
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
5301
- <xsl:apply-templates/>
5435
+ <fo:block id="{@id}">
5436
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
5302
5437
  </fo:block>
5303
5438
  </fo:block-container>
5304
5439
  </fo:block-container>
@@ -5310,10 +5445,43 @@
5310
5445
  <fo:inline>
5311
5446
  <xsl:apply-templates/>
5312
5447
  </fo:inline>
5313
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="formula_number"> <!-- show by demand -->
5448
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
5314
5449
  <xsl:if test="normalize-space() != ''">
5315
5450
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
5316
5451
  </xsl:if>
5452
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']">
5453
+ <fo:block xsl:use-attribute-sets="formula-style">
5454
+
5455
+
5456
+
5457
+ <fo:table table-layout="fixed" width="100%">
5458
+ <fo:table-column column-width="95%"/>
5459
+ <fo:table-column column-width="5%"/>
5460
+ <fo:table-body>
5461
+ <fo:table-row>
5462
+ <fo:table-cell display-align="center">
5463
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5464
+
5465
+
5466
+
5467
+ <xsl:apply-templates/>
5468
+ </fo:block>
5469
+ </fo:table-cell>
5470
+ <fo:table-cell display-align="center">
5471
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
5472
+ <xsl:apply-templates select="../*[local-name() = 'name']"/>
5473
+ </fo:block>
5474
+ </fo:table-cell>
5475
+ </fo:table-row>
5476
+ </fo:table-body>
5477
+ </fo:table>
5478
+ </fo:block>
5479
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']">
5480
+ <fo:block xsl:use-attribute-sets="formula-style">
5481
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5482
+ <xsl:apply-templates/>
5483
+ </fo:block>
5484
+ </fo:block>
5317
5485
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
5318
5486
 
5319
5487
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
@@ -6267,12 +6435,140 @@
6267
6435
  </fo:block-container>
6268
6436
  </fo:block-container>
6269
6437
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
6270
- <xsl:variable name="text">
6438
+ <xsl:choose>
6439
+ <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6440
+ <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6441
+ <xsl:choose>
6442
+ <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
6443
+ <xsl:apply-templates select="xalan:nodeset($syntax)" mode="syntax_highlight"/> <!-- process span tags -->
6444
+ </xsl:when>
6445
+ <xsl:otherwise> <!-- if case of non-succesfull syntax highlight (for instance, unknown lang), process without highlighting -->
6446
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6447
+ </xsl:otherwise>
6448
+ </xsl:choose>
6449
+ </xsl:when>
6450
+ <xsl:otherwise>
6451
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6452
+ </xsl:otherwise>
6453
+ </xsl:choose>
6454
+
6455
+ </xsl:template><xsl:template name="add_spaces_to_sourcecode">
6456
+ <xsl:variable name="text_step1">
6271
6457
  <xsl:call-template name="add-zero-spaces-equal"/>
6272
6458
  </xsl:variable>
6273
- <xsl:call-template name="add-zero-spaces-java">
6274
- <xsl:with-param name="text" select="$text"/>
6275
- </xsl:call-template>
6459
+ <xsl:variable name="text_step2">
6460
+ <xsl:call-template name="add-zero-spaces-java">
6461
+ <xsl:with-param name="text" select="$text_step1"/>
6462
+ </xsl:call-template>
6463
+ </xsl:variable>
6464
+ <xsl:value-of select="$text_step2"/>
6465
+ </xsl:template><xsl:template match="*" mode="syntax_highlight">
6466
+ <xsl:apply-templates mode="syntax_highlight"/>
6467
+ </xsl:template><xsl:variable name="syntax_highlight_styles_">
6468
+ <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/>
6469
+ <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/>
6470
+ <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/>
6471
+ <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/>
6472
+ <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/>
6473
+ <style class="hljs-char_and_escape_" xsl:use-attribute-sets="hljs-char_and_escape_"/>
6474
+ <style class="hljs-code" xsl:use-attribute-sets="hljs-code"/>
6475
+ <style class="hljs-comment" xsl:use-attribute-sets="hljs-comment"/>
6476
+ <style class="hljs-deletion" xsl:use-attribute-sets="hljs-deletion"/>
6477
+ <style class="hljs-doctag" xsl:use-attribute-sets="hljs-doctag"/>
6478
+ <style class="hljs-emphasis" xsl:use-attribute-sets="hljs-emphasis"/>
6479
+ <style class="hljs-formula" xsl:use-attribute-sets="hljs-formula"/>
6480
+ <style class="hljs-keyword" xsl:use-attribute-sets="hljs-keyword"/>
6481
+ <style class="hljs-link" xsl:use-attribute-sets="hljs-link"/>
6482
+ <style class="hljs-literal" xsl:use-attribute-sets="hljs-literal"/>
6483
+ <style class="hljs-meta" xsl:use-attribute-sets="hljs-meta"/>
6484
+ <style class="hljs-meta_hljs-string" xsl:use-attribute-sets="hljs-meta_hljs-string"/>
6485
+ <style class="hljs-meta_hljs-keyword" xsl:use-attribute-sets="hljs-meta_hljs-keyword"/>
6486
+ <style class="hljs-name" xsl:use-attribute-sets="hljs-name"/>
6487
+ <style class="hljs-number" xsl:use-attribute-sets="hljs-number"/>
6488
+ <style class="hljs-operator" xsl:use-attribute-sets="hljs-operator"/>
6489
+ <style class="hljs-params" xsl:use-attribute-sets="hljs-params"/>
6490
+ <style class="hljs-property" xsl:use-attribute-sets="hljs-property"/>
6491
+ <style class="hljs-punctuation" xsl:use-attribute-sets="hljs-punctuation"/>
6492
+ <style class="hljs-quote" xsl:use-attribute-sets="hljs-quote"/>
6493
+ <style class="hljs-regexp" xsl:use-attribute-sets="hljs-regexp"/>
6494
+ <style class="hljs-section" xsl:use-attribute-sets="hljs-section"/>
6495
+ <style class="hljs-selector-attr" xsl:use-attribute-sets="hljs-selector-attr"/>
6496
+ <style class="hljs-selector-class" xsl:use-attribute-sets="hljs-selector-class"/>
6497
+ <style class="hljs-selector-id" xsl:use-attribute-sets="hljs-selector-id"/>
6498
+ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/>
6499
+ <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/>
6500
+ <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/>
6501
+ <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/>
6502
+ <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/>
6503
+ <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/>
6504
+ <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/>
6505
+ <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> -->
6506
+ <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> -->
6507
+ <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/>
6508
+ <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/>
6509
+ <style class="hljs-title" xsl:use-attribute-sets="hljs-title"/>
6510
+ <style class="hljs-title_and_class_" xsl:use-attribute-sets="hljs-title_and_class_"/>
6511
+ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/>
6512
+ <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/>
6513
+ <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/>
6514
+ <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/>
6515
+ <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/>
6516
+ </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2">
6517
+ <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> -->
6518
+ <fo:inline>
6519
+ <xsl:variable name="classes_">
6520
+ <xsl:call-template name="split">
6521
+ <xsl:with-param name="pText" select="@class"/>
6522
+ <xsl:with-param name="sep" select="' '"/>
6523
+ </xsl:call-template>
6524
+ <!-- a few classes together (_and_ suffix) -->
6525
+ <xsl:if test="contains(@class, 'hljs-char') and contains(@class, 'escape_')">
6526
+ <item>hljs-char_and_escape_</item>
6527
+ </xsl:if>
6528
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_')">
6529
+ <item>hljs-title_and_class_</item>
6530
+ </xsl:if>
6531
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_') and contains(@class, 'inherited__')">
6532
+ <item>hljs-title_and_class__and_inherited__</item>
6533
+ </xsl:if>
6534
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'function_')">
6535
+ <item>hljs-title_and_function_</item>
6536
+ </xsl:if>
6537
+ <xsl:if test="contains(@class, 'hljs-variable') and contains(@class, 'language_')">
6538
+ <item>hljs-variable_and_language_</item>
6539
+ </xsl:if>
6540
+ <!-- with parent classes (_ suffix) -->
6541
+ <xsl:if test="contains(@class, 'hljs-keyword') and contains(ancestor::*/@class, 'hljs-meta')">
6542
+ <item>hljs-meta_hljs-keyword</item>
6543
+ </xsl:if>
6544
+ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')">
6545
+ <item>hljs-meta_hljs-string</item>
6546
+ </xsl:if>
6547
+ </xsl:variable>
6548
+ <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
6549
+
6550
+ <xsl:for-each select="$classes/item">
6551
+ <xsl:variable name="class_name" select="."/>
6552
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6553
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6554
+ </xsl:for-each>
6555
+ </xsl:for-each>
6556
+
6557
+ <!-- <xsl:variable name="class_name">
6558
+ <xsl:choose>
6559
+ <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when>
6560
+ <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when>
6561
+ <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when>
6562
+ <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
6563
+ </xsl:choose>
6564
+ </xsl:variable>
6565
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6566
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6567
+ </xsl:for-each> -->
6568
+
6569
+ <xsl:apply-templates mode="syntax_highlight"/></fo:inline>
6570
+ </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2">
6571
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6276
6572
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
6277
6573
  <xsl:if test="normalize-space() != ''">
6278
6574
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
@@ -6643,11 +6939,14 @@
6643
6939
 
6644
6940
 
6645
6941
  <fo:block-container margin-left="0mm">
6646
-
6647
- <fo:block xsl:use-attribute-sets="quote-style">
6942
+ <fo:block-container xsl:use-attribute-sets="quote-style">
6648
6943
 
6649
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6650
- </fo:block>
6944
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6945
+ <fo:block role="BlockQuote">
6946
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6947
+ </fo:block>
6948
+ </fo:block-container>
6949
+ </fo:block-container>
6651
6950
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
6652
6951
  <fo:block xsl:use-attribute-sets="quote-source-style">
6653
6952
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
@@ -6795,6 +7094,31 @@
6795
7094
  <xsl:with-param name="count" select="$count - 1"/>
6796
7095
  </xsl:call-template>
6797
7096
  </xsl:if>
7097
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']">
7098
+ <xsl:variable name="level">
7099
+ <xsl:call-template name="getLevel"/>
7100
+ </xsl:variable>
7101
+ <xsl:variable name="font-size">
7102
+ inherit
7103
+ </xsl:variable>
7104
+ <xsl:variable name="levelTerm">
7105
+ <xsl:call-template name="getLevelTermName"/>
7106
+ </xsl:variable>
7107
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
7108
+
7109
+
7110
+
7111
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
7112
+ <fo:block xsl:use-attribute-sets="term-name-style">
7113
+ <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
7114
+ </fo:block>
7115
+ </xsl:if>
7116
+
7117
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
7118
+ <xsl:call-template name="setStyle_preferred"/>
7119
+ <xsl:apply-templates/>
7120
+ </fo:block>
7121
+ </fo:block>
6798
7122
  </xsl:template><xsl:template match="*[local-name() = 'domain']">
6799
7123
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
6800
7124
  <xsl:text> </xsl:text>
@@ -6889,22 +7213,10 @@
6889
7213
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6890
7214
  </xsl:template><xsl:variable name="ul_labels_">
6891
7215
 
6892
-
6893
-
6894
-
6895
-
6896
-
6897
-
6898
-
6899
-
6900
-
6901
-
6902
-
6903
-
6904
-
6905
-
6906
-
6907
-
7216
+ <label level="1">–</label>
7217
+ <label level="2">•</label>
7218
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
7219
+
6908
7220
  </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
6909
7221
  <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6910
7222
  <xsl:variable name="list_level">
@@ -6930,6 +7242,91 @@
6930
7242
  </xsl:template><xsl:template match="label" mode="ul_labels">
6931
7243
  <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
6932
7244
  <xsl:value-of select="."/>
7245
+ </xsl:template><xsl:template name="getListItemFormat">
7246
+ <!-- Example: for BSI <?list-type loweralpha?> -->
7247
+ <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/>
7248
+ <xsl:choose>
7249
+ <xsl:when test="local-name(..) = 'ul'">
7250
+ <xsl:choose>
7251
+ <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
7252
+ <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
7253
+ </xsl:choose>
7254
+ </xsl:when>
7255
+ <xsl:otherwise> <!-- for ordered lists 'ol' -->
7256
+
7257
+ <!-- Example: for BSI <?list-start 2?> -->
7258
+ <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/>
7259
+
7260
+ <xsl:variable name="start_value">
7261
+ <xsl:choose>
7262
+ <xsl:when test="normalize-space($processing_instruction_start) != ''">
7263
+ <xsl:value-of select="number($processing_instruction_start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
7264
+ </xsl:when>
7265
+ <xsl:when test="normalize-space(../@start) != ''">
7266
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
7267
+ </xsl:when>
7268
+ <xsl:otherwise>0</xsl:otherwise>
7269
+ </xsl:choose>
7270
+ </xsl:variable>
7271
+
7272
+ <xsl:variable name="curr_value"><xsl:number/></xsl:variable>
7273
+
7274
+ <xsl:variable name="type">
7275
+ <xsl:choose>
7276
+ <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when>
7277
+ <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when>
7278
+
7279
+ <xsl:otherwise> <!-- if no @type or @class = 'steps' -->
7280
+
7281
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
7282
+ <xsl:variable name="list_level">
7283
+ <xsl:choose>
7284
+ <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when>
7285
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise>
7286
+ </xsl:choose>
7287
+ </xsl:variable>
7288
+
7289
+ <xsl:choose>
7290
+ <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 -->
7291
+ <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 -->
7292
+ <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 -->
7293
+ <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'-->
7294
+ <xsl:when test="$list_level mod 2 = 0">arabic</xsl:when> <!-- level 2 -->
7295
+ <xsl:otherwise> <!-- level 1 -->
7296
+ <xsl:choose>
7297
+ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when>
7298
+ <xsl:otherwise>alphabet</xsl:otherwise>
7299
+ </xsl:choose>
7300
+ </xsl:otherwise>
7301
+ </xsl:choose>
7302
+
7303
+ </xsl:otherwise>
7304
+ </xsl:choose>
7305
+ </xsl:variable>
7306
+
7307
+ <xsl:variable name="format">
7308
+ <xsl:choose>
7309
+ <xsl:when test="$type = 'arabic'">
7310
+ 1)
7311
+ </xsl:when>
7312
+ <xsl:when test="$type = 'alphabet'">
7313
+ a)
7314
+ </xsl:when>
7315
+ <xsl:when test="$type = 'alphabet_upper'">
7316
+ A.
7317
+ </xsl:when>
7318
+ <xsl:when test="$type = 'roman'">
7319
+ i)
7320
+ </xsl:when>
7321
+ <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
7322
+ <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
7323
+ </xsl:choose>
7324
+ </xsl:variable>
7325
+
7326
+ <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/>
7327
+
7328
+ </xsl:otherwise>
7329
+ </xsl:choose>
6933
7330
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6934
7331
  <xsl:choose>
6935
7332
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -6945,18 +7342,66 @@
6945
7342
 
6946
7343
  <fo:block-container margin-left="0mm">
6947
7344
  <fo:block>
6948
- <xsl:apply-templates select="." mode="ul_ol"/>
7345
+ <xsl:apply-templates select="." mode="list"/>
6949
7346
  </fo:block>
6950
7347
  </fo:block-container>
6951
7348
  </fo:block-container>
6952
7349
  </xsl:when>
6953
7350
  <xsl:otherwise>
6954
7351
  <fo:block>
6955
- <xsl:apply-templates select="." mode="ul_ol"/>
7352
+ <xsl:apply-templates select="." mode="list"/>
6956
7353
  </fo:block>
6957
7354
  </xsl:otherwise>
6958
7355
  </xsl:choose>
6959
- </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
7356
+ </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7357
+ <fo:list-block xsl:use-attribute-sets="list-style">
7358
+
7359
+
7360
+
7361
+
7362
+
7363
+
7364
+
7365
+
7366
+
7367
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
7368
+ </fo:list-block>
7369
+ <!-- <xsl:for-each select="./iho:note">
7370
+ <xsl:call-template name="note"/>
7371
+ </xsl:for-each> -->
7372
+ <xsl:apply-templates select="./*[local-name() = 'note']"/>
7373
+ </xsl:template><xsl:template match="*[local-name()='li']">
7374
+ <fo:list-item xsl:use-attribute-sets="list-item-style">
7375
+ <xsl:copy-of select="@id"/>
7376
+
7377
+
7378
+
7379
+ <fo:list-item-label end-indent="label-end()">
7380
+ <fo:block xsl:use-attribute-sets="list-item-label-style">
7381
+
7382
+
7383
+
7384
+ <xsl:call-template name="getListItemFormat"/>
7385
+ </fo:block>
7386
+ </fo:list-item-label>
7387
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
7388
+ <fo:block>
7389
+
7390
+
7391
+
7392
+
7393
+
7394
+ <xsl:apply-templates/>
7395
+
7396
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
7397
+
7398
+ <xsl:for-each select="./bsi:note">
7399
+ <xsl:call-template name="note"/>
7400
+ </xsl:for-each> -->
7401
+ </fo:block>
7402
+ </fo:list-item-body>
7403
+ </fo:list-item>
7404
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn">
6960
7405
  <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
6961
7406
  <bookmark><xsl:value-of select="@id"/></bookmark>
6962
7407
  </xsl:for-each>
@@ -6978,7 +7423,7 @@
6978
7423
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
6979
7424
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
6980
7425
  <xsl:if test="@to">
6981
- <xsl:value-of select="$dash"/>
7426
+ <xsl:value-of select="$en_dash"/>
6982
7427
  <xsl:copy>
6983
7428
  <xsl:copy-of select="@*"/>
6984
7429
  <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
@@ -7003,7 +7448,7 @@
7003
7448
  <xsl:param name="target"/>
7004
7449
  <!-- <node></node> -->
7005
7450
  <xsl:choose>
7006
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
7451
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $en_dash) and $remove = 'true'">
7007
7452
  <!-- skip text (i.e. remove it) and process next element -->
7008
7453
  <!-- [removed_<xsl:value-of select="."/>] -->
7009
7454
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
@@ -7087,12 +7532,22 @@
7087
7532
  </xsl:variable>
7088
7533
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
7089
7534
  <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7535
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
7536
+ <fo:block xsl:use-attribute-sets="indexsect-title-style">
7537
+ <!-- Index -->
7538
+ <xsl:apply-templates/>
7539
+ </fo:block>
7540
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4">
7541
+ <!-- Letter A, B, C, ... -->
7542
+ <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
7543
+ <xsl:apply-templates/>
7544
+ </fo:block>
7090
7545
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
7091
7546
  <xsl:apply-templates/>
7092
7547
  <fo:block>
7093
- <xsl:if test="following-sibling::*[local-name() = 'clause']">
7094
- <fo:block> </fo:block>
7095
- </xsl:if>
7548
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
7549
+ <fo:block> </fo:block>
7550
+ </xsl:if>
7096
7551
  </fo:block>
7097
7552
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
7098
7553
  <xsl:apply-templates/>
@@ -7102,6 +7557,9 @@
7102
7557
 
7103
7558
  <xsl:apply-templates/>
7104
7559
  </fo:block>
7560
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()">
7561
+ <!-- to split by '_' and other chars -->
7562
+ <xsl:call-template name="add-zero-spaces-java"/>
7105
7563
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
7106
7564
  <fo:inline id="{@id}" font-size="1pt"/>
7107
7565
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
@@ -7458,7 +7916,7 @@
7458
7916
  </fo:table-body>
7459
7917
  </fo:table>
7460
7918
  </fo:block>
7461
- </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7919
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2">
7462
7920
  <fo:table-row min-height="5mm">
7463
7921
  <xsl:apply-templates/>
7464
7922
  </fo:table-row>
@@ -7691,9 +8149,6 @@
7691
8149
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
7692
8150
  </xsl:choose>
7693
8151
  </xsl:template><xsl:template name="addPDFUAmeta">
7694
- <xsl:variable name="lang">
7695
- <xsl:call-template name="getLang"/>
7696
- </xsl:variable>
7697
8152
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
7698
8153
  <pdf:dictionary type="normal" key="ViewerPreferences">
7699
8154
  <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
@@ -7921,10 +8376,12 @@
7921
8376
  <xsl:param name="key"/>
7922
8377
  <xsl:param name="formatted">false</xsl:param>
7923
8378
  <xsl:param name="lang"/>
8379
+ <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
7924
8380
 
7925
8381
  <xsl:variable name="curr_lang">
7926
8382
  <xsl:choose>
7927
8383
  <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
8384
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7928
8385
  <xsl:otherwise>
7929
8386
  <xsl:call-template name="getLang"/>
7930
8387
  </xsl:otherwise>
@@ -7959,6 +8416,7 @@
7959
8416
  </xsl:otherwise>
7960
8417
  </xsl:choose>
7961
8418
  </xsl:when>
8419
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7962
8420
  <xsl:otherwise>
7963
8421
  <xsl:variable name="key_">
7964
8422
  <xsl:call-template name="capitalize">