metanorma-iso 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,6 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
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
-
10
5
 
11
6
 
12
7
  <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
@@ -17,11 +12,6 @@
17
12
 
18
13
  <xsl:variable name="debug">false</xsl:variable>
19
14
 
20
- <xsl:variable name="marginLeftRight1" select="25"/>
21
- <xsl:variable name="marginLeftRight2" select="12.5"/>
22
- <xsl:variable name="marginTop" select="27.4"/>
23
- <xsl:variable name="marginBottom" select="13"/>
24
-
25
15
  <xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
26
16
 
27
17
  <xsl:variable name="all_rights_reserved">
@@ -168,10 +158,6 @@
168
158
  </contents>
169
159
  </xsl:variable>
170
160
 
171
- <xsl:variable name="lang">
172
- <xsl:call-template name="getLang"/>
173
- </xsl:variable>
174
-
175
161
  <xsl:template match="/">
176
162
  <xsl:call-template name="namespaceCheck"/>
177
163
  <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}"> <!-- -->
@@ -1405,36 +1391,7 @@
1405
1391
 
1406
1392
  <xsl:template match="iso:p | iso:termsource | iso:termnote" mode="contents"/>
1407
1393
 
1408
- <xsl:template name="getListItemFormat">
1409
- <xsl:choose>
1410
- <xsl:when test="local-name(..) = 'ul'">
1411
- <xsl:call-template name="setULLabel"/>
1412
- </xsl:when>
1413
- <xsl:otherwise> <!-- for ordered lists -->
1414
- <xsl:choose>
1415
- <xsl:when test="../@type = 'arabic'">
1416
- <xsl:number format="1." lang="en"/>
1417
- </xsl:when>
1418
- <xsl:when test="../@type = 'alphabet'">
1419
- <xsl:number format="a)" lang="en"/>
1420
- </xsl:when>
1421
- <xsl:when test="../@type = 'alphabet_upper'">
1422
- <xsl:number format="A." lang="en"/>
1423
- </xsl:when>
1424
- <xsl:when test="../@type = 'roman'">
1425
- <xsl:number format="i)"/>
1426
- </xsl:when>
1427
- <xsl:when test="../@type = 'roman_upper'">
1428
- <xsl:number format="I."/>
1429
- </xsl:when>
1430
- <xsl:otherwise>
1431
- <xsl:number format="a)"/>
1432
- </xsl:otherwise>
1433
- </xsl:choose>
1434
- </xsl:otherwise>
1435
- </xsl:choose>
1436
- </xsl:template>
1437
-
1394
+
1438
1395
 
1439
1396
  <!-- ============================= -->
1440
1397
  <!-- ============================= -->
@@ -1648,11 +1605,11 @@
1648
1605
  <xsl:template match="iso:li//iso:p//text()">
1649
1606
  <xsl:choose>
1650
1607
  <xsl:when test="contains(., '&#9;')">
1651
- <!-- <fo:inline white-space="pre"><xsl:value-of select="translate(., $thinspace, ' ')"/></fo:inline> -->
1608
+ <!-- <fo:inline white-space="pre"><xsl:value-of select="translate(., $thin_space, ' ')"/></fo:inline> -->
1652
1609
  <fo:inline white-space="pre"><xsl:value-of select="."/></fo:inline>
1653
1610
  </xsl:when>
1654
1611
  <xsl:otherwise>
1655
- <!-- <xsl:value-of select="translate(., $thinspace, ' ')"/> -->
1612
+ <!-- <xsl:value-of select="translate(., $thin_space, ' ')"/> -->
1656
1613
  <xsl:value-of select="."/>
1657
1614
  </xsl:otherwise>
1658
1615
  </xsl:choose>
@@ -1665,76 +1622,6 @@
1665
1622
  <xsl:apply-templates/>
1666
1623
  </xsl:template>
1667
1624
 
1668
-
1669
- <xsl:template match="iso:ul | iso:ol" mode="ul_ol">
1670
- <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
1671
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
1672
- </fo:list-block>
1673
- <xsl:for-each select="./iso:note">
1674
- <xsl:call-template name="note"/>
1675
- </xsl:for-each>
1676
- </xsl:template>
1677
-
1678
- <xsl:template match="iso:li">
1679
- <fo:list-item id="{@id}">
1680
- <fo:list-item-label end-indent="label-end()">
1681
- <fo:block>
1682
- <xsl:call-template name="getListItemFormat"/>
1683
- </fo:block>
1684
- </fo:list-item-label>
1685
- <fo:list-item-body start-indent="body-start()">
1686
- <fo:block>
1687
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
1688
-
1689
- <xsl:for-each select="./iso:note">
1690
- <xsl:call-template name="note"/>
1691
- </xsl:for-each>
1692
- </fo:block>
1693
- </fo:list-item-body>
1694
- </fo:list-item>
1695
- </xsl:template>
1696
-
1697
-
1698
- <xsl:template match="iso:preferred">
1699
- <xsl:variable name="levelTerm">
1700
- <xsl:call-template name="getLevelTermName"/>
1701
- </xsl:variable>
1702
- <fo:block line-height="1.1" role="H{$levelTerm}">
1703
- <fo:block font-weight="bold" keep-with-next="always">
1704
- <xsl:apply-templates select="ancestor::iso:term[1]/iso:name"/>
1705
- </fo:block>
1706
- <fo:block font-weight="bold" keep-with-next="always">
1707
- <xsl:call-template name="setStyle_preferred"/>
1708
- <xsl:apply-templates/>
1709
- </fo:block>
1710
- </fo:block>
1711
- </xsl:template>
1712
-
1713
-
1714
-
1715
- <xsl:template match="iso:formula/iso:stem">
1716
- <fo:block margin-top="6pt" margin-bottom="12pt">
1717
- <fo:table table-layout="fixed" width="100%">
1718
- <fo:table-column column-width="95%"/>
1719
- <fo:table-column column-width="5%"/>
1720
- <fo:table-body>
1721
- <fo:table-row>
1722
- <fo:table-cell display-align="center">
1723
- <fo:block text-align="left" margin-left="5mm">
1724
- <xsl:apply-templates/>
1725
- </fo:block>
1726
- </fo:table-cell>
1727
- <fo:table-cell display-align="center">
1728
- <fo:block text-align="right">
1729
- <xsl:apply-templates select="../iso:name" mode="formula_number"/>
1730
- </fo:block>
1731
- </fo:table-cell>
1732
- </fo:table-row>
1733
- </fo:table-body>
1734
- </fo:table>
1735
- </fo:block>
1736
- </xsl:template>
1737
-
1738
1625
 
