metanorma-bipm 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,14 +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:variable name="images" select="document($svg_images)"/>
7
- <xsl:param name="basepath"/>
8
-
9
- <!-- <item id="#">N_page</item> -->
10
- <!-- param for second pass -->
11
- <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
12
-
13
5
  <xsl:param name="align-cross-elements"/>
14
6
 
15
7
 
@@ -86,12 +78,6 @@
86
78
 
87
79
  <xsl:variable name="debug">false</xsl:variable>
88
80
 
89
- <xsl:variable name="marginLeftRight1" select="25"/>
90
- <xsl:variable name="marginLeftRight2" select="15"/>
91
- <xsl:variable name="marginTop" select="29.5"/>
92
- <xsl:variable name="marginBottom" select="23.5"/>
93
-
94
-
95
81
  <xsl:variable name="all_rights_reserved">
96
82
  <xsl:call-template name="getLocalizedString">
97
83
  <xsl:with-param name="key">all_rights_reserved</xsl:with-param>
@@ -162,14 +148,9 @@
162
148
  </xsl:for-each>
163
149
 
164
150
  </xsl:for-each>
165
-
166
151
  </xsl:variable>
167
152
 
168
153
 
169
- <xsl:variable name="lang">
170
- <xsl:call-template name="getLang"/>
171
- </xsl:variable>
172
-
173
154
  <xsl:template match="/">
174
155
  <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
175
156
  <fo:layout-master-set>
@@ -622,43 +603,6 @@
622
603
  </xsl:template>
623
604
 
624
605
 
625
-
626
- <xsl:template name="getListItemFormat">
627
- <xsl:choose>
628
- <xsl:when test="local-name(..) = 'ul'">
629
- <xsl:call-template name="setULLabel"/>
630
- </xsl:when>
631
- <xsl:otherwise> <!-- for ordered lists -->
632
- <xsl:variable name="start_value">
633
- <xsl:choose>
634
- <xsl:when test="normalize-space(../@start) != ''">
635
- <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
636
- </xsl:when>
637
- <xsl:otherwise>0</xsl:otherwise>
638
- </xsl:choose>
639
- </xsl:variable>
640
-
641
- <xsl:variable name="curr_value">
642
- <xsl:number/>
643
- </xsl:variable>
644
-
645
- <xsl:variable name="format">
646
- <xsl:choose>
647
- <xsl:when test="../@type = 'arabic'">1.</xsl:when>
648
- <xsl:when test="../@type = 'alphabet'">a)</xsl:when>
649
- <xsl:when test="../@type = 'alphabet_upper'">A.</xsl:when>
650
- <xsl:when test="../@type = 'roman'">i)</xsl:when>
651
- <xsl:when test="../@type = 'roman_upper'">I.</xsl:when>
652
- <xsl:otherwise>a)</xsl:otherwise>
653
- </xsl:choose>
654
- </xsl:variable>
655
-
656
- <xsl:number value="$start_value + $curr_value" format="{$format}" lang="en"/>
657
-
658
- </xsl:otherwise>
659
- </xsl:choose>
660
- </xsl:template>
661
-
662
606
  <xsl:template name="setListItemLabel">
663
607
  <xsl:attribute name="label">
664
608
  <xsl:call-template name="getListItemFormat"/>
@@ -730,32 +674,6 @@
730
674
  </xsl:template>
731
675
 
732
676
 
733
- <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="ul_ol">
734
- <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
735
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
736
- </fo:list-block>
737
- <xsl:for-each select="./*[local-name()='note']">
738
- <xsl:call-template name="note"/>
739
- </xsl:for-each>
740
- </xsl:template>
741
-
742
-
743
- <xsl:template match="*[local-name()='li']">
744
- <fo:list-item id="{@id}">
745
- <fo:list-item-label end-indent="label-end()">
746
- <fo:block>
747
- <xsl:call-template name="getListItemFormat"/>
748
- </fo:block>
749
- </fo:list-item-label>
750
- <fo:list-item-body start-indent="body-start()">
751
- <fo:block>
752
- <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
753
- <xsl:apply-templates select=".//*[local-name()='note']"/>
754
- </fo:block>
755
- </fo:list-item-body>
756
- </fo:list-item>
757
- </xsl:template>
758
-
759
677
 
760
678
  <!-- for two-columns layout -->
761
679
 
@@ -781,30 +699,15 @@
781
699
  </xsl:template>
782
700
 
783
701
 
784
- <xsl:template match="*[local-name()='preferred']">
785
- <xsl:variable name="level">
786
- <xsl:call-template name="getLevel"/>
787
- </xsl:variable>
788
- <fo:block line-height="1.1" role="H{$level}">
789
- <fo:block font-weight="bold" keep-with-next="always">
790
- <xsl:apply-templates select="ancestor::*[local-name()='term'][1]/*[local-name()='name']"/>
791
- </fo:block>
792
- <fo:block font-weight="bold" keep-with-next="always">
793
- <xsl:call-template name="setStyle_preferred"/>
794
- <xsl:apply-templates/>
795
- </fo:block>
796
- </fo:block>
797
- </xsl:template>
798
-
799
- <xsl:template match="*[local-name()='preferred'][not(parent::*[local-name()='term'])]">
702
+ <xsl:template match="*[local-name()='preferred'][not(parent::*[local-name()='term'])]" priority="2">
800
703
  <xsl:variable name="levelTerm">
801
704
  <xsl:call-template name="getLevelTermName"/>
802
705
  </xsl:variable>
803
- <fo:block line-height="1.1" role="H{$levelTerm}">
804
- <fo:block font-weight="bold" keep-with-next="always">
706
+ <fo:block role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
707
+ <fo:block xsl:use-attribute-sets="term-name-style">
805
708
  <xsl:apply-templates select="preceding-sibling::*[local-name()='term_name'][1]" mode="presentation"/>
