metanorma-un 0.5.6 → 0.5.11

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
 
@@ -1518,6 +1560,7 @@
1518
1560
 
1519
1561
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1520
1562
 
1563
+
1521
1564
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1522
1565
 
1523
1566
 
@@ -1542,6 +1585,7 @@
1542
1585
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1543
1586
 
1544
1587
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1588
+
1545
1589
 
1546
1590
 
1547
1591
 
@@ -1663,7 +1707,9 @@
1663
1707
 
1664
1708
 
1665
1709
 
1666
-
1710
+ <!-- <xsl:if test="$namespace = 'bipm'">
1711
+ <fo:block>&#xA0;</fo:block>
1712
+ </xsl:if> -->
1667
1713
 
1668
1714
  <!-- $namespace = 'iso' or -->
1669
1715
 
@@ -1697,10 +1743,12 @@
1697
1743
 
1698
1744
 
1699
1745
  <xsl:variable name="colwidths">
1700
- <xsl:call-template name="calculate-column-widths">
1701
- <xsl:with-param name="cols-count" select="$cols-count"/>
1702
- <xsl:with-param name="table" select="$simple-table"/>
1703
- </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>
1704
1752
  </xsl:variable>
1705
1753
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1706
1754
 
@@ -1742,7 +1790,12 @@
1742
1790
 
1743
1791
  <xsl:variable name="table_attributes">
1744
1792
  <attribute name="table-layout">fixed</attribute>
1745
- <attribute name="width">100%</attribute>
1793
+ <attribute name="width">
1794
+ <xsl:choose>
1795
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1796
+ <xsl:otherwise>100%</xsl:otherwise>
1797
+ </xsl:choose>
1798
+ </attribute>
1746
1799
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1747
1800
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1748
1801
 
@@ -1773,16 +1826,25 @@
1773
1826
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1774
1827
  </xsl:if>
1775
1828
 
1776
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1777
- <xsl:choose>
1778
- <xsl:when test=". = 1 or . = 0">
1779
- <fo:table-column column-width="proportional-column-width(2)"/>
1780
- </xsl:when>
1781
- <xsl:otherwise>
1782
- <fo:table-column column-width="proportional-column-width({.})"/>
1783
- </xsl:otherwise>
1784
- </xsl:choose>
1785
- </xsl:for-each>
1829
+ <xsl:choose>
1830
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1831
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1832
+ <fo:table-column column-width="{@width}"/>
1833
+ </xsl:for-each>
1834
+ </xsl:when>
1835
+ <xsl:otherwise>
1836
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1837
+ <xsl:choose>
1838
+ <xsl:when test=". = 1 or . = 0">
1839
+ <fo:table-column column-width="proportional-column-width(2)"/>
1840
+ </xsl:when>
1841
+ <xsl:otherwise>
1842
+ <fo:table-column column-width="proportional-column-width({.})"/>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1845
+ </xsl:for-each>
1846
+ </xsl:otherwise>
1847
+ </xsl:choose>
1786
1848
 
1787
1849
  <xsl:choose>
1788
1850
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1795,10 +1857,12 @@
1795
1857
 
1796
1858
  </fo:table>
1797
1859
 
1860
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1798
1861
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1799
1862
  <xsl:call-template name="insertTableFooterInSeparateTable">
1800
1863
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1801
1864
  <xsl:with-param name="colwidths" select="$colwidths"/>
1865
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1802
1866
  </xsl:call-template>
1803
1867
  </xsl:for-each>
1804
1868
 
@@ -1831,6 +1895,7 @@
1831
1895
  <xsl:if test="normalize-space() != ''">
1832
1896
  <fo:block xsl:use-attribute-sets="table-name-style">
1833
1897
 
1898
+
1834
1899
  <xsl:apply-templates/>
1835
1900
  </fo:block>
1836
1901
  </xsl:if>