1739
1626
  <!-- For express listings PDF attachments -->
1740
1627
  <xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
@@ -1783,26 +1670,6 @@
1783
1670
  </fo:page-sequence>
1784
1671
  </xsl:template>
1785
1672
 
1786
- <!-- <xsl:template match="iso:clause[@type = 'index']/iso:title" priority="4"> -->
1787
- <xsl:template match="iso:indexsect/iso:title" priority="4">
1788
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt" role="H1">
1789
- <!-- Index -->
1790
- <xsl:apply-templates/>
1791
- </fo:block>
1792
- </xsl:template>
1793
-
1794
- <!-- <xsl:template match="iso:clause[@type = 'index']/iso:clause/iso:title" priority="4"> -->
1795
- <xsl:template match="iso:indexsect/iso:clause/iso:title" priority="4">
1796
- <!-- Letter A, B, C, ... -->
1797
- <fo:block font-size="10pt" font-weight="bold" margin-bottom="3pt" keep-with-next="always">
1798
- <xsl:apply-templates/>
1799
- </fo:block>
1800
- </xsl:template>
1801
-
1802
- <xsl:template match="iso:indexsect//iso:li/text()">
1803
- <!-- to split by '_' and other chars -->
1804
- <xsl:call-template name="add-zero-spaces-java"/>
1805
- </xsl:template>
1806
1673
 
1807
1674
  <xsl:template match="iso:xref" priority="2">
1808
1675
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
@@ -1826,9 +1693,9 @@
1826
1693
  <!-- End of Index processing -->
1827
1694
  <!-- =================== -->
1828
1695
 
1829
- <!-- <xsl:variable name="thinspace" select="'&#x2009;'"/>
1830
- <xsl:template match="text()[contains(., $thinspace)]">
1831
- <xsl:value-of select="translate(., $thinspace, ' ')"/>
1696
+ <!--
1697
+ <xsl:template match="text()[contains(., $thin_space)]">
1698
+ <xsl:value-of select="translate(., $thin_space, ' ')"/>
1832
1699
  </xsl:template> -->
1833
1700
 
1834
1701
 
@@ -1983,11 +1850,21 @@
1983
1850
  </xsl:template>
1984
1851
 
1985
1852
 
1986
- <xsl:variable name="pageWidth_">
1853
+ <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">
1854
+ <xsl:call-template name="getLang"/>
1855
+ </xsl:variable><xsl:variable name="pageWidth_">
1987
1856
  210
1988
1857
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1989
1858
  297
1990
- </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
1859
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
1860
+ 25
1861
+ </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
1862
+ 12.5
1863
+ </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_">
1864
+ 27.4
1865
+ </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
1866
+ 13
1867
+ </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
1991
1868
 
1992
1869
  <title-edition lang="en">
1993
1870
 
@@ -2051,7 +1928,7 @@
2051
1928
  </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
2052
1929
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2053
1930
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2054
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1931
+ </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">
2055
1932
  <xsl:param name="name"/>
2056
1933
  <xsl:param name="lang"/>
2057
1934
  <xsl:variable name="lang_">
@@ -2074,7 +1951,7 @@
2074
1951
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2075
1952
  </xsl:otherwise>
2076
1953
  </xsl:choose>
2077
- </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">
1954
+ </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">
2078
1955
 
2079
1956
 
2080
1957
 
@@ -2245,11 +2122,12 @@
2245
2122
 
2246
2123
 
2247
2124
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
2248
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2249
2125
 
2250
2126
 
2251
2127
 
2252
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
2128
+
2129
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2130
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2253
2131
 
2254
2132
 
2255
2133
 
@@ -2648,12 +2526,11 @@
2648
2526
 
2649
2527
 
2650
2528
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2651
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
2529
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
2530
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
2652
2531
 
2653
2532
 
2654
2533
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2655
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
2656
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
2657
2534
 
2658
2535
 
2659
2536
 
@@ -2661,10 +2538,8 @@
2661
2538
 
2662
2539
 
2663
2540
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2541
+ <xsl:attribute name="text-align">right</xsl:attribute>
2664
2542
 
2665
-
2666
- <xsl:attribute name="text-align">right</xsl:attribute>
2667
-
2668
2543
 
2669
2544
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
2670
2545
 
@@ -2688,6 +2563,9 @@
2688
2563
 
2689
2564
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2690
2565
 
