metanorma-un 0.5.7 → 0.5.12

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.
@@ -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, HanSans" font-size="10pt" xml:lang="{$lang}">
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)"/>
@@ -1420,6 +1420,7 @@
1420
1420
 
1421
1421
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1422
1422
 
1423
+
1423
1424
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1424
1425
 
1425
1426
 
@@ -1427,6 +1428,7 @@
1427
1428
 
1428
1429
 
1429
1430
 
1431
+
1430
1432
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1431
1433
 
1432
1434
 
@@ -1444,6 +1446,7 @@
1444
1446
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1445
1447
 
1446
1448
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1449
+
1447
1450
 
1448
1451
 
1449
1452
 
@@ -1555,7 +1558,7 @@
1555
1558
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1556
1559
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1557
1560
  <xsl:call-template name="add-zero-spaces-java"/>
1558
- </xsl:template><xsl:template match="*[local-name()='table']">
1561
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1559
1562
 
1560
1563
  <xsl:variable name="simple-table">
1561
1564
  <xsl:call-template name="getSimpleTable"/>
@@ -1601,10 +1604,12 @@
1601
1604
 
1602
1605
 
1603
1606
  <xsl:variable name="colwidths">
1604
- <xsl:call-template name="calculate-column-widths">
1605
- <xsl:with-param name="cols-count" select="$cols-count"/>
1606
- <xsl:with-param name="table" select="$simple-table"/>
1607
- </xsl:call-template>
1607
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1608
+ <xsl:call-template name="calculate-column-widths">
1609
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1610
+ <xsl:with-param name="table" select="$simple-table"/>
1611
+ </xsl:call-template>
1612
+ </xsl:if>
1608
1613
  </xsl:variable>
1609
1614
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1610
1615
 
@@ -1648,7 +1653,12 @@
1648
1653
 
1649
1654
  <xsl:variable name="table_attributes">
1650
1655
  <attribute name="table-layout">fixed</attribute>
1651
- <attribute name="width">100%</attribute>
1656
+ <attribute name="width">
1657
+ <xsl:choose>
1658
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1659
+ <xsl:otherwise>100%</xsl:otherwise>
1660
+ </xsl:choose>
1661
+ </attribute>
1652
1662
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1653
1663
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1654
1664
 
@@ -1682,16 +1692,25 @@
1682
1692
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1683
1693
  </xsl:if>
1684
1694
 
1685
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1686
- <xsl:choose>
1687
- <xsl:when test=". = 1 or . = 0">
1688
- <fo:table-column column-width="proportional-column-width(2)"/>
1689
- </xsl:when>
1690
- <xsl:otherwise>
1691
- <fo:table-column column-width="proportional-column-width({.})"/>
1692
- </xsl:otherwise>
1693
- </xsl:choose>
1694
- </xsl:for-each>
1695
+ <xsl:choose>
1696
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1697
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1698
+ <fo:table-column column-width="{@width}"/>
1699
+ </xsl:for-each>
1700
+ </xsl:when>
1701
+ <xsl:otherwise>
1702
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1703
+ <xsl:choose>
1704
+ <xsl:when test=". = 1 or . = 0">
1705
+ <fo:table-column column-width="proportional-column-width(2)"/>
1706
+ </xsl:when>
1707
+ <xsl:otherwise>
1708
+ <fo:table-column column-width="proportional-column-width({.})"/>
1709
+ </xsl:otherwise>
1710
+ </xsl:choose>
1711
+ </xsl:for-each>
1712
+ </xsl:otherwise>
1713
+ </xsl:choose>
1695
1714
 
1696
1715
  <xsl:choose>
1697
1716
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -1704,10 +1723,12 @@
1704
1723
 
1705
1724
  </fo:table>
1706
1725
 
1726
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1707
1727
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1708
1728
  <xsl:call-template name="insertTableFooterInSeparateTable">
1709
1729
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
1710
1730
  <xsl:with-param name="colwidths" select="$colwidths"/>
1731
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1711
1732
  </xsl:call-template>
1712
1733
  </xsl:for-each>