806
709
  </fo:block>
807
- <fo:block font-weight="bold" keep-with-next="always">
710
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
808
711
  <xsl:call-template name="setStyle_preferred"/>
809
712
  <xsl:apply-templates/>
810
713
  </fo:block>
@@ -945,29 +848,6 @@
945
848
  </fo:block>
946
849
  </xsl:template>
947
850
 
948
- <xsl:template match="*[local-name()='formula']/*[local-name()='stem']">
949
- <fo:block margin-top="6pt" margin-bottom="12pt">
950
- <fo:table table-layout="fixed" width="100%">
951
- <fo:table-column column-width="95%"/>
952
- <fo:table-column column-width="5%"/>
953
- <fo:table-body>
954
- <fo:table-row>
955
- <fo:table-cell display-align="center">
956
- <fo:block text-align="left" margin-left="25mm">
957
- <xsl:apply-templates/>
958
- </fo:block>
959
- </fo:table-cell>
960
- <fo:table-cell display-align="center">
961
- <fo:block text-align="right">
962
- <xsl:apply-templates select="../*[local-name()='name']" mode="formula_number"/>
963
- </fo:block>
964
- </fo:table-cell>
965
- </fo:table-row>
966
- </fo:table-body>
967
- </fo:table>
968
- </fo:block>
969
- </xsl:template>
970
-
971
851
 
972
852
  <xsl:template name="printEdition">
973
853
  <xsl:variable name="edition" select="normalize-space(//*[local-name()='bibdata']/*[local-name()='edition'])"/>
@@ -1277,28 +1157,6 @@
1277
1157
  </fo:page-sequence>
1278
1158
  </xsl:template>
1279
1159
 
1280
- <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:title" priority="4"> -->
1281
- <xsl:template match="jcgm:indexsect/jcgm:title" priority="4">
1282
- <fo:block font-weight="bold" span="all" role="H1">
1283
- <!-- Index -->
1284
- <xsl:apply-templates/>
1285
- </fo:block>
1286
- </xsl:template>
1287
-
1288
-
1289
- <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:clause/jcgm:title" priority="4"> -->
1290
- <xsl:template match="jcgm:indexsect/jcgm:clause/jcgm:title" priority="4">
1291
- <!-- Letter A, B, C, ... -->
1292
- <fo:block font-weight="bold" margin-left="25mm" keep-with-next="always">
1293
- <xsl:apply-templates/>
1294
- </fo:block>
1295
- </xsl:template>
1296
-
1297
- <!-- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:ul" priority="4"> -->
1298
- <xsl:template match="jcgm:indexsect//jcgm:ul" priority="4">
1299
- <xsl:apply-templates/>
1300
- </xsl:template>
1301
-
1302
1160
 
1303
1161
  <!-- =================== -->
1304
1162
  <!-- End of Index processing -->
@@ -1649,7 +1507,7 @@
1649
1507
  </term>
1650
1508
  To:
1651
1509
  <term/>
1652
- <name>...</name>
1510
+ <term_name>...</term_name>
1653
1511
  <preferred>...</preferred>
1654
1512
  <definition>...</definition>
1655
1513
  <termsource>...</termsource>
@@ -1852,11 +1710,21 @@
1852
1710
  </fo:block-container>
1853
1711
  </xsl:template>
1854
1712
 
1855
- <xsl:variable name="pageWidth_">
1713
+ <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">
1714
+ <xsl:call-template name="getLang"/>
1715
+ </xsl:variable><xsl:variable name="pageWidth_">
1856
1716
  210
1857
1717
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1858
1718
  297
1859
- </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
1719
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
1720
+ 25
1721
+ </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
1722
+ 15
1723
+ </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_">
1724
+ 29.5
1725
+ </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_">
1726
+ 23.5
1727
+ </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_">
1860
1728
 
1861
1729
  <title-edition lang="en">
1862
1730
 
@@ -1916,7 +1784,7 @@
1916
1784
  </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
1917
1785
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1918
1786
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1919
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1787
+ </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">
1920
1788
  <xsl:param name="name"/>
1921
1789
  <xsl:param name="lang"/>
1922
1790
  <xsl:variable name="lang_">
@@ -1939,7 +1807,7 @@
1939
1807
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1940
1808
  </xsl:otherwise>
1941
1809
  </xsl:choose>
1942
- </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">
1810
+ </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">
1943
1811
 
1944
1812
  <xsl:attribute name="font-family">Times New Roman, STIX Two Math, Source Han Sans</xsl:attribute>
1945
1813
  <xsl:attribute name="font-size">10.5pt</xsl:attribute>
@@ -2105,11 +1973,11 @@
2105
1973
 
2106
1974
 
2107
1975
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
2108
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2109
1976
 
2110
1977
 
2111
1978
 
2112
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
1979
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1980
+
2113
1981
 
2114
1982
 
2115
1983
 
@@ -2506,13 +2374,12 @@
2506
2374
 
2507
2375
 
2508
2376
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2509
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
2377
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
2378
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
2510
2379
 
2511
2380
 
2512
2381
 
2513
2382
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2514
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
2515
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
2516
2383
  <xsl:attribute name="font-style">italic</xsl:attribute>
2517
2384
  <xsl:attribute name="text-align">justify</xsl:attribute>
2518
2385
 
@@ -2521,10 +2388,8 @@
2521
2388
 
2522
2389
 
2523
2390
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2391
+ <xsl:attribute name="text-align">right</xsl:attribute>
2524
2392
 
2525
-
2526
- <xsl:attribute name="text-align">right</xsl:attribute>
2527
-
2528
2393
 
2529
2394
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
2530
2395
 
@@ -2548,6 +2413,9 @@
2548
2413
 