2566
+ </xsl:attribute-set><xsl:attribute-set name="term-name-style">
2567
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2568
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2691
2569
  </xsl:attribute-set><xsl:attribute-set name="figure-style">
2692
2570
 
2693
2571
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -2718,6 +2596,36 @@
2718
2596
 
2719
2597
 
2720
2598
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
2599
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2600
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2601
+
2602
+
2603
+
2604
+
2605
+
2606
+
2607
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style">
2608
+ <xsl:attribute name="text-align">center</xsl:attribute>
2609
+
2610
+
2611
+
2612
+
2613
+
2614
+ <xsl:attribute name="text-align">left</xsl:attribute>
2615
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
2616
+
2617
+
2618
+
2619
+
2620
+
2621
+
2622
+
2623
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
2624
+ <xsl:attribute name="text-align">right</xsl:attribute>
2625
+
2626
+
2627
+
2628
+
2721
2629
 
2722
2630
  </xsl:attribute-set><xsl:attribute-set name="image-style">
2723
2631
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2753,6 +2661,20 @@
2753
2661
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2754
2662
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2755
2663
 
2664
+ </xsl:attribute-set><xsl:attribute-set name="preferred-block-style">
2665
+
2666
+
2667
+
2668
+
2669
+ <xsl:attribute name="line-height">1.1</xsl:attribute>
2670
+
2671
+
2672
+
2673
+ </xsl:attribute-set><xsl:attribute-set name="preferred-term-style">
2674
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2675
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2676
+
2677
+
2756
2678
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
2757
2679
 
2758
2680
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -2790,6 +2712,36 @@
2790
2712
 
2791
2713
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2792
2714
 
2715
+
2716
+
2717
+
2718
+
2719
+
2720
+
2721
+ <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
2722
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
2723
+
2724
+
2725
+
2726
+
2727
+
2728
+
2729
+
2730
+
2731
+
2732
+
2733
+
2734
+ </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2735
+
2736
+
2737
+ </xsl:attribute-set><xsl:attribute-set name="list-item-label-style">
2738
+
2739
+
2740
+
2741
+ </xsl:attribute-set><xsl:attribute-set name="list-item-body-style">
2742
+
2743
+
2744
+
2793
2745
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2794
2746
  <xsl:attribute name="line-height">135%</xsl:attribute>
2795
2747
  </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
@@ -3058,6 +3010,119 @@
3058
3010
 
3059
3011
 
3060
3012
 
3013
+ </xsl:attribute-set><xsl:attribute-set name="hljs-doctag">
3014
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3015
+ </xsl:attribute-set><xsl:attribute-set name="hljs-keyword">
3016
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3017
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword">
3018
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3019
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag">
3020
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3021
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable">
3022
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3023
+ </xsl:attribute-set><xsl:attribute-set name="hljs-type">
3024
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3025
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_">
3026
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
3027
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title">
3028
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3029
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_">
3030
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3031
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__">
3032
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3033
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_">
3034
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
3035
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attr">
3036
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3037
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attribute">
3038
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3039
+ </xsl:attribute-set><xsl:attribute-set name="hljs-literal">
3040
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3041
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta">
3042
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3043
+ </xsl:attribute-set><xsl:attribute-set name="hljs-number">
3044
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3045
+ </xsl:attribute-set><xsl:attribute-set name="hljs-operator">
3046
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3047
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable">
3048
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3049
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr">
3050
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3051
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class">
3052
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3053
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id">
3054
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3055
+ </xsl:attribute-set><xsl:attribute-set name="hljs-regexp">
3056
+ <xsl:attribute name="color">#032f62</xsl:attribute>
3057
+ </xsl:attribute-set><xsl:attribute-set name="hljs-string">
3058
+ <xsl:attribute name="color">#032f62</xsl:attribute>
3059
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string">
3060
+ <xsl:attribute name="color">#032f62</xsl:attribute>
3061
+ </xsl:attribute-set><xsl:attribute-set name="hljs-built_in">
3062
+ <xsl:attribute name="color">#e36209</xsl:attribute>
3063
+ </xsl:attribute-set><xsl:attribute-set name="hljs-symbol">
3064
+ <xsl:attribute name="color">#e36209</xsl:attribute>
3065
+ </xsl:attribute-set><xsl:attribute-set name="hljs-comment">
3066
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
3067
+ </xsl:attribute-set><xsl:attribute-set name="hljs-code">
3068
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
3069
+ </xsl:attribute-set><xsl:attribute-set name="hljs-formula">
3070
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
3071
+ </xsl:attribute-set><xsl:attribute-set name="hljs-name">
3072
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3073
+ </xsl:attribute-set><xsl:attribute-set name="hljs-quote">
3074
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3075
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag">
3076
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3077
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo">
3078
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3079
+ </xsl:attribute-set><xsl:attribute-set name="hljs-subst">
3080
+ <xsl:attribute name="color">#24292e</xsl:attribute>
3081
+ </xsl:attribute-set><xsl:attribute-set name="hljs-section">
3082
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
3083
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3084
+ </xsl:attribute-set><xsl:attribute-set name="hljs-bullet">
3085
+ <xsl:attribute name="color">#735c0f</xsl:attribute>
3086
+ </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis">
3087
+ <xsl:attribute name="color">#24292e</xsl:attribute>
3088
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3089
+ </xsl:attribute-set><xsl:attribute-set name="hljs-strong">
3090
+ <xsl:attribute name="color">#24292e</xsl:attribute>
3091
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3092
+ </xsl:attribute-set><xsl:attribute-set name="hljs-addition">
3093
+ <xsl:attribute name="color">#22863a</xsl:attribute>
3094
+ <xsl:attribute name="background-color">#f0fff4</xsl:attribute>
3095
+ </xsl:attribute-set><xsl:attribute-set name="hljs-deletion">
3096
+ <xsl:attribute name="color">#b31d28</xsl:attribute>
3097
+ <xsl:attribute name="background-color">#ffeef0</xsl:attribute>
3098
+ </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_">
3099
+ </xsl:attribute-set><xsl:attribute-set name="hljs-link">
3100
+ </xsl:attribute-set><xsl:attribute-set name="hljs-params">
3101
+ </xsl:attribute-set><xsl:attribute-set name="hljs-property">
3102
+ </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation">
3103
+ </xsl:attribute-set><xsl:attribute-set name="hljs-tag">
3104
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style">
3105
+ <xsl:attribute name="role">H1</xsl:attribute>
3106
+
3107
+
3108
+
3109
+
3110
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
3111
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3112
+ <xsl:attribute name="margin-bottom">84pt</xsl:attribute>
3113
+
3114
+
3115
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style">
3116
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3117
+
3118
+
3119
+
3120
+
3121
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
3122
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3123
+ <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
3124
+
3125
+
3061
3126
  </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">