1713
1734
 
@@ -1961,12 +1982,22 @@
1961
1982
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1962
1983
  <xsl:param name="table_attributes"/>
1963
1984
  <xsl:param name="colwidths"/>
1985
+ <xsl:param name="colgroup"/>
1964
1986
 
1965
1987
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1966
1988
 
1967
1989
  <xsl:if test="$isNoteOrFnExist = 'true'">
1968
1990
 
1969
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1991
+ <xsl:variable name="cols-count">
1992
+ <xsl:choose>
1993
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1994
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1995
+ </xsl:when>
1996
+ <xsl:otherwise>
1997
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1998
+ </xsl:otherwise>
1999
+ </xsl:choose>
2000
+ </xsl:variable>
1970
2001
 
1971
2002
  <fo:table keep-with-previous="always">
1972
2003
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -1984,16 +2015,25 @@
1984
2015
  </xsl:choose>
1985
2016
  </xsl:for-each>
1986
2017
 
1987
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1988
- <xsl:choose>
1989
- <xsl:when test=". = 1 or . = 0">
1990
- <fo:table-column column-width="proportional-column-width(2)"/>
1991
- </xsl:when>
1992
- <xsl:otherwise>
1993
- <fo:table-column column-width="proportional-column-width({.})"/>
1994
- </xsl:otherwise>
1995
- </xsl:choose>
1996
- </xsl:for-each>
2018
+ <xsl:choose>
2019
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2020
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2021
+ <fo:table-column column-width="{@width}"/>
2022
+ </xsl:for-each>
2023
+ </xsl:when>
2024
+ <xsl:otherwise>
2025
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2026
+ <xsl:choose>
2027
+ <xsl:when test=". = 1 or . = 0">
2028
+ <fo:table-column column-width="proportional-column-width(2)"/>
2029
+ </xsl:when>
2030
+ <xsl:otherwise>
2031
+ <fo:table-column column-width="proportional-column-width({.})"/>
2032
+ </xsl:otherwise>
2033
+ </xsl:choose>
2034
+ </xsl:for-each>
2035
+ </xsl:otherwise>
2036
+ </xsl:choose>
1997
2037
 
1998
2038
  <fo:table-body>
1999
2039
  <fo:table-row>
@@ -2427,7 +2467,9 @@
2427
2467
  </xsl:template><xsl:template match="*[local-name()='dl']">
2428
2468
  <fo:block-container>
2429
2469
 
2430
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2470
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2471
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2472
+ </xsl:if>
2431
2473
 
2432
2474
 
2433
2475
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2442,6 +2484,7 @@
2442
2484
  <fo:block-container>
2443
2485
 
2444
2486
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2487
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2445
2488
 
2446
2489
 
2447
2490
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2625,12 +2668,32 @@
2625
2668
  </xsl:otherwise>
2626
2669
  </xsl:choose>
2627
2670
  </xsl:template><xsl:template name="getMaxLength_dt">
2628
- <xsl:for-each select="*[local-name()='dt']">
2629
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2630
- <xsl:if test="position() = 1">
2631
- <xsl:value-of select="string-length(normalize-space(.))"/>
2632
- </xsl:if>
2633
- </xsl:for-each>
2671
+ <xsl:variable name="lengths">
2672
+ <xsl:for-each select="*[local-name()='dt']">
2673
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2674
+ <xsl:variable name="attributes">
2675
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2676
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2677
+ </xsl:variable>
2678
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2679
+ </xsl:for-each>
2680
+ </xsl:variable>
2681
+ <xsl:variable name="maxLength">
2682
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2683
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2684
+ <xsl:if test="position() = 1">
2685
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2686
+ </xsl:if>
2687
+ </xsl:for-each> -->
2688
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2689
+ <xsl:sort select="." data-type="number" order="descending"/>
2690
+ <xsl:if test="position() = 1">
2691
+ <xsl:value-of select="."/>
2692
+ </xsl:if>
2693
+ </xsl:for-each>
2694
+ </xsl:variable>
2695
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2696
+ <xsl:value-of select="$maxLength"/>
2634
2697
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2635
2698
  <xsl:param name="key_iso"/>
