metanorma-un 0.5.5 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@
37
37
 
38
38
  <xsl:template match="/">
39
39
  <xsl:call-template name="namespaceCheck"/>
40
- <fo:root font-family="Times New Roman, STIX Two Math, HanSans" font-size="10pt" xml:lang="{$lang}">
40
+ <fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
41
41
  <fo:layout-master-set>
42
42
  <!-- Cover page -->
43
43
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -162,7 +162,40 @@
162
162
  <fo:block margin-left="-20mm">
163
163
  <fo:block font-size="17pt" margin-bottom="16pt">
164
164
  <xsl:value-of select="$title"/>
165
+
166
+ <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']">
167
+ <xsl:variable name="number" select="position()"/>
168
+ <fo:inline font-size="14pt" baseline-shift="15%" font-weight="normal">
169
+ <xsl:if test="$number = 1">
170
+ <xsl:text> </xsl:text>
171
+ </xsl:if>
172
+ <fo:basic-link internal-destination="title-footnote_{$number}" fox:alt-text="title footnote">
173
+ <xsl:call-template name="repeat">
174
+ <xsl:with-param name="char" select="'*'"/>
175
+ <xsl:with-param name="count" select="$number"/>
176
+ </xsl:call-template>
177
+ </fo:basic-link>
178
+ <xsl:if test="position() != last()"><fo:inline baseline-shift="20%">,</fo:inline></xsl:if>
179
+ </fo:inline>
180
+ </xsl:for-each>
181
+
182
+ <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']">
183
+ <xsl:variable name="number" select="position()"/>
184
+ <fo:block id="title-footnote_{$number}" font-size="14pt" font-weight="normal">
185
+ <xsl:if test="$number = 1">
186
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
187
+ </xsl:if>
188
+ <xsl:call-template name="repeat">
189
+ <xsl:with-param name="char" select="'*'"/>
190
+ <xsl:with-param name="count" select="$number"/>
191
+ </xsl:call-template>
192
+ <xsl:text> </xsl:text>
193
+ <xsl:apply-templates/>
194
+ </fo:block>
195
+ </xsl:for-each>
196
+
165
197
  </fo:block>
198
+
166
199
  <fo:block font-size="14pt" margin-bottom="16pt">
167
200
  <xsl:value-of select="/un:un-standard/un:bibdata/un:title[@language = 'en' and @type = 'subtitle']"/>
168
201
  </fo:block>
@@ -583,7 +616,7 @@
583
616
  <xsl:when test="ancestor::*[un:annex]">
584
617
  <xsl:choose>
585
618
  <xsl:when test="$level = 1">
586
- <xsl:number format="a)"/>
619
+ <xsl:number format="a)" lang="en"/>
587
620
  </xsl:when>
588
621
  <xsl:when test="$level = 2">
589
622
  <xsl:number format="i)"/>
@@ -1214,13 +1247,22 @@
1214
1247
  <title-part lang="en">
1215
1248
 
1216
1249
 
1250
+
1217
1251
  </title-part>
1218
1252
  <title-part lang="fr">
1219
1253
 
1220
1254
 
1255
+
1221
1256
  </title-part>
1222
1257
  <title-part lang="zh">第 # 部分:</title-part>
1223
1258
 
1259
+ <title-subpart lang="en">
1260
+
1261
+ </title-subpart>
1262
+ <title-subpart lang="fr">
1263
+
1264
+ </title-subpart>
1265
+
1224
1266
  <title-modified lang="en">modified</title-modified>
1225
1267
  <title-modified lang="fr">modifiée</title-modified>
1226
1268
 
@@ -1475,6 +1517,7 @@
1475
1517
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1476
1518
 
1477
1519
 
1520
+
1478
1521
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1479
1522
 
1480
1523
 
@@ -1517,6 +1560,7 @@
1517
1560
 
1518
1561
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1519
1562
 
1563
+
1520
1564
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1521
1565
 