3062
3127
  <xsl:for-each select="/*/*[local-name()='preface']/*">
3063
3128
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -3159,9 +3224,12 @@
3159
3224
 
3160
3225
 
3161
3226
  </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
3227
+ <xsl:param name="margin"/>
3162
3228
 
3163
3229
  <!-- process in the template 'paragraph' -->
3164
- <xsl:call-template name="paragraph"/>
3230
+ <xsl:call-template name="paragraph">
3231
+ <xsl:with-param name="margin" select="$margin"/>
3232
+ </xsl:call-template>
3165
3233
 
3166
3234
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
3167
3235
  <fo:block xsl:use-attribute-sets="feedback-statement-style">
@@ -3173,9 +3241,12 @@
3173
3241
  <xsl:call-template name="title"/>
3174
3242
 
3175
3243
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
3244
+ <xsl:param name="margin"/>
3176
3245
 
3177
3246
  <!-- process in the template 'paragraph' -->
3178
- <xsl:call-template name="paragraph"/>
3247
+ <xsl:call-template name="paragraph">
3248
+ <xsl:with-param name="margin" select="$margin"/>
3249
+ </xsl:call-template>
3179
3250
 
3180
3251
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3181
3252
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
@@ -3521,8 +3592,7 @@
3521
3592
  </xsl:call-template>
3522
3593
  </xsl:if>
3523
3594
  </xsl:template><xsl:template match="text()" mode="td_text">
3524
- <xsl:variable name="zero-space">​</xsl:variable>
3525
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3595
+ <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
3526
3596
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
3527
3597
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
3528
3598
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
@@ -4586,20 +4656,44 @@
4586
4656
  <fo:inline text-decoration="underline">
4587
4657
  <xsl:apply-templates/>
4588
4658
  </fo:inline>
4589
- </xsl:template><xsl:template match="*[local-name()='add']">
4659
+ </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add">
4590
4660
  <xsl:param name="skip">true</xsl:param>
4661
+ <xsl:param name="block">false</xsl:param>
4662
+ <xsl:param name="type"/>
4663
+ <xsl:param name="text-align"/>
4591
4664
  <xsl:choose>
4592
4665
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4593
4666
  <xsl:choose>
4594
- <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>
4667
+ <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>
4595
4668
  <xsl:otherwise>
4596
- <fo:inline>
4669
+ <xsl:variable name="tag">
4597
4670
  <xsl:call-template name="insertTag">
4598
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
4671
+ <xsl:with-param name="type">
4672
+ <xsl:choose>
4673
+ <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4674
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4675
+ </xsl:choose>
4676
+ </xsl:with-param>
4599
4677
  <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4600
4678
  <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4601
4679
  </xsl:call-template>
4602
- </fo:inline>
4680
+ </xsl:variable>
4681
+ <xsl:choose>
4682
+ <xsl:when test="$block = 'false'">
4683
+ <fo:inline>
4684
+ <xsl:copy-of select="$tag"/>
4685
+ </fo:inline>
4686
+ </xsl:when>
4687
+ <xsl:otherwise>
4688
+ <fo:block> <!-- for around figures -->
4689
+ <xsl:if test="$text-align != ''">
4690
+ <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
4691
+ </xsl:if>
4692
+ <xsl:copy-of select="$tag"/>
4693
+ </fo:block>
4694
+ </xsl:otherwise>
4695
+ </xsl:choose>
4696
+
4603
4697
  </xsl:otherwise>
4604
4698
  </xsl:choose>
4605
4699
  </xsl:when>
@@ -4958,17 +5052,21 @@
4958
5052
  </xsl:apply-templates>
4959
5053
  </xsl:template><xsl:template name="getLang">
4960
5054
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4961
- <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4962
5055
  <xsl:variable name="language">
4963
5056
  <xsl:choose>
4964
5057
  <xsl:when test="$language_current != ''">
4965
5058
  <xsl:value-of select="$language_current"/>
4966
5059
  </xsl:when>
4967
- <xsl:when test="$language_current_2 != ''">
4968
- <xsl:value-of select="$language_current_2"/>
4969
- </xsl:when>
4970
5060
  <xsl:otherwise>
