metanorma-un 0.5.5 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +62 -0
- data/README.adoc +2 -4
- data/lib/asciidoctor/un/basicdoc.rng +50 -3
- data/lib/asciidoctor/un/isodoc.rng +36 -43
- data/lib/isodoc/un/base_convert.rb +1 -1
- data/lib/isodoc/un/html/htmlstyle.css +7 -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/pdf_convert.rb +2 -2
- data/lib/isodoc/un/un.plenary-attachment.xsl +322 -63
- data/lib/isodoc/un/un.plenary.xsl +322 -63
- data/lib/isodoc/un/un.recommendation.xsl +290 -64
- data/lib/isodoc/un/word_convert.rb +5 -1
- data/lib/isodoc/un/xref.rb +4 -4
- data/lib/metanorma/un/processor.rb +11 -8
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +2 -2
- metadata +7 -9
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
@@ -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
|
|
@@ -1367,6 +1376,7 @@
|
|
1367
1376
|
<xsl:attribute name="border-top">0.1mm solid black</xsl:attribute>
|
1368
1377
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1369
1378
|
|
1379
|
+
|
1370
1380
|
</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">
|
1371
1381
|
|
1372
1382
|
|
@@ -1410,6 +1420,7 @@
|
|
1410
1420
|
|
1411
1421
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1412
1422
|
|
1423
|
+
|
1413
1424
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1414
1425
|
|
1415
1426
|
|
@@ -1434,6 +1445,7 @@
|
|
1434
1445
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1435
1446
|
|
1436
1447
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1448
|
+
|
1437
1449
|
|
1438
1450
|
|
1439
1451
|
|
@@ -1555,7 +1567,9 @@
|
|
1555
1567
|
|
1556
1568
|
|
1557
1569
|
|
1558
|
-
|
1570
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1571
|
+
<fo:block> </fo:block>
|
1572
|
+
</xsl:if> -->
|
1559
1573
|
|
1560
1574
|
<!-- $namespace = 'iso' or -->
|
1561
1575
|
|
@@ -1589,10 +1603,12 @@
|
|
1589
1603
|
|
1590
1604
|
|
1591
1605
|
<xsl:variable name="colwidths">
|
1592
|
-
<xsl:
|
1593
|
-
<xsl:
|
1594
|
-
|
1595
|
-
|
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>
|
1596
1612
|
</xsl:variable>
|
1597
1613
|
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1598
1614
|
|
@@ -1670,16 +1686,25 @@
|
|
1670
1686
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1671
1687
|
</xsl:if>
|
1672
1688
|
|
1673
|
-
<xsl:
|
1674
|
-
<xsl:
|
1675
|
-
<xsl:
|
1676
|
-
<fo:table-column column-width="
|
1677
|
-
</xsl:
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1689
|
+
<xsl:choose>
|
1690
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1691
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1692
|
+
<fo:table-column column-width="{@width}"/>
|
1693
|
+
</xsl:for-each>
|
1694
|
+
</xsl:when>
|
1695
|
+
<xsl:otherwise>
|
1696
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1697
|
+
<xsl:choose>
|
1698
|
+
<xsl:when test=". = 1 or . = 0">
|
1699
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1700
|
+
</xsl:when>
|
1701
|
+
<xsl:otherwise>
|
1702
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1703
|
+
</xsl:otherwise>
|
1704
|
+
</xsl:choose>
|
1705
|
+
</xsl:for-each>
|
1706
|
+
</xsl:otherwise>
|
1707
|
+
</xsl:choose>
|
1683
1708
|
|
1684
1709
|
<xsl:choose>
|
1685
1710
|
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
@@ -1692,10 +1717,12 @@
|
|
1692
1717
|
|
1693
1718
|
</fo:table>
|
1694
1719
|
|
1720
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1695
1721
|
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1696
1722
|
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1697
1723
|
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1698
1724
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1725
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1699
1726
|
</xsl:call-template>
|
1700
1727
|
</xsl:for-each>
|
1701
1728
|
|
@@ -1728,6 +1755,7 @@
|
|
1728
1755
|
<xsl:if test="normalize-space() != ''">
|
1729
1756
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1730
1757
|
|
1758
|
+
|
1731
1759
|
<xsl:apply-templates/>
|
1732
1760
|
</fo:block>
|
1733
1761
|
</xsl:if>
|
@@ -1910,12 +1938,26 @@
|
|
1910
1938
|
|
1911
1939
|
|
1912
1940
|
|
1913
|
-
<!-- except gb and bipm -->
|
1914
1941
|
|
1915
|
-
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1916
1942
|
|
1917
1943
|
|
1944
|
+
<!-- except gb -->
|
1918
1945
|
|
1946
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1947
|
+
|
1948
|
+
|
1949
|
+
<!-- show Note under table in preface (ex. abstract) sections -->
|
1950
|
+
<!-- empty, because notes show at page side in main sections -->
|
1951
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1952
|
+
<xsl:choose>
|
1953
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
1954
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1955
|
+
</xsl:when>
|
1956
|
+
<xsl:otherwise>
|
1957
|
+
<fo:block/>
|
1958
|
+
</xsl:otherwise>
|
1959
|
+
</xsl:choose>
|
1960
|
+
</xsl:if> -->
|
1919
1961
|
|
1920
1962
|
|
1921
1963
|
<!-- horizontal row separator -->
|
@@ -1934,12 +1976,22 @@
|
|
1934
1976
|
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1935
1977
|
<xsl:param name="table_attributes"/>
|
1936
1978
|
<xsl:param name="colwidths"/>
|
1979
|
+
<xsl:param name="colgroup"/>
|
1937
1980
|
|
1938
1981
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1939
1982
|
|
1940
1983
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1941
1984
|
|
1942
|
-
<xsl:variable name="cols-count"
|
1985
|
+
<xsl:variable name="cols-count">
|
1986
|
+
<xsl:choose>
|
1987
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1988
|
+
<xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
|
1989
|
+
</xsl:when>
|
1990
|
+
<xsl:otherwise>
|
1991
|
+
<xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
|
1992
|
+
</xsl:otherwise>
|
1993
|
+
</xsl:choose>
|
1994
|
+
</xsl:variable>
|
1943
1995
|
|
1944
1996
|
<fo:table keep-with-previous="always">
|
1945
1997
|
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
@@ -1957,16 +2009,25 @@
|
|
1957
2009
|
</xsl:choose>
|
1958
2010
|
</xsl:for-each>
|
1959
2011
|
|
1960
|
-
<xsl:
|
1961
|
-
<xsl:
|
1962
|
-
<xsl:
|
1963
|
-
<fo:table-column column-width="
|
1964
|
-
</xsl:
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
2012
|
+
<xsl:choose>
|
2013
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2014
|
+
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2015
|
+
<fo:table-column column-width="{@width}"/>
|
2016
|
+
</xsl:for-each>
|
2017
|
+
</xsl:when>
|
2018
|
+
<xsl:otherwise>
|
2019
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2020
|
+
<xsl:choose>
|
2021
|
+
<xsl:when test=". = 1 or . = 0">
|
2022
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2023
|
+
</xsl:when>
|
2024
|
+
<xsl:otherwise>
|
2025
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2026
|
+
</xsl:otherwise>
|
2027
|
+
</xsl:choose>
|
2028
|
+
</xsl:for-each>
|
2029
|
+
</xsl:otherwise>
|
2030
|
+
</xsl:choose>
|
1970
2031
|
|
1971
2032
|
<fo:table-body>
|
1972
2033
|
<fo:table-row>
|
@@ -1978,7 +2039,11 @@
|
|
1978
2039
|
|
1979
2040
|
|
1980
2041
|
|
1981
|
-
|
2042
|
+
|
2043
|
+
|
2044
|
+
|
2045
|
+
|
2046
|
+
<!-- except gb -->
|
1982
2047
|
|
1983
2048
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1984
2049
|
|
@@ -2064,6 +2129,10 @@
|
|
2064
2129
|
|
2065
2130
|
|
2066
2131
|
|
2132
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2133
|
+
<xsl:attribute name="height">8mm</xsl:attribute>
|
2134
|
+
</xsl:if> -->
|
2135
|
+
|
2067
2136
|
<xsl:apply-templates/>
|
2068
2137
|
</fo:table-row>
|
2069
2138
|
</xsl:template><xsl:template match="*[local-name()='th']">
|
@@ -2167,7 +2236,8 @@
|
|
2167
2236
|
</xsl:attribute>
|
2168
2237
|
</xsl:if>
|
2169
2238
|
<xsl:call-template name="display-align"/>
|
2170
|
-
<fo:block>
|
2239
|
+
<fo:block>
|
2240
|
+
|
2171
2241
|
<xsl:apply-templates/>
|
2172
2242
|
</fo:block>
|
2173
2243
|
</fo:table-cell>
|
@@ -2389,7 +2459,13 @@
|
|
2389
2459
|
<xsl:apply-templates/>
|
2390
2460
|
</fo:inline>
|
2391
2461
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2392
|
-
<fo:block-container
|
2462
|
+
<fo:block-container>
|
2463
|
+
|
2464
|
+
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
2465
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2466
|
+
</xsl:if>
|
2467
|
+
|
2468
|
+
|
2393
2469
|
<xsl:if test="parent::*[local-name() = 'note']">
|
2394
2470
|
<xsl:attribute name="margin-left">
|
2395
2471
|
<xsl:choose>
|
@@ -2399,8 +2475,12 @@
|
|
2399
2475
|
</xsl:attribute>
|
2400
2476
|
|
2401
2477
|
</xsl:if>
|
2402
|
-
<fo:block-container
|
2403
|
-
|
2478
|
+
<fo:block-container>
|
2479
|
+
|
2480
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2481
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2482
|
+
|
2483
|
+
|
2404
2484
|
<xsl:variable name="parent" select="local-name(..)"/>
|
2405
2485
|
|
2406
2486
|
<xsl:variable name="key_iso">
|
@@ -2414,9 +2494,12 @@
|
|
2414
2494
|
<fo:block margin-bottom="12pt" text-align="left">
|
2415
2495
|
|
2416
2496
|
<xsl:variable name="title-where">
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2497
|
+
|
2498
|
+
|
2499
|
+
<xsl:call-template name="getTitle">
|
2500
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2501
|
+
</xsl:call-template>
|
2502
|
+
|
2420
2503
|
</xsl:variable>
|
2421
2504
|
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
2422
2505
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
@@ -2432,9 +2515,12 @@
|
|
2432
2515
|
|
2433
2516
|
|
2434
2517
|
<xsl:variable name="title-where">
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2518
|
+
|
2519
|
+
|
2520
|
+
<xsl:call-template name="getTitle">
|
2521
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2522
|
+
</xsl:call-template>
|
2523
|
+
|
2438
2524
|
</xsl:variable>
|
2439
2525
|
<xsl:value-of select="$title-where"/>
|
2440
2526
|
</fo:block>
|
@@ -2445,9 +2531,12 @@
|
|
2445
2531
|
|
2446
2532
|
|
2447
2533
|
<xsl:variable name="title-key">
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2534
|
+
|
2535
|
+
|
2536
|
+
<xsl:call-template name="getTitle">
|
2537
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
2538
|
+
</xsl:call-template>
|
2539
|
+
|
2451
2540
|
</xsl:variable>
|
2452
2541
|
<xsl:value-of select="$title-key"/>
|
2453
2542
|
</fo:block>
|
@@ -2573,12 +2662,32 @@
|
|
2573
2662
|
</xsl:otherwise>
|
2574
2663
|
</xsl:choose>
|
2575
2664
|
</xsl:template><xsl:template name="getMaxLength_dt">
|
2576
|
-
<xsl:
|
2577
|
-
<xsl:
|
2578
|
-
|
2579
|
-
<xsl:
|
2580
|
-
|
2581
|
-
|
2665
|
+
<xsl:variable name="lengths">
|
2666
|
+
<xsl:for-each select="*[local-name()='dt']">
|
2667
|
+
<xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
|
2668
|
+
<xsl:variable name="attributes">
|
2669
|
+
<xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
|
2670
|
+
<xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
|
2671
|
+
</xsl:variable>
|
2672
|
+
<length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
|
2673
|
+
</xsl:for-each>
|
2674
|
+
</xsl:variable>
|
2675
|
+
<xsl:variable name="maxLength">
|
2676
|
+
<!-- <xsl:for-each select="*[local-name()='dt']">
|
2677
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
2678
|
+
<xsl:if test="position() = 1">
|
2679
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
2680
|
+
</xsl:if>
|
2681
|
+
</xsl:for-each> -->
|
2682
|
+
<xsl:for-each select="xalan:nodeset($lengths)/length">
|
2683
|
+
<xsl:sort select="." data-type="number" order="descending"/>
|
2684
|
+
<xsl:if test="position() = 1">
|
2685
|
+
<xsl:value-of select="."/>
|
2686
|
+
</xsl:if>
|
2687
|
+
</xsl:for-each>
|
2688
|
+
</xsl:variable>
|
2689
|
+
<!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
|
2690
|
+
<xsl:value-of select="$maxLength"/>
|
2582
2691
|
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
|
2583
2692
|
<xsl:param name="key_iso"/>
|
2584
2693
|
|
@@ -2690,6 +2799,7 @@
|
|
2690
2799
|
</fo:inline>
|
2691
2800
|
</xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
|
2692
2801
|
<fo:inline font-weight="bold">
|
2802
|
+
|
2693
2803
|
<xsl:apply-templates/>
|
2694
2804
|
</fo:inline>
|
2695
2805
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
@@ -3018,7 +3128,18 @@
|
|
3018
3128
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
3019
3129
|
</xsl:apply-templates>
|
3020
3130
|
</xsl:template><xsl:template name="getLang">
|
3021
|
-
<xsl:variable name="
|
3131
|
+
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3132
|
+
<xsl:variable name="language">
|
3133
|
+
<xsl:choose>
|
3134
|
+
<xsl:when test="$language_current != ''">
|
3135
|
+
<xsl:value-of select="$language_current"/>
|
3136
|
+
</xsl:when>
|
3137
|
+
<xsl:otherwise>
|
3138
|
+
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3139
|
+
</xsl:otherwise>
|
3140
|
+
</xsl:choose>
|
3141
|
+
</xsl:variable>
|
3142
|
+
|
3022
3143
|
<xsl:choose>
|
3023
3144
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
3024
3145
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
@@ -3053,6 +3174,7 @@
|
|
3053
3174
|
<xsl:value-of select="substring($str, 2)"/>
|
3054
3175
|
</xsl:template><xsl:template match="mathml:math">
|
3055
3176
|
<fo:inline font-family="STIX Two Math"> <!-- -->
|
3177
|
+
|
3056
3178
|
<xsl:variable name="mathml">
|
3057
3179
|
<xsl:apply-templates select="." mode="mathml"/>
|
3058
3180
|
</xsl:variable>
|
@@ -3082,6 +3204,7 @@
|
|
3082
3204
|
</xsl:choose>
|
3083
3205
|
</xsl:variable>
|
3084
3206
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3207
|
+
|
3085
3208
|
<xsl:choose>
|
3086
3209
|
<xsl:when test="$target = ''">
|
3087
3210
|
<xsl:apply-templates/>
|
@@ -3135,10 +3258,14 @@
|
|
3135
3258
|
</fo:inline>
|
3136
3259
|
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3137
3260
|
<xsl:variable name="title-modified">
|
3138
|
-
|
3139
|
-
|
3140
|
-
|
3261
|
+
|
3262
|
+
|
3263
|
+
<xsl:call-template name="getTitle">
|
3264
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
3265
|
+
</xsl:call-template>
|
3266
|
+
|
3141
3267
|
</xsl:variable>
|
3268
|
+
|
3142
3269
|
<xsl:choose>
|
3143
3270
|
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
3144
3271
|
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
@@ -3212,6 +3339,8 @@
|
|
3212
3339
|
|
3213
3340
|
|
3214
3341
|
|
3342
|
+
|
3343
|
+
|
3215
3344
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
3216
3345
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3217
3346
|
</fo:inline>
|
@@ -3304,7 +3433,8 @@
|
|
3304
3433
|
</fo:inline>
|
3305
3434
|
</xsl:if>
|
3306
3435
|
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3307
|
-
<fo:block-container id="{@id}">
|
3436
|
+
<fo:block-container id="{@id}">
|
3437
|
+
|
3308
3438
|
<fo:block>
|
3309
3439
|
<xsl:apply-templates/>
|
3310
3440
|
</fo:block>
|
@@ -3360,7 +3490,7 @@
|
|
3360
3490
|
<xsl:apply-templates mode="bookmarks"/>
|
3361
3491
|
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3362
3492
|
<xsl:apply-templates select="."/>
|
3363
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3493
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3364
3494
|
<xsl:apply-templates mode="bookmarks"/>
|
3365
3495
|
</xsl:template><xsl:template name="addBookmarks">
|
3366
3496
|
<xsl:param name="contents"/>
|
@@ -3376,6 +3506,8 @@
|
|
3376
3506
|
<xsl:variable name="bookmark-title_">
|
3377
3507
|
<xsl:call-template name="getLangVersion">
|
3378
3508
|
<xsl:with-param name="lang" select="@lang"/>
|
3509
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
3510
|
+
<xsl:with-param name="title" select="@title-part"/>
|
3379
3511
|
</xsl:call-template>
|
3380
3512
|
</xsl:variable>
|
3381
3513
|
<xsl:choose>
|
@@ -3393,13 +3525,34 @@
|
|
3393
3525
|
</xsl:choose>
|
3394
3526
|
</fo:bookmark-title>
|
3395
3527
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3528
|
+
|
3529
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3530
|
+
<xsl:with-param name="contents" select="contents"/>
|
3531
|
+
</xsl:call-template>
|
3532
|
+
|
3533
|
+
<xsl:call-template name="insertTableBookmarks">
|
3534
|
+
<xsl:with-param name="contents" select="contents"/>
|
3535
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3536
|
+
</xsl:call-template>
|
3537
|
+
|
3396
3538
|
</fo:bookmark>
|
3397
3539
|
|
3398
3540
|
</xsl:for-each>
|
3399
3541
|
</xsl:when>
|
3400
3542
|
<xsl:otherwise>
|
3401
3543
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3544
|
+
|
3402
3545
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3546
|
+
|
3547
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3548
|
+
<xsl:with-param name="contents" select="contents"/>
|
3549
|
+
</xsl:call-template>
|
3550
|
+
|
3551
|
+
<xsl:call-template name="insertTableBookmarks">
|
3552
|
+
<xsl:with-param name="contents" select="contents"/>
|
3553
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3554
|
+
</xsl:call-template>
|
3555
|
+
|
3403
3556
|
</xsl:for-each>
|
3404
3557
|
</xsl:otherwise>
|
3405
3558
|
</xsl:choose>
|
@@ -3418,8 +3571,44 @@
|
|
3418
3571
|
|
3419
3572
|
</fo:bookmark-tree>
|
3420
3573
|
</xsl:if>
|
3574
|
+
</xsl:template><xsl:template name="insertFigureBookmarks">
|
3575
|
+
<xsl:param name="contents"/>
|
3576
|
+
<xsl:if test="xalan:nodeset($contents)/figure">
|
3577
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
|
3578
|
+
<fo:bookmark-title>Figures</fo:bookmark-title>
|
3579
|
+
<xsl:for-each select="xalan:nodeset($contents)/figure">
|
3580
|
+
<fo:bookmark internal-destination="{@id}">
|
3581
|
+
<fo:bookmark-title>
|
3582
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3583
|
+
</fo:bookmark-title>
|
3584
|
+
</fo:bookmark>
|
3585
|
+
</xsl:for-each>
|
3586
|
+
</fo:bookmark>
|
3587
|
+
</xsl:if>
|
3588
|
+
</xsl:template><xsl:template name="insertTableBookmarks">
|
3589
|
+
<xsl:param name="contents"/>
|
3590
|
+
<xsl:param name="lang"/>
|
3591
|
+
<xsl:if test="xalan:nodeset($contents)/table">
|
3592
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
|
3593
|
+
<fo:bookmark-title>
|
3594
|
+
<xsl:choose>
|
3595
|
+
<xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
|
3596
|
+
<xsl:otherwise>Tables</xsl:otherwise>
|
3597
|
+
</xsl:choose>
|
3598
|
+
</fo:bookmark-title>
|
3599
|
+
<xsl:for-each select="xalan:nodeset($contents)/table">
|
3600
|
+
<fo:bookmark internal-destination="{@id}">
|
3601
|
+
<fo:bookmark-title>
|
3602
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3603
|
+
</fo:bookmark-title>
|
3604
|
+
</fo:bookmark>
|
3605
|
+
</xsl:for-each>
|
3606
|
+
</fo:bookmark>
|
3607
|
+
</xsl:if>
|
3421
3608
|
</xsl:template><xsl:template name="getLangVersion">
|
3422
3609
|
<xsl:param name="lang"/>
|
3610
|
+
<xsl:param name="doctype" select="''"/>
|
3611
|
+
<xsl:param name="title" select="''"/>
|
3423
3612
|
<xsl:choose>
|
3424
3613
|
<xsl:when test="$lang = 'en'">
|
3425
3614
|
|
@@ -3907,7 +4096,8 @@
|
|
3907
4096
|
<fo:block-container margin-left="0mm">
|
3908
4097
|
|
3909
4098
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3910
|
-
<xsl:apply-templates select=".//*[local-name() = 'p']"/>
|
4099
|
+
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
4100
|
+
<xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3911
4101
|
</fo:block>
|
3912
4102
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3913
4103
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -4031,9 +4221,12 @@
|
|
4031
4221
|
</fo:block>
|
4032
4222
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
4033
4223
|
<xsl:variable name="title-deprecated">
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4224
|
+
|
4225
|
+
|
4226
|
+
<xsl:call-template name="getTitle">
|
4227
|
+
<xsl:with-param name="name" select="'title-deprecated'"/>
|
4228
|
+
</xsl:call-template>
|
4229
|
+
|
4037
4230
|
</xsl:variable>
|
4038
4231
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
4039
4232
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
@@ -4089,7 +4282,7 @@
|
|
4089
4282
|
<fo:block id="{@id}">
|
4090
4283
|
<xsl:apply-templates/>
|
4091
4284
|
</fo:block>
|
4092
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4285
|
+
</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']">
|
4093
4286
|
|
4094
4287
|
<fo:block id="{@id}">
|
4095
4288
|
<xsl:apply-templates/>
|
@@ -4151,7 +4344,8 @@
|
|
4151
4344
|
<fo:table-column column-width="107mm"/>
|
4152
4345
|
<fo:table-column column-width="15mm"/>
|
4153
4346
|
<fo:table-body>
|
4154
|
-
<fo:table-row
|
4347
|
+
<fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
|
4348
|
+
|
4155
4349
|
<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
|
4156
4350
|
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
|
4157
4351
|
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
|
@@ -4169,6 +4363,10 @@
|
|
4169
4363
|
<fo:block><xsl:apply-templates/></fo:block>
|
4170
4364
|
</fo:table-cell>
|
4171
4365
|
</xsl:template><xsl:template name="processBibitem">
|
4366
|
+
|
4367
|
+
|
4368
|
+
<!-- end BIPM bibitem processing-->
|
4369
|
+
|
4172
4370
|
|
4173
4371
|
|
4174
4372
|
|
@@ -4406,13 +4604,22 @@
|
|
4406
4604
|
</xsl:template><xsl:template name="split">
|
4407
4605
|
<xsl:param name="pText" select="."/>
|
4408
4606
|
<xsl:param name="sep" select="','"/>
|
4607
|
+
<xsl:param name="normalize-space" select="'true'"/>
|
4409
4608
|
<xsl:if test="string-length($pText) >0">
|
4410
4609
|
<item>
|
4411
|
-
<xsl:
|
4610
|
+
<xsl:choose>
|
4611
|
+
<xsl:when test="$normalize-space = 'true'">
|
4612
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
4613
|
+
</xsl:when>
|
4614
|
+
<xsl:otherwise>
|
4615
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
4616
|
+
</xsl:otherwise>
|
4617
|
+
</xsl:choose>
|
4412
4618
|
</item>
|
4413
4619
|
<xsl:call-template name="split">
|
4414
4620
|
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
4415
4621
|
<xsl:with-param name="sep" select="$sep"/>
|
4622
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
4416
4623
|
</xsl:call-template>
|
4417
4624
|
</xsl:if>
|
4418
4625
|
</xsl:template><xsl:template name="getDocumentId">
|
@@ -4478,4 +4685,23 @@
|
|
4478
4685
|
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4479
4686
|
</xsl:call-template>
|
4480
4687
|
</xsl:if>
|
4688
|
+
</xsl:template><xsl:template name="repeat">
|
4689
|
+
<xsl:param name="char" select="'*'"/>
|
4690
|
+
<xsl:param name="count"/>
|
4691
|
+
<xsl:if test="$count > 0">
|
4692
|
+
<xsl:value-of select="$char"/>
|
4693
|
+
<xsl:call-template name="repeat">
|
4694
|
+
<xsl:with-param name="char" select="$char"/>
|
4695
|
+
<xsl:with-param name="count" select="$count - 1"/>
|
4696
|
+
</xsl:call-template>
|
4697
|
+
</xsl:if>
|
4698
|
+
</xsl:template><xsl:template name="getLocalizedString">
|
4699
|
+
<xsl:param name="key"/>
|
4700
|
+
|
4701
|
+
<xsl:variable name="curr_lang">
|
4702
|
+
<xsl:call-template name="getLang"/>
|
4703
|
+
</xsl:variable>
|
4704
|
+
|
4705
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4706
|
+
|
4481
4707
|
</xsl:template></xsl:stylesheet>
|