1522
1566
 
@@ -1541,6 +1585,7 @@
1541
1585
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1542
1586
 
1543
1587
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1588
+
1544
1589
 
1545
1590
 
1546
1591
 
@@ -1662,7 +1707,9 @@
1662
1707
 
1663
1708
 
1664
1709
 
1665
-
1710
+ <!-- <xsl:if test="$namespace = 'bipm'">
1711
+ <fo:block>&#xA0;</fo:block>
1712
+ </xsl:if> -->
1666
1713
 
1667
1714
  <!-- $namespace = 'iso' or -->
1668
1715
 
@@ -1696,10 +1743,12 @@
1696
1743
 
1697
1744
 
1698
1745
  <xsl:variable name="colwidths">
1699
- <xsl:call-template name="calculate-column-widths">
1700
- <xsl:with-param name="cols-count" select="$cols-count"/>
1701
- <xsl:with-param name="table" select="$simple-table"/>
1702
- </xsl:call-template>
1746
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1747
+ <xsl:call-template name="calculate-column-widths">
1748
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1749
+ <xsl:with-param name="table" select="$simple-table"/>
1750
+ </xsl:call-template>
1751
+ </xsl:if>
1703
1752
  </xsl:variable>
1704
1753
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1705
1754
 
@@ -1772,16 +1821,25 @@
1772
1821
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1773
1822
  </xsl:if>
1774
1823
 
1775
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1776
- <xsl:choose>
1777
- <xsl:when test=". = 1 or . = 0">
1778
- <fo:table-column column-width="proportional-column-width(2)"/>
1779
- </xsl:when>
1780
- <xsl:otherwise>
1781
- <fo:table-column column-width="proportional-column-width({.})"/>
1782
- </xsl:otherwise>
1783
- </xsl:choose>
1784
- </xsl:for-each>
1824
+ <xsl:choose>
1825
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1826
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1827
+ <fo:table-column column-width="{@width}"/>
1828
+ </xsl:for-each>
1829
+ </xsl:when>
1830
+ <xsl:otherwise>
1831
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1832
+ <xsl:choose>
1833
+ <xsl:when test=". = 1 or . = 0">
1834
+ <fo:table-column column-width="proportional-column-width(2)"/>
1835
+ </xsl:when>
1836
+ <xsl:otherwise>
1837
+ <fo:table-column column-width="proportional-column-width({.})"/>
1838
+ </xsl:otherwise>
1839
+ </xsl:choose>
1840
+ </xsl:for-each>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1785
1843
 
1786
1844
  <xsl:choose>
1787
1845
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1794,10 +1852,12 @@
1794
1852
 
1795
1853
  </fo:table>
1796
1854
 
1855
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1797
1856
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1798
1857
  <xsl:call-template name="insertTableFooterInSeparateTable">
1799
1858
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1800
1859
  <xsl:with-param name="colwidths" select="$colwidths"/>
1860
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1801
1861
  </xsl:call-template>
1802
1862
  </xsl:for-each>
1803
1863
 
@@ -1830,6 +1890,7 @@
1830
1890
  <xsl:if test="normalize-space() != ''">
1831
1891
  <fo:block xsl:use-attribute-sets="table-name-style">
1832
1892
 
1893
+
1833
1894
  <xsl:apply-templates/>
1834
1895
  </fo:block>
1835
1896
  </xsl:if>
@@ -2012,12 +2073,26 @@
2012
2073
 
2013
2074
 
2014
2075
 
2015
- <!-- except gb and bipm -->
2016
2076
 
2017
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2018
2077
 
2019
2078
 
2079
+ <!-- except gb -->
2020
2080
 