4971
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
5061
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5062
+ <xsl:choose>
5063
+ <xsl:when test="$language_current_2 != ''">
5064
+ <xsl:value-of select="$language_current_2"/>
5065
+ </xsl:when>
5066
+ <xsl:otherwise>
5067
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
5068
+ </xsl:otherwise>
5069
+ </xsl:choose>
4972
5070
  </xsl:otherwise>
4973
5071
  </xsl:choose>
4974
5072
  </xsl:variable>
@@ -5192,8 +5290,8 @@
5192
5290
 
5193
5291
  </xsl:if>
5194
5292
  <fo:block-container margin-left="0mm">
5195
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
5196
- <xsl:apply-templates/>
5293
+ <fo:block id="{@id}">
5294
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
5197
5295
  </fo:block>
5198
5296
  </fo:block-container>
5199
5297
  </fo:block-container>
@@ -5205,10 +5303,43 @@
5205
5303
  <fo:inline>
5206
5304
  <xsl:apply-templates/>
5207
5305
  </fo:inline>
5208
- </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 -->
5306
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
5209
5307
  <xsl:if test="normalize-space() != ''">
5210
5308
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
5211
5309
  </xsl:if>
5310
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']">
5311
+ <fo:block xsl:use-attribute-sets="formula-style">
5312
+
5313
+
5314
+
5315
+ <fo:table table-layout="fixed" width="100%">
5316
+ <fo:table-column column-width="95%"/>
5317
+ <fo:table-column column-width="5%"/>
5318
+ <fo:table-body>
5319
+ <fo:table-row>
5320
+ <fo:table-cell display-align="center">
5321
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5322
+
5323
+
5324
+
5325
+ <xsl:apply-templates/>
5326
+ </fo:block>
5327
+ </fo:table-cell>
5328
+ <fo:table-cell display-align="center">
5329
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
5330
+ <xsl:apply-templates select="../*[local-name() = 'name']"/>
5331
+ </fo:block>
5332
+ </fo:table-cell>
5333
+ </fo:table-row>
5334
+ </fo:table-body>
5335
+ </fo:table>
5336
+ </fo:block>
5337
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']">
5338
+ <fo:block xsl:use-attribute-sets="formula-style">
5339
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5340
+ <xsl:apply-templates/>
5341
+ </fo:block>
5342
+ </fo:block>
5212
5343
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
5213
5344
 
5214
5345
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
@@ -6158,12 +6289,140 @@
6158
6289
  </fo:block-container>
6159
6290
  </fo:block-container>
6160
6291
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
6161
- <xsl:variable name="text">
6292
+ <xsl:choose>
6293
+ <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6294
+ <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6295
+ <xsl:choose>
6296
+ <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
6297
+ <xsl:apply-templates select="xalan:nodeset($syntax)" mode="syntax_highlight"/> <!-- process span tags -->
6298
+ </xsl:when>
6299
+ <xsl:otherwise> <!-- if case of non-succesfull syntax highlight (for instance, unknown lang), process without highlighting -->
6300
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6301
+ </xsl:otherwise>
6302
+ </xsl:choose>
6303
+ </xsl:when>
6304
+ <xsl:otherwise>
6305
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6306
+ </xsl:otherwise>
6307
+ </xsl:choose>
6308
+
6309
+ </xsl:template><xsl:template name="add_spaces_to_sourcecode">
6310
+ <xsl:variable name="text_step1">
6162
6311
  <xsl:call-template name="add-zero-spaces-equal"/>
6163
6312
  </xsl:variable>