2636
2699
 
@@ -2742,6 +2805,7 @@
2742
2805
  </fo:inline>
2743
2806
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2744
2807
  <fo:inline font-weight="bold">
2808
+
2745
2809
  <xsl:apply-templates/>
2746
2810
  </fo:inline>
2747
2811
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2768,6 +2832,7 @@
2768
2832
 
2769
2833
 
2770
2834
 
2835
+
2771
2836
 
2772
2837
  </xsl:variable>
2773
2838
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -2781,6 +2846,10 @@
2781
2846
  </xsl:if>
2782
2847
  <xsl:apply-templates/>
2783
2848
  </fo:inline>
2849
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2850
+ <fo:inline text-decoration="underline">
2851
+ <xsl:apply-templates/>
2852
+ </fo:inline>
2784
2853
  </xsl:template><xsl:template match="*[local-name()='del']">
2785
2854
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2786
2855
  <xsl:apply-templates/>
@@ -3146,6 +3215,7 @@
3146
3215
  </xsl:choose>
3147
3216
  </xsl:variable>
3148
3217
  <fo:inline xsl:use-attribute-sets="link-style">
3218
+
3149
3219
  <xsl:choose>
3150
3220
  <xsl:when test="$target = ''">
3151
3221
  <xsl:apply-templates/>
@@ -3373,8 +3443,9 @@
3373
3443
  </xsl:if> -->
3374
3444
  </fo:inline>
3375
3445
  </xsl:if>
3376
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3377
- <fo:block-container id="{@id}">
3446
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3447
+ <fo:block-container id="{@id}">
3448
+
3378
3449
  <fo:block>
3379
3450
  <xsl:apply-templates/>
3380
3451
  </fo:block>
@@ -3430,7 +3501,7 @@
3430
3501
  <xsl:apply-templates mode="bookmarks"/>
3431
3502
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3432
3503
  <xsl:apply-templates select="."/>
3433
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3504
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3434
3505
  <xsl:apply-templates mode="bookmarks"/>
3435
3506
  </xsl:template><xsl:template name="addBookmarks">
3436
3507
  <xsl:param name="contents"/>
@@ -3446,6 +3517,8 @@
3446
3517
  <xsl:variable name="bookmark-title_">
3447
3518
  <xsl:call-template name="getLangVersion">
3448
3519
  <xsl:with-param name="lang" select="@lang"/>
3520
+ <xsl:with-param name="doctype" select="@doctype"/>
3521
+ <xsl:with-param name="title" select="@title-part"/>
3449
3522
  </xsl:call-template>
3450
3523
  </xsl:variable>
3451
3524
  <xsl:choose>
@@ -3463,13 +3536,34 @@
3463
3536
  </xsl:choose>
3464
3537
  </fo:bookmark-title>
3465
3538
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3539
+
3540
+ <xsl:call-template name="insertFigureBookmarks">
3541
+ <xsl:with-param name="contents" select="contents"/>
3542
+ </xsl:call-template>
3543
+
3544
+ <xsl:call-template name="insertTableBookmarks">
3545
+ <xsl:with-param name="contents" select="contents"/>
3546
+ <xsl:with-param name="lang" select="@lang"/>
3547
+ </xsl:call-template>
3548
+
3466
3549
  </fo:bookmark>
3467
3550
 
3468
3551
  </xsl:for-each>
3469
3552
  </xsl:when>
3470
3553
  <xsl:otherwise>
3471
3554
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3555
+
3472
3556
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3557
+
3558
+ <xsl:call-template name="insertFigureBookmarks">
3559
+ <xsl:with-param name="contents" select="contents"/>
3560
+ </xsl:call-template>
3561
+
3562
+ <xsl:call-template name="insertTableBookmarks">
3563
+ <xsl:with-param name="contents" select="contents"/>
3564
+ <xsl:with-param name="lang" select="@lang"/>
3565
+ </xsl:call-template>
3566
+
3473
3567
  </xsl:for-each>