@@ -2051,12 +2116,22 @@
2051
2116
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2052
2117
  <xsl:param name="table_attributes"/>
2053
2118
  <xsl:param name="colwidths"/>
2119
+ <xsl:param name="colgroup"/>
2054
2120
 
2055
2121
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2056
2122
 
2057
2123
  <xsl:if test="$isNoteOrFnExist = 'true'">
2058
2124
 
2059
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2125
+ <xsl:variable name="cols-count">
2126
+ <xsl:choose>
2127
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2128
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
2129
+ </xsl:when>
2130
+ <xsl:otherwise>
2131
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
2132
+ </xsl:otherwise>
2133
+ </xsl:choose>
2134
+ </xsl:variable>
2060
2135
 
2061
2136
  <fo:table keep-with-previous="always">
2062
2137
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -2074,16 +2149,25 @@
2074
2149
  </xsl:choose>
2075
2150
  </xsl:for-each>
2076
2151
 
2077
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2078
- <xsl:choose>
2079
- <xsl:when test=". = 1 or . = 0">
2080
- <fo:table-column column-width="proportional-column-width(2)"/>
2081
- </xsl:when>
2082
- <xsl:otherwise>
2083
- <fo:table-column column-width="proportional-column-width({.})"/>
2084
- </xsl:otherwise>
2085
- </xsl:choose>
2086
- </xsl:for-each>
2152
+ <xsl:choose>
2153
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2154
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2155
+ <fo:table-column column-width="{@width}"/>
2156
+ </xsl:for-each>
2157
+ </xsl:when>
2158
+ <xsl:otherwise>
2159
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2160
+ <xsl:choose>
2161
+ <xsl:when test=". = 1 or . = 0">
2162
+ <fo:table-column column-width="proportional-column-width(2)"/>
2163
+ </xsl:when>
2164
+ <xsl:otherwise>
2165
+ <fo:table-column column-width="proportional-column-width({.})"/>
2166
+ </xsl:otherwise>
2167
+ </xsl:choose>
2168
+ </xsl:for-each>
2169
+ </xsl:otherwise>
2170
+ </xsl:choose>
2087
2171
 
2088
2172
  <fo:table-body>
2089
2173
  <fo:table-row>
@@ -2188,6 +2272,7 @@
2188
2272
  </xsl:if>
2189
2273
 
2190
2274
 
2275
+
2191
2276
  <!-- <xsl:if test="$namespace = 'bipm'">
2192
2277
  <xsl:attribute name="height">8mm</xsl:attribute>
2193
2278
  </xsl:if> -->
@@ -2291,7 +2376,8 @@
2291
2376
  </xsl:attribute>
2292
2377
  </xsl:if>
2293
2378
  <xsl:call-template name="display-align"/>
2294
- <fo:block>
2379
+ <fo:block>
2380
+
2295
2381
  <xsl:apply-templates/>
2296
2382
  </fo:block>
2297
2383
  </fo:table-cell>
@@ -2513,7 +2599,13 @@
2513
2599
  <xsl:apply-templates/>
2514
2600
  </fo:inline>
2515
2601
  </xsl:template><xsl:template match="*[local-name()='dl']">
2516
- <fo:block-container margin-left="0mm">
2602
+ <fo:block-container>
2603
+
2604
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2605
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2606
+ </xsl:if>
2607
+
2608
+
2517
2609
  <xsl:if test="parent::*[local-name() = 'note']">
2518
2610
  <xsl:attribute name="margin-left">
2519
2611
  <xsl:choose>
@@ -2523,8 +2615,12 @@
2523
2615
  </xsl:attribute>
2524
2616
 
2525
2617
  </xsl:if>
2526
- <fo:block-container margin-left="0mm">
2527
-
2618
+ <fo:block-container>
2619
+
2620
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2621
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2622
+
2623
+
2528
2624
  <xsl:variable name="parent" select="local-name(..)"/>
2529
2625
 