6164
- <xsl:call-template name="add-zero-spaces-java">
6165
- <xsl:with-param name="text" select="$text"/>
6166
- </xsl:call-template>
6313
+ <xsl:variable name="text_step2">
6314
+ <xsl:call-template name="add-zero-spaces-java">
6315
+ <xsl:with-param name="text" select="$text_step1"/>
6316
+ </xsl:call-template>
6317
+ </xsl:variable>
6318
+ <xsl:value-of select="$text_step2"/>
6319
+ </xsl:template><xsl:template match="*" mode="syntax_highlight">
6320
+ <xsl:apply-templates mode="syntax_highlight"/>
6321
+ </xsl:template><xsl:variable name="syntax_highlight_styles_">
6322
+ <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/>
6323
+ <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/>
6324
+ <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/>
6325
+ <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/>
6326
+ <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/>
6327
+ <style class="hljs-char_and_escape_" xsl:use-attribute-sets="hljs-char_and_escape_"/>
6328
+ <style class="hljs-code" xsl:use-attribute-sets="hljs-code"/>
6329
+ <style class="hljs-comment" xsl:use-attribute-sets="hljs-comment"/>
6330
+ <style class="hljs-deletion" xsl:use-attribute-sets="hljs-deletion"/>
6331
+ <style class="hljs-doctag" xsl:use-attribute-sets="hljs-doctag"/>
6332
+ <style class="hljs-emphasis" xsl:use-attribute-sets="hljs-emphasis"/>
6333
+ <style class="hljs-formula" xsl:use-attribute-sets="hljs-formula"/>
6334
+ <style class="hljs-keyword" xsl:use-attribute-sets="hljs-keyword"/>
6335
+ <style class="hljs-link" xsl:use-attribute-sets="hljs-link"/>
6336
+ <style class="hljs-literal" xsl:use-attribute-sets="hljs-literal"/>
6337
+ <style class="hljs-meta" xsl:use-attribute-sets="hljs-meta"/>
6338
+ <style class="hljs-meta_hljs-string" xsl:use-attribute-sets="hljs-meta_hljs-string"/>
6339
+ <style class="hljs-meta_hljs-keyword" xsl:use-attribute-sets="hljs-meta_hljs-keyword"/>
6340
+ <style class="hljs-name" xsl:use-attribute-sets="hljs-name"/>
6341
+ <style class="hljs-number" xsl:use-attribute-sets="hljs-number"/>
6342
+ <style class="hljs-operator" xsl:use-attribute-sets="hljs-operator"/>
6343
+ <style class="hljs-params" xsl:use-attribute-sets="hljs-params"/>
6344
+ <style class="hljs-property" xsl:use-attribute-sets="hljs-property"/>
6345
+ <style class="hljs-punctuation" xsl:use-attribute-sets="hljs-punctuation"/>
6346
+ <style class="hljs-quote" xsl:use-attribute-sets="hljs-quote"/>
6347
+ <style class="hljs-regexp" xsl:use-attribute-sets="hljs-regexp"/>
6348
+ <style class="hljs-section" xsl:use-attribute-sets="hljs-section"/>
6349
+ <style class="hljs-selector-attr" xsl:use-attribute-sets="hljs-selector-attr"/>
6350
+ <style class="hljs-selector-class" xsl:use-attribute-sets="hljs-selector-class"/>
6351
+ <style class="hljs-selector-id" xsl:use-attribute-sets="hljs-selector-id"/>
6352
+ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/>
6353
+ <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/>
6354
+ <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/>
6355
+ <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/>
6356
+ <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/>
6357
+ <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/>
6358
+ <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/>
6359
+ <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> -->
6360
+ <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> -->
6361
+ <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/>
6362
+ <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/>
6363
+ <style class="hljs-title" xsl:use-attribute-sets="hljs-title"/>
6364
+ <style class="hljs-title_and_class_" xsl:use-attribute-sets="hljs-title_and_class_"/>
6365
+ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/>
6366
+ <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/>
6367
+ <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/>
6368
+ <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/>
6369
+ <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/>
6370
+ </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2">
6371
+ <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> -->
6372
+ <fo:inline>
6373
+ <xsl:variable name="classes_">
6374
+ <xsl:call-template name="split">
6375
+ <xsl:with-param name="pText" select="@class"/>
6376
+ <xsl:with-param name="sep" select="' '"/>
6377
+ </xsl:call-template>
6378
+ <!-- a few classes together (_and_ suffix) -->
6379
+ <xsl:if test="contains(@class, 'hljs-char') and contains(@class, 'escape_')">
6380
+ <item>hljs-char_and_escape_</item>
6381
+ </xsl:if>
6382
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_')">
6383
+ <item>hljs-title_and_class_</item>
6384
+ </xsl:if>
6385
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_') and contains(@class, 'inherited__')">
6386
+ <item>hljs-title_and_class__and_inherited__</item>
6387
+ </xsl:if>
6388
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'function_')">
6389
+ <item>hljs-title_and_function_</item>
6390
+ </xsl:if>
6391
+ <xsl:if test="contains(@class, 'hljs-variable') and contains(@class, 'language_')">
6392
+ <item>hljs-variable_and_language_</item>
6393
+ </xsl:if>
6394
+ <!-- with parent classes (_ suffix) -->
6395
+ <xsl:if test="contains(@class, 'hljs-keyword') and contains(ancestor::*/@class, 'hljs-meta')">
6396
+ <item>hljs-meta_hljs-keyword</item>
6397
+ </xsl:if>
6398
+ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')">
6399
+ <item>hljs-meta_hljs-string</item>
6400
+ </xsl:if>
6401
+ </xsl:variable>
6402
+ <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
6403
+
6404
+ <xsl:for-each select="$classes/item">
6405
+ <xsl:variable name="class_name" select="."/>
6406
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6407
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6408
+ </xsl:for-each>
6409
+ </xsl:for-each>
6410
+
6411
+ <!-- <xsl:variable name="class_name">
6412
+ <xsl:choose>
6413
+ <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when>
6414
+ <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when>
6415
+ <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when>
6416
+ <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
6417
+ </xsl:choose>
6418
+ </xsl:variable>
6419
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6420
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6421
+ </xsl:for-each> -->
6422
+
6423
+ <xsl:apply-templates mode="syntax_highlight"/></fo:inline>
6424
+ </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2">
6425
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6167
6426
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
6168
6427
  <xsl:if test="normalize-space() != ''">
6169
6428
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
@@ -6539,11 +6798,14 @@
6539
6798
 
6540
6799
 
6541
6800
  <fo:block-container margin-left="0mm">
6542
-
6543
- <fo:block xsl:use-attribute-sets="quote-style">
6801
+ <fo:block-container xsl:use-attribute-sets="quote-style">
6544
6802
 
6545
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6546
- </fo:block>
6803
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6804
+ <fo:block role="BlockQuote">
6805
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6806
+ </fo:block>
6807
+ </fo:block-container>
6808
+ </fo:block-container>
6547
6809
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
6548
6810
  <fo:block xsl:use-attribute-sets="quote-source-style">
6549
6811
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
@@ -6688,6 +6950,31 @@
6688
6950
  <xsl:with-param name="count" select="$count - 1"/>
6689
6951
  </xsl:call-template>
6690
6952
  </xsl:if>
