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.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +29 -8
- data/README.adoc +2 -4
- data/lib/asciidoctor/un/basicdoc.rng +50 -3
- data/lib/asciidoctor/un/isodoc.rng +61 -3
- data/lib/isodoc/un/base_convert.rb +1 -1
- data/lib/isodoc/un/html/htmlstyle.css +3 -3
- data/lib/isodoc/un/html/htmlstyle.scss +2 -2
- data/lib/isodoc/un/html/unece.css +19 -20
- data/lib/isodoc/un/html/unece.scss +19 -20
- data/lib/isodoc/un/html/wordstyle.css +17 -17
- data/lib/isodoc/un/html/wordstyle.scss +17 -17
- data/lib/isodoc/un/html_convert.rb +3 -1
- data/lib/isodoc/un/i18n-en.yaml +1 -0
- data/lib/isodoc/un/un.plenary-attachment.xsl +312 -61
- data/lib/isodoc/un/un.plenary.xsl +312 -61
- data/lib/isodoc/un/un.recommendation.xsl +280 -62
- data/lib/isodoc/un/word_convert.rb +5 -1
- data/lib/isodoc/un/xref.rb +8 -6
- data/lib/metanorma/un/processor.rb +11 -8
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +2 -2
- metadata +6 -6
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
<xsl:template match="/">
|
41
41
|
<xsl:call-template name="namespaceCheck"/>
|
42
|
-
<fo:root font-family="Times New Roman, STIX Two Math,
|
42
|
+
<fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
|
43
43
|
<fo:layout-master-set>
|
44
44
|
<!-- Cover page -->
|
45
45
|
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
@@ -644,7 +644,7 @@
|
|
644
644
|
<xsl:otherwise> <!-- for ordered lists -->
|
645
645
|
<xsl:choose>
|
646
646
|
<xsl:when test="../@type = 'arabic'">
|
647
|
-
<xsl:number format="a)"/>
|
647
|
+
<xsl:number format="a)" lang="en"/>
|
648
648
|
</xsl:when>
|
649
649
|
<xsl:when test="../@type = 'alphabet'">
|
650
650
|
<xsl:number format="1)"/>
|
@@ -652,7 +652,7 @@
|
|
652
652
|
<xsl:when test="ancestor::*[un:annex]">
|
653
653
|
<xsl:choose>
|
654
654
|
<xsl:when test="$level = 1">
|
655
|
-
<xsl:number format="a)"/>
|
655
|
+
<xsl:number format="a)" lang="en"/>
|
656
656
|
</xsl:when>
|
657
657
|
<xsl:when test="$level = 2">
|
658
658
|
<xsl:number format="i)"/>
|
@@ -1106,13 +1106,22 @@
|
|
1106
1106
|
<title-part lang="en">
|
1107
1107
|
|
1108
1108
|
|
1109
|
+
|
1109
1110
|
</title-part>
|
1110
1111
|
<title-part lang="fr">
|
1111
1112
|
|
1112
1113
|
|
1114
|
+
|
1113
1115
|
</title-part>
|
1114
1116
|
<title-part lang="zh">第 # 部分:</title-part>
|
1115
1117
|
|
1118
|
+
<title-subpart lang="en">
|
1119
|
+
|
1120
|
+
</title-subpart>
|
1121
|
+
<title-subpart lang="fr">
|
1122
|
+
|
1123
|
+
</title-subpart>
|
1124
|
+
|
1116
1125
|
<title-modified lang="en">modified</title-modified>
|
1117
1126
|
<title-modified lang="fr">modifiée</title-modified>
|
1118
1127
|
|
@@ -1411,6 +1420,7 @@
|
|
1411
1420
|
|
1412
1421
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1413
1422
|
|
1423
|
+
|
1414
1424
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1415
1425
|
|
1416
1426
|
|
@@ -1435,6 +1445,7 @@
|
|
1435
1445
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1436
1446
|
|
1437
1447
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1448
|
+
|
1438
1449
|
|
1439
1450
|
|
1440
1451
|
|
@@ -1556,7 +1567,9 @@
|
|
1556
1567
|
|
1557
1568
|
|
1558
1569
|
|
1559
|
-
|
1570
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1571
|
+
<fo:block> </fo:block>
|
1572
|
+
</xsl:if> -->
|
1560
1573
|
|
1561
1574
|
<!-- $namespace = 'iso' or -->
|
1562
1575
|
|
@@ -1590,10 +1603,12 @@
|
|
1590
1603
|
|
1591
1604
|
|
1592
1605
|
<xsl:variable name="colwidths">
|
1593
|
-
<xsl:
|
1594
|
-
<xsl:
|
1595
|
-
|
1596
|
-
|
1606
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1607
|
+
<xsl:call-template name="calculate-column-widths">
|
1608
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1609
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1610
|
+
</xsl:call-template>
|
1611
|
+
</xsl:if>
|
1597
1612
|
</xsl:variable>
|
1598
1613
|
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1599
1614
|
|
@@ -1637,7 +1652,12 @@
|
|
1637
1652
|
|
1638
1653
|
<xsl:variable name="table_attributes">
|
1639
1654
|
<attribute name="table-layout">fixed</attribute>
|
1640
|
-
<attribute name="width">
|
1655
|
+
<attribute name="width">
|
1656
|
+
<xsl:choose>
|
1657
|
+
<xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
|
1658
|
+
<xsl:otherwise>100%</xsl:otherwise>
|
1659
|
+
</xsl:choose>
|
1660
|
+
</attribute>
|
1641
1661
|
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1642
1662
|
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1643
1663
|
|
@@ -1671,16 +1691,25 @@
|
|
1671
1691
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1672
1692
|
</xsl:if>
|
1673
1693
|
|
1674
|
-
<xsl:
|
1675
|
-
<xsl:
|
1676
|
-
<xsl:
|
1677
|
-
<fo:table-column column-width="
|
1678
|
-
</xsl:
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1694
|
+
<xsl:choose>
|
1695
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1696
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1697
|
+
<fo:table-column column-width="{@width}"/>
|
1698
|
+
</xsl:for-each>
|
1699
|
+
</xsl:when>
|
1700
|
+
<xsl:otherwise>
|
1701
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1702
|
+
<xsl:choose>
|
1703
|
+
<xsl:when test=". = 1 or . = 0">
|
1704
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1705
|
+
</xsl:when>
|
1706
|
+
<xsl:otherwise>
|
1707
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1708
|
+
</xsl:otherwise>
|
1709
|
+
</xsl:choose>
|
1710
|
+
</xsl:for-each>
|
1711
|
+
</xsl:otherwise>
|
1712
|
+
</xsl:choose>
|
1684
1713
|
|
1685
1714
|
<xsl:choose>
|
1686
1715
|
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
@@ -1693,10 +1722,12 @@
|
|
1693
1722
|
|
1694
1723
|
</fo:table>
|
1695
1724
|
|
1725
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1696
1726
|
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1697
1727
|
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1698
1728
|
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1699
1729
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1730
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1700
1731
|
</xsl:call-template>
|
1701
1732
|
</xsl:for-each>
|
1702
1733
|
|
@@ -1729,6 +1760,7 @@
|
|
1729
1760
|
<xsl:if test="normalize-space() != ''">
|
1730
1761
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1731
1762
|
|
1763
|
+
|
1732
1764
|
<xsl:apply-templates/>
|
1733
1765
|
</fo:block>
|
1734
1766
|
</xsl:if>
|
@@ -1949,12 +1981,22 @@
|
|
1949
1981
|
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1950
1982
|
<xsl:param name="table_attributes"/>
|
1951
1983
|
<xsl:param name="colwidths"/>
|
1984
|
+
<xsl:param name="colgroup"/>
|
1952
1985
|
|
1953
1986
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1954
1987
|
|
1955
1988
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1956
1989
|
|
1957
|
-
<xsl:variable name="cols-count"
|
1990
|
+
<xsl:variable name="cols-count">
|
1991
|
+
<xsl:choose>
|
1992
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1993
|
+
<xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
|
1994
|
+
</xsl:when>
|
1995
|
+
<xsl:otherwise>
|
1996
|
+
<xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
|
1997
|
+
</xsl:otherwise>
|
1998
|
+
</xsl:choose>
|
1999
|
+
</xsl:variable>
|
1958
2000
|
|
1959
2001
|
<fo:table keep-with-previous="always">
|
1960
2002
|
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
@@ -1972,16 +2014,25 @@
|
|
1972
2014
|
</xsl:choose>
|
1973
2015
|
</xsl:for-each>
|
1974
2016
|
|
1975
|
-
<xsl:
|
1976
|
-
<xsl:
|
1977
|
-
<xsl:
|
1978
|
-
<fo:table-column column-width="
|
1979
|
-
</xsl:
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
2017
|
+
<xsl:choose>
|
2018
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2019
|
+
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2020
|
+
<fo:table-column column-width="{@width}"/>
|
2021
|
+
</xsl:for-each>
|
2022
|
+
</xsl:when>
|
2023
|
+
<xsl:otherwise>
|
2024
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2025
|
+
<xsl:choose>
|
2026
|
+
<xsl:when test=". = 1 or . = 0">
|
2027
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2028
|
+
</xsl:when>
|
2029
|
+
<xsl:otherwise>
|
2030
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2031
|
+
</xsl:otherwise>
|
2032
|
+
</xsl:choose>
|
2033
|
+
</xsl:for-each>
|
2034
|
+
</xsl:otherwise>
|
2035
|
+
</xsl:choose>
|
1985
2036
|
|
1986
2037
|
<fo:table-body>
|
1987
2038
|
<fo:table-row>
|
@@ -2082,6 +2133,7 @@
|
|
2082
2133
|
|
2083
2134
|
|
2084
2135
|
|
2136
|
+
|
2085
2137
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2086
2138
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2087
2139
|
</xsl:if> -->
|
@@ -2189,7 +2241,8 @@
|
|
2189
2241
|
</xsl:attribute>
|
2190
2242
|
</xsl:if>
|
2191
2243
|
<xsl:call-template name="display-align"/>
|
2192
|
-
<fo:block>
|
2244
|
+
<fo:block>
|
2245
|
+
|
2193
2246
|
<xsl:apply-templates/>
|
2194
2247
|
</fo:block>
|
2195
2248
|
</fo:table-cell>
|
@@ -2411,7 +2464,13 @@
|
|
2411
2464
|
<xsl:apply-templates/>
|
2412
2465
|
</fo:inline>
|
2413
2466
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2414
|
-
<fo:block-container
|
2467
|
+
<fo:block-container>
|
2468
|
+
|
2469
|
+
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
2470
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2471
|
+
</xsl:if>
|
2472
|
+
|
2473
|
+
|
2415
2474
|
<xsl:if test="parent::*[local-name() = 'note']">
|
2416
2475
|
<xsl:attribute name="margin-left">
|
2417
2476
|
<xsl:choose>
|
@@ -2421,8 +2480,12 @@
|
|
2421
2480
|
</xsl:attribute>
|
2422
2481
|
|
2423
2482
|
</xsl:if>
|
2424
|
-
<fo:block-container
|
2425
|
-
|
2483
|
+
<fo:block-container>
|
2484
|
+
|
2485
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2486
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2487
|
+
|
2488
|
+
|
2426
2489
|
<xsl:variable name="parent" select="local-name(..)"/>
|
2427
2490
|
|
2428
2491
|
<xsl:variable name="key_iso">
|
@@ -2436,9 +2499,12 @@
|
|
2436
2499
|
<fo:block margin-bottom="12pt" text-align="left">
|
2437
2500
|
|
2438
2501
|
<xsl:variable name="title-where">
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2502
|
+
|
2503
|
+
|
2504
|
+
<xsl:call-template name="getTitle">
|
2505
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2506
|
+
</xsl:call-template>
|
2507
|
+
|
2442
2508
|
</xsl:variable>
|
2443
2509
|
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
2444
2510
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
@@ -2454,9 +2520,12 @@
|
|
2454
2520
|
|
2455
2521
|
|
2456
2522
|
<xsl:variable name="title-where">
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2523
|
+
|
2524
|
+
|
2525
|
+
<xsl:call-template name="getTitle">
|
2526
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2527
|
+
</xsl:call-template>
|
2528
|
+
|
2460
2529
|
</xsl:variable>
|
2461
2530
|
<xsl:value-of select="$title-where"/>
|
2462
2531
|
</fo:block>
|
@@ -2467,9 +2536,12 @@
|
|
2467
2536
|
|
2468
2537
|
|
2469
2538
|
<xsl:variable name="title-key">
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2539
|
+
|
2540
|
+
|
2541
|
+
<xsl:call-template name="getTitle">
|
2542
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
2543
|
+
</xsl:call-template>
|
2544
|
+
|
2473
2545
|
</xsl:variable>
|
2474
2546
|
<xsl:value-of select="$title-key"/>
|
2475
2547
|
</fo:block>
|
@@ -2595,12 +2667,32 @@
|
|
2595
2667
|
</xsl:otherwise>
|
2596
2668
|
</xsl:choose>
|
2597
2669
|
</xsl:template><xsl:template name="getMaxLength_dt">
|
2598
|
-
<xsl:
|
2599
|
-
<xsl:
|
2600
|
-
|
2601
|
-
<xsl:
|
2602
|
-
|
2603
|
-
|
2670
|
+
<xsl:variable name="lengths">
|
2671
|
+
<xsl:for-each select="*[local-name()='dt']">
|
2672
|
+
<xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
|
2673
|
+
<xsl:variable name="attributes">
|
2674
|
+
<xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
|
2675
|
+
<xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
|
2676
|
+
</xsl:variable>
|
2677
|
+
<length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
|
2678
|
+
</xsl:for-each>
|
2679
|
+
</xsl:variable>
|
2680
|
+
<xsl:variable name="maxLength">
|
2681
|
+
<!-- <xsl:for-each select="*[local-name()='dt']">
|
2682
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
2683
|
+
<xsl:if test="position() = 1">
|
2684
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
2685
|
+
</xsl:if>
|
2686
|
+
</xsl:for-each> -->
|
2687
|
+
<xsl:for-each select="xalan:nodeset($lengths)/length">
|
2688
|
+
<xsl:sort select="." data-type="number" order="descending"/>
|
2689
|
+
<xsl:if test="position() = 1">
|
2690
|
+
<xsl:value-of select="."/>
|
2691
|
+
</xsl:if>
|
2692
|
+
</xsl:for-each>
|
2693
|
+
</xsl:variable>
|
2694
|
+
<!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
|
2695
|
+
<xsl:value-of select="$maxLength"/>
|
2604
2696
|
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
|
2605
2697
|
<xsl:param name="key_iso"/>
|
2606
2698
|
|
@@ -2712,6 +2804,7 @@
|
|
2712
2804
|
</fo:inline>
|
2713
2805
|
</xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
|
2714
2806
|
<fo:inline font-weight="bold">
|
2807
|
+
|
2715
2808
|
<xsl:apply-templates/>
|
2716
2809
|
</fo:inline>
|
2717
2810
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
@@ -2751,6 +2844,10 @@
|
|
2751
2844
|
</xsl:if>
|
2752
2845
|
<xsl:apply-templates/>
|
2753
2846
|
</fo:inline>
|
2847
|
+
</xsl:template><xsl:template match="*[local-name()='underline']">
|
2848
|
+
<fo:inline text-decoration="underline">
|
2849
|
+
<xsl:apply-templates/>
|
2850
|
+
</fo:inline>
|
2754
2851
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2755
2852
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
2756
2853
|
<xsl:apply-templates/>
|
@@ -3040,7 +3137,18 @@
|
|
3040
3137
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
3041
3138
|
</xsl:apply-templates>
|
3042
3139
|
</xsl:template><xsl:template name="getLang">
|
3043
|
-
<xsl:variable name="
|
3140
|
+
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3141
|
+
<xsl:variable name="language">
|
3142
|
+
<xsl:choose>
|
3143
|
+
<xsl:when test="$language_current != ''">
|
3144
|
+
<xsl:value-of select="$language_current"/>
|
3145
|
+
</xsl:when>
|
3146
|
+
<xsl:otherwise>
|
3147
|
+
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3148
|
+
</xsl:otherwise>
|
3149
|
+
</xsl:choose>
|
3150
|
+
</xsl:variable>
|
3151
|
+
|
3044
3152
|
<xsl:choose>
|
3045
3153
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
3046
3154
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
@@ -3075,6 +3183,7 @@
|
|
3075
3183
|
<xsl:value-of select="substring($str, 2)"/>
|
3076
3184
|
</xsl:template><xsl:template match="mathml:math">
|
3077
3185
|
<fo:inline font-family="STIX Two Math"> <!-- -->
|
3186
|
+
|
3078
3187
|
<xsl:variable name="mathml">
|
3079
3188
|
<xsl:apply-templates select="." mode="mathml"/>
|
3080
3189
|
</xsl:variable>
|
@@ -3104,6 +3213,7 @@
|
|
3104
3213
|
</xsl:choose>
|
3105
3214
|
</xsl:variable>
|
3106
3215
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3216
|
+
|
3107
3217
|
<xsl:choose>
|
3108
3218
|
<xsl:when test="$target = ''">
|
3109
3219
|
<xsl:apply-templates/>
|
@@ -3157,10 +3267,14 @@
|
|
3157
3267
|
</fo:inline>
|
3158
3268
|
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3159
3269
|
<xsl:variable name="title-modified">
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3270
|
+
|
3271
|
+
|
3272
|
+
<xsl:call-template name="getTitle">
|
3273
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
3274
|
+
</xsl:call-template>
|
3275
|
+
|
3163
3276
|
</xsl:variable>
|
3277
|
+
|
3164
3278
|
<xsl:choose>
|
3165
3279
|
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
3166
3280
|
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
@@ -3328,7 +3442,8 @@
|
|
3328
3442
|
</fo:inline>
|
3329
3443
|
</xsl:if>
|
3330
3444
|
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3331
|
-
<fo:block-container id="{@id}">
|
3445
|
+
<fo:block-container id="{@id}">
|
3446
|
+
|
3332
3447
|
<fo:block>
|
3333
3448
|
<xsl:apply-templates/>
|
3334
3449
|
</fo:block>
|
@@ -3384,7 +3499,7 @@
|
|
3384
3499
|
<xsl:apply-templates mode="bookmarks"/>
|
3385
3500
|
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3386
3501
|
<xsl:apply-templates select="."/>
|
3387
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3502
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3388
3503
|
<xsl:apply-templates mode="bookmarks"/>
|
3389
3504
|
</xsl:template><xsl:template name="addBookmarks">
|
3390
3505
|
<xsl:param name="contents"/>
|
@@ -3400,6 +3515,8 @@
|
|
3400
3515
|
<xsl:variable name="bookmark-title_">
|
3401
3516
|
<xsl:call-template name="getLangVersion">
|
3402
3517
|
<xsl:with-param name="lang" select="@lang"/>
|
3518
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
3519
|
+
<xsl:with-param name="title" select="@title-part"/>
|
3403
3520
|
</xsl:call-template>
|
3404
3521
|
</xsl:variable>
|
3405
3522
|
<xsl:choose>
|
@@ -3417,13 +3534,34 @@
|
|
3417
3534
|
</xsl:choose>
|
3418
3535
|
</fo:bookmark-title>
|
3419
3536
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3537
|
+
|
3538
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3539
|
+
<xsl:with-param name="contents" select="contents"/>
|
3540
|
+
</xsl:call-template>
|
3541
|
+
|
3542
|
+
<xsl:call-template name="insertTableBookmarks">
|
3543
|
+
<xsl:with-param name="contents" select="contents"/>
|
3544
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3545
|
+
</xsl:call-template>
|
3546
|
+
|
3420
3547
|
</fo:bookmark>
|
3421
3548
|
|
3422
3549
|
</xsl:for-each>
|
3423
3550
|
</xsl:when>
|
3424
3551
|
<xsl:otherwise>
|
3425
3552
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3553
|
+
|
3426
3554
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3555
|
+
|
3556
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3557
|
+
<xsl:with-param name="contents" select="contents"/>
|
3558
|
+
</xsl:call-template>
|
3559
|
+
|
3560
|
+
<xsl:call-template name="insertTableBookmarks">
|
3561
|
+
<xsl:with-param name="contents" select="contents"/>
|
3562
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3563
|
+
</xsl:call-template>
|
3564
|
+
|
3427
3565
|
</xsl:for-each>
|
3428
3566
|
</xsl:otherwise>
|
3429
3567
|
</xsl:choose>
|
@@ -3442,8 +3580,44 @@
|
|
3442
3580
|
|
3443
3581
|
</fo:bookmark-tree>
|
3444
3582
|
</xsl:if>
|
3583
|
+
</xsl:template><xsl:template name="insertFigureBookmarks">
|
3584
|
+
<xsl:param name="contents"/>
|
3585
|
+
<xsl:if test="xalan:nodeset($contents)/figure">
|
3586
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
|
3587
|
+
<fo:bookmark-title>Figures</fo:bookmark-title>
|
3588
|
+
<xsl:for-each select="xalan:nodeset($contents)/figure">
|
3589
|
+
<fo:bookmark internal-destination="{@id}">
|
3590
|
+
<fo:bookmark-title>
|
3591
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3592
|
+
</fo:bookmark-title>
|
3593
|
+
</fo:bookmark>
|
3594
|
+
</xsl:for-each>
|
3595
|
+
</fo:bookmark>
|
3596
|
+
</xsl:if>
|
3597
|
+
</xsl:template><xsl:template name="insertTableBookmarks">
|
3598
|
+
<xsl:param name="contents"/>
|
3599
|
+
<xsl:param name="lang"/>
|
3600
|
+
<xsl:if test="xalan:nodeset($contents)/table">
|
3601
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
|
3602
|
+
<fo:bookmark-title>
|
3603
|
+
<xsl:choose>
|
3604
|
+
<xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
|
3605
|
+
<xsl:otherwise>Tables</xsl:otherwise>
|
3606
|
+
</xsl:choose>
|
3607
|
+
</fo:bookmark-title>
|
3608
|
+
<xsl:for-each select="xalan:nodeset($contents)/table">
|
3609
|
+
<fo:bookmark internal-destination="{@id}">
|
3610
|
+
<fo:bookmark-title>
|
3611
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3612
|
+
</fo:bookmark-title>
|
3613
|
+
</fo:bookmark>
|
3614
|
+
</xsl:for-each>
|
3615
|
+
</fo:bookmark>
|
3616
|
+
</xsl:if>
|
3445
3617
|
</xsl:template><xsl:template name="getLangVersion">
|
3446
3618
|
<xsl:param name="lang"/>
|
3619
|
+
<xsl:param name="doctype" select="''"/>
|
3620
|
+
<xsl:param name="title" select="''"/>
|
3447
3621
|
<xsl:choose>
|
3448
3622
|
<xsl:when test="$lang = 'en'">
|
3449
3623
|
|
@@ -3931,7 +4105,8 @@
|
|
3931
4105
|
<fo:block-container margin-left="0mm">
|
3932
4106
|
|
3933
4107
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3934
|
-
<xsl:apply-templates select=".//*[local-name() = 'p']"/>
|
4108
|
+
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
4109
|
+
<xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3935
4110
|
</fo:block>
|
3936
4111
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3937
4112
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -4055,9 +4230,12 @@
|
|
4055
4230
|
</fo:block>
|
4056
4231
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
4057
4232
|
<xsl:variable name="title-deprecated">
|
4058
|
-
|
4059
|
-
|
4060
|
-
|
4233
|
+
|
4234
|
+
|
4235
|
+
<xsl:call-template name="getTitle">
|
4236
|
+
<xsl:with-param name="name" select="'title-deprecated'"/>
|
4237
|
+
</xsl:call-template>
|
4238
|
+
|
4061
4239
|
</xsl:variable>
|
4062
4240
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
4063
4241
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
@@ -4113,7 +4291,7 @@
|
|
4113
4291
|
<fo:block id="{@id}">
|
4114
4292
|
<xsl:apply-templates/>
|
4115
4293
|
</fo:block>
|
4116
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4294
|
+
</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']">
|
4117
4295
|
|
4118
4296
|
<fo:block id="{@id}">
|
4119
4297
|
<xsl:apply-templates/>
|
@@ -4175,7 +4353,8 @@
|
|
4175
4353
|
<fo:table-column column-width="107mm"/>
|
4176
4354
|
<fo:table-column column-width="15mm"/>
|
4177
4355
|
<fo:table-body>
|
4178
|
-
<fo:table-row
|
4356
|
+
<fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
|
4357
|
+
|
4179
4358
|
<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
|
4180
4359
|
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
|
4181
4360
|
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
|
@@ -4193,6 +4372,10 @@
|
|
4193
4372
|
<fo:block><xsl:apply-templates/></fo:block>
|
4194
4373
|
</fo:table-cell>
|
4195
4374
|
</xsl:template><xsl:template name="processBibitem">
|
4375
|
+
|
4376
|
+
|
4377
|
+
<!-- end BIPM bibitem processing-->
|
4378
|
+
|
4196
4379
|
|
4197
4380
|
|
4198
4381
|
|
@@ -4251,6 +4434,8 @@
|
|
4251
4434
|
<xsl:value-of select="translate(.,'. ','')"/>
|
4252
4435
|
</xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
4253
4436
|
<xsl:value-of select="substring(.,1,1)"/>
|
4437
|
+
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4438
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4254
4439
|
</xsl:template><xsl:template name="convertDate">
|
4255
4440
|
<xsl:param name="date"/>
|
4256
4441
|
<xsl:param name="format" select="'short'"/>
|
@@ -4430,13 +4615,22 @@
|
|
4430
4615
|
</xsl:template><xsl:template name="split">
|
4431
4616
|
<xsl:param name="pText" select="."/>
|
4432
4617
|
<xsl:param name="sep" select="','"/>
|
4618
|
+
<xsl:param name="normalize-space" select="'true'"/>
|
4433
4619
|
<xsl:if test="string-length($pText) >0">
|
4434
4620
|
<item>
|
4435
|
-
<xsl:
|
4621
|
+
<xsl:choose>
|
4622
|
+
<xsl:when test="$normalize-space = 'true'">
|
4623
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
4624
|
+
</xsl:when>
|
4625
|
+
<xsl:otherwise>
|
4626
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
4627
|
+
</xsl:otherwise>
|
4628
|
+
</xsl:choose>
|
4436
4629
|
</item>
|
4437
4630
|
<xsl:call-template name="split">
|
4438
4631
|
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
4439
4632
|
<xsl:with-param name="sep" select="$sep"/>
|
4633
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
4440
4634
|
</xsl:call-template>
|
4441
4635
|
</xsl:if>
|
4442
4636
|
</xsl:template><xsl:template name="getDocumentId">
|
@@ -4502,4 +4696,28 @@
|
|
4502
4696
|
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4503
4697
|
</xsl:call-template>
|
4504
4698
|
</xsl:if>
|
4699
|
+
</xsl:template><xsl:template name="repeat">
|
4700
|
+
<xsl:param name="char" select="'*'"/>
|
4701
|
+
<xsl:param name="count"/>
|
4702
|
+
<xsl:if test="$count > 0">
|
4703
|
+
<xsl:value-of select="$char"/>
|
4704
|
+
<xsl:call-template name="repeat">
|
4705
|
+
<xsl:with-param name="char" select="$char"/>
|
4706
|
+
<xsl:with-param name="count" select="$count - 1"/>
|
4707
|
+
</xsl:call-template>
|
4708
|
+
</xsl:if>
|
4709
|
+
</xsl:template><xsl:template name="getLocalizedString">
|
4710
|
+
<xsl:param name="key"/>
|
4711
|
+
|
4712
|
+
<xsl:variable name="curr_lang">
|
4713
|
+
<xsl:call-template name="getLang"/>
|
4714
|
+
</xsl:variable>
|
4715
|
+
|
4716
|
+
<xsl:choose>
|
4717
|
+
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
4718
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4719
|
+
</xsl:when>
|
4720
|
+
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4721
|
+
</xsl:choose>
|
4722
|
+
|
4505
4723
|
</xsl:template></xsl:stylesheet>
|