2549
2414
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2550
2415
 
2416
+ </xsl:attribute-set><xsl:attribute-set name="term-name-style">
2417
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2418
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2551
2419
  </xsl:attribute-set><xsl:attribute-set name="figure-style">
2552
2420
 
2553
2421
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -2578,6 +2446,37 @@
2578
2446
 
2579
2447
 
2580
2448
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
2449
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2450
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2451
+
2452
+
2453
+
2454
+
2455
+
2456
+
2457
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style">
2458
+ <xsl:attribute name="text-align">center</xsl:attribute>
2459
+
2460
+
2461
+
2462
+
2463
+
2464
+
2465
+
2466
+ <xsl:attribute name="text-align">left</xsl:attribute>
2467
+ <xsl:attribute name="margin-left">25mm</xsl:attribute>
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+ </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
2474
+ <xsl:attribute name="text-align">right</xsl:attribute>
2475
+
2476
+
2477
+
2478
+
2479
+
2581
2480
 
2582
2481
  </xsl:attribute-set><xsl:attribute-set name="image-style">
2583
2482
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2613,6 +2512,20 @@
2613
2512
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2614
2513
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2615
2514
 
2515
+ </xsl:attribute-set><xsl:attribute-set name="preferred-block-style">
2516
+
2517
+
2518
+
2519
+
2520
+
2521
+ <xsl:attribute name="line-height">1.1</xsl:attribute>
2522
+
2523
+
2524
+ </xsl:attribute-set><xsl:attribute-set name="preferred-term-style">
2525
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2526
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2527
+
2528
+
2616
2529
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
2617
2530
 
2618
2531
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -2650,6 +2563,36 @@
2650
2563
 
2651
2564
  </xsl:attribute-set><xsl:attribute-set name="list-style">
2652
2565
 
2566
+
2567
+
2568
+
2569
+
2570
+
2571
+
2572
+
2573
+ <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
2574
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+
2583
+
2584
+
2585
+ </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2586
+
2587
+
2588
+ </xsl:attribute-set><xsl:attribute-set name="list-item-label-style">
2589
+
2590
+
2591
+
2592
+ </xsl:attribute-set><xsl:attribute-set name="list-item-body-style">
2593
+
2594
+
2595
+
2653
2596
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2654
2597
  <xsl:attribute name="line-height">135%</xsl:attribute>
2655
2598
  </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
@@ -2922,6 +2865,117 @@
2922
2865
 
2923
2866
 
2924
2867
 
2868
+ </xsl:attribute-set><xsl:attribute-set name="hljs-doctag">
2869
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2870
+ </xsl:attribute-set><xsl:attribute-set name="hljs-keyword">
2871
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2872
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword">
2873
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2874
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag">
2875
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2876
+ </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable">
2877
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2878
+ </xsl:attribute-set><xsl:attribute-set name="hljs-type">
2879
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2880
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_">
2881
+ <xsl:attribute name="color">#d73a49</xsl:attribute>
2882
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title">
2883
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2884
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_">
2885
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2886
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__">
2887
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2888
+ </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_">
2889
+ <xsl:attribute name="color">#6f42c1</xsl:attribute>
2890
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attr">
2891
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2892
+ </xsl:attribute-set><xsl:attribute-set name="hljs-attribute">
2893
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2894
+ </xsl:attribute-set><xsl:attribute-set name="hljs-literal">
2895
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2896
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta">
2897
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2898
+ </xsl:attribute-set><xsl:attribute-set name="hljs-number">
2899
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2900
+ </xsl:attribute-set><xsl:attribute-set name="hljs-operator">
2901
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2902
+ </xsl:attribute-set><xsl:attribute-set name="hljs-variable">
2903
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2904
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr">
2905
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2906
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class">
2907
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2908
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id">
2909
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2910
+ </xsl:attribute-set><xsl:attribute-set name="hljs-regexp">
2911
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2912
+ </xsl:attribute-set><xsl:attribute-set name="hljs-string">
2913
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2914
+ </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string">
2915
+ <xsl:attribute name="color">#032f62</xsl:attribute>
2916
+ </xsl:attribute-set><xsl:attribute-set name="hljs-built_in">
2917
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2918
+ </xsl:attribute-set><xsl:attribute-set name="hljs-symbol">
2919
+ <xsl:attribute name="color">#e36209</xsl:attribute>
2920
+ </xsl:attribute-set><xsl:attribute-set name="hljs-comment">
2921
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2922
+ </xsl:attribute-set><xsl:attribute-set name="hljs-code">
2923
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2924
+ </xsl:attribute-set><xsl:attribute-set name="hljs-formula">
2925
+ <xsl:attribute name="color">#6a737d</xsl:attribute>
2926
+ </xsl:attribute-set><xsl:attribute-set name="hljs-name">
2927
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2928
+ </xsl:attribute-set><xsl:attribute-set name="hljs-quote">
2929
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2930
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag">
2931
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2932
+ </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo">
2933
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2934
+ </xsl:attribute-set><xsl:attribute-set name="hljs-subst">
2935
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2936
+ </xsl:attribute-set><xsl:attribute-set name="hljs-section">
2937
+ <xsl:attribute name="color">#005cc5</xsl:attribute>
2938
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2939
+ </xsl:attribute-set><xsl:attribute-set name="hljs-bullet">
2940
+ <xsl:attribute name="color">#735c0f</xsl:attribute>
2941
+ </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis">
2942
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2943
+ <xsl:attribute name="font-style">italic</xsl:attribute>
2944
+ </xsl:attribute-set><xsl:attribute-set name="hljs-strong">
2945
+ <xsl:attribute name="color">#24292e</xsl:attribute>
2946
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2947
+ </xsl:attribute-set><xsl:attribute-set name="hljs-addition">
2948
+ <xsl:attribute name="color">#22863a</xsl:attribute>
2949
+ <xsl:attribute name="background-color">#f0fff4</xsl:attribute>
2950
+ </xsl:attribute-set><xsl:attribute-set name="hljs-deletion">
2951
+ <xsl:attribute name="color">#b31d28</xsl:attribute>
2952
+ <xsl:attribute name="background-color">#ffeef0</xsl:attribute>
2953
+ </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_">
2954
+ </xsl:attribute-set><xsl:attribute-set name="hljs-link">
2955
+ </xsl:attribute-set><xsl:attribute-set name="hljs-params">
2956
+ </xsl:attribute-set><xsl:attribute-set name="hljs-property">
2957
+ </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation">
2958
+ </xsl:attribute-set><xsl:attribute-set name="hljs-tag">
2959
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style">
2960
+ <xsl:attribute name="role">H1</xsl:attribute>
2961
+
2962
+
2963
+
2964
+
2965
+
2966
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2967
+ <xsl:attribute name="span">all</xsl:attribute>
2968
+
2969
+ </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style">
2970
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2971
+
2972
+
2973
+
2974
+
2975
+
2976
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2977
+ <xsl:attribute name="margin-left">25mm</xsl:attribute>
2978
+
2925
2979
  </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">