2530
2626
  <xsl:variable name="key_iso">
@@ -2538,9 +2634,12 @@
2538
2634
  <fo:block margin-bottom="12pt" text-align="left">
2539
2635
 
2540
2636
  <xsl:variable name="title-where">
2541
- <xsl:call-template name="getTitle">
2542
- <xsl:with-param name="name" select="'title-where'"/>
2543
- </xsl:call-template>
2637
+
2638
+
2639
+ <xsl:call-template name="getTitle">
2640
+ <xsl:with-param name="name" select="'title-where'"/>
2641
+ </xsl:call-template>
2642
+
2544
2643
  </xsl:variable>
2545
2644
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2546
2645
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2556,9 +2655,12 @@
2556
2655
 
2557
2656
 
2558
2657
  <xsl:variable name="title-where">
2559
- <xsl:call-template name="getTitle">
2560
- <xsl:with-param name="name" select="'title-where'"/>
2561
- </xsl:call-template>
2658
+
2659
+
2660
+ <xsl:call-template name="getTitle">
2661
+ <xsl:with-param name="name" select="'title-where'"/>
2662
+ </xsl:call-template>
2663
+
2562
2664
  </xsl:variable>
2563
2665
  <xsl:value-of select="$title-where"/>
2564
2666
  </fo:block>
@@ -2569,9 +2671,12 @@
2569
2671
 
2570
2672
 
2571
2673
  <xsl:variable name="title-key">
2572
- <xsl:call-template name="getTitle">
2573
- <xsl:with-param name="name" select="'title-key'"/>
2574
- </xsl:call-template>
2674
+
2675
+
2676
+ <xsl:call-template name="getTitle">
2677
+ <xsl:with-param name="name" select="'title-key'"/>
2678
+ </xsl:call-template>
2679
+
2575
2680
  </xsl:variable>
2576
2681
  <xsl:value-of select="$title-key"/>
2577
2682
  </fo:block>
@@ -2697,12 +2802,32 @@
2697
2802
  </xsl:otherwise>
2698
2803
  </xsl:choose>
2699
2804
  </xsl:template><xsl:template name="getMaxLength_dt">
2700
- <xsl:for-each select="*[local-name()='dt']">
2701
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2702
- <xsl:if test="position() = 1">
2703
- <xsl:value-of select="string-length(normalize-space(.))"/>
2704
- </xsl:if>
2705
- </xsl:for-each>
2805
+ <xsl:variable name="lengths">
2806
+ <xsl:for-each select="*[local-name()='dt']">
2807
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2808
+ <xsl:variable name="attributes">
2809
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2810
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2811
+ </xsl:variable>
2812
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2813
+ </xsl:for-each>
2814
+ </xsl:variable>
2815
+ <xsl:variable name="maxLength">
2816
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2817
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2818
+ <xsl:if test="position() = 1">
2819
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2820
+ </xsl:if>
2821
+ </xsl:for-each> -->
2822
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2823
+ <xsl:sort select="." data-type="number" order="descending"/>
2824
+ <xsl:if test="position() = 1">
2825
+ <xsl:value-of select="."/>
2826
+ </xsl:if>
2827
+ </xsl:for-each>
2828
+ </xsl:variable>
2829
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2830
+ <xsl:value-of select="$maxLength"/>
2706
2831
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2707
2832
  <xsl:param name="key_iso"/>
2708
2833
 
@@ -2814,6 +2939,7 @@
2814
2939
  </fo:inline>
2815
2940
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2816
2941
  <fo:inline font-weight="bold">
2942
+
2817
2943
  <xsl:apply-templates/>
2818
2944
  </fo:inline>
2819
2945
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2853,6 +2979,10 @@
2853
2979
  </xsl:if>
2854
2980
  <xsl:apply-templates/>
2855
2981
  </fo:inline>