6953
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']">
6954
+ <xsl:variable name="level">
6955
+ <xsl:call-template name="getLevel"/>
6956
+ </xsl:variable>
6957
+ <xsl:variable name="font-size">
6958
+ inherit
6959
+ </xsl:variable>
6960
+ <xsl:variable name="levelTerm">
6961
+ <xsl:call-template name="getLevelTermName"/>
6962
+ </xsl:variable>
6963
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
6964
+
6965
+
6966
+
6967
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
6968
+ <fo:block xsl:use-attribute-sets="term-name-style">
6969
+ <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
6970
+ </fo:block>
6971
+ </xsl:if>
6972
+
6973
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
6974
+ <xsl:call-template name="setStyle_preferred"/>
6975
+ <xsl:apply-templates/>
6976
+ </fo:block>
6977
+ </fo:block>
6691
6978
  </xsl:template><xsl:template match="*[local-name() = 'domain']">
6692
6979
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
6693
6980
  <xsl:text> </xsl:text>
@@ -6776,24 +7063,8 @@
6776
7063
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6777
7064
  </xsl:template><xsl:variable name="ul_labels_">
6778
7065
 
6779
-
6780
-
6781
-
6782
-
6783
-
6784
-
6785
- <label>—</label> <!-- em dash -->
6786
-
6787
-
6788
-
6789
-
6790
-
6791
-
6792
-
6793
-
6794
-
6795
-
6796
-
7066
+ <label>—</label> <!-- em dash -->
7067
+
6797
7068
  </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
6798
7069
  <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6799
7070
  <xsl:variable name="list_level">
@@ -6819,6 +7090,91 @@
6819
7090
  </xsl:template><xsl:template match="label" mode="ul_labels">
6820
7091
  <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
6821
7092
  <xsl:value-of select="."/>
7093
+ </xsl:template><xsl:template name="getListItemFormat">
7094
+ <!-- Example: for BSI <?list-type loweralpha?> -->
7095
+ <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/>
7096
+ <xsl:choose>
7097
+ <xsl:when test="local-name(..) = 'ul'">
7098
+ <xsl:choose>
7099
+ <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
7100
+ <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
7101
+ </xsl:choose>
7102
+ </xsl:when>
7103
+ <xsl:otherwise> <!-- for ordered lists 'ol' -->
7104
+
7105
+ <!-- Example: for BSI <?list-start 2?> -->
7106
+ <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/>
7107
+
7108
+ <xsl:variable name="start_value">
7109
+ <xsl:choose>
7110
+ <xsl:when test="normalize-space($processing_instruction_start) != ''">
7111
+ <xsl:value-of select="number($processing_instruction_start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
7112
+ </xsl:when>
7113
+ <xsl:when test="normalize-space(../@start) != ''">
7114
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
7115
+ </xsl:when>
7116
+ <xsl:otherwise>0</xsl:otherwise>
7117
+ </xsl:choose>
7118
+ </xsl:variable>
7119
+
7120
+ <xsl:variable name="curr_value"><xsl:number/></xsl:variable>
7121
+
7122
+ <xsl:variable name="type">
7123
+ <xsl:choose>
7124
+ <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when>
7125
+ <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when>
7126
+
7127
+ <xsl:otherwise> <!-- if no @type or @class = 'steps' -->
7128
+
7129
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
7130
+ <xsl:variable name="list_level">
7131
+ <xsl:choose>
7132
+ <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when>
7133
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise>
7134
+ </xsl:choose>
7135
+ </xsl:variable>
7136
+
7137
+ <xsl:choose>
7138
+ <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 -->
7139
+ <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 -->
7140
+ <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 -->
7141
+ <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'-->
7142
+ <xsl:when test="$list_level mod 2 = 0">arabic</xsl:when> <!-- level 2 -->
7143
+ <xsl:otherwise> <!-- level 1 -->
7144
+ <xsl:choose>
7145
+ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when>
7146
+ <xsl:otherwise>alphabet</xsl:otherwise>
7147
+ </xsl:choose>
7148
+ </xsl:otherwise>
7149
+ </xsl:choose>
7150
+
7151
+ </xsl:otherwise>
7152
+ </xsl:choose>
7153
+ </xsl:variable>
7154
+
7155
+ <xsl:variable name="format">
7156
+ <xsl:choose>
7157
+ <xsl:when test="$type = 'arabic'">
7158
+ 1.
7159
+ </xsl:when>
7160
+ <xsl:when test="$type = 'alphabet'">
7161
+ a)
7162
+ </xsl:when>
7163
+ <xsl:when test="$type = 'alphabet_upper'">
7164
+ A.
7165
+ </xsl:when>
7166
+ <xsl:when test="$type = 'roman'">
7167
+ i)
7168
+ </xsl:when>
7169
+ <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
7170
+ <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
7171
+ </xsl:choose>
7172
+ </xsl:variable>
7173
+
7174
+ <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/>
7175
+
7176
+ </xsl:otherwise>
7177
+ </xsl:choose>
6822
7178
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6823
7179
  <xsl:choose>
6824
7180
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -6834,18 +7190,66 @@
6834
7190
 
6835
7191
  <fo:block-container margin-left="0mm">
6836
7192
  <fo:block>
6837
- <xsl:apply-templates select="." mode="ul_ol"/>
7193
+ <xsl:apply-templates select="." mode="list"/>
6838
7194
  </fo:block>
6839
7195
  </fo:block-container>
6840
7196
  </fo:block-container>
6841
7197
  </xsl:when>
6842
7198
  <xsl:otherwise>
6843
7199
  <fo:block>
6844
- <xsl:apply-templates select="." mode="ul_ol"/>
7200
+ <xsl:apply-templates select="." mode="list"/>
6845
7201
  </fo:block>
6846
7202
  </xsl:otherwise>
6847
7203
  </xsl:choose>