2926
2980
  <xsl:for-each select="/*/*[local-name()='preface']/*">
2927
2981
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -3008,9 +3062,12 @@
3008
3062
 
3009
3063
 
3010
3064
  </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
3065
+ <xsl:param name="margin"/>
3011
3066
 
3012
3067
  <!-- process in the template 'paragraph' -->
3013
- <xsl:call-template name="paragraph"/>
3068
+ <xsl:call-template name="paragraph">
3069
+ <xsl:with-param name="margin" select="$margin"/>
3070
+ </xsl:call-template>
3014
3071
 
3015
3072
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
3016
3073
  <fo:block xsl:use-attribute-sets="feedback-statement-style">
@@ -3022,9 +3079,12 @@
3022
3079
  <xsl:call-template name="title"/>
3023
3080
 
3024
3081
  </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
3082
+ <xsl:param name="margin"/>
3025
3083
 
3026
3084
  <!-- process in the template 'paragraph' -->
3027
- <xsl:call-template name="paragraph"/>
3085
+ <xsl:call-template name="paragraph">
3086
+ <xsl:with-param name="margin" select="$margin"/>
3087
+ </xsl:call-template>
3028
3088
 
3029
3089
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
3030
3090
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
@@ -3366,8 +3426,7 @@
3366
3426
  </xsl:call-template>
3367
3427
  </xsl:if>
3368
3428
  </xsl:template><xsl:template match="text()" mode="td_text">
3369
- <xsl:variable name="zero-space">​</xsl:variable>
3370
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
3429
+ <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
3371
3430
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
3372
3431
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
3373
3432
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
@@ -4432,20 +4491,44 @@
4432
4491
  <fo:inline text-decoration="underline">
4433
4492
  <xsl:apply-templates/>
4434
4493
  </fo:inline>
4435
- </xsl:template><xsl:template match="*[local-name()='add']">
4494
+ </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add">
4436
4495
  <xsl:param name="skip">true</xsl:param>
4496
+ <xsl:param name="block">false</xsl:param>
4497
+ <xsl:param name="type"/>
4498
+ <xsl:param name="text-align"/>
4437
4499
  <xsl:choose>
4438
4500
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4439
4501
  <xsl:choose>
4440
- <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>
4502
+ <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>
4441
4503
  <xsl:otherwise>
4442
- <fo:inline>
4504
+ <xsl:variable name="tag">
4443
4505
  <xsl:call-template name="insertTag">
4444
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
4506
+ <xsl:with-param name="type">
4507
+ <xsl:choose>
4508
+ <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4509
+ <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4510
+ </xsl:choose>
4511
+ </xsl:with-param>
4445
4512
  <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4446
4513
  <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4447
4514
  </xsl:call-template>
4448
- </fo:inline>
4515
+ </xsl:variable>
4516
+ <xsl:choose>
4517
+ <xsl:when test="$block = 'false'">
4518
+ <fo:inline>
4519
+ <xsl:copy-of select="$tag"/>
4520
+ </fo:inline>
4521
+ </xsl:when>
4522
+ <xsl:otherwise>
4523
+ <fo:block> <!-- for around figures -->
4524
+ <xsl:if test="$text-align != ''">
4525
+ <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
4526
+ </xsl:if>
4527
+ <xsl:copy-of select="$tag"/>
4528
+ </fo:block>
4529
+ </xsl:otherwise>
4530
+ </xsl:choose>
4531
+
4449
4532
  </xsl:otherwise>
4450
4533
  </xsl:choose>
4451
4534
  </xsl:when>
@@ -4804,17 +4887,21 @@
4804
4887
  </xsl:apply-templates>
4805
4888
  </xsl:template><xsl:template name="getLang">
4806
4889
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4807
- <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4808
4890
  <xsl:variable name="language">
4809
4891
  <xsl:choose>
4810
4892
  <xsl:when test="$language_current != ''">
4811
4893
  <xsl:value-of select="$language_current"/>
4812
4894
  </xsl:when>
4813
- <xsl:when test="$language_current_2 != ''">
4814
- <xsl:value-of select="$language_current_2"/>
4815
- </xsl:when>
4816
4895
  <xsl:otherwise>
4817
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4896
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4897
+ <xsl:choose>
4898
+ <xsl:when test="$language_current_2 != ''">
4899
+ <xsl:value-of select="$language_current_2"/>
4900
+ </xsl:when>
4901
+ <xsl:otherwise>
4902
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4903
+ </xsl:otherwise>
4904
+ </xsl:choose>
4818
4905
  </xsl:otherwise>