2081
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2082
+
2083
+
2084
+ <!-- show Note under table in preface (ex. abstract) sections -->
2085
+ <!-- empty, because notes show at page side in main sections -->
2086
+ <!-- <xsl:if test="$namespace = 'bipm'">
2087
+ <xsl:choose>
2088
+ <xsl:when test="ancestor::*[local-name()='preface']">
2089
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2090
+ </xsl:when>
2091
+ <xsl:otherwise>
2092
+ <fo:block/>
2093
+ </xsl:otherwise>
2094
+ </xsl:choose>
2095
+ </xsl:if> -->
2021
2096
 
2022
2097
 
2023
2098
  <!-- horizontal row separator -->
@@ -2036,12 +2111,22 @@
2036
2111
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2037
2112
  <xsl:param name="table_attributes"/>
2038
2113
  <xsl:param name="colwidths"/>
2114
+ <xsl:param name="colgroup"/>
2039
2115
 
2040
2116
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2041
2117
 
2042
2118
  <xsl:if test="$isNoteOrFnExist = 'true'">
2043
2119
 
2044
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2120
+ <xsl:variable name="cols-count">
2121
+ <xsl:choose>
2122
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2123
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
2124
+ </xsl:when>
2125
+ <xsl:otherwise>
2126
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
2127
+ </xsl:otherwise>
2128
+ </xsl:choose>
2129
+ </xsl:variable>
2045
2130
 
2046
2131
  <fo:table keep-with-previous="always">
2047
2132
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -2059,16 +2144,25 @@
2059
2144
  </xsl:choose>
2060
2145
  </xsl:for-each>
2061
2146
 
2062
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2063
- <xsl:choose>
2064
- <xsl:when test=". = 1 or . = 0">
2065
- <fo:table-column column-width="proportional-column-width(2)"/>
2066
- </xsl:when>
2067
- <xsl:otherwise>
2068
- <fo:table-column column-width="proportional-column-width({.})"/>
2069
- </xsl:otherwise>
2070
- </xsl:choose>
2071
- </xsl:for-each>
2147
+ <xsl:choose>
2148
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2149
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2150
+ <fo:table-column column-width="{@width}"/>
2151
+ </xsl:for-each>
2152
+ </xsl:when>
2153
+ <xsl:otherwise>
2154
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2155
+ <xsl:choose>
2156
+ <xsl:when test=". = 1 or . = 0">
2157
+ <fo:table-column column-width="proportional-column-width(2)"/>
2158
+ </xsl:when>
2159
+ <xsl:otherwise>
2160
+ <fo:table-column column-width="proportional-column-width({.})"/>
2161
+ </xsl:otherwise>
2162
+ </xsl:choose>
2163
+ </xsl:for-each>
2164
+ </xsl:otherwise>
2165
+ </xsl:choose>
2072
2166
 
2073
2167
  <fo:table-body>
2074
2168
  <fo:table-row>
@@ -2080,7 +2174,11 @@
2080
2174
 
2081
2175
 
2082
2176
 
2083
- <!-- except gb and bipm -->
2177
+
2178
+
2179
+
2180
+
2181
+ <!-- except gb -->
2084
2182
 
2085
2183
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2086
2184
 
@@ -2170,6 +2268,10 @@
2170
2268
 
2171
2269
 
2172
2270
 
2271
+ <!-- <xsl:if test="$namespace = 'bipm'">
2272
+ <xsl:attribute name="height">8mm</xsl:attribute>
2273
+ </xsl:if> -->
2274
+
2173
2275
  <xsl:apply-templates/>
2174
2276
  </fo:table-row>
2175
2277
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -2269,7 +2371,8 @@
2269
2371
  </xsl:attribute>
2270
2372
  </xsl:if>
2271
2373
  <xsl:call-template name="display-align"/>
2272
- <fo:block>
2374
+ <fo:block>
2375
+
2273
2376
  <xsl:apply-templates/>
2274
2377
  </fo:block>
2275
2378
  </fo:table-cell>
@@ -2491,7 +2594,13 @@
2491
2594
  <xsl:apply-templates/>
2492
2595
  </fo:inline>