6848
- </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
7204
+ </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7205
+ <fo:list-block xsl:use-attribute-sets="list-style">
7206
+
7207
+
7208
+
7209
+
7210
+
7211
+
7212
+
7213
+
7214
+
7215
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
7216
+ </fo:list-block>
7217
+ <!-- <xsl:for-each select="./iho:note">
7218
+ <xsl:call-template name="note"/>
7219
+ </xsl:for-each> -->
7220
+ <xsl:apply-templates select="./*[local-name() = 'note']"/>
7221
+ </xsl:template><xsl:template match="*[local-name()='li']">
7222
+ <fo:list-item xsl:use-attribute-sets="list-item-style">
7223
+ <xsl:copy-of select="@id"/>
7224
+
7225
+
7226
+
7227
+ <fo:list-item-label end-indent="label-end()">
7228
+ <fo:block xsl:use-attribute-sets="list-item-label-style">
7229
+
7230
+
7231
+
7232
+ <xsl:call-template name="getListItemFormat"/>
7233
+ </fo:block>
7234
+ </fo:list-item-label>
7235
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
7236
+ <fo:block>
7237
+
7238
+
7239
+
7240
+
7241
+
7242
+ <xsl:apply-templates/>
7243
+
7244
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
7245
+
7246
+ <xsl:for-each select="./bsi:note">
7247
+ <xsl:call-template name="note"/>
7248
+ </xsl:for-each> -->
7249
+ </fo:block>
7250
+ </fo:list-item-body>
7251
+ </fo:list-item>
7252
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn">
6849
7253
  <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
6850
7254
  <bookmark><xsl:value-of select="@id"/></bookmark>
6851
7255
  </xsl:for-each>
@@ -6867,7 +7271,7 @@
6867
7271
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
6868
7272
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
6869
7273
  <xsl:if test="@to">
6870
- <xsl:value-of select="$dash"/>
7274
+ <xsl:value-of select="$en_dash"/>
6871
7275
  <xsl:copy>
6872
7276
  <xsl:copy-of select="@*"/>
6873
7277
  <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
@@ -6892,7 +7296,7 @@
6892
7296
  <xsl:param name="target"/>
6893
7297
  <!-- <node></node> -->
6894
7298
  <xsl:choose>
6895
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
7299
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $en_dash) and $remove = 'true'">
6896
7300
  <!-- skip text (i.e. remove it) and process next element -->
6897
7301
  <!-- [removed_<xsl:value-of select="."/>] -->
6898
7302
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
@@ -6976,12 +7380,22 @@
6976
7380
  </xsl:variable>
6977
7381
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
6978
7382
  <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7383
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
7384
+ <fo:block xsl:use-attribute-sets="indexsect-title-style">
7385
+ <!-- Index -->
7386
+ <xsl:apply-templates/>
7387
+ </fo:block>
7388
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4">
7389
+ <!-- Letter A, B, C, ... -->
7390
+ <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
7391
+ <xsl:apply-templates/>
7392
+ </fo:block>
6979
7393
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
6980
7394
  <xsl:apply-templates/>
6981
7395
  <fo:block>
6982
- <xsl:if test="following-sibling::*[local-name() = 'clause']">
6983
- <fo:block> </fo:block>
6984
- </xsl:if>
7396
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
7397
+ <fo:block> </fo:block>
7398
+ </xsl:if>
6985
7399
  </fo:block>
6986
7400
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
6987
7401
  <xsl:apply-templates/>
@@ -6991,6 +7405,9 @@
6991
7405
 
6992
7406
  <xsl:apply-templates/>
6993
7407
  </fo:block>
7408
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()">
7409
+ <!-- to split by '_' and other chars -->
7410
+ <xsl:call-template name="add-zero-spaces-java"/>
6994
7411
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
6995
7412
  <fo:inline id="{@id}" font-size="1pt"/>
6996
7413
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
@@ -7327,7 +7744,7 @@
7327
7744
  </fo:table-body>
7328
7745
  </fo:table>
7329
7746
  </fo:block>
7330
- </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7747
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2">
7331
7748
  <fo:table-row min-height="5mm">
7332
7749
  <xsl:apply-templates/>
7333
7750
  </fo:table-row>
@@ -7549,9 +7966,6 @@
7549
7966
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
7550
7967
  </xsl:choose>
7551
7968
  </xsl:template><xsl:template name="addPDFUAmeta">
7552
- <xsl:variable name="lang">
7553
- <xsl:call-template name="getLang"/>
7554
- </xsl:variable>
7555
7969
  <pdf:catalog>
7556
7970
  <pdf:dictionary type="normal" key="ViewerPreferences">
7557
7971
  <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
@@ -7779,10 +8193,12 @@
7779
8193
  <xsl:param name="key"/>
7780
8194
  <xsl:param name="formatted">false</xsl:param>
7781
8195
  <xsl:param name="lang"/>
8196
+ <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
7782
8197
 
7783
8198
  <xsl:variable name="curr_lang">
7784
8199
  <xsl:choose>
7785
8200
  <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
8201
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7786
8202
  <xsl:otherwise>
7787
8203
  <xsl:call-template name="getLang"/>
7788
8204
  </xsl:otherwise>
@@ -7817,6 +8233,7 @@
7817
8233
  </xsl:otherwise>
7818
8234
  </xsl:choose>
7819
8235
  </xsl:when>
8236
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7820
8237
  <xsl:otherwise>
7821
8238
  <xsl:variable name="key_">
7822
8239
  <xsl:call-template name="capitalize">