4819
4906
  </xsl:choose>
4820
4907
  </xsl:variable>
@@ -5031,8 +5118,8 @@
5031
5118
 
5032
5119
  </xsl:if>
5033
5120
  <fo:block-container margin-left="0mm">
5034
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
5035
- <xsl:apply-templates/>
5121
+ <fo:block id="{@id}">
5122
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
5036
5123
  </fo:block>
5037
5124
  </fo:block-container>
5038
5125
  </fo:block-container>
@@ -5044,10 +5131,43 @@
5044
5131
  <fo:inline>
5045
5132
  <xsl:apply-templates/>
5046
5133
  </fo:inline>
5047
- </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 -->
5134
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
5048
5135
  <xsl:if test="normalize-space() != ''">
5049
5136
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
5050
5137
  </xsl:if>
5138
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']">
5139
+ <fo:block xsl:use-attribute-sets="formula-style">
5140
+
5141
+
5142
+
5143
+ <fo:table table-layout="fixed" width="100%">
5144
+ <fo:table-column column-width="95%"/>
5145
+ <fo:table-column column-width="5%"/>
5146
+ <fo:table-body>
5147
+ <fo:table-row>
5148
+ <fo:table-cell display-align="center">
5149
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5150
+
5151
+
5152
+
5153
+ <xsl:apply-templates/>
5154
+ </fo:block>
5155
+ </fo:table-cell>
5156
+ <fo:table-cell display-align="center">
5157
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style">
5158
+ <xsl:apply-templates select="../*[local-name() = 'name']"/>
5159
+ </fo:block>
5160
+ </fo:table-cell>
5161
+ </fo:table-row>
5162
+ </fo:table-body>
5163
+ </fo:table>
5164
+ </fo:block>
5165
+ </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']">
5166
+ <fo:block xsl:use-attribute-sets="formula-style">
5167
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style">
5168
+ <xsl:apply-templates/>
5169
+ </fo:block>
5170
+ </fo:block>
5051
5171
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
5052
5172
 
5053
5173
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
@@ -5995,12 +6115,140 @@
5995
6115
  </fo:block-container>
5996
6116
  </fo:block-container>
5997
6117
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
5998
- <xsl:variable name="text">
6118
+ <xsl:choose>
6119
+ <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6120
+ <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6121
+ <xsl:choose>
6122
+ <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
6123
+ <xsl:apply-templates select="xalan:nodeset($syntax)" mode="syntax_highlight"/> <!-- process span tags -->
6124
+ </xsl:when>
6125
+ <xsl:otherwise> <!-- if case of non-succesfull syntax highlight (for instance, unknown lang), process without highlighting -->
6126
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6127
+ </xsl:otherwise>
6128
+ </xsl:choose>
6129
+ </xsl:when>
6130
+ <xsl:otherwise>
6131
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6132
+ </xsl:otherwise>
6133
+ </xsl:choose>
6134
+
6135
+ </xsl:template><xsl:template name="add_spaces_to_sourcecode">
6136
+ <xsl:variable name="text_step1">
5999
6137
  <xsl:call-template name="add-zero-spaces-equal"/>
6000
6138
  </xsl:variable>