3474
3568
  </xsl:otherwise>
3475
3569
  </xsl:choose>
@@ -3488,8 +3582,44 @@
3488
3582
 
3489
3583
  </fo:bookmark-tree>
3490
3584
  </xsl:if>
3585
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3586
+ <xsl:param name="contents"/>
3587
+ <xsl:if test="xalan:nodeset($contents)/figure">
3588
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3589
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3590
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3591
+ <fo:bookmark internal-destination="{@id}">
3592
+ <fo:bookmark-title>
3593
+ <xsl:value-of select="normalize-space(title)"/>
3594
+ </fo:bookmark-title>
3595
+ </fo:bookmark>
3596
+ </xsl:for-each>
3597
+ </fo:bookmark>
3598
+ </xsl:if>
3599
+ </xsl:template><xsl:template name="insertTableBookmarks">
3600
+ <xsl:param name="contents"/>
3601
+ <xsl:param name="lang"/>
3602
+ <xsl:if test="xalan:nodeset($contents)/table">
3603
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3604
+ <fo:bookmark-title>
3605
+ <xsl:choose>
3606
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3607
+ <xsl:otherwise>Tables</xsl:otherwise>
3608
+ </xsl:choose>
3609
+ </fo:bookmark-title>
3610
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3611
+ <fo:bookmark internal-destination="{@id}">
3612
+ <fo:bookmark-title>
3613
+ <xsl:value-of select="normalize-space(title)"/>
3614
+ </fo:bookmark-title>
3615
+ </fo:bookmark>
3616
+ </xsl:for-each>
3617
+ </fo:bookmark>
3618
+ </xsl:if>
3491
3619
  </xsl:template><xsl:template name="getLangVersion">
3492
3620
  <xsl:param name="lang"/>
3621
+ <xsl:param name="doctype" select="''"/>
3622
+ <xsl:param name="title" select="''"/>
3493
3623
  <xsl:choose>
3494
3624
  <xsl:when test="$lang = 'en'">
3495
3625
 
@@ -3525,6 +3655,12 @@
3525
3655
  <!-- <xsl:text> </xsl:text> -->
3526
3656
  </xsl:template><xsl:template name="getSection">
3527
3657
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3658
+ <!--
3659
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3660
+ <xsl:value-of select="."/>
3661
+ </xsl:for-each>
3662
+ -->
3663
+
3528
3664
  </xsl:template><xsl:template name="getName">
3529
3665
  <xsl:choose>
3530
3666
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3577,6 +3713,10 @@
3577
3713
  <xsl:copy>
3578
3714
  <xsl:apply-templates mode="contents_item"/>
3579
3715
  </xsl:copy>
3716
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3717
+ <xsl:copy>
3718
+ <xsl:apply-templates mode="contents_item"/>
3719
+ </xsl:copy>
3580
3720
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3581
3721
  <xsl:text> </xsl:text>
3582
3722
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3602,6 +3742,7 @@
3602
3742
 
3603
3743
 
3604
3744
 
3745
+
3605
3746
 
3606
3747
 
3607
3748
 
@@ -3977,7 +4118,8 @@
3977
4118
  <fo:block-container margin-left="0mm">
3978
4119
 
3979
4120
  <fo:block xsl:use-attribute-sets="quote-style">
3980
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4121
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4122
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3981
4123
  </fo:block>
3982
4124
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3983
4125
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4130,6 +4272,7 @@
4130
4272
 
4131
4273
 
4132
4274
 
4275
+
4133
4276
 
4134
4277
 
4135
4278
 
@@ -4146,7 +4289,7 @@
4146
4289
 
4147
4290
 
4148
4291
 
4149
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4292
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
4150
4293
  <fo:block break-after="page"/>
4151
4294
  <fo:block>
4152
4295
  <xsl:call-template name="setId"/>
@@ -4154,7 +4297,8 @@
4154
4297
  </fo:block>
4155
4298
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4156
4299
  <fo:block>
4157
- <xsl:call-template name="setId"/>
4300
+ <xsl:call-template name="setId"/>
4301
+
4158
4302
 