2493
2596
  </xsl:template><xsl:template match="*[local-name()='dl']">
2494
- <fo:block-container margin-left="0mm">
2597
+ <fo:block-container>
2598
+
2599
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2600
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2601
+ </xsl:if>
2602
+
2603
+
2495
2604
  <xsl:if test="parent::*[local-name() = 'note']">
2496
2605
  <xsl:attribute name="margin-left">
2497
2606
  <xsl:choose>
@@ -2501,8 +2610,12 @@
2501
2610
  </xsl:attribute>
2502
2611
 
2503
2612
  </xsl:if>
2504
- <fo:block-container margin-left="0mm">
2505
-
2613
+ <fo:block-container>
2614
+
2615
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2616
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2617
+
2618
+
2506
2619
  <xsl:variable name="parent" select="local-name(..)"/>
2507
2620
 
2508
2621
  <xsl:variable name="key_iso">
@@ -2516,9 +2629,12 @@
2516
2629
  <fo:block margin-bottom="12pt" text-align="left">
2517
2630
 
2518
2631
  <xsl:variable name="title-where">
2519
- <xsl:call-template name="getTitle">
2520
- <xsl:with-param name="name" select="'title-where'"/>
2521
- </xsl:call-template>
2632
+
2633
+
2634
+ <xsl:call-template name="getTitle">
2635
+ <xsl:with-param name="name" select="'title-where'"/>
2636
+ </xsl:call-template>
2637
+
2522
2638
  </xsl:variable>
2523
2639
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2524
2640
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2534,9 +2650,12 @@
2534
2650
 
2535
2651
 
2536
2652
  <xsl:variable name="title-where">
2537
- <xsl:call-template name="getTitle">
2538
- <xsl:with-param name="name" select="'title-where'"/>
2539
- </xsl:call-template>
2653
+
2654
+
2655
+ <xsl:call-template name="getTitle">
2656
+ <xsl:with-param name="name" select="'title-where'"/>
2657
+ </xsl:call-template>
2658
+
2540
2659
  </xsl:variable>
2541
2660
  <xsl:value-of select="$title-where"/>
2542
2661
  </fo:block>
@@ -2547,9 +2666,12 @@
2547
2666
 
2548
2667
 
2549
2668
  <xsl:variable name="title-key">
2550
- <xsl:call-template name="getTitle">
2551
- <xsl:with-param name="name" select="'title-key'"/>
2552
- </xsl:call-template>
2669
+
2670
+
2671
+ <xsl:call-template name="getTitle">
2672
+ <xsl:with-param name="name" select="'title-key'"/>
2673
+ </xsl:call-template>
2674
+
2553
2675
  </xsl:variable>
2554
2676
  <xsl:value-of select="$title-key"/>
2555
2677
  </fo:block>
@@ -2675,12 +2797,32 @@
2675
2797
  </xsl:otherwise>
2676
2798
  </xsl:choose>
2677
2799
  </xsl:template><xsl:template name="getMaxLength_dt">
2678
- <xsl:for-each select="*[local-name()='dt']">
2679
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2680
- <xsl:if test="position() = 1">
2681
- <xsl:value-of select="string-length(normalize-space(.))"/>
2682
- </xsl:if>
2683
- </xsl:for-each>
2800
+ <xsl:variable name="lengths">
2801
+ <xsl:for-each select="*[local-name()='dt']">
2802
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2803
+ <xsl:variable name="attributes">
2804
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2805
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2806
+ </xsl:variable>
2807
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2808
+ </xsl:for-each>
2809
+ </xsl:variable>
2810
+ <xsl:variable name="maxLength">
2811
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2812
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2813
+ <xsl:if test="position() = 1">
2814
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2815
+ </xsl:if>
2816
+ </xsl:for-each> -->
2817
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2818
+ <xsl:sort select="." data-type="number" order="descending"/>
2819
+ <xsl:if test="position() = 1">
2820
+ <xsl:value-of select="."/>
2821
+ </xsl:if>
2822
+ </xsl:for-each>
2823
+ </xsl:variable>
2824
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2825
+ <xsl:value-of select="$maxLength"/>
2684
2826
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2685
2827
  <xsl:param name="key_iso"/>