6001
- <xsl:call-template name="add-zero-spaces-java">
6002
- <xsl:with-param name="text" select="$text"/>
6003
- </xsl:call-template>
6139
+ <xsl:variable name="text_step2">
6140
+ <xsl:call-template name="add-zero-spaces-java">
6141
+ <xsl:with-param name="text" select="$text_step1"/>
6142
+ </xsl:call-template>
6143
+ </xsl:variable>
6144
+ <xsl:value-of select="$text_step2"/>
6145
+ </xsl:template><xsl:template match="*" mode="syntax_highlight">
6146
+ <xsl:apply-templates mode="syntax_highlight"/>
6147
+ </xsl:template><xsl:variable name="syntax_highlight_styles_">
6148
+ <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/>
6149
+ <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/>
6150
+ <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/>
6151
+ <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/>
6152
+ <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/>
6153
+ <style class="hljs-char_and_escape_" xsl:use-attribute-sets="hljs-char_and_escape_"/>
6154
+ <style class="hljs-code" xsl:use-attribute-sets="hljs-code"/>
6155
+ <style class="hljs-comment" xsl:use-attribute-sets="hljs-comment"/>
6156
+ <style class="hljs-deletion" xsl:use-attribute-sets="hljs-deletion"/>
6157
+ <style class="hljs-doctag" xsl:use-attribute-sets="hljs-doctag"/>
6158
+ <style class="hljs-emphasis" xsl:use-attribute-sets="hljs-emphasis"/>
6159
+ <style class="hljs-formula" xsl:use-attribute-sets="hljs-formula"/>
6160
+ <style class="hljs-keyword" xsl:use-attribute-sets="hljs-keyword"/>
6161
+ <style class="hljs-link" xsl:use-attribute-sets="hljs-link"/>
6162
+ <style class="hljs-literal" xsl:use-attribute-sets="hljs-literal"/>
6163
+ <style class="hljs-meta" xsl:use-attribute-sets="hljs-meta"/>
6164
+ <style class="hljs-meta_hljs-string" xsl:use-attribute-sets="hljs-meta_hljs-string"/>
6165
+ <style class="hljs-meta_hljs-keyword" xsl:use-attribute-sets="hljs-meta_hljs-keyword"/>
6166
+ <style class="hljs-name" xsl:use-attribute-sets="hljs-name"/>
6167
+ <style class="hljs-number" xsl:use-attribute-sets="hljs-number"/>
6168
+ <style class="hljs-operator" xsl:use-attribute-sets="hljs-operator"/>
6169
+ <style class="hljs-params" xsl:use-attribute-sets="hljs-params"/>
6170
+ <style class="hljs-property" xsl:use-attribute-sets="hljs-property"/>
6171
+ <style class="hljs-punctuation" xsl:use-attribute-sets="hljs-punctuation"/>
6172
+ <style class="hljs-quote" xsl:use-attribute-sets="hljs-quote"/>
6173
+ <style class="hljs-regexp" xsl:use-attribute-sets="hljs-regexp"/>
6174
+ <style class="hljs-section" xsl:use-attribute-sets="hljs-section"/>
6175
+ <style class="hljs-selector-attr" xsl:use-attribute-sets="hljs-selector-attr"/>
6176
+ <style class="hljs-selector-class" xsl:use-attribute-sets="hljs-selector-class"/>
6177
+ <style class="hljs-selector-id" xsl:use-attribute-sets="hljs-selector-id"/>
6178
+ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/>
6179
+ <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/>
6180
+ <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/>
6181
+ <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/>
6182
+ <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/>
6183
+ <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/>
6184
+ <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/>
6185
+ <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> -->
6186
+ <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> -->
6187
+ <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/>
6188
+ <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/>
6189
+ <style class="hljs-title" xsl:use-attribute-sets="hljs-title"/>
6190
+ <style class="hljs-title_and_class_" xsl:use-attribute-sets="hljs-title_and_class_"/>
6191
+ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/>
6192
+ <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/>
6193
+ <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/>
6194
+ <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/>
6195
+ <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/>
6196
+ </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2">
6197
+ <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> -->
6198
+ <fo:inline>
6199
+ <xsl:variable name="classes_">
6200
+ <xsl:call-template name="split">
6201
+ <xsl:with-param name="pText" select="@class"/>
6202
+ <xsl:with-param name="sep" select="' '"/>
6203
+ </xsl:call-template>
6204
+ <!-- a few classes together (_and_ suffix) -->
6205
+ <xsl:if test="contains(@class, 'hljs-char') and contains(@class, 'escape_')">
6206
+ <item>hljs-char_and_escape_</item>
6207
+ </xsl:if>
6208
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_')">
6209
+ <item>hljs-title_and_class_</item>
6210
+ </xsl:if>
6211
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'class_') and contains(@class, 'inherited__')">
6212
+ <item>hljs-title_and_class__and_inherited__</item>
6213
+ </xsl:if>
6214
+ <xsl:if test="contains(@class, 'hljs-title') and contains(@class, 'function_')">
6215
+ <item>hljs-title_and_function_</item>
6216
+ </xsl:if>
6217
+ <xsl:if test="contains(@class, 'hljs-variable') and contains(@class, 'language_')">
6218
+ <item>hljs-variable_and_language_</item>
6219
+ </xsl:if>
6220
+ <!-- with parent classes (_ suffix) -->
6221
+ <xsl:if test="contains(@class, 'hljs-keyword') and contains(ancestor::*/@class, 'hljs-meta')">
6222
+ <item>hljs-meta_hljs-keyword</item>
6223
+ </xsl:if>
6224
+ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')">
6225
+ <item>hljs-meta_hljs-string</item>
6226
+ </xsl:if>
6227
+ </xsl:variable>
6228
+ <xsl:variable name="classes" select="xalan:nodeset($classes_)"/>
6229
+
6230
+ <xsl:for-each select="$classes/item">
6231
+ <xsl:variable name="class_name" select="."/>
6232
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6233
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6234
+ </xsl:for-each>
6235
+ </xsl:for-each>
6236
+
6237
+ <!-- <xsl:variable name="class_name">
6238
+ <xsl:choose>
6239
+ <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when>
6240
+ <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when>
6241
+ <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when>
6242
+ <xsl:otherwise><xsl:value-of select="@class"/></xsl:otherwise>
6243
+ </xsl:choose>
6244
+ </xsl:variable>
6245
+ <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]">
6246
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
6247
+ </xsl:for-each> -->
6248
+
6249
+ <xsl:apply-templates mode="syntax_highlight"/></fo:inline>
6250
+ </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2">
6251
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
6004
6252
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
6005
6253
  <xsl:if test="normalize-space() != ''">
6006
6254
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
@@ -6380,8 +6628,7 @@
6380
6628
  </xsl:if>
6381
6629
 
6382
6630
  <fo:block-container margin-left="0mm">
6383
-
6384
- <fo:block xsl:use-attribute-sets="quote-style">
6631
+ <fo:block-container xsl:use-attribute-sets="quote-style">
6385
6632
 
6386
6633
  <xsl:if test="ancestor::*[local-name() = 'boilerplate']">
6387
6634
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
@@ -6389,8 +6636,12 @@
6389
6636
  <xsl:attribute name="font-style">normal</xsl:attribute>
6390
6637
  </xsl:if>
6391
6638
 
6392
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6393
- </fo:block>
6639
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6640
+ <fo:block role="BlockQuote">
6641
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
6642
+ </fo:block>
6643
+ </fo:block-container>
6644
+ </fo:block-container>
6394
6645
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
6395
6646
  <fo:block xsl:use-attribute-sets="quote-source-style">
6396
6647
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
@@ -6535,6 +6786,31 @@
6535
6786
  <xsl:with-param name="count" select="$count - 1"/>
6536
6787
  </xsl:call-template>
6537
6788
  </xsl:if>
