metanorma-un 0.7.1 → 0.7.5
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/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
|
|
@@ -337,7 +339,7 @@
|
|
337
339
|
|
338
340
|
<xsl:variable name="display">
|
339
341
|
<xsl:choose>
|
340
|
-
<xsl:when test="$level >
|
342
|
+
<xsl:when test="$level > $toc_level">false</xsl:when>
|
341
343
|
<xsl:otherwise>true</xsl:otherwise>
|
342
344
|
</xsl:choose>
|
343
345
|
</xsl:variable>
|
@@ -553,31 +555,6 @@
|
|
553
555
|
</xsl:template>
|
554
556
|
|
555
557
|
|
556
|
-
<xsl:template match="un:title/un:fn | un:p/un:fn[not(ancestor::un:table)] | un:figure/un:name/un:fn" priority="2">
|
557
|
-
<fo:footnote keep-with-previous.within-line="always">
|
558
|
-
<xsl:variable name="number">
|
559
|
-
<xsl:number level="any" count="un:fn[not(ancestor::un:table)]"/>
|
560
|
-
</xsl:variable>
|
561
|
-
<fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
|
562
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
563
|
-
<xsl:value-of select="$number + count(//un:bibitem/un:note)"/>
|
564
|
-
</fo:basic-link>
|
565
|
-
</fo:inline>
|
566
|
-
<fo:footnote-body>
|
567
|
-
<fo:block-container margin-left="-8mm">
|
568
|
-
<fo:block font-size="9pt" text-align="justify" line-height="125%" font-weight="normal" text-indent="0" margin-left="8mm">
|
569
|
-
<fo:inline id="footnote_{@reference}_{$number}" font-size="60%" keep-with-next.within-line="always" vertical-align="super" padding-right="8mm"> <!-- alignment-baseline="hanging" -->
|
570
|
-
<xsl:value-of select="$number + count(//un:bibitem/un:note)"/>
|
571
|
-
</fo:inline>
|
572
|
-
<xsl:for-each select="un:p">
|
573
|
-
<xsl:apply-templates/>
|
574
|
-
</xsl:for-each>
|
575
|
-
</fo:block>
|
576
|
-
</fo:block-container>
|
577
|
-
</fo:footnote-body>
|
578
|
-
</fo:footnote>
|
579
|
-
</xsl:template>
|
580
|
-
|
581
558
|
<xsl:template match="un:fn/un:p">
|
582
559
|
<fo:block>
|
583
560
|
<xsl:apply-templates/>
|
@@ -614,8 +591,9 @@
|
|
614
591
|
<fo:list-item-label end-indent="label-end()">
|
615
592
|
<fo:block>
|
616
593
|
<xsl:choose>
|
617
|
-
|
618
|
-
|
594
|
+
<xsl:when test="local-name(..) = 'ul'">
|
595
|
+
<xsl:call-template name="setULLabel"/>
|
596
|
+
</xsl:when>
|
619
597
|
<xsl:otherwise> <!-- for ordered lists -->
|
620
598
|
<xsl:choose>
|
621
599
|
<xsl:when test="../@type = 'arabic'">
|
@@ -756,7 +734,7 @@
|
|
756
734
|
|
757
735
|
<xsl:template match="un:title[parent::un:clause[@inline-header = 'true']]" priority="3"/>
|
758
736
|
|
759
|
-
<xsl:template match="un:title">
|
737
|
+
<xsl:template match="un:title" name="title">
|
760
738
|
|
761
739
|
<xsl:variable name="level">
|
762
740
|
<xsl:call-template name="getLevel"/>
|
@@ -1645,6 +1623,80 @@
|
|
1645
1623
|
|
1646
1624
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1647
1625
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1626
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1627
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1628
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1629
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1630
|
+
|
1631
|
+
|
1632
|
+
|
1633
|
+
|
1634
|
+
|
1635
|
+
|
1636
|
+
|
1637
|
+
|
1638
|
+
|
1639
|
+
|
1640
|
+
|
1641
|
+
|
1642
|
+
|
1643
|
+
|
1644
|
+
|
1645
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1646
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1647
|
+
|
1648
|
+
|
1649
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1650
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1651
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1652
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1653
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1654
|
+
|
1655
|
+
|
1656
|
+
|
1657
|
+
|
1658
|
+
|
1659
|
+
|
1660
|
+
|
1661
|
+
|
1662
|
+
|
1663
|
+
|
1664
|
+
|
1665
|
+
|
1666
|
+
|
1667
|
+
|
1668
|
+
|
1669
|
+
|
1670
|
+
|
1671
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1672
|
+
<xsl:attribute name="text-align">justify</xsl:attribute>
|
1673
|
+
<xsl:attribute name="line-height">125%</xsl:attribute>
|
1674
|
+
<xsl:attribute name="margin-left">8mm</xsl:attribute>
|
1675
|
+
|
1676
|
+
|
1677
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1678
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1679
|
+
|
1680
|
+
|
1681
|
+
|
1682
|
+
|
1683
|
+
|
1684
|
+
|
1685
|
+
|
1686
|
+
|
1687
|
+
|
1688
|
+
|
1689
|
+
|
1690
|
+
|
1691
|
+
|
1692
|
+
|
1693
|
+
|
1694
|
+
|
1695
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1696
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1697
|
+
<xsl:attribute name="padding-right">8mm</xsl:attribute>
|
1698
|
+
|
1699
|
+
|
1648
1700
|
</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">
|
1649
1701
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1650
1702
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1670,7 +1722,8 @@
|
|
1670
1722
|
<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"/>
|
1671
1723
|
|
1672
1724
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1673
|
-
|
1725
|
+
|
1726
|
+
<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']]">
|
1674
1727
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1675
1728
|
<xsl:apply-templates select="." mode="contents"/>
|
1676
1729
|
</xsl:for-each>
|
@@ -1680,7 +1733,7 @@
|
|
1680
1733
|
<xsl:apply-templates select="." mode="contents"/>
|
1681
1734
|
</xsl:for-each>
|
1682
1735
|
|
1683
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1736
|
+
<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')]]">
|
1684
1737
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1685
1738
|
<xsl:apply-templates select="." mode="contents"/>
|
1686
1739
|
</xsl:for-each>
|
@@ -2613,6 +2666,104 @@
|
|
2613
2666
|
|
2614
2667
|
</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">
|
2615
2668
|
<xsl:apply-templates/>
|
2669
|
+
</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">
|
2670
|
+
|
2671
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2672
|
+
<xsl:variable name="p_fn_">
|
2673
|
+
<xsl:choose>
|
2674
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2675
|
+
<fn gen_id="{generate-id(.)}">
|
2676
|
+
<xsl:copy-of select="@*"/>
|
2677
|
+
<xsl:copy-of select="node()"/>
|
2678
|
+
</fn>
|
2679
|
+
</xsl:when>
|
2680
|
+
<xsl:otherwise>
|
2681
|
+
<!-- itetation for:
|
2682
|
+
footnotes in bibdata/title
|
2683
|
+
footnotes in bibliography
|
2684
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2685
|
+
-->
|
2686
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2687
|
+
<fn gen_id="{generate-id(.)}">
|
2688
|
+
<xsl:copy-of select="@*"/>
|
2689
|
+
<xsl:copy-of select="node()"/>
|
2690
|
+
</fn>
|
2691
|
+
</xsl:for-each>
|
2692
|
+
<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']/*">
|
2693
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2694
|
+
<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])]">
|
2695
|
+
<!-- copy unique fn -->
|
2696
|
+
<fn gen_id="{generate-id(.)}">
|
2697
|
+
<xsl:copy-of select="@*"/>
|
2698
|
+
<xsl:copy-of select="node()"/>
|
2699
|
+
</fn>
|
2700
|
+
</xsl:for-each>
|
2701
|
+
</xsl:for-each>
|
2702
|
+
</xsl:otherwise>
|
2703
|
+
</xsl:choose>
|
2704
|
+
</xsl:variable>
|
2705
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2706
|
+
|
2707
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2708
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2709
|
+
<xsl:variable name="reference" select="@reference"/>
|
2710
|
+
<!-- fn sequence number in document -->
|
2711
|
+
<xsl:variable name="current_fn_number">
|
2712
|
+
<xsl:choose>
|
2713
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2714
|
+
<xsl:otherwise>
|
2715
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2716
|
+
</xsl:otherwise>
|
2717
|
+
</xsl:choose>
|
2718
|
+
</xsl:variable>
|
2719
|
+
<xsl:variable name="current_fn_number_text">
|
2720
|
+
<xsl:value-of select="$current_fn_number"/>
|
2721
|
+
|
2722
|
+
|
2723
|
+
</xsl:variable>
|
2724
|
+
|
2725
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2726
|
+
<xsl:variable name="footnote_inline">
|
2727
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2728
|
+
|
2729
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2730
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2731
|
+
</fo:basic-link>
|
2732
|
+
</fo:inline>
|
2733
|
+
</xsl:variable>
|
2734
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2735
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2736
|
+
<xsl:choose>
|
2737
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2738
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2739
|
+
</xsl:when>
|
2740
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2741
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2742
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2743
|
+
<fo:footnote-body>
|
2744
|
+
|
2745
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2746
|
+
|
2747
|
+
|
2748
|
+
<xsl:attribute name="margin-left">-8mm</xsl:attribute>
|
2749
|
+
|
2750
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2751
|
+
|
2752
|
+
|
2753
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2754
|
+
|
2755
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2756
|
+
</fo:inline>
|
2757
|
+
<xsl:apply-templates/>
|
2758
|
+
</fo:block>
|
2759
|
+
</fo:block-container>
|
2760
|
+
</fo:footnote-body>
|
2761
|
+
</fo:footnote>
|
2762
|
+
</xsl:when>
|
2763
|
+
<xsl:otherwise>
|
2764
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2765
|
+
</xsl:otherwise>
|
2766
|
+
</xsl:choose>
|
2616
2767
|
</xsl:template><xsl:template name="fn_display">
|
2617
2768
|
<xsl:variable name="references">
|
2618
2769
|
|
@@ -2805,6 +2956,8 @@
|
|
2805
2956
|
|
2806
2957
|
</fo:basic-link>
|
2807
2958
|
</fo:inline>
|
2959
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2960
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2808
2961
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2809
2962
|
<fo:inline>
|
2810
2963
|
<xsl:apply-templates/>
|
@@ -3162,6 +3315,7 @@
|
|
3162
3315
|
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
3163
3316
|
<xsl:apply-templates/>
|
3164
3317
|
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
3318
|
+
<xsl:apply-templates select="@language"/>
|
3165
3319
|
<xsl:apply-templates/>
|
3166
3320
|
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
3167
3321
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
@@ -3795,22 +3949,6 @@
|
|
3795
3949
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3796
3950
|
<xsl:apply-templates/>
|
3797
3951
|
</fo:inline>
|
3798
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3799
|
-
<xsl:variable name="title-modified">
|
3800
|
-
|
3801
|
-
|
3802
|
-
<xsl:call-template name="getTitle">
|
3803
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3804
|
-
</xsl:call-template>
|
3805
|
-
|
3806
|
-
</xsl:variable>
|
3807
|
-
|
3808
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3809
|
-
<xsl:choose>
|
3810
|
-
<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>
|
3811
|
-
<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>
|
3812
|
-
</xsl:choose>
|
3813
|
-
<xsl:apply-templates/>
|
3814
3952
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3815
3953
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3816
3954
|
|
@@ -4388,12 +4526,12 @@
|
|
4388
4526
|
</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">
|
4389
4527
|
<xsl:apply-templates mode="contents"/>
|
4390
4528
|
<xsl:text> </xsl:text>
|
4391
|
-
</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">
|
4529
|
+
</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">
|
4392
4530
|
<xsl:apply-templates mode="bookmarks"/>
|
4393
4531
|
<xsl:text> </xsl:text>
|
4394
4532
|
</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">
|
4395
4533
|
<xsl:value-of select="."/>
|
4396
|
-
</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">
|
4534
|
+
</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">
|
4397
4535
|
<xsl:value-of select="."/>
|
4398
4536
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4399
4537
|
<xsl:apply-templates mode="contents"/>
|
@@ -4663,6 +4801,8 @@
|
|
4663
4801
|
|
4664
4802
|
|
4665
4803
|
|
4804
|
+
|
4805
|
+
|
4666
4806
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4667
4807
|
<xsl:variable name="_font-size">
|
4668
4808
|
|
@@ -4696,13 +4836,17 @@
|
|
4696
4836
|
|
4697
4837
|
|
4698
4838
|
|
4839
|
+
|
4840
|
+
|
4699
4841
|
<xsl:apply-templates/>
|
4700
4842
|
</fo:block>
|
4701
|
-
|
4843
|
+
|
4702
4844
|
|
4703
4845
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4704
4846
|
|
4705
4847
|
|
4848
|
+
|
4849
|
+
|
4706
4850
|
</fo:block-container>
|
4707
4851
|
</fo:block-container>
|
4708
4852
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5054,45 +5198,69 @@
|
|
5054
5198
|
<xsl:variable name="termsource_text">
|
5055
5199
|
<xsl:apply-templates/>
|
5056
5200
|
</xsl:variable>
|
5057
|
-
|
5058
|
-
<xsl:choose>
|
5201
|
+
<xsl:copy-of select="$termsource_text"/>
|
5202
|
+
<!-- <xsl:choose>
|
5059
5203
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
5060
|
-
<!-- <xsl:apply-templates /> -->
|
5061
5204
|
<xsl:copy-of select="$termsource_text"/>
|
5062
5205
|
</xsl:when>
|
5063
5206
|
<xsl:otherwise>
|
5064
|
-
|
5065
|
-
|
5207
|
+
<xsl:if test="$namespace = 'bsi'">
|
5208
|
+
<xsl:choose>
|
5209
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
5210
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
5211
|
+
</xsl:choose>
|
5212
|
+
</xsl:if>
|
5213
|
+
<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'">
|
5066
5214
|
<xsl:text>[</xsl:text>
|
5067
|
-
|
5068
|
-
<!-- <xsl:apply-templates /> -->
|
5215
|
+
</xsl:if>
|
5069
5216
|
<xsl:copy-of select="$termsource_text"/>
|
5070
|
-
|
5071
|
-
|
5217
|
+
<xsl:if test="$namespace = 'bsi'">
|
5218
|
+
<xsl:choose>
|
5219
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
5220
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
5221
|
+
</xsl:choose>
|
5222
|
+
</xsl:if>
|
5223
|
+
<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'">
|
5072
5224
|
<xsl:text>]</xsl:text>
|
5073
|
-
|
5225
|
+
</xsl:if>
|
5074
5226
|
</xsl:otherwise>
|
5075
|
-
</xsl:choose>
|
5227
|
+
</xsl:choose> -->
|
5076
5228
|
</fo:block>
|
5077
5229
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
5078
5230
|
<xsl:if test="normalize-space() != ''">
|
5079
5231
|
<xsl:value-of select="."/>
|
5080
5232
|
</xsl:if>
|
5081
|
-
</xsl:template><xsl:
|
5082
|
-
<
|
5083
|
-
|
5084
|
-
|
5085
|
-
|
5233
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
5234
|
+
<fo:inline>
|
5235
|
+
|
5236
|
+
|
5237
|
+
<xsl:value-of select="."/>
|
5238
|
+
</fo:inline>
|
5239
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
5086
5240
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5087
5241
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5088
5242
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
5089
5243
|
</xsl:if>
|
5090
|
-
|
5091
5244
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
5092
5245
|
<xsl:apply-templates/>
|
5093
5246
|
</fo:inline>
|
5247
|
+
</fo:basic-link>
|
5248
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
5249
|
+
<xsl:variable name="title-modified">
|
5094
5250
|
|
5095
|
-
|
5251
|
+
|
5252
|
+
<xsl:call-template name="getTitle">
|
5253
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
5254
|
+
</xsl:call-template>
|
5255
|
+
|
5256
|
+
</xsl:variable>
|
5257
|
+
|
5258
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
5259
|
+
<xsl:choose>
|
5260
|
+
<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>
|
5261
|
+
<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>
|
5262
|
+
</xsl:choose>
|
5263
|
+
<xsl:apply-templates/>
|
5096
5264
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
5097
5265
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5098
5266
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5285,15 +5453,20 @@
|
|
5285
5453
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5286
5454
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5287
5455
|
</fo:block>
|
5456
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5457
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5458
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5459
|
+
</xsl:if>
|
5288
5460
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5289
5461
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5290
5462
|
<xsl:apply-templates/>
|
5291
5463
|
</fo:block>
|
5292
5464
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5293
5465
|
<xsl:apply-templates/>
|
5294
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5466
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5295
5467
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5296
|
-
<fo:block
|
5468
|
+
<!-- <fo:block> </fo:block> -->
|
5469
|
+
<fo:block/>
|
5297
5470
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5298
5471
|
|
5299
5472
|
<fo:block>
|
@@ -5359,6 +5532,51 @@
|
|
5359
5532
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
5360
5533
|
<!-- 0xA0 to space replacement -->
|
5361
5534
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5535
|
+
</xsl:template><xsl:variable name="ul_labels_">
|
5536
|
+
|
5537
|
+
|
5538
|
+
|
5539
|
+
|
5540
|
+
|
5541
|
+
|
5542
|
+
|
5543
|
+
|
5544
|
+
|
5545
|
+
|
5546
|
+
|
5547
|
+
|
5548
|
+
|
5549
|
+
|
5550
|
+
|
5551
|
+
|
5552
|
+
<label>•</label>
|
5553
|
+
|
5554
|
+
|
5555
|
+
</xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
|
5556
|
+
<xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
5557
|
+
<xsl:variable name="list_level">
|
5558
|
+
<xsl:choose>
|
5559
|
+
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
5560
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
|
5561
|
+
</xsl:choose>
|
5562
|
+
</xsl:variable>
|
5563
|
+
<xsl:choose>
|
5564
|
+
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
5565
|
+
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
5566
|
+
</xsl:when>
|
5567
|
+
<xsl:when test="$list_level mod 3 = 0">
|
5568
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
5569
|
+
</xsl:when>
|
5570
|
+
<xsl:when test="$list_level mod 2 = 0">
|
5571
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
5572
|
+
</xsl:when>
|
5573
|
+
<xsl:otherwise>
|
5574
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
5575
|
+
</xsl:otherwise>
|
5576
|
+
</xsl:choose>
|
5577
|
+
</xsl:template><xsl:template match="label" mode="ul_labels">
|
5578
|
+
<xsl:copy-of select="@*[not(local-name() = 'level')]"/>
|
5579
|
+
<xsl:value-of select="."/>
|
5362
5580
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
5363
5581
|
<xsl:choose>
|
5364
5582
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
@@ -5697,7 +5915,31 @@
|
|
5697
5915
|
<fo:block-container border="1pt solid black" width="50%">
|
5698
5916
|
<fo:block> </fo:block>
|
5699
5917
|
</fo:block-container>
|
5700
|
-
</xsl:template><xsl:
|
5918
|
+
</xsl:template><xsl:variable name="toc_level">
|
5919
|
+
<xsl:choose>
|
5920
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5921
|
+
<xsl:otherwise><!-- default value -->
|
5922
|
+
|
5923
|
+
|
5924
|
+
|
5925
|
+
|
5926
|
+
|
5927
|
+
|
5928
|
+
|
5929
|
+
|
5930
|
+
|
5931
|
+
|
5932
|
+
|
5933
|
+
|
5934
|
+
|
5935
|
+
|
5936
|
+
|
5937
|
+
|
5938
|
+
3
|
5939
|
+
|
5940
|
+
</xsl:otherwise>
|
5941
|
+
</xsl:choose>
|
5942
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5701
5943
|
<xsl:param name="colwidths"/>
|
5702
5944
|
<xsl:variable name="colwidths_">
|
5703
5945
|
<xsl:choose>
|
@@ -5788,6 +6030,10 @@
|
|
5788
6030
|
</svg>
|
5789
6031
|
</fo:instream-foreign-object>
|
5790
6032
|
</fo:inline>
|
6033
|
+
</xsl:template><xsl:template match="@language">
|
6034
|
+
<xsl:copy-of select="."/>
|
6035
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
|
6036
|
+
<xsl:call-template name="title"/>
|
5791
6037
|
</xsl:template><xsl:template name="convertDate">
|
5792
6038
|
<xsl:param name="date"/>
|
5793
6039
|
<xsl:param name="format" select="'short'"/>
|
@@ -6232,12 +6478,15 @@
|
|
6232
6478
|
<xsl:param name="default">left</xsl:param>
|
6233
6479
|
<xsl:attribute name="text-align">
|
6234
6480
|
<xsl:choose>
|
6235
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6481
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
6236
6482
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6237
6483
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6238
6484
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6239
6485
|
</xsl:choose>
|
6240
6486
|
</xsl:attribute>
|
6487
|
+
<xsl:if test="@align = 'indent'">
|
6488
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6489
|
+
</xsl:if>
|
6241
6490
|
</xsl:template><xsl:template name="number-to-words">
|
6242
6491
|
<xsl:param name="number"/>
|
6243
6492
|
<xsl:param name="first"/>
|
@@ -6334,4 +6583,14 @@
|
|
6334
6583
|
</xsl:otherwise>
|
6335
6584
|
</xsl:choose>
|
6336
6585
|
</xsl:if>
|
6586
|
+
</xsl:template><xsl:template name="setAltText">
|
6587
|
+
<xsl:param name="value"/>
|
6588
|
+
<xsl:attribute name="fox:alt-text">
|
6589
|
+
<xsl:choose>
|
6590
|
+
<xsl:when test="normalize-space($value) != ''">
|
6591
|
+
<xsl:value-of select="$value"/>
|
6592
|
+
</xsl:when>
|
6593
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6594
|
+
</xsl:choose>
|
6595
|
+
</xsl:attribute>
|
6337
6596
|
</xsl:template></xsl:stylesheet>
|