4159
4303
  <xsl:apply-templates/>
4160
4304
  </fo:block>
@@ -4162,7 +4306,7 @@
4162
4306
  <fo:block id="{@id}">
4163
4307
  <xsl:apply-templates/>
4164
4308
  </fo:block>
4165
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4309
+ </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']">
4166
4310
 
4167
4311
  <fo:block id="{@id}">
4168
4312
  <xsl:apply-templates/>
@@ -4224,7 +4368,8 @@
4224
4368
  <fo:table-column column-width="107mm"/>
4225
4369
  <fo:table-column column-width="15mm"/>
4226
4370
  <fo:table-body>
4227
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4371
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4372
+
4228
4373
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4229
4374
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4230
4375
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4242,6 +4387,10 @@
4242
4387
  <fo:block><xsl:apply-templates/></fo:block>
4243
4388
  </fo:table-cell>
4244
4389
  </xsl:template><xsl:template name="processBibitem">
4390
+
4391
+
4392
+ <!-- end BIPM bibitem processing-->
4393
+
4245
4394
 
4246
4395
 
4247
4396
 
@@ -4300,6 +4449,8 @@
4300
4449
  <xsl:value-of select="translate(.,'. ','')"/>
4301
4450
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4302
4451
  <xsl:value-of select="substring(.,1,1)"/>
4452
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4453
+ <fo:inline><xsl:apply-templates/></fo:inline>
4303
4454
  </xsl:template><xsl:template name="convertDate">
4304
4455
  <xsl:param name="date"/>
4305
4456
  <xsl:param name="format" select="'short'"/>
@@ -4324,6 +4475,57 @@
4324
4475
  </xsl:variable>
4325
4476
  <xsl:variable name="result">
4326
4477
  <xsl:choose>
4478
+ <xsl:when test="$format = 'ddMMyyyy'">
4479
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4480
+ <xsl:text> </xsl:text>
4481
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4482
+ </xsl:when>
4483
+ <xsl:when test="$format = 'ddMM'">
4484
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4485
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4486
+ </xsl:when>
4487
+ <xsl:when test="$format = 'short' or $day = ''">
4488
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4489
+ </xsl:when>
4490
+ <xsl:otherwise>
4491
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4492
+ </xsl:otherwise>
4493
+ </xsl:choose>
4494
+ </xsl:variable>
4495
+ <xsl:value-of select="$result"/>
4496
+ </xsl:template><xsl:template name="convertDateLocalized">
4497
+ <xsl:param name="date"/>
4498
+ <xsl:param name="format" select="'short'"/>
4499
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4500
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4501
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4502
+ <xsl:variable name="monthStr">
4503
+ <xsl:choose>
4504
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
4505
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
4506
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
4507
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
4508
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
4509
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
4510
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
4511
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
4512
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
4513
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
4514
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
4515
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
4516
+ </xsl:choose>
4517
+ </xsl:variable>
4518
+ <xsl:variable name="result">
4519
+ <xsl:choose>
4520
+ <xsl:when test="$format = 'ddMMyyyy'">
4521
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4522
+ <xsl:text> </xsl:text>
4523
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4524
+ </xsl:when>
4525
+ <xsl:when test="$format = 'ddMM'">
4526
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4527
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4528
+ </xsl:when>
4327
4529
  <xsl:when test="$format = 'short' or $day = ''">
4328
4530
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4329
4531
  </xsl:when>
@@ -4518,6 +4720,7 @@
4518
4720
 
4519
4721
 
4520
4722
 
4723
+
4521
4724
  </xsl:variable>
4522
4725
  <xsl:if test="$documentNS != $XSLNS">
4523
4726
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4577,6 +4780,11 @@
4577
4780
  <xsl:call-template name="getLang"/>
4578
4781
  </xsl:variable>
4579
4782
 
4580
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4783
+ <xsl:choose>
4784
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4785
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4786
+ </xsl:when>
4787
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4788
+ </xsl:choose>
4581
4789
 
4582
4790
  </xsl:template></xsl:stylesheet>