6789
+ </xsl:template><xsl:template match="*[local-name() = 'preferred']">
6790
+ <xsl:variable name="level">
6791
+ <xsl:call-template name="getLevel"/>
6792
+ </xsl:variable>
6793
+ <xsl:variable name="font-size">
6794
+ inherit
6795
+ </xsl:variable>
6796
+ <xsl:variable name="levelTerm">
6797
+ <xsl:call-template name="getLevelTermName"/>
6798
+ </xsl:variable>
6799
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
6800
+
6801
+
6802
+
6803
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
6804
+ <fo:block xsl:use-attribute-sets="term-name-style">
6805
+ <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
6806
+ </fo:block>
6807
+ </xsl:if>
6808
+
6809
+ <fo:block xsl:use-attribute-sets="preferred-term-style">
6810
+ <xsl:call-template name="setStyle_preferred"/>
6811
+ <xsl:apply-templates/>
6812
+ </fo:block>
6813
+ </fo:block>
6538
6814
  </xsl:template><xsl:template match="*[local-name() = 'domain']">
6539
6815
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
6540
6816
  <xsl:text> </xsl:text>
@@ -6627,26 +6903,10 @@
6627
6903
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6628
6904
  </xsl:template><xsl:variable name="ul_labels_">
6629
6905
 
6630
-
6631
-
6632
-
6633
-
6634
-
6635
-
6636
-
6637
- <label level="1">—</label> <!-- em dash -->
6638
- <label level="2">−</label><!-- minus sign -->
6639
- <label level="3" font-size="75%">o</label> <!-- white circle -->
6640
-
6641
-
6642
-
6643
-
6644
-
6645
-
6646
-
6647
-
6648
-
6649
-
6906
+ <label level="1">—</label> <!-- em dash -->
6907
+ <label level="2">−</label><!-- minus sign -->
6908
+ <label level="3" font-size="75%">o</label> <!-- white circle -->
6909
+
6650
6910
  </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
6651
6911
  <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6652
6912
  <xsl:variable name="list_level">
@@ -6672,6 +6932,91 @@
6672
6932
  </xsl:template><xsl:template match="label" mode="ul_labels">
6673
6933
  <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
6674
6934
  <xsl:value-of select="."/>
6935
+ </xsl:template><xsl:template name="getListItemFormat">
6936
+ <!-- Example: for BSI <?list-type loweralpha?> -->
6937
+ <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/>
6938
+ <xsl:choose>
6939
+ <xsl:when test="local-name(..) = 'ul'">
6940
+ <xsl:choose>
6941
+ <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
6942
+ <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
6943
+ </xsl:choose>
6944
+ </xsl:when>
6945
+ <xsl:otherwise> <!-- for ordered lists 'ol' -->
6946
+
6947
+ <!-- Example: for BSI <?list-start 2?> -->
6948
+ <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/>
6949
+
6950
+ <xsl:variable name="start_value">
6951
+ <xsl:choose>
6952
+ <xsl:when test="normalize-space($processing_instruction_start) != ''">
6953
+ <xsl:value-of select="number($processing_instruction_start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
6954
+ </xsl:when>
6955
+ <xsl:when test="normalize-space(../@start) != ''">
6956
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
6957
+ </xsl:when>
6958
+ <xsl:otherwise>0</xsl:otherwise>
6959
+ </xsl:choose>
6960
+ </xsl:variable>
6961
+
6962
+ <xsl:variable name="curr_value"><xsl:number/></xsl:variable>
6963
+
6964
+ <xsl:variable name="type">
6965
+ <xsl:choose>
6966
+ <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when>
6967
+ <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when>
6968
+
6969
+ <xsl:otherwise> <!-- if no @type or @class = 'steps' -->
6970
+
6971
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6972
+ <xsl:variable name="list_level">
6973
+ <xsl:choose>
6974
+ <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when>
6975
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise>
6976
+ </xsl:choose>
6977
+ </xsl:variable>
6978
+
6979
+ <xsl:choose>
6980
+ <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 -->
6981
+ <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 -->
6982
+ <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 -->
6983
+ <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'-->
6984
+ <xsl:when test="$list_level mod 2 = 0">arabic</xsl:when> <!-- level 2 -->
6985
+ <xsl:otherwise> <!-- level 1 -->
6986
+ <xsl:choose>
6987
+ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when>
6988
+ <xsl:otherwise>alphabet</xsl:otherwise>
6989
+ </xsl:choose>
6990
+ </xsl:otherwise>
6991
+ </xsl:choose>
6992
+
6993
+ </xsl:otherwise>
6994
+ </xsl:choose>
6995
+ </xsl:variable>
6996
+
6997
+ <xsl:variable name="format">
6998
+ <xsl:choose>
6999
+ <xsl:when test="$type = 'arabic'">
7000
+ 1.
7001
+ </xsl:when>
7002
+ <xsl:when test="$type = 'alphabet'">
7003
+ a)
7004
+ </xsl:when>
7005
+ <xsl:when test="$type = 'alphabet_upper'">
7006
+ A.
7007
+ </xsl:when>
7008
+ <xsl:when test="$type = 'roman'">
7009
+ i)
7010
+ </xsl:when>
7011
+ <xsl:when test="$type = 'roman_upper'">I.</xsl:when>
7012
+ <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using -->
7013
+ </xsl:choose>
7014
+ </xsl:variable>
7015
+
7016
+ <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/>
7017
+
7018
+ </xsl:otherwise>
7019
+ </xsl:choose>
6675
7020
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6676
7021
  <xsl:choose>
6677
7022
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -6687,18 +7032,66 @@
6687
7032
 
6688
7033
  <fo:block-container margin-left="0mm">
6689
7034
  <fo:block>
6690
- <xsl:apply-templates select="." mode="ul_ol"/>
7035
+ <xsl:apply-templates select="." mode="list"/>
6691
7036
  </fo:block>
6692
7037
  </fo:block-container>
6693
7038
  </fo:block-container>
6694
7039
  </xsl:when>
6695
7040
  <xsl:otherwise>
6696
7041
  <fo:block>
6697
- <xsl:apply-templates select="." mode="ul_ol"/>
7042
+ <xsl:apply-templates select="." mode="list"/>
6698
7043
  </fo:block>