2982
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2983
+ <fo:inline text-decoration="underline">
2984
+ <xsl:apply-templates/>
2985
+ </fo:inline>
2856
2986
  </xsl:template><xsl:template match="*[local-name()='del']">
2857
2987
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2858
2988
  <xsl:apply-templates/>
@@ -3142,7 +3272,18 @@
3142
3272
  <xsl:with-param name="previousRow" select="$newRow"/>
3143
3273
  </xsl:apply-templates>
3144
3274
  </xsl:template><xsl:template name="getLang">
3145
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3275
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3276
+ <xsl:variable name="language">
3277
+ <xsl:choose>
3278
+ <xsl:when test="$language_current != ''">
3279
+ <xsl:value-of select="$language_current"/>
3280
+ </xsl:when>
3281
+ <xsl:otherwise>
3282
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3283
+ </xsl:otherwise>
3284
+ </xsl:choose>
3285
+ </xsl:variable>
3286
+
3146
3287
  <xsl:choose>
3147
3288
  <xsl:when test="$language = 'English'">en</xsl:when>
3148
3289
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3177,6 +3318,7 @@
3177
3318
  <xsl:value-of select="substring($str, 2)"/>
3178
3319
  </xsl:template><xsl:template match="mathml:math">
3179
3320
  <fo:inline font-family="STIX Two Math"> <!-- -->
3321
+
3180
3322
  <xsl:variable name="mathml">
3181
3323
  <xsl:apply-templates select="." mode="mathml"/>
3182
3324
  </xsl:variable>
@@ -3206,6 +3348,7 @@
3206
3348
  </xsl:choose>
3207
3349
  </xsl:variable>
3208
3350
  <fo:inline xsl:use-attribute-sets="link-style">
3351
+
3209
3352
  <xsl:choose>
3210
3353
  <xsl:when test="$target = ''">
3211
3354
  <xsl:apply-templates/>
@@ -3259,10 +3402,14 @@
3259
3402
  </fo:inline>
3260
3403
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3261
3404
  <xsl:variable name="title-modified">
3262
- <xsl:call-template name="getTitle">
3263
- <xsl:with-param name="name" select="'title-modified'"/>
3264
- </xsl:call-template>
3405
+
3406
+
3407
+ <xsl:call-template name="getTitle">
3408
+ <xsl:with-param name="name" select="'title-modified'"/>
3409
+ </xsl:call-template>
3410
+
3265
3411
  </xsl:variable>
3412
+
3266
3413
  <xsl:choose>
3267
3414
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3268
3415
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3426,7 +3573,8 @@
3426
3573
  </fo:inline>
3427
3574
  </xsl:if>
3428
3575
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
3429
- <fo:block-container id="{@id}">
3576
+ <fo:block-container id="{@id}">
3577
+
3430
3578
  <fo:block>
3431
3579
  <xsl:apply-templates/>
3432
3580
  </fo:block>
@@ -3477,7 +3625,7 @@
3477
3625
  <xsl:apply-templates mode="bookmarks"/>
3478
3626
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3479
3627
  <xsl:apply-templates select="."/>
3480
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3628
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3481
3629
  <xsl:apply-templates mode="bookmarks"/>
3482
3630
  </xsl:template><xsl:template name="addBookmarks">
3483
3631
  <xsl:param name="contents"/>
@@ -3493,6 +3641,8 @@
3493
3641
  <xsl:variable name="bookmark-title_">
3494
3642
  <xsl:call-template name="getLangVersion">
3495
3643
  <xsl:with-param name="lang" select="@lang"/>
3644
+ <xsl:with-param name="doctype" select="@doctype"/>
3645
+ <xsl:with-param name="title" select="@title-part"/>
3496
3646
  </xsl:call-template>
3497
3647
  </xsl:variable>
3498
3648
  <xsl:choose>
@@ -3510,13 +3660,34 @@
3510
3660
  </xsl:choose>
3511
3661
  </fo:bookmark-title>