2686
2828
 
@@ -2792,6 +2934,7 @@
2792
2934
  </fo:inline>
2793
2935
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2794
2936
  <fo:inline font-weight="bold">
2937
+
2795
2938
  <xsl:apply-templates/>
2796
2939
  </fo:inline>
2797
2940
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -3120,7 +3263,18 @@
3120
3263
  <xsl:with-param name="previousRow" select="$newRow"/>
3121
3264
  </xsl:apply-templates>
3122
3265
  </xsl:template><xsl:template name="getLang">
3123
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3266
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3267
+ <xsl:variable name="language">
3268
+ <xsl:choose>
3269
+ <xsl:when test="$language_current != ''">
3270
+ <xsl:value-of select="$language_current"/>
3271
+ </xsl:when>
3272
+ <xsl:otherwise>
3273
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3274
+ </xsl:otherwise>
3275
+ </xsl:choose>
3276
+ </xsl:variable>
3277
+
3124
3278
  <xsl:choose>
3125
3279
  <xsl:when test="$language = 'English'">en</xsl:when>
3126
3280
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3155,6 +3309,7 @@
3155
3309
  <xsl:value-of select="substring($str, 2)"/>
3156
3310
  </xsl:template><xsl:template match="mathml:math">
3157
3311
  <fo:inline font-family="STIX Two Math"> <!-- -->
3312
+
3158
3313
  <xsl:variable name="mathml">
3159
3314
  <xsl:apply-templates select="." mode="mathml"/>
3160
3315
  </xsl:variable>
@@ -3184,6 +3339,7 @@
3184
3339
  </xsl:choose>
3185
3340
  </xsl:variable>
3186
3341
  <fo:inline xsl:use-attribute-sets="link-style">
3342
+
3187
3343
  <xsl:choose>
3188
3344
  <xsl:when test="$target = ''">
3189
3345
  <xsl:apply-templates/>
@@ -3237,10 +3393,14 @@
3237
3393
  </fo:inline>
3238
3394
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3239
3395
  <xsl:variable name="title-modified">
3240
- <xsl:call-template name="getTitle">
3241
- <xsl:with-param name="name" select="'title-modified'"/>
3242
- </xsl:call-template>
3396
+
3397
+
3398
+ <xsl:call-template name="getTitle">
3399
+ <xsl:with-param name="name" select="'title-modified'"/>
3400
+ </xsl:call-template>
3401
+
3243
3402
  </xsl:variable>
3403
+
3244
3404
  <xsl:choose>
3245
3405
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3246
3406
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3310,6 +3470,8 @@
3310
3470
 
3311
3471
 
3312
3472
 
3473
+
3474
+
3313
3475
  <fo:inline xsl:use-attribute-sets="note-name-style">
3314
3476
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3315
3477
  </fo:inline>
@@ -3402,7 +3564,8 @@
3402
3564
  </fo:inline>
3403
3565
  </xsl:if>
3404
3566
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3405
- <fo:block-container id="{@id}">
3567
+ <fo:block-container id="{@id}">
3568
+
3406
3569
  <fo:block>
3407
3570
  <xsl:apply-templates/>
3408
3571
  </fo:block>
@@ -3453,7 +3616,7 @@
3453
3616
  <xsl:apply-templates mode="bookmarks"/>
3454
3617
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3455
3618
  <xsl:apply-templates select="."/>
3456
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3619
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3457
3620
  <xsl:apply-templates mode="bookmarks"/>
3458
3621
  </xsl:template><xsl:template name="addBookmarks">
3459
3622
  <xsl:param name="contents"/>
