metanorma-un 0.7.0 → 0.7.4
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 +68 -18
- data/lib/isodoc/un/html/htmlstyle.css +4 -4
- data/lib/isodoc/un/html/htmlstyle.scss +5 -4
- 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/un.plenary-attachment.xsl +299 -75
- data/lib/isodoc/un/un.plenary.xsl +299 -75
- data/lib/isodoc/un/un.recommendation.xsl +296 -76
- 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/>
|
@@ -1645,6 +1622,80 @@
|
|
1645
1622
|
|
1646
1623
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1647
1624
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1625
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1626
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1627
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1628
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1629
|
+
|
1630
|
+
|
1631
|
+
|
1632
|
+
|
1633
|
+
|
1634
|
+
|
1635
|
+
|
1636
|
+
|
1637
|
+
|
1638
|
+
|
1639
|
+
|
1640
|
+
|
1641
|
+
|
1642
|
+
|
1643
|
+
|
1644
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1645
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1646
|
+
|
1647
|
+
|
1648
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1649
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1650
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1651
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1652
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1653
|
+
|
1654
|
+
|
1655
|
+
|
1656
|
+
|
1657
|
+
|
1658
|
+
|
1659
|
+
|
1660
|
+
|
1661
|
+
|
1662
|
+
|
1663
|
+
|
1664
|
+
|
1665
|
+
|
1666
|
+
|
1667
|
+
|
1668
|
+
|
1669
|
+
|
1670
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1671
|
+
<xsl:attribute name="text-align">justify</xsl:attribute>
|
1672
|
+
<xsl:attribute name="line-height">125%</xsl:attribute>
|
1673
|
+
<xsl:attribute name="margin-left">8mm</xsl:attribute>
|
1674
|
+
|
1675
|
+
|
1676
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1677
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1678
|
+
|
1679
|
+
|
1680
|
+
|
1681
|
+
|
1682
|
+
|
1683
|
+
|
1684
|
+
|
1685
|
+
|
1686
|
+
|
1687
|
+
|
1688
|
+
|
1689
|
+
|
1690
|
+
|
1691
|
+
|
1692
|
+
|
1693
|
+
|
1694
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1695
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1696
|
+
<xsl:attribute name="padding-right">8mm</xsl:attribute>
|
1697
|
+
|
1698
|
+
|
1648
1699
|
</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
1700
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1650
1701
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1670,7 +1721,8 @@
|
|
1670
1721
|
<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
1722
|
|
1672
1723
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1673
|
-
|
1724
|
+
|
1725
|
+
<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
1726
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1675
1727
|
<xsl:apply-templates select="." mode="contents"/>
|
1676
1728
|
</xsl:for-each>
|
@@ -1680,7 +1732,7 @@
|
|
1680
1732
|
<xsl:apply-templates select="." mode="contents"/>
|
1681
1733
|
</xsl:for-each>
|
1682
1734
|
|
1683
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1735
|
+
<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
1736
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1685
1737
|
<xsl:apply-templates select="." mode="contents"/>
|
1686
1738
|
</xsl:for-each>
|
@@ -2613,6 +2665,104 @@
|
|
2613
2665
|
|
2614
2666
|
</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
2667
|
<xsl:apply-templates/>
|
2668
|
+
</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">
|
2669
|
+
|
2670
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2671
|
+
<xsl:variable name="p_fn_">
|
2672
|
+
<xsl:choose>
|
2673
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2674
|
+
<fn gen_id="{generate-id(.)}">
|
2675
|
+
<xsl:copy-of select="@*"/>
|
2676
|
+
<xsl:copy-of select="node()"/>
|
2677
|
+
</fn>
|
2678
|
+
</xsl:when>
|
2679
|
+
<xsl:otherwise>
|
2680
|
+
<!-- itetation for:
|
2681
|
+
footnotes in bibdata/title
|
2682
|
+
footnotes in bibliography
|
2683
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2684
|
+
-->
|
2685
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2686
|
+
<fn gen_id="{generate-id(.)}">
|
2687
|
+
<xsl:copy-of select="@*"/>
|
2688
|
+
<xsl:copy-of select="node()"/>
|
2689
|
+
</fn>
|
2690
|
+
</xsl:for-each>
|
2691
|
+
<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']/*">
|
2692
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2693
|
+
<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])]">
|
2694
|
+
<!-- copy unique fn -->
|
2695
|
+
<fn gen_id="{generate-id(.)}">
|
2696
|
+
<xsl:copy-of select="@*"/>
|
2697
|
+
<xsl:copy-of select="node()"/>
|
2698
|
+
</fn>
|
2699
|
+
</xsl:for-each>
|
2700
|
+
</xsl:for-each>
|
2701
|
+
</xsl:otherwise>
|
2702
|
+
</xsl:choose>
|
2703
|
+
</xsl:variable>
|
2704
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2705
|
+
|
2706
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2707
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2708
|
+
<xsl:variable name="reference" select="@reference"/>
|
2709
|
+
<!-- fn sequence number in document -->
|
2710
|
+
<xsl:variable name="current_fn_number">
|
2711
|
+
<xsl:choose>
|
2712
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2713
|
+
<xsl:otherwise>
|
2714
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2715
|
+
</xsl:otherwise>
|
2716
|
+
</xsl:choose>
|
2717
|
+
</xsl:variable>
|
2718
|
+
<xsl:variable name="current_fn_number_text">
|
2719
|
+
<xsl:value-of select="$current_fn_number"/>
|
2720
|
+
|
2721
|
+
|
2722
|
+
</xsl:variable>
|
2723
|
+
|
2724
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2725
|
+
<xsl:variable name="footnote_inline">
|
2726
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2727
|
+
|
2728
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2729
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2730
|
+
</fo:basic-link>
|
2731
|
+
</fo:inline>
|
2732
|
+
</xsl:variable>
|
2733
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2734
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2735
|
+
<xsl:choose>
|
2736
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2737
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2738
|
+
</xsl:when>
|
2739
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2740
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2741
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2742
|
+
<fo:footnote-body>
|
2743
|
+
|
2744
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2745
|
+
|
2746
|
+
|
2747
|
+
<xsl:attribute name="margin-left">-8mm</xsl:attribute>
|
2748
|
+
|
2749
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2750
|
+
|
2751
|
+
|
2752
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2753
|
+
|
2754
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2755
|
+
</fo:inline>
|
2756
|
+
<xsl:apply-templates/>
|
2757
|
+
</fo:block>
|
2758
|
+
</fo:block-container>
|
2759
|
+
</fo:footnote-body>
|
2760
|
+
</fo:footnote>
|
2761
|
+
</xsl:when>
|
2762
|
+
<xsl:otherwise>
|
2763
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2764
|
+
</xsl:otherwise>
|
2765
|
+
</xsl:choose>
|
2616
2766
|
</xsl:template><xsl:template name="fn_display">
|
2617
2767
|
<xsl:variable name="references">
|
2618
2768
|
|
@@ -2805,6 +2955,8 @@
|
|
2805
2955
|
|
2806
2956
|
</fo:basic-link>
|
2807
2957
|
</fo:inline>
|
2958
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2959
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2808
2960
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2809
2961
|
<fo:inline>
|
2810
2962
|
<xsl:apply-templates/>
|
@@ -3104,6 +3256,7 @@
|
|
3104
3256
|
<fo:table-cell>
|
3105
3257
|
|
3106
3258
|
<fo:block margin-top="6pt">
|
3259
|
+
<xsl:copy-of select="@id"/>
|
3107
3260
|
|
3108
3261
|
|
3109
3262
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
@@ -3794,22 +3947,6 @@
|
|
3794
3947
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3795
3948
|
<xsl:apply-templates/>
|
3796
3949
|
</fo:inline>
|
3797
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3798
|
-
<xsl:variable name="title-modified">
|
3799
|
-
|
3800
|
-
|
3801
|
-
<xsl:call-template name="getTitle">
|
3802
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3803
|
-
</xsl:call-template>
|
3804
|
-
|
3805
|
-
</xsl:variable>
|
3806
|
-
|
3807
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3808
|
-
<xsl:choose>
|
3809
|
-
<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>
|
3810
|
-
<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>
|
3811
|
-
</xsl:choose>
|
3812
|
-
<xsl:apply-templates/>
|
3813
3950
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3814
3951
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3815
3952
|
|
@@ -3952,14 +4089,18 @@
|
|
3952
4089
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
|
3953
4090
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
3954
4091
|
</xsl:template><xsl:template match="*[local-name() = 'terms']">
|
4092
|
+
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
3955
4093
|
<fo:block id="{@id}">
|
3956
4094
|
<xsl:apply-templates/>
|
3957
4095
|
</fo:block>
|
3958
4096
|
</xsl:template><xsl:template match="*[local-name() = 'term']">
|
4097
|
+
<!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
|
3959
4098
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
3960
4099
|
|
3961
4100
|
|
3962
|
-
|
4101
|
+
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
4102
|
+
|
4103
|
+
</xsl:if>
|
3963
4104
|
<xsl:apply-templates/>
|
3964
4105
|
</fo:block>
|
3965
4106
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
@@ -4383,12 +4524,12 @@
|
|
4383
4524
|
</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">
|
4384
4525
|
<xsl:apply-templates mode="contents"/>
|
4385
4526
|
<xsl:text> </xsl:text>
|
4386
|
-
</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">
|
4527
|
+
</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">
|
4387
4528
|
<xsl:apply-templates mode="bookmarks"/>
|
4388
4529
|
<xsl:text> </xsl:text>
|
4389
4530
|
</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">
|
4390
4531
|
<xsl:value-of select="."/>
|
4391
|
-
</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">
|
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' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
4392
4533
|
<xsl:value-of select="."/>
|
4393
4534
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4394
4535
|
<xsl:apply-templates mode="contents"/>
|
@@ -4658,6 +4799,8 @@
|
|
4658
4799
|
|
4659
4800
|
|
4660
4801
|
|
4802
|
+
|
4803
|
+
|
4661
4804
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4662
4805
|
<xsl:variable name="_font-size">
|
4663
4806
|
|
@@ -4691,13 +4834,17 @@
|
|
4691
4834
|
|
4692
4835
|
|
4693
4836
|
|
4837
|
+
|
4838
|
+
|
4694
4839
|
<xsl:apply-templates/>
|
4695
4840
|
</fo:block>
|
4696
|
-
|
4841
|
+
|
4697
4842
|
|
4698
4843
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4699
4844
|
|
4700
4845
|
|
4846
|
+
|
4847
|
+
|
4701
4848
|
</fo:block-container>
|
4702
4849
|
</fo:block-container>
|
4703
4850
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4933,7 +5080,8 @@
|
|
4933
5080
|
</fo:block>
|
4934
5081
|
</fo:table-cell>
|
4935
5082
|
</xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
|
4936
|
-
<fo:block font-size="11pt"
|
5083
|
+
<fo:block font-size="11pt">
|
5084
|
+
|
4937
5085
|
<xsl:apply-templates/>
|
4938
5086
|
</fo:block>
|
4939
5087
|
</xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
|
@@ -5048,43 +5196,69 @@
|
|
5048
5196
|
<xsl:variable name="termsource_text">
|
5049
5197
|
<xsl:apply-templates/>
|
5050
5198
|
</xsl:variable>
|
5051
|
-
|
5052
|
-
<xsl:choose>
|
5199
|
+
<xsl:copy-of select="$termsource_text"/>
|
5200
|
+
<!-- <xsl:choose>
|
5053
5201
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
5054
|
-
<!-- <xsl:apply-templates /> -->
|
5055
5202
|
<xsl:copy-of select="$termsource_text"/>
|
5056
5203
|
</xsl:when>
|
5057
|
-
<xsl:otherwise>
|
5058
|
-
|
5204
|
+
<xsl:otherwise>
|
5205
|
+
<xsl:if test="$namespace = 'bsi'">
|
5206
|
+
<xsl:choose>
|
5207
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
5208
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
5209
|
+
</xsl:choose>
|
5210
|
+
</xsl:if>
|
5211
|
+
<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'">
|
5059
5212
|
<xsl:text>[</xsl:text>
|
5060
|
-
|
5061
|
-
<!-- <xsl:apply-templates /> -->
|
5213
|
+
</xsl:if>
|
5062
5214
|
<xsl:copy-of select="$termsource_text"/>
|
5063
|
-
|
5215
|
+
<xsl:if test="$namespace = 'bsi'">
|
5216
|
+
<xsl:choose>
|
5217
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
5218
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
5219
|
+
</xsl:choose>
|
5220
|
+
</xsl:if>
|
5221
|
+
<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'">
|
5064
5222
|
<xsl:text>]</xsl:text>
|
5065
|
-
|
5223
|
+
</xsl:if>
|
5066
5224
|
</xsl:otherwise>
|
5067
|
-
</xsl:choose>
|
5225
|
+
</xsl:choose> -->
|
5068
5226
|
</fo:block>
|
5069
5227
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
5070
5228
|
<xsl:if test="normalize-space() != ''">
|
5071
5229
|
<xsl:value-of select="."/>
|
5072
5230
|
</xsl:if>
|
5073
|
-
</xsl:template><xsl:
|
5074
|
-
<
|
5075
|
-
|
5076
|
-
|
5077
|
-
|
5231
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
5232
|
+
<fo:inline>
|
5233
|
+
|
5234
|
+
|
5235
|
+
<xsl:value-of select="."/>
|
5236
|
+
</fo:inline>
|
5237
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
5078
5238
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5079
5239
|
<xsl:if test="normalize-space(@citeas) = ''">
|
5080
5240
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
5081
5241
|
</xsl:if>
|
5082
|
-
|
5083
5242
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
5084
5243
|
<xsl:apply-templates/>
|
5085
5244
|
</fo:inline>
|
5245
|
+
</fo:basic-link>
|
5246
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
5247
|
+
<xsl:variable name="title-modified">
|
5086
5248
|
|
5087
|
-
|
5249
|
+
|
5250
|
+
<xsl:call-template name="getTitle">
|
5251
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
5252
|
+
</xsl:call-template>
|
5253
|
+
|
5254
|
+
</xsl:variable>
|
5255
|
+
|
5256
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
5257
|
+
<xsl:choose>
|
5258
|
+
<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>
|
5259
|
+
<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>
|
5260
|
+
</xsl:choose>
|
5261
|
+
<xsl:apply-templates/>
|
5088
5262
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
5089
5263
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
5090
5264
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5127,12 +5301,20 @@
|
|
5127
5301
|
</xsl:template><xsl:template match="*[local-name() = 'author']">
|
5128
5302
|
<xsl:text>— </xsl:text>
|
5129
5303
|
<xsl:apply-templates/>
|
5130
|
-
</xsl:template><xsl:
|
5304
|
+
</xsl:template><xsl:variable name="bibitem_hidden_">
|
5305
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
|
5306
|
+
<xsl:copy-of select="."/>
|
5307
|
+
</xsl:for-each>
|
5308
|
+
<xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
|
5309
|
+
<xsl:copy-of select="."/>
|
5310
|
+
</xsl:for-each>
|
5311
|
+
</xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
|
5131
5312
|
|
5132
5313
|
<xsl:variable name="bibitemid">
|
5133
5314
|
<xsl:choose>
|
5134
|
-
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"
|
5135
|
-
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"
|
5315
|
+
<!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
|
5316
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
|
5317
|
+
<xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
5136
5318
|
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
5137
5319
|
</xsl:choose>
|
5138
5320
|
</xsl:variable>
|
@@ -5223,10 +5405,10 @@
|
|
5223
5405
|
</xsl:choose>
|
5224
5406
|
</xsl:variable>
|
5225
5407
|
|
5226
|
-
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
5408
|
+
<!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
|
5227
5409
|
|
5228
5410
|
<xsl:choose>
|
5229
|
-
<xsl:when test="$
|
5411
|
+
<xsl:when test="$lang = 'zh'">
|
5230
5412
|
<fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
|
5231
5413
|
</xsl:when>
|
5232
5414
|
<xsl:when test="../../@inline-header = 'true'">
|
@@ -5269,15 +5451,20 @@
|
|
5269
5451
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5270
5452
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5271
5453
|
</fo:block>
|
5454
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5455
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5456
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5457
|
+
</xsl:if>
|
5272
5458
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5273
5459
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5274
5460
|
<xsl:apply-templates/>
|
5275
5461
|
</fo:block>
|
5276
5462
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5277
5463
|
<xsl:apply-templates/>
|
5278
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5464
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5279
5465
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5280
|
-
<fo:block
|
5466
|
+
<!-- <fo:block> </fo:block> -->
|
5467
|
+
<fo:block/>
|
5281
5468
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5282
5469
|
|
5283
5470
|
<fo:block>
|
@@ -5681,7 +5868,31 @@
|
|
5681
5868
|
<fo:block-container border="1pt solid black" width="50%">
|
5682
5869
|
<fo:block> </fo:block>
|
5683
5870
|
</fo:block-container>
|
5684
|
-
</xsl:template><xsl:
|
5871
|
+
</xsl:template><xsl:variable name="toc_level">
|
5872
|
+
<xsl:choose>
|
5873
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5874
|
+
<xsl:otherwise><!-- default value -->
|
5875
|
+
|
5876
|
+
|
5877
|
+
|
5878
|
+
|
5879
|
+
|
5880
|
+
|
5881
|
+
|
5882
|
+
|
5883
|
+
|
5884
|
+
|
5885
|
+
|
5886
|
+
|
5887
|
+
|
5888
|
+
|
5889
|
+
|
5890
|
+
|
5891
|
+
3
|
5892
|
+
|
5893
|
+
</xsl:otherwise>
|
5894
|
+
</xsl:choose>
|
5895
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5685
5896
|
<xsl:param name="colwidths"/>
|
5686
5897
|
<xsl:variable name="colwidths_">
|
5687
5898
|
<xsl:choose>
|
@@ -6216,12 +6427,15 @@
|
|
6216
6427
|
<xsl:param name="default">left</xsl:param>
|
6217
6428
|
<xsl:attribute name="text-align">
|
6218
6429
|
<xsl:choose>
|
6219
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6430
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
6220
6431
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6221
6432
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6222
6433
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6223
6434
|
</xsl:choose>
|
6224
6435
|
</xsl:attribute>
|
6436
|
+
<xsl:if test="@align = 'indent'">
|
6437
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6438
|
+
</xsl:if>
|
6225
6439
|
</xsl:template><xsl:template name="number-to-words">
|
6226
6440
|
<xsl:param name="number"/>
|
6227
6441
|
<xsl:param name="first"/>
|
@@ -6318,4 +6532,14 @@
|
|
6318
6532
|
</xsl:otherwise>
|
6319
6533
|
</xsl:choose>
|
6320
6534
|
</xsl:if>
|
6535
|
+
</xsl:template><xsl:template name="setAltText">
|
6536
|
+
<xsl:param name="value"/>
|
6537
|
+
<xsl:attribute name="fox:alt-text">
|
6538
|
+
<xsl:choose>
|
6539
|
+
<xsl:when test="normalize-space($value) != ''">
|
6540
|
+
<xsl:value-of select="$value"/>
|
6541
|
+
</xsl:when>
|
6542
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6543
|
+
</xsl:choose>
|
6544
|
+
</xsl:attribute>
|
6321
6545
|
</xsl:template></xsl:stylesheet>
|