3512
3662
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3663
+
3664
+ <xsl:call-template name="insertFigureBookmarks">
3665
+ <xsl:with-param name="contents" select="contents"/>
3666
+ </xsl:call-template>
3667
+
3668
+ <xsl:call-template name="insertTableBookmarks">
3669
+ <xsl:with-param name="contents" select="contents"/>
3670
+ <xsl:with-param name="lang" select="@lang"/>
3671
+ </xsl:call-template>
3672
+
3513
3673
  </fo:bookmark>
3514
3674
 
3515
3675
  </xsl:for-each>
3516
3676
  </xsl:when>
3517
3677
  <xsl:otherwise>
3518
3678
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3679
+
3519
3680
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3681
+
3682
+ <xsl:call-template name="insertFigureBookmarks">
3683
+ <xsl:with-param name="contents" select="contents"/>
3684
+ </xsl:call-template>
3685
+
3686
+ <xsl:call-template name="insertTableBookmarks">
3687
+ <xsl:with-param name="contents" select="contents"/>
3688
+ <xsl:with-param name="lang" select="@lang"/>
3689
+ </xsl:call-template>
3690
+
3520
3691
  </xsl:for-each>
3521
3692
  </xsl:otherwise>
3522
3693
  </xsl:choose>
@@ -3535,8 +3706,44 @@
3535
3706
 
3536
3707
  </fo:bookmark-tree>
3537
3708
  </xsl:if>
3709
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3710
+ <xsl:param name="contents"/>
3711
+ <xsl:if test="xalan:nodeset($contents)/figure">
3712
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3713
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3714
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3715
+ <fo:bookmark internal-destination="{@id}">
3716
+ <fo:bookmark-title>
3717
+ <xsl:value-of select="normalize-space(title)"/>
3718
+ </fo:bookmark-title>
3719
+ </fo:bookmark>
3720
+ </xsl:for-each>
3721
+ </fo:bookmark>
3722
+ </xsl:if>
3723
+ </xsl:template><xsl:template name="insertTableBookmarks">
3724
+ <xsl:param name="contents"/>
3725
+ <xsl:param name="lang"/>
3726
+ <xsl:if test="xalan:nodeset($contents)/table">
3727
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3728
+ <fo:bookmark-title>
3729
+ <xsl:choose>
3730
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3731
+ <xsl:otherwise>Tables</xsl:otherwise>
3732
+ </xsl:choose>
3733
+ </fo:bookmark-title>
3734
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3735
+ <fo:bookmark internal-destination="{@id}">
3736
+ <fo:bookmark-title>
3737
+ <xsl:value-of select="normalize-space(title)"/>
3738
+ </fo:bookmark-title>
3739
+ </fo:bookmark>
3740
+ </xsl:for-each>
3741
+ </fo:bookmark>
3742
+ </xsl:if>
3538
3743
  </xsl:template><xsl:template name="getLangVersion">
3539
3744
  <xsl:param name="lang"/>
3745
+ <xsl:param name="doctype" select="''"/>
3746
+ <xsl:param name="title" select="''"/>
3540
3747
  <xsl:choose>
3541
3748
  <xsl:when test="$lang = 'en'">
3542
3749
 
@@ -4024,7 +4231,8 @@
4024
4231
  <fo:block-container margin-left="0mm">
4025
4232
 
4026
4233
  <fo:block xsl:use-attribute-sets="quote-style">
4027
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4234
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4235
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4028
4236
  </fo:block>
4029
4237
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4030
4238
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4150,9 +4358,12 @@
4150
4358
  </fo:block>
4151
4359
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4152
4360
  <xsl:variable name="title-deprecated">
4153
- <xsl:call-template name="getTitle">
4154
- <xsl:with-param name="name" select="'title-deprecated'"/>
4155
- </xsl:call-template>
4361
+
4362
+
4363
+ <xsl:call-template name="getTitle">
4364
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4365
+ </xsl:call-template>
4366
+
4156
4367
  </xsl:variable>