@@ -3469,6 +3632,8 @@
3469
3632
  <xsl:variable name="bookmark-title_">
3470
3633
  <xsl:call-template name="getLangVersion">
3471
3634
  <xsl:with-param name="lang" select="@lang"/>
3635
+ <xsl:with-param name="doctype" select="@doctype"/>
3636
+ <xsl:with-param name="title" select="@title-part"/>
3472
3637
  </xsl:call-template>
3473
3638
  </xsl:variable>
3474
3639
  <xsl:choose>
@@ -3486,13 +3651,34 @@
3486
3651
  </xsl:choose>
3487
3652
  </fo:bookmark-title>
3488
3653
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3654
+
3655
+ <xsl:call-template name="insertFigureBookmarks">
3656
+ <xsl:with-param name="contents" select="contents"/>
3657
+ </xsl:call-template>
3658
+
3659
+ <xsl:call-template name="insertTableBookmarks">
3660
+ <xsl:with-param name="contents" select="contents"/>
3661
+ <xsl:with-param name="lang" select="@lang"/>
3662
+ </xsl:call-template>
3663
+
3489
3664
  </fo:bookmark>
3490
3665
 
3491
3666
  </xsl:for-each>
3492
3667
  </xsl:when>
3493
3668
  <xsl:otherwise>
3494
3669
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3670
+
3495
3671
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3672
+
3673
+ <xsl:call-template name="insertFigureBookmarks">
3674
+ <xsl:with-param name="contents" select="contents"/>
3675
+ </xsl:call-template>
3676
+
3677
+ <xsl:call-template name="insertTableBookmarks">
3678
+ <xsl:with-param name="contents" select="contents"/>
3679
+ <xsl:with-param name="lang" select="@lang"/>
3680
+ </xsl:call-template>
3681
+
3496
3682
  </xsl:for-each>
3497
3683
  </xsl:otherwise>
3498
3684
  </xsl:choose>
@@ -3511,8 +3697,44 @@
3511
3697
 
3512
3698
  </fo:bookmark-tree>
3513
3699
  </xsl:if>
3700
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3701
+ <xsl:param name="contents"/>
3702
+ <xsl:if test="xalan:nodeset($contents)/figure">
3703
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3704
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3705
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3706
+ <fo:bookmark internal-destination="{@id}">
3707
+ <fo:bookmark-title>
3708
+ <xsl:value-of select="normalize-space(title)"/>
3709
+ </fo:bookmark-title>
3710
+ </fo:bookmark>
3711
+ </xsl:for-each>
3712
+ </fo:bookmark>
3713
+ </xsl:if>
3714
+ </xsl:template><xsl:template name="insertTableBookmarks">
3715
+ <xsl:param name="contents"/>
3716
+ <xsl:param name="lang"/>
3717
+ <xsl:if test="xalan:nodeset($contents)/table">
3718
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3719
+ <fo:bookmark-title>
3720
+ <xsl:choose>
3721
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3722
+ <xsl:otherwise>Tables</xsl:otherwise>
3723
+ </xsl:choose>
3724
+ </fo:bookmark-title>
3725
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3726
+ <fo:bookmark internal-destination="{@id}">
3727
+ <fo:bookmark-title>
3728
+ <xsl:value-of select="normalize-space(title)"/>
3729
+ </fo:bookmark-title>
3730
+ </fo:bookmark>
3731
+ </xsl:for-each>
3732
+ </fo:bookmark>
3733
+ </xsl:if>
3514
3734
  </xsl:template><xsl:template name="getLangVersion">
3515
3735
  <xsl:param name="lang"/>
3736
+ <xsl:param name="doctype" select="''"/>
3737
+ <xsl:param name="title" select="''"/>
3516
3738
  <xsl:choose>
3517
3739
  <xsl:when test="$lang = 'en'">
3518
3740
 