6699
7044
  </xsl:otherwise>
6700
7045
  </xsl:choose>
6701
- </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
7046
+ </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7047
+ <fo:list-block xsl:use-attribute-sets="list-style">
7048
+
7049
+
7050
+
7051
+
7052
+
7053
+
7054
+
7055
+
7056
+
7057
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
7058
+ </fo:list-block>
7059
+ <!-- <xsl:for-each select="./iho:note">
7060
+ <xsl:call-template name="note"/>
7061
+ </xsl:for-each> -->
7062
+ <xsl:apply-templates select="./*[local-name() = 'note']"/>
7063
+ </xsl:template><xsl:template match="*[local-name()='li']">
7064
+ <fo:list-item xsl:use-attribute-sets="list-item-style">
7065
+ <xsl:copy-of select="@id"/>
7066
+
7067
+
7068
+
7069
+ <fo:list-item-label end-indent="label-end()">
7070
+ <fo:block xsl:use-attribute-sets="list-item-label-style">
7071
+
7072
+
7073
+
7074
+ <xsl:call-template name="getListItemFormat"/>
7075
+ </fo:block>
7076
+ </fo:list-item-label>
7077
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
7078
+ <fo:block>
7079
+
7080
+
7081
+
7082
+
7083
+
7084
+ <xsl:apply-templates/>
7085
+
7086
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
7087
+
7088
+ <xsl:for-each select="./bsi:note">
7089
+ <xsl:call-template name="note"/>
7090
+ </xsl:for-each> -->
7091
+ </fo:block>
7092
+ </fo:list-item-body>
7093
+ </fo:list-item>
7094
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn">
6702
7095
  <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
6703
7096
  <bookmark><xsl:value-of select="@id"/></bookmark>
6704
7097
  </xsl:for-each>
@@ -6720,7 +7113,7 @@
6720
7113
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
6721
7114
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
6722
7115
  <xsl:if test="@to">
6723
- <xsl:value-of select="$dash"/>
7116
+ <xsl:value-of select="$en_dash"/>
6724
7117
  <xsl:copy>
6725
7118
  <xsl:copy-of select="@*"/>
6726
7119
  <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
@@ -6745,7 +7138,7 @@
6745
7138
  <xsl:param name="target"/>
6746
7139
  <!-- <node></node> -->
6747
7140
  <xsl:choose>
6748
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
7141
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $en_dash) and $remove = 'true'">
6749
7142
  <!-- skip text (i.e. remove it) and process next element -->
6750
7143
  <!-- [removed_<xsl:value-of select="."/>] -->
6751
7144
  <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
@@ -6829,12 +7222,22 @@
6829
7222
  </xsl:variable>
6830
7223
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
6831
7224
  <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7225
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
7226
+ <fo:block xsl:use-attribute-sets="indexsect-title-style">
7227
+ <!-- Index -->
7228
+ <xsl:apply-templates/>
7229
+ </fo:block>
7230
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4">
7231
+ <!-- Letter A, B, C, ... -->
7232
+ <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
7233
+ <xsl:apply-templates/>
7234
+ </fo:block>
6832
7235
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
6833
7236
  <xsl:apply-templates/>
6834
7237
  <fo:block>
6835
- <xsl:if test="following-sibling::*[local-name() = 'clause']">
6836
- <fo:block> </fo:block>
6837
- </xsl:if>
7238
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
7239
+ <fo:block> </fo:block>
7240
+ </xsl:if>
6838
7241
  </fo:block>
6839
7242
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
6840
7243
  <xsl:apply-templates/>
@@ -6844,6 +7247,9 @@
6844
7247
 
6845
7248
  <xsl:apply-templates/>
6846
7249
  </fo:block>
7250
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()">
7251
+ <!-- to split by '_' and other chars -->
7252
+ <xsl:call-template name="add-zero-spaces-java"/>
6847
7253
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
6848
7254
  <fo:inline id="{@id}" font-size="1pt"/>
6849
7255
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
@@ -7185,7 +7591,7 @@
7185
7591
  </fo:table-body>
7186
7592
  </fo:table>
7187
7593
  </fo:block>
7188
- </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7594
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2">
7189
7595
  <fo:table-row min-height="5mm">
7190
7596
  <xsl:apply-templates/>
7191
7597
  </fo:table-row>
@@ -7412,9 +7818,6 @@
7412
7818
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
7413
7819
  </xsl:choose>
7414
7820
  </xsl:template><xsl:template name="addPDFUAmeta">
7415
- <xsl:variable name="lang">
7416
- <xsl:call-template name="getLang"/>
7417
- </xsl:variable>
7418
7821
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
7419
7822
  <pdf:dictionary type="normal" key="ViewerPreferences">
7420
7823
  <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
@@ -7639,10 +8042,12 @@
7639
8042
  <xsl:param name="key"/>
7640
8043
  <xsl:param name="formatted">false</xsl:param>
7641
8044
  <xsl:param name="lang"/>
8045
+ <xsl:param name="returnEmptyIfNotFound">false</xsl:param>
7642
8046
 
7643
8047
  <xsl:variable name="curr_lang">
7644
8048
  <xsl:choose>
7645
8049
  <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when>
8050
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7646
8051
  <xsl:otherwise>
7647
8052
  <xsl:call-template name="getLang"/>
7648
8053
  </xsl:otherwise>
@@ -7677,6 +8082,7 @@
7677
8082
  </xsl:otherwise>
7678
8083
  </xsl:choose>
7679
8084
  </xsl:when>
8085
+ <xsl:when test="$returnEmptyIfNotFound = 'true'"/>
7680
8086
  <xsl:otherwise>
7681
8087
  <xsl:variable name="key_">
7682
8088
  <xsl:call-template name="capitalize">