4157
4368
  <fo:block xsl:use-attribute-sets="deprecates-style">
4158
4369
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4206,7 +4417,7 @@
4206
4417
  <fo:block id="{@id}">
4207
4418
  <xsl:apply-templates/>
4208
4419
  </fo:block>
4209
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4420
+ </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']">
4210
4421
 
4211
4422
  <fo:block id="{@id}">
4212
4423
  <xsl:apply-templates/>
@@ -4268,7 +4479,8 @@
4268
4479
  <fo:table-column column-width="107mm"/>
4269
4480
  <fo:table-column column-width="15mm"/>
4270
4481
  <fo:table-body>
4271
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4482
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4483
+
4272
4484
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4273
4485
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4274
4486
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4286,6 +4498,10 @@
4286
4498
  <fo:block><xsl:apply-templates/></fo:block>
4287
4499
  </fo:table-cell>
4288
4500
  </xsl:template><xsl:template name="processBibitem">
4501
+
4502
+
4503
+ <!-- end BIPM bibitem processing-->
4504
+
4289
4505
 
4290
4506
 
4291
4507
 
@@ -4344,6 +4560,8 @@
4344
4560
  <xsl:value-of select="translate(.,'. ','')"/>
4345
4561
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4346
4562
  <xsl:value-of select="substring(.,1,1)"/>
4563
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4564
+ <fo:inline><xsl:apply-templates/></fo:inline>
4347
4565
  </xsl:template><xsl:template name="convertDate">
4348
4566
  <xsl:param name="date"/>
4349
4567
  <xsl:param name="format" select="'short'"/>
@@ -4523,13 +4741,22 @@
4523
4741
  </xsl:template><xsl:template name="split">
4524
4742
  <xsl:param name="pText" select="."/>
4525
4743
  <xsl:param name="sep" select="','"/>
4744
+ <xsl:param name="normalize-space" select="'true'"/>
4526
4745
  <xsl:if test="string-length($pText) &gt;0">
4527
4746
  <item>
4528
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4747
+ <xsl:choose>
4748
+ <xsl:when test="$normalize-space = 'true'">
4749
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4750
+ </xsl:when>
4751
+ <xsl:otherwise>
4752
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4753
+ </xsl:otherwise>
4754
+ </xsl:choose>
4529
4755
  </item>
4530
4756
  <xsl:call-template name="split">
4531
4757
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4532
4758
  <xsl:with-param name="sep" select="$sep"/>
4759
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4533
4760
  </xsl:call-template>
4534
4761
  </xsl:if>
4535
4762
  </xsl:template><xsl:template name="getDocumentId">
@@ -4595,4 +4822,28 @@
4595
4822
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4596
4823
  </xsl:call-template>
4597
4824
  </xsl:if>
4825
+ </xsl:template><xsl:template name="repeat">
4826
+ <xsl:param name="char" select="'*'"/>
4827
+ <xsl:param name="count"/>
4828
+ <xsl:if test="$count &gt; 0">
4829
+ <xsl:value-of select="$char"/>
4830
+ <xsl:call-template name="repeat">
4831
+ <xsl:with-param name="char" select="$char"/>
4832
+ <xsl:with-param name="count" select="$count - 1"/>
4833
+ </xsl:call-template>
4834
+ </xsl:if>
4835
+ </xsl:template><xsl:template name="getLocalizedString">
4836
+ <xsl:param name="key"/>
4837
+
4838
+ <xsl:variable name="curr_lang">
4839
+ <xsl:call-template name="getLang"/>
4840
+ </xsl:variable>
4841
+
4842
+ <xsl:choose>
4843
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4844
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4845
+ </xsl:when>
4846
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4847
+ </xsl:choose>
4848
+
4598
4849
  </xsl:template></xsl:stylesheet>