@@ -4000,7 +4222,8 @@
4000
4222
  <fo:block-container margin-left="0mm">
4001
4223
 
4002
4224
  <fo:block xsl:use-attribute-sets="quote-style">
4003
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4225
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4226
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4004
4227
  </fo:block>
4005
4228
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4006
4229
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4126,9 +4349,12 @@
4126
4349
  </fo:block>
4127
4350
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4128
4351
  <xsl:variable name="title-deprecated">
4129
- <xsl:call-template name="getTitle">
4130
- <xsl:with-param name="name" select="'title-deprecated'"/>
4131
- </xsl:call-template>
4352
+
4353
+
4354
+ <xsl:call-template name="getTitle">
4355
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4356
+ </xsl:call-template>
4357
+
4132
4358
  </xsl:variable>
4133
4359
  <fo:block xsl:use-attribute-sets="deprecates-style">
4134
4360
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4182,7 +4408,7 @@
4182
4408
  <fo:block id="{@id}">
4183
4409
  <xsl:apply-templates/>
4184
4410
  </fo:block>
4185
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4411
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4186
4412
 
4187
4413
  <fo:block id="{@id}">
4188
4414
  <xsl:apply-templates/>
@@ -4244,7 +4470,8 @@
4244
4470
  <fo:table-column column-width="107mm"/>
4245
4471
  <fo:table-column column-width="15mm"/>
4246
4472
  <fo:table-body>
4247
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4473
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4474
+
4248
4475
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4249
4476
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4250
4477
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4262,6 +4489,10 @@
4262
4489
  <fo:block><xsl:apply-templates/></fo:block>
4263
4490
  </fo:table-cell>
4264
4491
  </xsl:template><xsl:template name="processBibitem">
4492
+
4493
+
4494
+ <!-- end BIPM bibitem processing-->
4495
+
4265
4496
 
4266
4497
 
4267
4498
 
@@ -4499,13 +4730,22 @@
4499
4730
  </xsl:template><xsl:template name="split">
4500
4731
  <xsl:param name="pText" select="."/>
4501
4732
  <xsl:param name="sep" select="','"/>
4733
+ <xsl:param name="normalize-space" select="'true'"/>
4502
4734
  <xsl:if test="string-length($pText) &gt;0">
4503
4735
  <item>
4504
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4736
+ <xsl:choose>
4737
+ <xsl:when test="$normalize-space = 'true'">
4738
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4739
+ </xsl:when>
4740
+ <xsl:otherwise>
4741
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4742
+ </xsl:otherwise>
4743
+ </xsl:choose>
4505
4744
  </item>
4506
4745
  <xsl:call-template name="split">
4507
4746
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4508
4747
  <xsl:with-param name="sep" select="$sep"/>
4748
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4509
4749
  </xsl:call-template>
4510
4750
  </xsl:if>
4511
4751
  </xsl:template><xsl:template name="getDocumentId">
@@ -4571,4 +4811,23 @@
4571
4811
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4572
4812
  </xsl:call-template>
4573
4813
  </xsl:if>
4814
+ </xsl:template><xsl:template name="repeat">
4815
+ <xsl:param name="char" select="'*'"/>
4816
+ <xsl:param name="count"/>
4817
+ <xsl:if test="$count &gt; 0">
4818
+ <xsl:value-of select="$char"/>
4819
+ <xsl:call-template name="repeat">
4820
+ <xsl:with-param name="char" select="$char"/>
4821
+ <xsl:with-param name="count" select="$count - 1"/>
4822
+ </xsl:call-template>
4823
+ </xsl:if>
4824
+ </xsl:template><xsl:template name="getLocalizedString">
4825
+ <xsl:param name="key"/>
4826
+
4827
+ <xsl:variable name="curr_lang">
4828
+ <xsl:call-template name="getLang"/>
4829
+ </xsl:variable>
4830
+
4831
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4832
+
4574
4833
  </xsl:template></xsl:stylesheet>