metanorma-un 0.7.1 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/un/converter.rb +1 -1
- data/lib/asciidoctor/un/isodoc.rng +61 -18
- data/lib/isodoc/un/html/htmlstyle.css +28 -17
- data/lib/isodoc/un/html/htmlstyle.scss +20 -17
- data/lib/isodoc/un/html/scripts.html +0 -1
- data/lib/isodoc/un/html/unece.css +0 -1
- data/lib/isodoc/un/html/unece.scss +0 -1
- data/lib/isodoc/un/html/wordstyle.css +30 -18
- data/lib/isodoc/un/html/wordstyle.scss +30 -18
- data/lib/isodoc/un/un.plenary-attachment.xsl +331 -72
- data/lib/isodoc/un/un.plenary.xsl +331 -72
- data/lib/isodoc/un/un.recommendation.xsl +328 -73
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +1 -1
- metadata +8 -8
@@ -7,6 +7,8 @@
|
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
8
|
<xsl:param name="basepath"/>
|
9
9
|
|
10
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
|
11
|
+
|
10
12
|
|
11
13
|
|
12
14
|
|
@@ -217,7 +219,7 @@
|
|
217
219
|
<xsl:attribute name="margin-left">20mm</xsl:attribute>
|
218
220
|
</xsl:if>
|
219
221
|
<xsl:if test="@level >= 3 and @section != ''">
|
220
|
-
<xsl:attribute name="margin-left"
|
222
|
+
<xsl:attribute name="margin-left"><xsl:value-of select="(@level - 2) * 28"/>mm</xsl:attribute>
|
221
223
|
</xsl:if>
|
222
224
|
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
223
225
|
<xsl:if test="@section != ''">
|
@@ -362,7 +364,7 @@
|
|
362
364
|
<xsl:variable name="display">
|
363
365
|
<xsl:choose>
|
364
366
|
<xsl:when test="ancestor-or-self::un:annex and $level >= 2">false</xsl:when>
|
365
|
-
<xsl:when test="$level >
|
367
|
+
<xsl:when test="$level > $toc_level">false</xsl:when>
|
366
368
|
<xsl:when test="@inline-header='true'">false</xsl:when>
|
367
369
|
<xsl:otherwise>true</xsl:otherwise>
|
368
370
|
</xsl:choose>
|
@@ -593,31 +595,6 @@
|
|
593
595
|
</fo:block>
|
594
596
|
</xsl:template>
|
595
597
|
|
596
|
-
|
597
|
-
<!-- un:fn[not(ancestor::un:un-standard)] means fn element in virtual variable $title -->
|
598
|
-
<xsl:template match="un:title//un:fn | un:p/un:fn[not(ancestor::un:table)]" priority="2">
|
599
|
-
<fo:footnote keep-with-previous.within-line="always">
|
600
|
-
<xsl:variable name="number">
|
601
|
-
<xsl:number level="any" count="un:fn[not(ancestor::un:table)]"/>
|
602
|
-
</xsl:variable>
|
603
|
-
<fo:inline font-size="55%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% -->
|
604
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
605
|
-
<xsl:value-of select="$number + count(//un:bibitem/un:note)"/>
|
606
|
-
</fo:basic-link>
|
607
|
-
</fo:inline>
|
608
|
-
<fo:footnote-body>
|
609
|
-
<fo:block font-size="9pt" line-height="125%" font-weight="normal" text-indent="0">
|
610
|
-
<fo:inline id="footnote_{@reference}_{$number}" font-size="60%" padding-right="1mm" keep-with-next.within-line="always" vertical-align="super"> <!-- alignment-baseline="hanging" -->
|
611
|
-
<xsl:value-of select="$number + count(//un:bibitem/un:note)"/>
|
612
|
-
</fo:inline>
|
613
|
-
<xsl:for-each select="un:p">
|
614
|
-
<xsl:apply-templates/>
|
615
|
-
</xsl:for-each>
|
616
|
-
</fo:block>
|
617
|
-
</fo:footnote-body>
|
618
|
-
</fo:footnote>
|
619
|
-
</xsl:template>
|
620
|
-
|
621
598
|
<xsl:template match="un:fn/un:p">
|
622
599
|
<fo:block>
|
623
600
|
<xsl:apply-templates/>
|
@@ -653,8 +630,9 @@
|
|
653
630
|
<fo:list-item-label end-indent="label-end()">
|
654
631
|
<fo:block>
|
655
632
|
<xsl:choose>
|
656
|
-
|
657
|
-
|
633
|
+
<xsl:when test="local-name(..) = 'ul'">
|
634
|
+
<xsl:call-template name="setULLabel"/>
|
635
|
+
</xsl:when>
|
658
636
|
<xsl:otherwise> <!-- for ordered lists -->
|
659
637
|
<xsl:choose>
|
660
638
|
<xsl:when test="../@type = 'arabic'">
|
@@ -786,7 +764,7 @@
|
|
786
764
|
|
787
765
|
<xsl:template match="un:title[parent::un:clause[@inline-header = 'true']]" priority="3"/>
|
788
766
|
|
789
|
-
<xsl:template match="un:title">
|
767
|
+
<xsl:template match="un:title" name="title">
|
790
768
|
|
791
769
|
<xsl:variable name="level">
|
792
770
|
<xsl:call-template name="getLevel"/>
|
@@ -1603,6 +1581,78 @@
|
|
1603
1581
|
|
1604
1582
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1605
1583
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1584
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1585
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1586
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1587
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1588
|
+
|
1589
|
+
|
1590
|
+
|
1591
|
+
|
1592
|
+
|
1593
|
+
|
1594
|
+
|
1595
|
+
|
1596
|
+
|
1597
|
+
|
1598
|
+
|
1599
|
+
|
1600
|
+
|
1601
|
+
|
1602
|
+
|
1603
|
+
|
1604
|
+
<xsl:attribute name="font-size">55%</xsl:attribute>
|
1605
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1606
|
+
|
1607
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1608
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1609
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1610
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1611
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1612
|
+
|
1613
|
+
|
1614
|
+
|
1615
|
+
|
1616
|
+
|
1617
|
+
|
1618
|
+
|
1619
|
+
|
1620
|
+
|
1621
|
+
|
1622
|
+
|
1623
|
+
|
1624
|
+
|
1625
|
+
|
1626
|
+
|
1627
|
+
|
1628
|
+
|
1629
|
+
|
1630
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1631
|
+
<xsl:attribute name="line-height">125%</xsl:attribute>
|
1632
|
+
|
1633
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1634
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1635
|
+
|
1636
|
+
|
1637
|
+
|
1638
|
+
|
1639
|
+
|
1640
|
+
|
1641
|
+
|
1642
|
+
|
1643
|
+
|
1644
|
+
|
1645
|
+
|
1646
|
+
|
1647
|
+
|
1648
|
+
|
1649
|
+
|
1650
|
+
|
1651
|
+
|
1652
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1653
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1654
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1655
|
+
|
1606
1656
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
|
1607
1657
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1608
1658
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1628,7 +1678,8 @@
|
|
1628
1678
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
1629
1679
|
|
1630
1680
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1631
|
-
|
1681
|
+
|
1682
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
|
1632
1683
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1633
1684
|
<xsl:apply-templates select="." mode="contents"/>
|
1634
1685
|
</xsl:for-each>
|
@@ -1638,7 +1689,7 @@
|
|
1638
1689
|
<xsl:apply-templates select="." mode="contents"/>
|
1639
1690
|
</xsl:for-each>
|
1640
1691
|
|
1641
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1692
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1642
1693
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1643
1694
|
<xsl:apply-templates select="." mode="contents"/>
|
1644
1695
|
</xsl:for-each>
|
@@ -2576,6 +2627,102 @@
|
|
2576
2627
|
|
2577
2628
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
|
2578
2629
|
<xsl:apply-templates/>
|
2630
|
+
</xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
|
2631
|
+
|
2632
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2633
|
+
<xsl:variable name="p_fn_">
|
2634
|
+
<xsl:choose>
|
2635
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2636
|
+
<fn gen_id="{generate-id(.)}">
|
2637
|
+
<xsl:copy-of select="@*"/>
|
2638
|
+
<xsl:copy-of select="node()"/>
|
2639
|
+
</fn>
|
2640
|
+
</xsl:when>
|
2641
|
+
<xsl:otherwise>
|
2642
|
+
<!-- itetation for:
|
2643
|
+
footnotes in bibdata/title
|
2644
|
+
footnotes in bibliography
|
2645
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2646
|
+
-->
|
2647
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2648
|
+
<fn gen_id="{generate-id(.)}">
|
2649
|
+
<xsl:copy-of select="@*"/>
|
2650
|
+
<xsl:copy-of select="node()"/>
|
2651
|
+
</fn>
|
2652
|
+
</xsl:for-each>
|
2653
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
|
2654
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2655
|
+
<xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
2656
|
+
<!-- copy unique fn -->
|
2657
|
+
<fn gen_id="{generate-id(.)}">
|
2658
|
+
<xsl:copy-of select="@*"/>
|
2659
|
+
<xsl:copy-of select="node()"/>
|
2660
|
+
</fn>
|
2661
|
+
</xsl:for-each>
|
2662
|
+
</xsl:for-each>
|
2663
|
+
</xsl:otherwise>
|
2664
|
+
</xsl:choose>
|
2665
|
+
</xsl:variable>
|
2666
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2667
|
+
|
2668
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2669
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2670
|
+
<xsl:variable name="reference" select="@reference"/>
|
2671
|
+
<!-- fn sequence number in document -->
|
2672
|
+
<xsl:variable name="current_fn_number">
|
2673
|
+
<xsl:choose>
|
2674
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2675
|
+
<xsl:otherwise>
|
2676
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2677
|
+
</xsl:otherwise>
|
2678
|
+
</xsl:choose>
|
2679
|
+
</xsl:variable>
|
2680
|
+
<xsl:variable name="current_fn_number_text">
|
2681
|
+
<xsl:value-of select="$current_fn_number"/>
|
2682
|
+
|
2683
|
+
|
2684
|
+
</xsl:variable>
|
2685
|
+
|
2686
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2687
|
+
<xsl:variable name="footnote_inline">
|
2688
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2689
|
+
|
2690
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2691
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2692
|
+
</fo:basic-link>
|
2693
|
+
</fo:inline>
|
2694
|
+
</xsl:variable>
|
2695
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2696
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2697
|
+
<xsl:choose>
|
2698
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2699
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2700
|
+
</xsl:when>
|
2701
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2702
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2703
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2704
|
+
<fo:footnote-body>
|
2705
|
+
|
2706
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2707
|
+
|
2708
|
+
|
2709
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2710
|
+
|
2711
|
+
|
2712
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2713
|
+
|
2714
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2715
|
+
</fo:inline>
|
2716
|
+
<xsl:apply-templates/>
|
2717
|
+
</fo:block>
|
2718
|
+
</fo:block-container>
|
2719
|
+
</fo:footnote-body>
|
2720
|
+
</fo:footnote>
|
2721
|
+
</xsl:when>
|
2722
|
+
<xsl:otherwise>
|
2723
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2724
|
+
</xsl:otherwise>
|
2725
|
+
</xsl:choose>
|
2579
2726
|
</xsl:template><xsl:template name="fn_display">
|
2580
2727
|
<xsl:variable name="references">
|
2581
2728
|
|
@@ -2768,6 +2915,8 @@
|
|
2768
2915
|
|
2769
2916
|
</fo:basic-link>
|
2770
2917
|
</fo:inline>
|
2918
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2919
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2771
2920
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2772
2921
|
<fo:inline>
|
2773
2922
|
<xsl:apply-templates/>
|
@@ -3125,6 +3274,7 @@
|
|
3125
3274
|
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
3126
3275
|
<xsl:apply-templates/>
|
3127
3276
|
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
3277
|
+
<xsl:apply-templates select="@language"/>
|
3128
3278
|
<xsl:apply-templates/>
|
3129
3279
|
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
3130
3280
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
@@ -3758,22 +3908,6 @@
|
|
3758
3908
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3759
3909
|
<xsl:apply-templates/>
|
3760
3910
|
</fo:inline>
|
3761
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3762
|
-
<xsl:variable name="title-modified">
|
3763
|
-
|
3764
|
-
|
3765
|
-
<xsl:call-template name="getTitle">
|
3766
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3767
|
-
</xsl:call-template>
|
3768
|
-
|
3769
|
-
</xsl:variable>
|
3770
|
-
|
3771
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3772
|
-
<xsl:choose>
|
3773
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
3774
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
3775
|
-
</xsl:choose>
|
3776
|
-
<xsl:apply-templates/>
|
3777
3911
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3778
3912
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3779
3913
|
|
@@ -4360,12 +4494,12 @@
|
|
4360
4494
|
</xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4361
4495
|
<xsl:apply-templates mode="contents"/>
|
4362
4496
|
<xsl:text> </xsl:text>
|
4363
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
4497
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
|
4364
4498
|
<xsl:apply-templates mode="bookmarks"/>
|
4365
4499
|
<xsl:text> </xsl:text>
|
4366
4500
|
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
4367
4501
|
<xsl:value-of select="."/>
|
4368
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
4502
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
4369
4503
|
<xsl:value-of select="."/>
|
4370
4504
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4371
4505
|
<xsl:apply-templates mode="contents"/>
|
@@ -4635,6 +4769,8 @@
|
|
4635
4769
|
|
4636
4770
|
|
4637
4771
|
|
4772
|
+
|
4773
|
+
|
4638
4774
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4639
4775
|
<xsl:variable name="_font-size">
|
4640
4776
|
|
@@ -4668,13 +4804,17 @@
|
|
4668
4804
|
|
4669
4805
|
|
4670
4806
|
|
4807
|
+
|
4808
|
+
|
4671
4809
|
<xsl:apply-templates/>
|
4672
4810
|
</fo:block>
|
4673
|
-
|
4811
|
+
|
4674
4812
|
|
4675
4813
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4676
4814
|
|
4677
4815
|
|
4816
|
+
|
4817
|
+
|
4678
4818
|
</fo:block-container>
|
4679
4819
|
</fo:block-container>
|
4680
4820
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5026,45 +5166,69 @@
|
|
5026
5166
|
<xsl:variable name="termsource_text">
|
5027
5167
|
<xsl:apply-templates/>
|
5028
5168
|
</xsl:variable>
|
5029
|
-
|
5030
|
-
<xsl:choose>
|
5169
|
+
<xsl:copy-of select="$termsource_text"/>
|
5170
|
+
<!-- <xsl:choose>
|
5031
5171
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
5032
|
-
<!-- <xsl:apply-templates /> -->
|
5033
5172
|
<xsl:copy-of select="$termsource_text"/>
|
5034
5173
|
</xsl:when>
|
5035
5174
|
<xsl:otherwise>
|
5036
|
-
|
5037
|
-
|
5175
|
+
<xsl:if test="$namespace = 'bsi'">
|
5176
|
+
<xsl:choose>
|
5177
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
5178
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
5179
|
+
</xsl:choose>
|
5180
|
+
</xsl:if>
|
5181
|
+
<xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
|
5038
5182
|
<xsl:text>[</xsl:text>
|
5039
|
-
|
5040
|
-
<!-- <xsl:apply-templates /> -->
|
5183
|
+
</xsl:if>
|
5041
5184
|
<xsl:copy-of select="$termsource_text"/>
|
5042
|
-
|
5043
|
-
|
5185
|
+
<xsl:if test="$namespace = 'bsi'">
|
5186
|
+
<xsl:choose>
|
5187
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
5188
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
5189
|
+
</xsl:choose>
|
5190
|
+
</xsl:if>
|
5191
|
+
<xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
|
5044
5192
|
<xsl:text>]</xsl:text>
|
5045
|
-
|
5193
|
+
</xsl:if>
|
5046
5194
|
</xsl:otherwise>
|
5047
|
-
</xsl:choose>
|
5195
|
+
</xsl:choose> -->
|
5048
5196
|
</fo:block>
|
5049
5197
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
5050
5198
|
<xsl:if test="normalize-space() != ''">
|
5051
5199
|
<xsl:value-of select="."/>
|
5052
5200
|
</xsl:if>
|
5053
|
-
</xsl:template><xsl:
|
5054
|
-
<
|
5055
|
-
|
5056
|
-
|
5057
|
-
|
5201
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
5202
|
+
<fo:inline>
|
5203
|
+
|
5204
|
+
|
5205
|
+
<xsl:value-of select="."/>
|
5206
|
+
</fo:inline>
|
5207
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
5058
5208
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5059
5209
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5060
5210
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
5061
5211
|
</xsl:if>
|
5062
|
-
|
5063
5212
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
5064
5213
|
<xsl:apply-templates/>
|
5065
5214
|
</fo:inline>
|
5215
|
+
</fo:basic-link>
|
5216
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
5217
|
+
<xsl:variable name="title-modified">
|
5066
5218
|
|
5067
|
-
|
5219
|
+
|
5220
|
+
<xsl:call-template name="getTitle">
|
5221
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
5222
|
+
</xsl:call-template>
|
5223
|
+
|
5224
|
+
</xsl:variable>
|
5225
|
+
|
5226
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
5227
|
+
<xsl:choose>
|
5228
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
5229
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
5230
|
+
</xsl:choose>
|
5231
|
+
<xsl:apply-templates/>
|
5068
5232
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
5069
5233
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5070
5234
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5255,15 +5419,20 @@
|
|
5255
5419
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5256
5420
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5257
5421
|
</fo:block>
|
5422
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5423
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5424
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5425
|
+
</xsl:if>
|
5258
5426
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5259
5427
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5260
5428
|
<xsl:apply-templates/>
|
5261
5429
|
</fo:block>
|
5262
5430
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5263
5431
|
<xsl:apply-templates/>
|
5264
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5432
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5265
5433
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5266
|
-
<fo:block
|
5434
|
+
<!-- <fo:block> </fo:block> -->
|
5435
|
+
<fo:block/>
|
5267
5436
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5268
5437
|
|
5269
5438
|
<fo:block break-after="page"/>
|
@@ -5331,6 +5500,51 @@
|
|
5331
5500
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
5332
5501
|
<!-- 0xA0 to space replacement -->
|
5333
5502
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5503
|
+
</xsl:template><xsl:variable name="ul_labels_">
|
5504
|
+
|
5505
|
+
|
5506
|
+
|
5507
|
+
|
5508
|
+
|
5509
|
+
|
5510
|
+
|
5511
|
+
|
5512
|
+
|
5513
|
+
|
5514
|
+
|
5515
|
+
|
5516
|
+
|
5517
|
+
|
5518
|
+
|
5519
|
+
|
5520
|
+
|
5521
|
+
<label>•</label>
|
5522
|
+
|
5523
|
+
</xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
|
5524
|
+
<xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
5525
|
+
<xsl:variable name="list_level">
|
5526
|
+
<xsl:choose>
|
5527
|
+
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
5528
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
|
5529
|
+
</xsl:choose>
|
5530
|
+
</xsl:variable>
|
5531
|
+
<xsl:choose>
|
5532
|
+
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
5533
|
+
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
5534
|
+
</xsl:when>
|
5535
|
+
<xsl:when test="$list_level mod 3 = 0">
|
5536
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
5537
|
+
</xsl:when>
|
5538
|
+
<xsl:when test="$list_level mod 2 = 0">
|
5539
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
5540
|
+
</xsl:when>
|
5541
|
+
<xsl:otherwise>
|
5542
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
5543
|
+
</xsl:otherwise>
|
5544
|
+
</xsl:choose>
|
5545
|
+
</xsl:template><xsl:template match="label" mode="ul_labels">
|
5546
|
+
<xsl:copy-of select="@*[not(local-name() = 'level')]"/>
|
5547
|
+
<xsl:value-of select="."/>
|
5334
5548
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
5335
5549
|
<xsl:choose>
|
5336
5550
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
@@ -5669,7 +5883,31 @@
|
|
5669
5883
|
<fo:block-container border="1pt solid black" width="50%">
|
5670
5884
|
<fo:block> </fo:block>
|
5671
5885
|
</fo:block-container>
|
5672
|
-
</xsl:template><xsl:
|
5886
|
+
</xsl:template><xsl:variable name="toc_level">
|
5887
|
+
<xsl:choose>
|
5888
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5889
|
+
<xsl:otherwise><!-- default value -->
|
5890
|
+
|
5891
|
+
|
5892
|
+
|
5893
|
+
|
5894
|
+
|
5895
|
+
|
5896
|
+
|
5897
|
+
|
5898
|
+
|
5899
|
+
|
5900
|
+
|
5901
|
+
|
5902
|
+
|
5903
|
+
|
5904
|
+
|
5905
|
+
|
5906
|
+
|
5907
|
+
3
|
5908
|
+
</xsl:otherwise>
|
5909
|
+
</xsl:choose>
|
5910
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5673
5911
|
<xsl:param name="colwidths"/>
|
5674
5912
|
<xsl:variable name="colwidths_">
|
5675
5913
|
<xsl:choose>
|
@@ -5760,6 +5998,10 @@
|
|
5760
5998
|
</svg>
|
5761
5999
|
</fo:instream-foreign-object>
|
5762
6000
|
</fo:inline>
|
6001
|
+
</xsl:template><xsl:template match="@language">
|
6002
|
+
<xsl:copy-of select="."/>
|
6003
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
|
6004
|
+
<xsl:call-template name="title"/>
|
5763
6005
|
</xsl:template><xsl:template name="convertDate">
|
5764
6006
|
<xsl:param name="date"/>
|
5765
6007
|
<xsl:param name="format" select="'short'"/>
|
@@ -6204,12 +6446,15 @@
|
|
6204
6446
|
<xsl:param name="default">left</xsl:param>
|
6205
6447
|
<xsl:attribute name="text-align">
|
6206
6448
|
<xsl:choose>
|
6207
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6449
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
6208
6450
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6209
6451
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6210
6452
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6211
6453
|
</xsl:choose>
|
6212
6454
|
</xsl:attribute>
|
6455
|
+
<xsl:if test="@align = 'indent'">
|
6456
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6457
|
+
</xsl:if>
|
6213
6458
|
</xsl:template><xsl:template name="number-to-words">
|
6214
6459
|
<xsl:param name="number"/>
|
6215
6460
|
<xsl:param name="first"/>
|
@@ -6306,4 +6551,14 @@
|
|
6306
6551
|
</xsl:otherwise>
|
6307
6552
|
</xsl:choose>
|
6308
6553
|
</xsl:if>
|
6554
|
+
</xsl:template><xsl:template name="setAltText">
|
6555
|
+
<xsl:param name="value"/>
|
6556
|
+
<xsl:attribute name="fox:alt-text">
|
6557
|
+
<xsl:choose>
|
6558
|
+
<xsl:when test="normalize-space($value) != ''">
|
6559
|
+
<xsl:value-of select="$value"/>
|
6560
|
+
</xsl:when>
|
6561
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6562
|
+
</xsl:choose>
|
6563
|
+
</xsl:attribute>
|
6309
6564
|
</xsl:template></xsl:stylesheet>
|
data/lib/metanorma/un/version.rb
CHANGED
data/metanorma-unece.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
|
33
33
|
spec.add_dependency "metanorma-standoc", "~> 1.11.0"
|
34
34
|
|
35
|
-
spec.add_development_dependency "
|
35
|
+
spec.add_development_dependency "debug"
|
36
36
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
37
37
|
spec.add_development_dependency "guard", "~> 2.14"
|
38
38
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|