metanorma-itu 2.9.2 → 2.9.3
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/.rspec +1 -0
- data/Gemfile +25 -3
- data/Gemfile.lock +1605 -0
- data/lib/isodoc/itu/init.rb +4 -3
- data/lib/isodoc/itu/itu.implementers-guide.xsl +512 -233
- data/lib/isodoc/itu/itu.in-force.xsl +512 -233
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +512 -233
- data/lib/isodoc/itu/itu.recommendation-supplement.xsl +512 -233
- data/lib/isodoc/itu/itu.recommendation.xsl +512 -233
- data/lib/isodoc/itu/itu.resolution.xsl +512 -233
- data/lib/isodoc/itu/itu.service-publication.xsl +512 -233
- data/lib/isodoc/itu/itu.technical-paper.xsl +512 -233
- data/lib/isodoc/itu/itu.technical-report.xsl +512 -233
- data/lib/isodoc/itu/presentation_ref.rb +0 -1
- data/lib/isodoc/itu/presentation_xml_convert.rb +0 -1
- data/lib/metanorma/itu/citation_style.rb +30 -0
- data/lib/metanorma/itu/cleanup.rb +12 -1
- data/lib/metanorma/itu/document/metadata/itu_bib_data_extension_type.rb +26 -0
- data/lib/metanorma/itu/document/metadata/itu_bibliographic_item.rb +21 -0
- data/lib/metanorma/itu/document/metadata/itu_series.rb +22 -0
- data/lib/metanorma/itu/document/metadata/itu_structured_identifier.rb +23 -0
- data/lib/metanorma/itu/document/metadata/meeting_date.rb +18 -0
- data/lib/metanorma/itu/document/metadata/meeting_element.rb +18 -0
- data/lib/metanorma/itu/document/metadata/study_period.rb +18 -0
- data/lib/metanorma/itu/document/metadata.rb +18 -0
- data/lib/metanorma/itu/document/root.rb +26 -0
- data/lib/metanorma/itu/document.rb +54 -0
- data/lib/metanorma/itu/front_id.rb +60 -3
- data/lib/metanorma/itu/html/renderer.rb +28 -0
- data/lib/metanorma/itu/html.rb +15 -0
- data/lib/metanorma/itu/itu-style.yml +40 -0
- data/lib/metanorma/itu/version.rb +1 -1
- data/lib/metanorma/itu.rb +2 -0
- data/metanorma-itu.gemspec +3 -2
- metadata +44 -18
- data/lib/isodoc/itu/html/_coverpage.css +0 -646
- data/lib/isodoc/itu/html/htmlstyle.css +0 -1478
- data/lib/isodoc/itu/html/itu.css +0 -1243
- data/lib/isodoc/itu/html/wordstyle.css +0 -1974
- data/lib/relaton/render/config.yml +0 -3
- data/lib/relaton/render/general.rb +0 -19
- data/lib/relaton/render/parse.rb +0 -9
|
@@ -8,6 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
<xsl:variable name="debug">false</xsl:variable>
|
|
10
10
|
|
|
11
|
+
<xsl:variable name="variables_">
|
|
12
|
+
<xsl:for-each select="//mn:metanorma">
|
|
13
|
+
<xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
|
|
14
|
+
|
|
15
|
+
<xsl:variable name="current_document">
|
|
16
|
+
<xsl:copy-of select="."/>
|
|
17
|
+
</xsl:variable>
|
|
18
|
+
|
|
19
|
+
<xsl:for-each select="xalan:nodeset($current_document)">
|
|
20
|
+
<mnx:doc num="{$num}">
|
|
21
|
+
|
|
22
|
+
</mnx:doc>
|
|
23
|
+
</xsl:for-each>
|
|
24
|
+
</xsl:for-each>
|
|
25
|
+
</xsl:variable>
|
|
26
|
+
<xsl:variable name="variables" select="xalan:nodeset($variables_)"/>
|
|
27
|
+
|
|
11
28
|
<!-- Example:
|
|
12
29
|
<item level="1" id="Foreword" display="true">Foreword</item>
|
|
13
30
|
<item id="term-script" display="false">3.2</item>
|
|
@@ -1841,20 +1858,22 @@
|
|
|
1841
1858
|
|
|
1842
1859
|
<xsl:template name="insertListOf_Item">
|
|
1843
1860
|
<fo:block xsl:use-attribute-sets="toc-listof-item-style">
|
|
1844
|
-
<fo:
|
|
1845
|
-
<
|
|
1846
|
-
<xsl:
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
<fo:
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1861
|
+
<fo:wrapper role="Reference">
|
|
1862
|
+
<fo:basic-link internal-destination="{@id}">
|
|
1863
|
+
<xsl:call-template name="setAltText">
|
|
1864
|
+
<xsl:with-param name="value" select="@alt-text"/>
|
|
1865
|
+
</xsl:call-template>
|
|
1866
|
+
<xsl:variable name="item">
|
|
1867
|
+
<!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
|
|
1868
|
+
<xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
|
|
1869
|
+
</xsl:variable>
|
|
1870
|
+
<xsl:apply-templates select="xalan:nodeset($item)/node()"/>
|
|
1871
|
+
<fo:inline keep-together.within-line="always" role="SKIP">
|
|
1872
|
+
<fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
|
|
1873
|
+
<fo:page-number-citation ref-id="{@id}" role="SKIP"/>
|
|
1874
|
+
</fo:inline>
|
|
1875
|
+
</fo:basic-link>
|
|
1876
|
+
</fo:wrapper>
|
|
1858
1877
|
</fo:block>
|
|
1859
1878
|
</xsl:template>
|
|
1860
1879
|
|
|
@@ -1866,105 +1885,21 @@
|
|
|
1866
1885
|
<xsl:variable name="doctype" select="ancestor::mn:metanorma/mn:bibdata/mn:ext/mn:doctype[not(@language) or @language = '']"/>
|
|
1867
1886
|
<xsl:if test="$doctype != 'resolution' and $doctype != 'service-publication'">
|
|
1868
1887
|
<fo:block break-after="page"/>
|
|
1869
|
-
<fo:block-container>
|
|
1888
|
+
<fo:block-container role="SKIP">
|
|
1870
1889
|
<fo:block role="SKIP">
|
|
1871
1890
|
<xsl:apply-templates/>
|
|
1872
1891
|
</fo:block>
|
|
1873
1892
|
|
|
1874
|
-
<fo:block role="
|
|
1893
|
+
<fo:block role="SKIP">
|
|
1875
1894
|
<xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
|
|
1876
1895
|
|
|
1877
|
-
<
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
<xsl:call-template name="refine_toc-item-style"/>
|
|
1882
|
-
|
|
1883
|
-
<fo:list-block provisional-label-separation="3mm">
|
|
1884
|
-
<xsl:attribute name="provisional-distance-between-starts">
|
|
1885
|
-
<xsl:choose>
|
|
1886
|
-
<xsl:when test="@section != ''">
|
|
1887
|
-
<xsl:if test="@level = 1">
|
|
1888
|
-
<xsl:choose>
|
|
1889
|
-
<xsl:when test="string-length(@section) > 10">27mm</xsl:when>
|
|
1890
|
-
<xsl:when test="string-length(@section) > 5">22mm</xsl:when>
|
|
1891
|
-
<!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
|
|
1892
|
-
<xsl:otherwise>12mm</xsl:otherwise>
|
|
1893
|
-
</xsl:choose>
|
|
1894
|
-
</xsl:if>
|
|
1895
|
-
<xsl:if test="@level >= 2"><xsl:value-of select="(@level - 1) * 26"/>mm</xsl:if>
|
|
1896
|
-
</xsl:when>
|
|
1897
|
-
<xsl:otherwise>0mm</xsl:otherwise>
|
|
1898
|
-
</xsl:choose>
|
|
1899
|
-
</xsl:attribute>
|
|
1900
|
-
<fo:list-item>
|
|
1901
|
-
<fo:list-item-label end-indent="label-end()">
|
|
1902
|
-
<xsl:if test="@level >= 2">
|
|
1903
|
-
<xsl:attribute name="start-indent"><xsl:value-of select="(@level - 1) * 12"/>mm</xsl:attribute>
|
|
1904
|
-
</xsl:if>
|
|
1905
|
-
<fo:block>
|
|
1906
|
-
<xsl:if test="@section">
|
|
1907
|
-
<xsl:value-of select="@section"/>
|
|
1908
|
-
</xsl:if>
|
|
1909
|
-
</fo:block>
|
|
1910
|
-
</fo:list-item-label>
|
|
1911
|
-
<fo:list-item-body start-indent="body-start()">
|
|
1912
|
-
<fo:block text-align-last="justify">
|
|
1913
|
-
<fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
|
|
1914
|
-
<xsl:apply-templates select="mnx:title"/>
|
|
1915
|
-
<fo:inline keep-together.within-line="always">
|
|
1916
|
-
<fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
|
|
1917
|
-
<fo:page-number-citation ref-id="{@id}"/>
|
|
1918
|
-
</fo:inline>
|
|
1919
|
-
</fo:basic-link>
|
|
1920
|
-
</fo:block>
|
|
1921
|
-
</fo:list-item-body>
|
|
1922
|
-
</fo:list-item>
|
|
1923
|
-
</fo:list-block>
|
|
1924
|
-
</fo:block>
|
|
1925
|
-
</xsl:for-each>
|
|
1926
|
-
|
|
1927
|
-
<xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
|
|
1928
|
-
|
|
1929
|
-
<!-- List of Tables -->
|
|
1930
|
-
<xsl:for-each select="$contents//mnx:tables/mnx:table">
|
|
1931
|
-
<xsl:if test="position() = 1">
|
|
1932
|
-
<xsl:call-template name="insertListOf_Title">
|
|
1933
|
-
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
|
|
1934
|
-
</xsl:call-template>
|
|
1935
|
-
<fo:block xsl:use-attribute-sets="toc-title-page-style">
|
|
1936
|
-
<xsl:value-of select="$i18n_page"/>
|
|
1937
|
-
</fo:block>
|
|
1938
|
-
</xsl:if>
|
|
1939
|
-
<xsl:call-template name="insertListOf_Item"/>
|
|
1940
|
-
</xsl:for-each>
|
|
1941
|
-
|
|
1942
|
-
<!-- List of Figures -->
|
|
1943
|
-
<xsl:for-each select="$contents//mnx:figures/mnx:figure">
|
|
1944
|
-
<xsl:if test="position() = 1">
|
|
1945
|
-
<xsl:call-template name="insertListOf_Title">
|
|
1946
|
-
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
|
|
1947
|
-
</xsl:call-template>
|
|
1948
|
-
<fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
|
|
1949
|
-
<xsl:value-of select="$i18n_page"/>
|
|
1950
|
-
</fo:block>
|
|
1951
|
-
</xsl:if>
|
|
1952
|
-
<xsl:call-template name="insertListOf_Item"/>
|
|
1953
|
-
</xsl:for-each>
|
|
1954
|
-
|
|
1955
|
-
<!-- List of Examples -->
|
|
1956
|
-
<xsl:for-each select="$contents//mnx:examples/mnx:example">
|
|
1957
|
-
<xsl:if test="position() = 1">
|
|
1958
|
-
<xsl:call-template name="insertListOf_Title">
|
|
1959
|
-
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
|
|
1960
|
-
</xsl:call-template>
|
|
1961
|
-
<fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
|
|
1962
|
-
<xsl:value-of select="$i18n_page"/>
|
|
1963
|
-
</fo:block>
|
|
1964
|
-
</xsl:if>
|
|
1965
|
-
<xsl:call-template name="insertListOf_Item"/>
|
|
1966
|
-
</xsl:for-each>
|
|
1896
|
+
<fo:block role="TOC">
|
|
1897
|
+
<xsl:apply-templates select="$contents/mnx:doc[@num = $num]/mnx:contents/mnx:item[@display = 'true']"/>
|
|
1898
|
+
</fo:block>
|
|
1967
1899
|
|
|
1900
|
+
<xsl:call-template name="insertListsOf">
|
|
1901
|
+
<xsl:with-param name="num" select="$num"/>
|
|
1902
|
+
</xsl:call-template>
|
|
1968
1903
|
</xsl:if>
|
|
1969
1904
|
</fo:block>
|
|
1970
1905
|
</fo:block-container>
|
|
@@ -1983,6 +1918,137 @@
|
|
|
1983
1918
|
</fo:block>
|
|
1984
1919
|
</xsl:template>
|
|
1985
1920
|
|
|
1921
|
+
<xsl:template match="mnx:contents//mnx:item[@display = 'true']">
|
|
1922
|
+
<fo:block xsl:use-attribute-sets="toc-item-style">
|
|
1923
|
+
|
|
1924
|
+
<xsl:call-template name="refine_toc-item-style"/>
|
|
1925
|
+
|
|
1926
|
+
<fo:list-block provisional-label-separation="3mm" role="SKIP">
|
|
1927
|
+
<xsl:attribute name="provisional-distance-between-starts">
|
|
1928
|
+
<xsl:choose>
|
|
1929
|
+
<xsl:when test="@section != ''">
|
|
1930
|
+
<xsl:if test="@level = 1">
|
|
1931
|
+
<xsl:choose>
|
|
1932
|
+
<xsl:when test="string-length(@section) > 10">27mm</xsl:when>
|
|
1933
|
+
<xsl:when test="string-length(@section) > 5">22mm</xsl:when>
|
|
1934
|
+
<!-- <xsl:when test="@type = 'annex'">20mm</xsl:when> -->
|
|
1935
|
+
<xsl:otherwise>12mm</xsl:otherwise>
|
|
1936
|
+
</xsl:choose>
|
|
1937
|
+
</xsl:if>
|
|
1938
|
+
<xsl:if test="@level >= 2"><xsl:value-of select="(@level - 1) * 26"/>mm</xsl:if>
|
|
1939
|
+
</xsl:when>
|
|
1940
|
+
<xsl:otherwise>0mm</xsl:otherwise>
|
|
1941
|
+
</xsl:choose>
|
|
1942
|
+
</xsl:attribute>
|
|
1943
|
+
<fo:list-item role="SKIP">
|
|
1944
|
+
<fo:list-item-label end-indent="label-end()">
|
|
1945
|
+
<xsl:if test="@level >= 2">
|
|
1946
|
+
<xsl:attribute name="start-indent"><xsl:value-of select="(@level - 1) * 12"/>mm</xsl:attribute>
|
|
1947
|
+
</xsl:if>
|
|
1948
|
+
<fo:block role="SKIP">
|
|
1949
|
+
<xsl:if test="@section">
|
|
1950
|
+
<xsl:value-of select="@section"/>
|
|
1951
|
+
</xsl:if>
|
|
1952
|
+
</fo:block>
|
|
1953
|
+
</fo:list-item-label>
|
|
1954
|
+
<fo:list-item-body start-indent="body-start()" role="SKIP">
|
|
1955
|
+
<fo:block text-align-last="justify" role="Reference">
|
|
1956
|
+
<xsl:variable name="alt_text"><xsl:apply-templates select="mnx:title" mode="bookmarks"/></xsl:variable>
|
|
1957
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{$alt_text}">
|
|
1958
|
+
<xsl:apply-templates select="mnx:title"/>
|
|
1959
|
+
<fo:inline keep-together.within-line="always" role="SKIP">
|
|
1960
|
+
<fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
|
|
1961
|
+
<fo:page-number-citation ref-id="{@id}" role="SKIP"/>
|
|
1962
|
+
</fo:inline>
|
|
1963
|
+
</fo:basic-link>
|
|
1964
|
+
</fo:block>
|
|
1965
|
+
</fo:list-item-body>
|
|
1966
|
+
</fo:list-item>
|
|
1967
|
+
</fo:list-block>
|
|
1968
|
+
|
|
1969
|
+
<xsl:if test="mnx:item[@display = 'true']">
|
|
1970
|
+
<fo:block role="TOC">
|
|
1971
|
+
<xsl:apply-templates select="mnx:item[@display = 'true']"/>
|
|
1972
|
+
</fo:block>
|
|
1973
|
+
</xsl:if>
|
|
1974
|
+
</fo:block>
|
|
1975
|
+
</xsl:template>
|
|
1976
|
+
|
|
1977
|
+
<xsl:template name="insertListsOf">
|
|
1978
|
+
<xsl:param name="num"/>
|
|
1979
|
+
<!-- List of Tables -->
|
|
1980
|
+
<xsl:call-template name="insertListOfTables">
|
|
1981
|
+
<xsl:with-param name="num" select="$num"/>
|
|
1982
|
+
</xsl:call-template>
|
|
1983
|
+
|
|
1984
|
+
<!-- List of Figures -->
|
|
1985
|
+
<xsl:call-template name="insertListOfFigures">
|
|
1986
|
+
<xsl:with-param name="num" select="$num"/>
|
|
1987
|
+
</xsl:call-template>
|
|
1988
|
+
|
|
1989
|
+
<!-- List of Examples -->
|
|
1990
|
+
<xsl:call-template name="insertListOfExamples">
|
|
1991
|
+
<xsl:with-param name="num" select="$num"/>
|
|
1992
|
+
</xsl:call-template>
|
|
1993
|
+
</xsl:template>
|
|
1994
|
+
|
|
1995
|
+
<xsl:template name="insertListOfTables">
|
|
1996
|
+
<xsl:param name="num"/>
|
|
1997
|
+
<xsl:if test="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
|
|
1998
|
+
<xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
|
|
1999
|
+
<!-- List of Tables -->
|
|
2000
|
+
<xsl:call-template name="insertListOf_Title">
|
|
2001
|
+
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
|
|
2002
|
+
</xsl:call-template>
|
|
2003
|
+
<fo:block xsl:use-attribute-sets="toc-title-page-style">
|
|
2004
|
+
<xsl:value-of select="$i18n_page"/>
|
|
2005
|
+
</fo:block>
|
|
2006
|
+
<fo:block role="TOC">
|
|
2007
|
+
<xsl:for-each select="$contents/mnx:doc[@num = $num]/mnx:contents//mnx:tables/mnx:table">
|
|
2008
|
+
<xsl:call-template name="insertListOf_Item"/>
|
|
2009
|
+
</xsl:for-each>
|
|
2010
|
+
</fo:block>
|
|
2011
|
+
</xsl:if>
|
|
2012
|
+
</xsl:template>
|
|
2013
|
+
|
|
2014
|
+
<xsl:template name="insertListOfFigures">
|
|
2015
|
+
<xsl:param name="num"/>
|
|
2016
|
+
<xsl:if test="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
|
|
2017
|
+
<xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
|
|
2018
|
+
<!-- List of Figures -->
|
|
2019
|
+
<xsl:call-template name="insertListOf_Title">
|
|
2020
|
+
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
|
|
2021
|
+
</xsl:call-template>
|
|
2022
|
+
<fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
|
|
2023
|
+
<xsl:value-of select="$i18n_page"/>
|
|
2024
|
+
</fo:block>
|
|
2025
|
+
<fo:block role="TOC">
|
|
2026
|
+
<xsl:for-each select="$contents/mnx:doc[@num = $num]/mnx:contents//mnx:figures/mnx:figure">
|
|
2027
|
+
<xsl:call-template name="insertListOf_Item"/>
|
|
2028
|
+
</xsl:for-each>
|
|
2029
|
+
</fo:block>
|
|
2030
|
+
</xsl:if>
|
|
2031
|
+
</xsl:template>
|
|
2032
|
+
|
|
2033
|
+
<xsl:template name="insertListOfExamples">
|
|
2034
|
+
<xsl:param name="num"/>
|
|
2035
|
+
<xsl:if test="$contents/mnx:doc[@num = $num]/mnx:contents//mnx:examples/mnx:example">
|
|
2036
|
+
<xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param><xsl:with-param name="bibdata_updated" select="/*/mn:bibdata"/></xsl:call-template></xsl:variable>
|
|
2037
|
+
<!-- List of Examples -->
|
|
2038
|
+
<xsl:call-template name="insertListOf_Title">
|
|
2039
|
+
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
|
|
2040
|
+
</xsl:call-template>
|
|
2041
|
+
<fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
|
|
2042
|
+
<xsl:value-of select="$i18n_page"/>
|
|
2043
|
+
</fo:block>
|
|
2044
|
+
<fo:block role="TOC">
|
|
2045
|
+
<xsl:for-each select="$contents/mnx:doc[@num = $num]/mnx:contents//mnx:examples/mnx:example">
|
|
2046
|
+
<xsl:call-template name="insertListOf_Item"/>
|
|
2047
|
+
</xsl:for-each>
|
|
2048
|
+
</fo:block>
|
|
2049
|
+
</xsl:if>
|
|
2050
|
+
</xsl:template>
|
|
2051
|
+
|
|
1986
2052
|
<xsl:template match="mn:clause[@type = 'keyword']" priority="4"/>
|
|
1987
2053
|
|
|
1988
2054
|
<xsl:template match="mn:sections//mn:p[@class = 'zzSTDTitle1']" priority="4">
|
|
@@ -2066,7 +2132,9 @@
|
|
|
2066
2132
|
<xsl:call-template name="getName"/>
|
|
2067
2133
|
</xsl:variable>
|
|
2068
2134
|
<xsl:variable name="variant_title">
|
|
2069
|
-
<xsl:
|
|
2135
|
+
<xsl:if test="not(self::mn:annex)">
|
|
2136
|
+
<xsl:copy-of select="mn:variant-title[@type = 'toc']/node()"/>
|
|
2137
|
+
</xsl:if>
|
|
2070
2138
|
</xsl:variable>
|
|
2071
2139
|
|
|
2072
2140
|
<mnx:item level="{$level}" section="{$section}" type="{$type}" display="{$display}">
|
|
@@ -3202,6 +3270,7 @@
|
|
|
3202
3270
|
</xsl:variable>
|
|
3203
3271
|
|
|
3204
3272
|
<!-- Characters -->
|
|
3273
|
+
<xsl:variable name="nbsp"> </xsl:variable>
|
|
3205
3274
|
<xsl:variable name="linebreak">
</xsl:variable>
|
|
3206
3275
|
<xsl:variable name="em_space"> </xsl:variable>
|
|
3207
3276
|
<xsl:variable name="tab_zh"> </xsl:variable>
|
|
@@ -4165,7 +4234,11 @@
|
|
|
4165
4234
|
<xsl:text disable-output-escaping="yes"></page_sequence></xsl:text>
|
|
4166
4235
|
|
|
4167
4236
|
<!-- create a new page_sequence (opening elements) -->
|
|
4168
|
-
<xsl:text disable-output-escaping="yes"><page_sequence xmlns="</xsl:text><xsl:value-of select="$namespace_full"/>"<xsl:if test="$orientation != ''"> orientation="<xsl:value-of select="$orientation"/>"</xsl:if
|
|
4237
|
+
<xsl:text disable-output-escaping="yes"><page_sequence xmlns="</xsl:text><xsl:value-of select="$namespace_full"/>"<xsl:if test="$orientation != ''"> orientation="<xsl:value-of select="$orientation"/>"</xsl:if>
|
|
4238
|
+
<xsl:text> xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"</xsl:text>
|
|
4239
|
+
<!-- prevent for role="Part_continue" for last pagebreak in preface, sections, annex -->
|
|
4240
|
+
<xsl:if test="(ancestor::mn:preface and following::*[ancestor::mn:preface]) or (ancestor::mn:sections and following::*[ancestor::mn:sections]) or (ancestor::mn:annex and following::*[ancestor::mn:annex])"><xsl:text> role="NonStruct"</xsl:text></xsl:if>
|
|
4241
|
+
<xsl:text disable-output-escaping="yes">></xsl:text>
|
|
4169
4242
|
|
|
4170
4243
|
<xsl:call-template name="insertOpeningElements">
|
|
4171
4244
|
<xsl:with-param name="tree" select="$tree"/>
|
|
@@ -4225,6 +4298,7 @@
|
|
|
4225
4298
|
<xsl:text>"</xsl:text>
|
|
4226
4299
|
</xsl:for-each>
|
|
4227
4300
|
<xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
|
|
4301
|
+
<xsl:if test="$add_continue = 'true'"> role="NonStruct"</xsl:if><!-- the condition 'xsl:if' to prevent the attribute role for math -->
|
|
4228
4302
|
<xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
|
|
4229
4303
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
|
4230
4304
|
<xsl:if test="$debug = 'true'">
|
|
@@ -4743,6 +4817,7 @@
|
|
|
4743
4817
|
</xsl:template>
|
|
4744
4818
|
|
|
4745
4819
|
<xsl:attribute-set name="license-statement-style">
|
|
4820
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
4746
4821
|
</xsl:attribute-set> <!-- license-statement-style -->
|
|
4747
4822
|
|
|
4748
4823
|
<xsl:template name="refine_license-statement-style">
|
|
@@ -4985,10 +5060,10 @@
|
|
|
4985
5060
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
|
4986
5061
|
</xsl:if>
|
|
4987
5062
|
|
|
4988
|
-
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
|
5063
|
+
<!-- <xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
|
4989
5064
|
<xsl:attribute name="color">inherit</xsl:attribute>
|
|
4990
5065
|
<xsl:attribute name="text-decoration">none</xsl:attribute>
|
|
4991
|
-
</xsl:if>
|
|
5066
|
+
</xsl:if> -->
|
|
4992
5067
|
|
|
4993
5068
|
<xsl:call-template name="refine_link-style"/>
|
|
4994
5069
|
|
|
@@ -5026,11 +5101,17 @@
|
|
|
5026
5101
|
</xsl:choose>
|
|
5027
5102
|
</xsl:otherwise>
|
|
5028
5103
|
</xsl:choose>
|
|
5104
|
+
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
|
5105
|
+
<!-- paper clip icon rendering moved here from
|
|
5106
|
+
org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDFileAttachmentAppearanceHandler.java drawPaperclip
|
|
5107
|
+
for https://github.com/metanorma/metanorma-pdfa/issues/71 -->
|
|
5108
|
+
<xsl:call-template name="drawPaperClip"/>
|
|
5109
|
+
</xsl:if>
|
|
5029
5110
|
</fo:basic-link>
|
|
5030
|
-
<xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
|
5031
|
-
|
|
5032
|
-
<fo:inline keep-with-previous.within-line="always"
|
|
5033
|
-
</xsl:if>
|
|
5111
|
+
<!-- <xsl:if test="$isLinkToEmbeddedFile = 'true'">
|
|
5112
|
+
<!- - reserve space at right for PaperClip icon - ->
|
|
5113
|
+
<fo:inline keep-with-previous.within-line="always">        </fo:inline>
|
|
5114
|
+
</xsl:if> -->
|
|
5034
5115
|
</xsl:with-param>
|
|
5035
5116
|
</xsl:call-template>
|
|
5036
5117
|
</xsl:otherwise>
|
|
@@ -5038,6 +5119,59 @@
|
|
|
5038
5119
|
</fo:inline>
|
|
5039
5120
|
</xsl:template> <!-- link -->
|
|
5040
5121
|
|
|
5122
|
+
<xsl:template name="drawPaperClip">
|
|
5123
|
+
<fo:wrapper role="artifact">
|
|
5124
|
+
<fo:inline-container width="6mm" height="1mm" keep-with-previous.within-line="always" id="__internal_layout__attachment_{@target}_{generate-id()}">
|
|
5125
|
+
<!-- underline for paperclip icon -->
|
|
5126
|
+
<fo:block line-height="0.5"> </fo:block>
|
|
5127
|
+
<fo:block line-height="1" margin-top="-4mm" font-size="1pt" text-align="center">
|
|
5128
|
+
<xsl:if test="ancestor::mn:tr">
|
|
5129
|
+
<xsl:attribute name="margin-top">-3mm</xsl:attribute>
|
|
5130
|
+
</xsl:if>
|
|
5131
|
+
<fo:instream-foreign-object content-height="3.8mm" scaling="uniform" fox:alt-text="PaperClip" fox:placement="Inline">
|
|
5132
|
+
<xsl:copy-of select="$paperClipImage"/>
|
|
5133
|
+
</fo:instream-foreign-object>
|
|
5134
|
+
</fo:block>
|
|
5135
|
+
</fo:inline-container>
|
|
5136
|
+
</fo:wrapper>
|
|
5137
|
+
</xsl:template>
|
|
5138
|
+
|
|
5139
|
+
<xsl:variable name="paperClipImage">
|
|
5140
|
+
<!-- <svg width="17" height="17" xmlns="http://www.w3.org/2000/svg">
|
|
5141
|
+
<path style="transform-origin: center; transform: scale(1, -1);"
|
|
5142
|
+
d="M 13.574 9.301
|
|
5143
|
+
L 8.926 13.949
|
|
5144
|
+
C 7.648 15.227 5.625 15.227 4.426 13.949
|
|
5145
|
+
C 3.148 12.676 3.148 10.648 4.426 9.449
|
|
5146
|
+
L 10.426 3.449
|
|
5147
|
+
C 11.176 2.773 12.301 2.773 13.051 3.449
|
|
5148
|
+
C 13.801 4.199 13.801 5.398 13.051 6.074
|
|
5149
|
+
L 7.875 11.25
|
|
5150
|
+
C 7.648 11.477 7.273 11.477 7.051 11.25
|
|
5151
|
+
C 6.824 11.023 6.824 10.648 7.051 10.426
|
|
5152
|
+
L 10.875 6.602
|
|
5153
|
+
C 11.176 6.301 11.176 5.852 10.875 5.551
|
|
5154
|
+
C 10.574 5.25 10.125 5.25 9.824 5.551
|
|
5155
|
+
L 6 9.449
|
|
5156
|
+
C 5.176 10.273 5.176 11.551 6 12.375
|
|
5157
|
+
C 6.824 13.125 8.102 13.125 8.926 12.375
|
|
5158
|
+
L 14.102 7.199
|
|
5159
|
+
C 15.449 5.852 15.449 3.75 14.102 2.398
|
|
5160
|
+
C 12.75 1.051 10.648 1.051 9.301 2.398
|
|
5161
|
+
L 3.301 8.398
|
|
5162
|
+
C 2.398 9.301 1.949 10.5 1.949 11.699
|
|
5163
|
+
C 1.949 14.324 4.051 16.352 6.676 16.352
|
|
5164
|
+
C 7.949 16.352 9.074 15.824 9.977 15
|
|
5165
|
+
L 14.625 10.352
|
|
5166
|
+
C 14.926 10.051 14.926 9.602 14.625 9.301
|
|
5167
|
+
C 14.324 9 13.875 9 13.574 9.301"
|
|
5168
|
+
stroke="none" fill="black" />
|
|
5169
|
+
</svg> -->
|
|
5170
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13.16 14.96">
|
|
5171
|
+
<path d="m11.63,7.05c.3.3.75.3,1.05,0,.3-.3.3-.75,0-1.05L8.03,1.35c-.9-.82-2.03-1.35-3.3-1.35C2.1,0,0,2.03,0,4.65c0,1.2.45,2.4,1.35,3.3l6,6c1.35,1.35,3.45,1.35,4.8,0,1.35-1.35,1.35-3.45,0-4.8L6.98,3.98c-.82-.75-2.1-.75-2.93,0-.82.82-.82,2.1,0,2.93l3.82,3.9c.3.3.75.3,1.05,0s.3-.75,0-1.05l-3.82-3.82c-.23-.22-.23-.6,0-.82.22-.23.6-.23.82,0l5.18,5.18c.75.68.75,1.88,0,2.62-.75.68-1.88.68-2.62,0L2.48,6.9c-1.28-1.2-1.28-3.23,0-4.5,1.2-1.28,3.22-1.28,4.5,0l4.65,4.65" style="stroke-width: 0px;"/>
|
|
5172
|
+
</svg>
|
|
5173
|
+
</xsl:variable>
|
|
5174
|
+
|
|
5041
5175
|
<xsl:attribute-set name="sourcecode-container-style">
|
|
5042
5176
|
</xsl:attribute-set>
|
|
5043
5177
|
|
|
@@ -6766,7 +6900,15 @@
|
|
|
6766
6900
|
<xsl:call-template name="refine_term-style"/>
|
|
6767
6901
|
<xsl:call-template name="addTagElementT"/>
|
|
6768
6902
|
|
|
6769
|
-
<
|
|
6903
|
+
<fo:block role="SKIP">
|
|
6904
|
+
|
|
6905
|
+
<!-- element before fmt-defition -->
|
|
6906
|
+
<xsl:apply-templates select="node()[not(self::mn:fmt-name) and not(self::mn:fmt-definition) and not(preceding-sibling::mn:fmt-definition)]"/>
|
|
6907
|
+
</fo:block>
|
|
6908
|
+
|
|
6909
|
+
<!-- elements after fmt-definition (include fmt-definition) -->
|
|
6910
|
+
<xsl:apply-templates select="node()[self::mn:fmt-definition or preceding-sibling::mn:fmt-definition]"/>
|
|
6911
|
+
|
|
6770
6912
|
</fo:block>
|
|
6771
6913
|
</xsl:template>
|
|
6772
6914
|
|
|
@@ -7524,6 +7666,13 @@
|
|
|
7524
7666
|
<xsl:template name="refine_table-fn-body-style">
|
|
7525
7667
|
</xsl:template>
|
|
7526
7668
|
|
|
7669
|
+
<xsl:attribute-set name="table-fn-p-style">
|
|
7670
|
+
<xsl:attribute name="role">P</xsl:attribute>
|
|
7671
|
+
</xsl:attribute-set>
|
|
7672
|
+
|
|
7673
|
+
<xsl:template name="refine_table-fn-p-style">
|
|
7674
|
+
</xsl:template>
|
|
7675
|
+
|
|
7527
7676
|
<xsl:template name="setNoBordersForTableList">
|
|
7528
7677
|
<xsl:if test="ancestor::mn:fmt-ol or ancestor::mn:fmt-ul">
|
|
7529
7678
|
<xsl:attribute name="border">none</xsl:attribute>
|
|
@@ -7857,6 +8006,10 @@
|
|
|
7857
8006
|
<!-- <Caption><P> tags, see https://github.com/metanorma/metanorma-pdfa/issues/81 -->
|
|
7858
8007
|
<fo:block role="P">
|
|
7859
8008
|
|
|
8009
|
+
<xsl:if test="$continued = 'true'">
|
|
8010
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
8011
|
+
</xsl:if>
|
|
8012
|
+
|
|
7860
8013
|
<xsl:choose>
|
|
7861
8014
|
<xsl:when test="$continued = 'true'">
|
|
7862
8015
|
</xsl:when>
|
|
@@ -7866,7 +8019,7 @@
|
|
|
7866
8019
|
</xsl:choose>
|
|
7867
8020
|
|
|
7868
8021
|
</fo:block>
|
|
7869
|
-
</fo:block>
|
|
8022
|
+
</fo:block> <!-- END: Table name -->
|
|
7870
8023
|
|
|
7871
8024
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
|
7872
8025
|
<xsl:if test="$continued = 'true'">
|
|
@@ -8815,8 +8968,16 @@
|
|
|
8815
8968
|
</fo:block>
|
|
8816
8969
|
</xsl:template> <!-- table/note -->
|
|
8817
8970
|
|
|
8818
|
-
<xsl:template match="mn:table/*[self::mn:note or self::mn:example]/mn:p | mn:table/mn:tfoot//*[self::mn:note or self::mn:example]/mn:p" priority="2">
|
|
8819
|
-
<
|
|
8971
|
+
<xsl:template match="mn:table/*[self::mn:note or self::mn:example]/mn:p | mn:table/mn:tfoot//*[self::mn:note or self::mn:example][not(ancestor::mn:fn)]/mn:p" priority="2">
|
|
8972
|
+
<xsl:param name="fo_element">inline</xsl:param>
|
|
8973
|
+
<xsl:choose>
|
|
8974
|
+
<xsl:when test="contains($fo_element, 'block')">
|
|
8975
|
+
<fo:block role="P"><xsl:apply-templates/></fo:block>
|
|
8976
|
+
</xsl:when>
|
|
8977
|
+
<xsl:otherwise>
|
|
8978
|
+
<fo:inline role="P"><xsl:apply-templates/></fo:inline>
|
|
8979
|
+
</xsl:otherwise>
|
|
8980
|
+
</xsl:choose>
|
|
8820
8981
|
</xsl:template>
|
|
8821
8982
|
|
|
8822
8983
|
<!-- ============================ -->
|
|
@@ -8855,11 +9016,19 @@
|
|
|
8855
9016
|
<xsl:with-param name="process">true</xsl:with-param>
|
|
8856
9017
|
</xsl:apply-templates>
|
|
8857
9018
|
|
|
9019
|
+
<!-- 1st element in fn ('p' usually) -->
|
|
8858
9020
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
|
8859
9021
|
<xsl:call-template name="refine_table-fn-body-style"/>
|
|
8860
9022
|
<!-- <xsl:copy-of select="./node()"/> -->
|
|
8861
|
-
<xsl:apply-templates/>
|
|
9023
|
+
<xsl:apply-templates select="node()[normalize-space() != '' or self::*][1]"/>
|
|
8862
9024
|
</fo:inline>
|
|
9025
|
+
<!-- 2th, 3rd ... -->
|
|
9026
|
+
<xsl:if test="node()[position() > 1][normalize-space() != '' or self::*]">
|
|
9027
|
+
<fo:block xsl:use-attribute-sets="table-fn-body-style">
|
|
9028
|
+
<xsl:call-template name="refine_table-fn-body-style"/>
|
|
9029
|
+
<xsl:apply-templates select="node()[position() > 1]"/>
|
|
9030
|
+
</fo:block>
|
|
9031
|
+
</xsl:if>
|
|
8863
9032
|
|
|
8864
9033
|
</fo:block>
|
|
8865
9034
|
|
|
@@ -9014,6 +9183,23 @@
|
|
|
9014
9183
|
</xsl:choose>
|
|
9015
9184
|
</xsl:template> <!-- fn -->
|
|
9016
9185
|
|
|
9186
|
+
<xsl:template match="mn:table//mn:fn//mn:p | mn:table//mn:fmt-fn-body//mn:p" priority="4">
|
|
9187
|
+
<xsl:choose>
|
|
9188
|
+
<xsl:when test="preceding-sibling::*">
|
|
9189
|
+
<fo:block xsl:use-attribute-sets="table-fn-p-style">
|
|
9190
|
+
<xsl:call-template name="refine_table-fn-p-style"/>
|
|
9191
|
+
<xsl:apply-templates/>
|
|
9192
|
+
</fo:block>
|
|
9193
|
+
</xsl:when>
|
|
9194
|
+
<xsl:otherwise>
|
|
9195
|
+
<fo:inline xsl:use-attribute-sets="table-fn-p-style">
|
|
9196
|
+
<xsl:call-template name="refine_table-fn-p-style"/>
|
|
9197
|
+
<xsl:apply-templates/>
|
|
9198
|
+
</fo:inline>
|
|
9199
|
+
</xsl:otherwise>
|
|
9200
|
+
</xsl:choose>
|
|
9201
|
+
</xsl:template>
|
|
9202
|
+
|
|
9017
9203
|
<!-- split string 'text' by 'separator' -->
|
|
9018
9204
|
<xsl:template name="tokenize">
|
|
9019
9205
|
<xsl:param name="text"/>
|
|
@@ -11891,6 +12077,7 @@
|
|
|
11891
12077
|
<xsl:template match="mn:figure[not(mn:image) and *[local-name() = 'svg']]/mn:fmt-name/mn:bookmark" priority="2"/>
|
|
11892
12078
|
<xsl:template match="mn:figure[not(mn:image)]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
|
11893
12079
|
<xsl:param name="name"/>
|
|
12080
|
+
<xsl:param name="inline_image">false</xsl:param>
|
|
11894
12081
|
|
|
11895
12082
|
<xsl:variable name="svg_content">
|
|
11896
12083
|
<xsl:apply-templates select="." mode="svg_update"/>
|
|
@@ -12002,7 +12189,7 @@
|
|
|
12002
12189
|
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
|
12003
12190
|
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
|
12004
12191
|
</xsl:when>
|
|
12005
|
-
<xsl:when test="not(ancestor::mn:figure)">
|
|
12192
|
+
<xsl:when test="not(ancestor::mn:figure) or ancestor::mn:fmt-name">
|
|
12006
12193
|
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
|
12007
12194
|
</xsl:when>
|
|
12008
12195
|
<xsl:otherwise>
|
|
@@ -12031,7 +12218,7 @@
|
|
|
12031
12218
|
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
|
12032
12219
|
</xsl:when>
|
|
12033
12220
|
<xsl:otherwise>
|
|
12034
|
-
<xsl:if test="$isGenerateTableIF = 'false'">
|
|
12221
|
+
<xsl:if test="$isGenerateTableIF = 'false' and normalize-space($inline_image) = 'false'">
|
|
12035
12222
|
<xsl:attribute name="width">100%</xsl:attribute>
|
|
12036
12223
|
</xsl:if>
|
|
12037
12224
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
|
@@ -12227,9 +12414,12 @@
|
|
|
12227
12414
|
</xsl:template>
|
|
12228
12415
|
|
|
12229
12416
|
<!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
|
|
12230
|
-
|
|
12417
|
+
<!-- Note: count(ancestor::*) = 0 for image in mnx:figures/mnx:figure/fmt-name, when fmt-name is context/root node in template insertListOf_Item -->
|
|
12418
|
+
<xsl:template match="*[not(self::mn:figure)]/mn:image[*[local-name() = 'svg']] | mn:image[count(ancestor::*) = 0][*[local-name() = 'svg']]" priority="3">
|
|
12231
12419
|
<xsl:for-each select="*[local-name() = 'svg']">
|
|
12232
|
-
<xsl:call-template name="image_svg"
|
|
12420
|
+
<xsl:call-template name="image_svg">
|
|
12421
|
+
<xsl:with-param name="inline_image" select="not(ancestor::mn:bibdata)"/>
|
|
12422
|
+
</xsl:call-template>
|
|
12233
12423
|
</xsl:for-each>
|
|
12234
12424
|
</xsl:template>
|
|
12235
12425
|
|
|
@@ -12887,6 +13077,10 @@
|
|
|
12887
13077
|
|
|
12888
13078
|
</fo:inline>
|
|
12889
13079
|
</xsl:template>
|
|
13080
|
+
|
|
13081
|
+
<!-- remove whitespace from PDF structure tree (https://github.com/metanorma/mn-native-pdf/issues/1071) -->
|
|
13082
|
+
<xsl:template match="mn:fmt-stem/mn:semx/text()[normalize-space() = ''] | mn:fmt-stem/text()[normalize-space() = ''] | text()[preceding-sibling::*[1][self::mn:fmt-stem]][following-sibling::*[1][self::mn:bookmark]][normalize-space() = '']" priority="3"/>
|
|
13083
|
+
|
|
12890
13084
|
<!-- ======================================= -->
|
|
12891
13085
|
<!-- END: math -->
|
|
12892
13086
|
<!-- ======================================= -->
|
|
@@ -13726,7 +13920,7 @@
|
|
|
13726
13920
|
<xsl:template name="refine_references-non-normative-style">
|
|
13727
13921
|
</xsl:template>
|
|
13728
13922
|
|
|
13729
|
-
|
|
13923
|
+
<!-- ======================= -->
|
|
13730
13924
|
<!-- Bibliography rendering -->
|
|
13731
13925
|
<!-- ======================= -->
|
|
13732
13926
|
|
|
@@ -13744,7 +13938,7 @@
|
|
|
13744
13938
|
<xsl:template match="mn:references[@normative='true']" priority="2">
|
|
13745
13939
|
|
|
13746
13940
|
<xsl:call-template name="setNamedDestination"/>
|
|
13747
|
-
<fo:block id="{@id}">
|
|
13941
|
+
<fo:block id="{@id}" role="Sect">
|
|
13748
13942
|
<xsl:apply-templates/>
|
|
13749
13943
|
</fo:block>
|
|
13750
13944
|
</xsl:template>
|
|
@@ -13768,6 +13962,9 @@
|
|
|
13768
13962
|
|
|
13769
13963
|
<fo:block xsl:use-attribute-sets="references-non-normative-style">
|
|
13770
13964
|
<xsl:call-template name="refine_references-non-normative-style"/>
|
|
13965
|
+
<xsl:copy-of select="@role"/>
|
|
13966
|
+
<xsl:call-template name="addTagElementT"/>
|
|
13967
|
+
|
|
13771
13968
|
<xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
|
|
13772
13969
|
</fo:block>
|
|
13773
13970
|
</xsl:template> <!-- references -->
|
|
@@ -14705,6 +14902,7 @@
|
|
|
14705
14902
|
|
|
14706
14903
|
<!-- List of Figures, Tables, Examples -->
|
|
14707
14904
|
<xsl:attribute-set name="toc-listof-title-style">
|
|
14905
|
+
<xsl:attribute name="role">H2</xsl:attribute>
|
|
14708
14906
|
<xsl:attribute name="space-before">36pt</xsl:attribute>
|
|
14709
14907
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
14710
14908
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
@@ -14815,17 +15013,26 @@
|
|
|
14815
15013
|
<xsl:template name="processTables_Contents">
|
|
14816
15014
|
<mnx:tables>
|
|
14817
15015
|
<xsl:for-each select="//mn:table[not(ancestor::mn:metanorma-extension)][@id and mn:fmt-name and normalize-space(@id) != '']">
|
|
15016
|
+
<xsl:variable name="root">
|
|
15017
|
+
<xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
|
|
15018
|
+
<xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
|
|
15019
|
+
</xsl:variable>
|
|
14818
15020
|
<xsl:choose>
|
|
14819
15021
|
<xsl:when test="mn:fmt-name">
|
|
14820
15022
|
<xsl:variable name="fmt_name">
|
|
14821
15023
|
<xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
|
|
14822
15024
|
</xsl:variable>
|
|
14823
|
-
<
|
|
15025
|
+
<xsl:variable name="alt_text_">
|
|
15026
|
+
<xsl:apply-templates select="xalan:nodeset($fmt_name)/node()" mode="bookmarks"/>
|
|
15027
|
+
</xsl:variable>
|
|
15028
|
+
<xsl:variable name="alt_text" select="normalize-space(translate(normalize-space($alt_text_), concat($nbsp,$zero_width_space,$hair_space), ' '))"/>
|
|
15029
|
+
|
|
15030
|
+
<mnx:table id="{@id}" alt-text="{$alt_text}" root="{$root}">
|
|
14824
15031
|
<xsl:copy-of select="$fmt_name"/>
|
|
14825
15032
|
</mnx:table>
|
|
14826
15033
|
</xsl:when>
|
|
14827
15034
|
<xsl:otherwise>
|
|
14828
|
-
<mnx:table id="{@id}" alt-text="{mn:name}">
|
|
15035
|
+
<mnx:table id="{@id}" alt-text="{mn:name}" root="{$root}">
|
|
14829
15036
|
<xsl:copy-of select="mn:name"/>
|
|
14830
15037
|
</mnx:table>
|
|
14831
15038
|
</xsl:otherwise>
|
|
@@ -14837,17 +15044,26 @@
|
|
|
14837
15044
|
<xsl:template name="processFigures_Contents">
|
|
14838
15045
|
<mnx:figures>
|
|
14839
15046
|
<xsl:for-each select="//mn:figure[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(mn:name, 'Figure ') and normalize-space(@id) != '']">
|
|
15047
|
+
<xsl:variable name="root">
|
|
15048
|
+
<xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
|
|
15049
|
+
<xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
|
|
15050
|
+
</xsl:variable>
|
|
14840
15051
|
<xsl:choose>
|
|
14841
15052
|
<xsl:when test="mn:fmt-name">
|
|
14842
15053
|
<xsl:variable name="fmt_name">
|
|
14843
15054
|
<xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
|
|
14844
15055
|
</xsl:variable>
|
|
14845
|
-
<
|
|
15056
|
+
<xsl:variable name="alt_text_">
|
|
15057
|
+
<xsl:apply-templates select="xalan:nodeset($fmt_name)/node()" mode="bookmarks"/>
|
|
15058
|
+
</xsl:variable>
|
|
15059
|
+
<xsl:variable name="alt_text" select="normalize-space(translate(normalize-space($alt_text_), concat($nbsp,$zero_width_space,$hair_space), ' '))"/>
|
|
15060
|
+
|
|
15061
|
+
<mnx:figure id="{@id}" alt-text="{$alt_text}" root="{$root}">
|
|
14846
15062
|
<xsl:copy-of select="$fmt_name"/>
|
|
14847
15063
|
</mnx:figure>
|
|
14848
15064
|
</xsl:when>
|
|
14849
15065
|
<xsl:otherwise>
|
|
14850
|
-
<mnx:figure id="{@id}" alt-text="{mn:name}">
|
|
15066
|
+
<mnx:figure id="{@id}" alt-text="{mn:name}" root="{$root}">
|
|
14851
15067
|
<xsl:copy-of select="mn:name"/>
|
|
14852
15068
|
</mnx:figure>
|
|
14853
15069
|
</xsl:otherwise>
|
|
@@ -14859,23 +15075,40 @@
|
|
|
14859
15075
|
<xsl:template name="processExamples_Contents">
|
|
14860
15076
|
<mnx:examples>
|
|
14861
15077
|
<xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
|
|
14862
|
-
|
|
14863
|
-
|
|
14864
|
-
|
|
14865
|
-
|
|
14866
|
-
<xsl:
|
|
14867
|
-
|
|
14868
|
-
|
|
14869
|
-
|
|
14870
|
-
<xsl:
|
|
14871
|
-
<xsl:
|
|
14872
|
-
|
|
14873
|
-
|
|
14874
|
-
|
|
14875
|
-
<xsl:
|
|
14876
|
-
</xsl:
|
|
14877
|
-
|
|
14878
|
-
|
|
15078
|
+
<xsl:choose>
|
|
15079
|
+
<!-- https://github.com/metanorma/mn-native-pdf/issues/1116 -->
|
|
15080
|
+
<!-- example's will be processed from fmt-footnote-container -->
|
|
15081
|
+
<xsl:when test="ancestor::mn:fn and ancestor::mn:tr"><!--skip--></xsl:when>
|
|
15082
|
+
<xsl:otherwise>
|
|
15083
|
+
<!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
|
|
15084
|
+
//example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
|
|
15085
|
+
with the last two elements dropped if //example/name does not exist. -->
|
|
15086
|
+
<xsl:variable name="example_name">
|
|
15087
|
+
<!-- <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/> -->
|
|
15088
|
+
<xsl:apply-templates select="mn:fmt-name/mn:semx[@element = 'name']/node()" mode="update_xml_step1"/>
|
|
15089
|
+
</xsl:variable>
|
|
15090
|
+
<xsl:variable name="alt_text_">
|
|
15091
|
+
<xsl:apply-templates select="xalan:nodeset($example_name)/node()" mode="bookmarks"/>
|
|
15092
|
+
</xsl:variable>
|
|
15093
|
+
<xsl:variable name="alt_text" select="normalize-space(translate(normalize-space($alt_text_), concat($nbsp,$zero_width_space,$hair_space), ' '))"/>
|
|
15094
|
+
<xsl:variable name="root">
|
|
15095
|
+
<xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
|
|
15096
|
+
<xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
|
|
15097
|
+
</xsl:variable>
|
|
15098
|
+
|
|
15099
|
+
<mnx:example id="{@id}" alt-text="{$alt_text_}" root="{$root}">
|
|
15100
|
+
<xsl:element name="fmt-name" namespace="{$namespace_full}">
|
|
15101
|
+
<xsl:call-template name="capitalize"><!-- https://github.com/metanorma/metanorma-pdfa/issues/72 -->
|
|
15102
|
+
<xsl:with-param name="str" select="mn:fmt-xref-label[@container]"/>
|
|
15103
|
+
</xsl:call-template>
|
|
15104
|
+
<xsl:if test="normalize-space($example_name) != ''">
|
|
15105
|
+
<xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
|
|
15106
|
+
<xsl:copy-of select="$example_name"/>
|
|
15107
|
+
</xsl:if>
|
|
15108
|
+
</xsl:element>
|
|
15109
|
+
</mnx:example>
|
|
15110
|
+
</xsl:otherwise>
|
|
15111
|
+
</xsl:choose>
|
|
14879
15112
|
</xsl:for-each>
|
|
14880
15113
|
</mnx:examples>
|
|
14881
15114
|
</xsl:template>
|
|
@@ -15073,6 +15306,11 @@
|
|
|
15073
15306
|
<xsl:apply-templates mode="bookmarks"/>
|
|
15074
15307
|
</xsl:template>
|
|
15075
15308
|
|
|
15309
|
+
<xsl:template match="*[local-name() = 'math']" mode="bookmarks">
|
|
15310
|
+
<xsl:value-of select="normalize-space(.)"/>
|
|
15311
|
+
</xsl:template>
|
|
15312
|
+
<xsl:template match="mn:asciimath" mode="bookmarks"/>
|
|
15313
|
+
|
|
15076
15314
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
|
15077
15315
|
<xsl:template match="mn:span" mode="bookmarks">
|
|
15078
15316
|
<xsl:apply-templates mode="bookmarks"/>
|
|
@@ -15091,6 +15329,54 @@
|
|
|
15091
15329
|
|
|
15092
15330
|
<xsl:template match="mn:requirement | mn:recommendation | mn:permission" mode="bookmarks" priority="3"/>
|
|
15093
15331
|
|
|
15332
|
+
<xsl:template match="mn:fmt-link" mode="bookmarks">
|
|
15333
|
+
<!-- apply template from common.link.xsl -->
|
|
15334
|
+
<xsl:variable name="link"><xsl:apply-templates select="."/></xsl:variable>
|
|
15335
|
+
<xsl:value-of select="normalize-space($link)"/>
|
|
15336
|
+
</xsl:template>
|
|
15337
|
+
|
|
15338
|
+
<xsl:template match="mn:image" mode="bookmarks"/>
|
|
15339
|
+
|
|
15340
|
+
<xsl:template match="mn:image[normalize-space(@alt) != '']" mode="bookmarks">
|
|
15341
|
+
<xsl:value-of select="concat('[', normalize-space(@alt), ']')"/>
|
|
15342
|
+
</xsl:template>
|
|
15343
|
+
|
|
15344
|
+
<xsl:template match="mnx:item" mode="bookmarks">
|
|
15345
|
+
<xsl:apply-templates mode="bookmarks"/>
|
|
15346
|
+
</xsl:template>
|
|
15347
|
+
|
|
15348
|
+
<xsl:template match="mnx:item[@id != '']" mode="bookmarks">
|
|
15349
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
|
15350
|
+
<fo:bookmark-title>
|
|
15351
|
+
<xsl:if test="@section != ''">
|
|
15352
|
+
<xsl:value-of select="@section"/>
|
|
15353
|
+
<xsl:text> </xsl:text>
|
|
15354
|
+
</xsl:if>
|
|
15355
|
+
<xsl:variable name="title">
|
|
15356
|
+
<xsl:if test="1 = 2">
|
|
15357
|
+
<xsl:for-each select="mnx:title/node()">
|
|
15358
|
+
<xsl:choose>
|
|
15359
|
+
<xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
|
|
15360
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
|
15361
|
+
</xsl:choose>
|
|
15362
|
+
</xsl:for-each>
|
|
15363
|
+
</xsl:if>
|
|
15364
|
+
<xsl:apply-templates select="mnx:title/node()" mode="bookmarks"/>
|
|
15365
|
+
</xsl:variable>
|
|
15366
|
+
<xsl:value-of select="normalize-space($title)"/>
|
|
15367
|
+
</fo:bookmark-title>
|
|
15368
|
+
<xsl:apply-templates select="mnx:item" mode="bookmarks"/>
|
|
15369
|
+
</fo:bookmark>
|
|
15370
|
+
</xsl:template>
|
|
15371
|
+
|
|
15372
|
+
<xsl:template match="text()" mode="bookmarks">
|
|
15373
|
+
<xsl:value-of select="."/>
|
|
15374
|
+
</xsl:template>
|
|
15375
|
+
|
|
15376
|
+
<xsl:template match="mnx:item/text()" mode="bookmarks"/>
|
|
15377
|
+
|
|
15378
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]" mode="bookmarks"/>
|
|
15379
|
+
|
|
15094
15380
|
<!-- Bookmarks -->
|
|
15095
15381
|
<xsl:template name="addBookmarks">
|
|
15096
15382
|
<xsl:param name="contents"/>
|
|
@@ -15144,7 +15430,7 @@
|
|
|
15144
15430
|
</xsl:choose>
|
|
15145
15431
|
</fo:bookmark-title>
|
|
15146
15432
|
|
|
15147
|
-
<xsl:apply-templates select="mnx:contents/mnx:item" mode="
|
|
15433
|
+
<xsl:apply-templates select="mnx:contents/mnx:item" mode="bookmarks"/>
|
|
15148
15434
|
|
|
15149
15435
|
<xsl:call-template name="insertFigureBookmarks">
|
|
15150
15436
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
@@ -15170,7 +15456,7 @@
|
|
|
15170
15456
|
<xsl:otherwise>
|
|
15171
15457
|
<xsl:for-each select="$contents_nodes/mnx:doc">
|
|
15172
15458
|
|
|
15173
|
-
<xsl:apply-templates select="mnx:contents/mnx:item" mode="
|
|
15459
|
+
<xsl:apply-templates select="mnx:contents/mnx:item" mode="bookmarks"/>
|
|
15174
15460
|
|
|
15175
15461
|
<xsl:call-template name="insertFigureBookmarks">
|
|
15176
15462
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
@@ -15194,7 +15480,7 @@
|
|
|
15194
15480
|
</xsl:choose>
|
|
15195
15481
|
</xsl:when>
|
|
15196
15482
|
<xsl:otherwise>
|
|
15197
|
-
<xsl:apply-templates select="$contents_nodes/mnx:contents/mnx:item" mode="
|
|
15483
|
+
<xsl:apply-templates select="$contents_nodes/mnx:contents/mnx:item" mode="bookmarks"/>
|
|
15198
15484
|
|
|
15199
15485
|
<xsl:call-template name="insertFigureBookmarks">
|
|
15200
15486
|
<xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
|
|
@@ -15248,7 +15534,9 @@
|
|
|
15248
15534
|
<fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
|
|
15249
15535
|
<xsl:for-each select="$contents_nodes//mnx:figures/mnx:figure">
|
|
15250
15536
|
<fo:bookmark internal-destination="{@id}">
|
|
15251
|
-
<fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
|
|
15537
|
+
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
|
15538
|
+
<xsl:variable name="title"><xsl:apply-templates mode="bookmarks"/></xsl:variable>
|
|
15539
|
+
<fo:bookmark-title><xsl:value-of select="normalize-space($title)"/></fo:bookmark-title>
|
|
15252
15540
|
</fo:bookmark>
|
|
15253
15541
|
</xsl:for-each>
|
|
15254
15542
|
</fo:bookmark>
|
|
@@ -15289,7 +15577,9 @@
|
|
|
15289
15577
|
<xsl:for-each select="$contents_nodes//mnx:tables/mnx:table">
|
|
15290
15578
|
<fo:bookmark internal-destination="{@id}">
|
|
15291
15579
|
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
|
15292
|
-
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
|
15580
|
+
<!-- <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title> -->
|
|
15581
|
+
<xsl:variable name="title"><xsl:apply-templates mode="bookmarks"/></xsl:variable>
|
|
15582
|
+
<fo:bookmark-title><xsl:value-of select="normalize-space($title)"/></fo:bookmark-title>
|
|
15293
15583
|
</fo:bookmark>
|
|
15294
15584
|
</xsl:for-each>
|
|
15295
15585
|
</fo:bookmark>
|
|
@@ -15330,7 +15620,9 @@
|
|
|
15330
15620
|
<xsl:for-each select="$contents_nodes//mnx:examples/mnx:example">
|
|
15331
15621
|
<fo:bookmark internal-destination="{@id}">
|
|
15332
15622
|
<!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
|
|
15333
|
-
<fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
|
|
15623
|
+
<!-- <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title> -->
|
|
15624
|
+
<xsl:variable name="title"><xsl:apply-templates mode="bookmarks"/></xsl:variable>
|
|
15625
|
+
<fo:bookmark-title><xsl:value-of select="normalize-space($title)"/></fo:bookmark-title>
|
|
15334
15626
|
</fo:bookmark>
|
|
15335
15627
|
</xsl:for-each>
|
|
15336
15628
|
</fo:bookmark>
|
|
@@ -15338,26 +15630,6 @@
|
|
|
15338
15630
|
</xsl:template> <!-- insertExampleBookmarks -->
|
|
15339
15631
|
<!-- End Bookmarks -->
|
|
15340
15632
|
|
|
15341
|
-
<!-- ============================ -->
|
|
15342
|
-
<!-- mode="bookmark_clean" -->
|
|
15343
|
-
<!-- ============================ -->
|
|
15344
|
-
<xsl:template match="node()" mode="bookmark_clean">
|
|
15345
|
-
<xsl:apply-templates select="node()" mode="bookmark_clean"/>
|
|
15346
|
-
</xsl:template>
|
|
15347
|
-
|
|
15348
|
-
<xsl:template match="text()" mode="bookmark_clean">
|
|
15349
|
-
<xsl:value-of select="."/>
|
|
15350
|
-
</xsl:template>
|
|
15351
|
-
|
|
15352
|
-
<xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
|
|
15353
|
-
<xsl:value-of select="normalize-space(.)"/>
|
|
15354
|
-
</xsl:template>
|
|
15355
|
-
|
|
15356
|
-
<xsl:template match="mn:asciimath" mode="bookmark_clean"/>
|
|
15357
|
-
<!-- ============================ -->
|
|
15358
|
-
<!-- END: mode="bookmark_clean" -->
|
|
15359
|
-
<!-- ============================ -->
|
|
15360
|
-
|
|
15361
15633
|
<xsl:template name="getLangVersion">
|
|
15362
15634
|
<xsl:param name="lang"/>
|
|
15363
15635
|
<xsl:param name="doctype" select="''"/>
|
|
@@ -15372,37 +15644,6 @@
|
|
|
15372
15644
|
</xsl:choose>
|
|
15373
15645
|
</xsl:template>
|
|
15374
15646
|
|
|
15375
|
-
<xsl:template match="mnx:item" mode="bookmark">
|
|
15376
|
-
<xsl:choose>
|
|
15377
|
-
<xsl:when test="@id != ''">
|
|
15378
|
-
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
|
15379
|
-
<fo:bookmark-title>
|
|
15380
|
-
<xsl:if test="@section != ''">
|
|
15381
|
-
<xsl:value-of select="@section"/>
|
|
15382
|
-
<xsl:text> </xsl:text>
|
|
15383
|
-
</xsl:if>
|
|
15384
|
-
<xsl:variable name="title">
|
|
15385
|
-
<xsl:for-each select="mnx:title/node()">
|
|
15386
|
-
<xsl:choose>
|
|
15387
|
-
<xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
|
|
15388
|
-
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
|
15389
|
-
</xsl:choose>
|
|
15390
|
-
</xsl:for-each>
|
|
15391
|
-
</xsl:variable>
|
|
15392
|
-
<xsl:value-of select="normalize-space($title)"/>
|
|
15393
|
-
</fo:bookmark-title>
|
|
15394
|
-
<xsl:apply-templates mode="bookmark"/>
|
|
15395
|
-
</fo:bookmark>
|
|
15396
|
-
</xsl:when>
|
|
15397
|
-
<xsl:otherwise>
|
|
15398
|
-
<xsl:apply-templates mode="bookmark"/>
|
|
15399
|
-
</xsl:otherwise>
|
|
15400
|
-
</xsl:choose>
|
|
15401
|
-
</xsl:template>
|
|
15402
|
-
|
|
15403
|
-
<xsl:template match="mnx:title" mode="bookmark"/>
|
|
15404
|
-
<xsl:template match="text()" mode="bookmark"/>
|
|
15405
|
-
|
|
15406
15647
|
<!-- ====== -->
|
|
15407
15648
|
<!-- ====== -->
|
|
15408
15649
|
<xsl:template match="mn:title" mode="contents_item">
|
|
@@ -15456,6 +15697,10 @@
|
|
|
15456
15697
|
<xsl:text> </xsl:text>
|
|
15457
15698
|
</xsl:template>
|
|
15458
15699
|
|
|
15700
|
+
<xsl:template match="mn:br | mn:tab" mode="bookmarks">
|
|
15701
|
+
<xsl:text> </xsl:text>
|
|
15702
|
+
</xsl:template>
|
|
15703
|
+
|
|
15459
15704
|
<xsl:template match="mn:strong" mode="contents_item">
|
|
15460
15705
|
<xsl:param name="element"/>
|
|
15461
15706
|
<xsl:copy>
|
|
@@ -15465,26 +15710,9 @@
|
|
|
15465
15710
|
</xsl:copy>
|
|
15466
15711
|
</xsl:template>
|
|
15467
15712
|
|
|
15468
|
-
<xsl:template match="mn:em" mode="contents_item">
|
|
15469
|
-
<xsl:copy>
|
|
15470
|
-
<xsl:apply-templates mode="contents_item"/>
|
|
15471
|
-
</xsl:copy>
|
|
15472
|
-
</xsl:template>
|
|
15473
|
-
|
|
15474
|
-
<xsl:template match="mn:sub" mode="contents_item">
|
|
15475
|
-
<xsl:copy>
|
|
15476
|
-
<xsl:apply-templates mode="contents_item"/>
|
|
15477
|
-
</xsl:copy>
|
|
15478
|
-
</xsl:template>
|
|
15479
|
-
|
|
15480
|
-
<xsl:template match="mn:sup" mode="contents_item">
|
|
15481
|
-
<xsl:copy>
|
|
15482
|
-
<xsl:apply-templates mode="contents_item"/>
|
|
15483
|
-
</xsl:copy>
|
|
15484
|
-
</xsl:template>
|
|
15485
|
-
|
|
15486
|
-
<xsl:template match="mn:tt" mode="contents_item">
|
|
15713
|
+
<xsl:template match="mn:em | mn:sub | mn:sup | mn:tt | mn:underline | mn:hi | mn:strike | mn:span[@class] | mn:smallcap" mode="contents_item">
|
|
15487
15714
|
<xsl:copy>
|
|
15715
|
+
<xsl:copy-of select="@*"/>
|
|
15488
15716
|
<xsl:apply-templates mode="contents_item"/>
|
|
15489
15717
|
</xsl:copy>
|
|
15490
15718
|
</xsl:template>
|
|
@@ -15556,6 +15784,24 @@
|
|
|
15556
15784
|
</xsl:apply-templates>
|
|
15557
15785
|
</xsl:template>
|
|
15558
15786
|
|
|
15787
|
+
<xsl:template match="mn:fmt-link" mode="contents_item">
|
|
15788
|
+
<!-- apply template from common.link.xsl -->
|
|
15789
|
+
<xsl:variable name="link"><xsl:apply-templates select="."/></xsl:variable>
|
|
15790
|
+
<xsl:value-of select="normalize-space($link)"/>
|
|
15791
|
+
</xsl:template>
|
|
15792
|
+
|
|
15793
|
+
<xsl:template match="mn:image" mode="contents_item">
|
|
15794
|
+
<xsl:copy-of select="."/>
|
|
15795
|
+
</xsl:template>
|
|
15796
|
+
|
|
15797
|
+
<xsl:template match="*[local-name() = 'padding']" mode="contents_item">
|
|
15798
|
+
<xsl:text> </xsl:text>
|
|
15799
|
+
</xsl:template>
|
|
15800
|
+
|
|
15801
|
+
<xsl:template match="*[local-name() = 'padding']" mode="bookmarks">
|
|
15802
|
+
<xsl:text> </xsl:text>
|
|
15803
|
+
</xsl:template>
|
|
15804
|
+
|
|
15559
15805
|
<!-- =================== -->
|
|
15560
15806
|
<!-- Table of Contents (ToC) processing -->
|
|
15561
15807
|
<!-- =================== -->
|
|
@@ -16648,6 +16894,7 @@
|
|
|
16648
16894
|
<xsl:call-template name="setId"/>
|
|
16649
16895
|
|
|
16650
16896
|
<xsl:call-template name="sections_element_style"/>
|
|
16897
|
+
<xsl:copy-of select="@role"/>
|
|
16651
16898
|
|
|
16652
16899
|
<!-- <xsl:if test="$namespace = 'rsd'"> -->
|
|
16653
16900
|
<xsl:call-template name="addTagElementT"/>
|
|
@@ -16692,6 +16939,7 @@
|
|
|
16692
16939
|
<xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
|
|
16693
16940
|
<xsl:call-template name="setNamedDestination"/>
|
|
16694
16941
|
<fo:block role="Sect">
|
|
16942
|
+
<xsl:copy-of select="@role"/>
|
|
16695
16943
|
<xsl:call-template name="addTagElementT"/>
|
|
16696
16944
|
<xsl:call-template name="setId"/>
|
|
16697
16945
|
<xsl:call-template name="addReviewHelper"/>
|
|
@@ -16730,6 +16978,7 @@
|
|
|
16730
16978
|
<xsl:call-template name="setBlockSpanAll"/>
|
|
16731
16979
|
|
|
16732
16980
|
<xsl:call-template name="refine_clause-style"/>
|
|
16981
|
+
<xsl:copy-of select="@role"/>
|
|
16733
16982
|
|
|
16734
16983
|
<xsl:call-template name="addReviewHelper"/>
|
|
16735
16984
|
|
|
@@ -16851,24 +17100,16 @@
|
|
|
16851
17100
|
|
|
16852
17101
|
<xsl:template name="addTagElementT">
|
|
16853
17102
|
<xsl:variable name="title_">
|
|
16854
|
-
<xsl:apply-templates select="mn:fmt-title"/>
|
|
17103
|
+
<xsl:apply-templates select="mn:fmt-title" mode="bookmarks"/>
|
|
16855
17104
|
<xsl:if test="not(mn:fmt-title) and self::mn:term">
|
|
16856
17105
|
<name>
|
|
16857
|
-
<xsl:apply-templates select="mn:fmt-name"/>
|
|
17106
|
+
<xsl:apply-templates select="mn:fmt-name" mode="bookmarks"/>
|
|
16858
17107
|
<xsl:text> </xsl:text>
|
|
16859
17108
|
<xsl:apply-templates select="mn:fmt-preferred/node()[1]"/>
|
|
16860
17109
|
</name>
|
|
16861
17110
|
</xsl:if>
|
|
16862
17111
|
</xsl:variable>
|
|
16863
|
-
<xsl:variable name="
|
|
16864
|
-
<xsl:for-each select="xalan:nodeset($title_)/*/node()">
|
|
16865
|
-
<xsl:choose>
|
|
16866
|
-
<xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
|
|
16867
|
-
<xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
|
|
16868
|
-
</xsl:choose>
|
|
16869
|
-
</xsl:for-each>
|
|
16870
|
-
</xsl:variable>
|
|
16871
|
-
<xsl:variable name="title" select="normalize-space(translate($title__, concat($em_space,' 
'), ' '))"/>
|
|
17112
|
+
<xsl:variable name="title" select="normalize-space(translate($title_, concat($em_space,' 
'), ' '))"/>
|
|
16872
17113
|
<xsl:if test="$title != ''">
|
|
16873
17114
|
<xsl:attribute name="fox:title">
|
|
16874
17115
|
<xsl:if test="ancestor::mn:sections">
|
|
@@ -17378,6 +17619,27 @@
|
|
|
17378
17619
|
<!-- Get or calculate depth of term's name -->
|
|
17379
17620
|
<xsl:template name="getLevelTermName">
|
|
17380
17621
|
<xsl:choose>
|
|
17622
|
+
<xsl:when test="self::mn:term">
|
|
17623
|
+
<xsl:choose>
|
|
17624
|
+
<xsl:when test="normalize-space(@depth) != ''">
|
|
17625
|
+
<xsl:value-of select="@depth"/>
|
|
17626
|
+
</xsl:when>
|
|
17627
|
+
<xsl:otherwise>
|
|
17628
|
+
<xsl:variable name="title_level_">
|
|
17629
|
+
<xsl:for-each select="preceding-sibling::mn:fmt-title[1]">
|
|
17630
|
+
<xsl:call-template name="getLevel"/>
|
|
17631
|
+
</xsl:for-each>
|
|
17632
|
+
</xsl:variable>
|
|
17633
|
+
<xsl:variable name="title_level" select="normalize-space($title_level_)"/>
|
|
17634
|
+
<xsl:choose>
|
|
17635
|
+
<xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
|
|
17636
|
+
<xsl:otherwise>
|
|
17637
|
+
<xsl:call-template name="getLevel"/>
|
|
17638
|
+
</xsl:otherwise>
|
|
17639
|
+
</xsl:choose>
|
|
17640
|
+
</xsl:otherwise>
|
|
17641
|
+
</xsl:choose>
|
|
17642
|
+
</xsl:when><!-- end: self::mn:term -->
|
|
17381
17643
|
<xsl:when test="normalize-space(../@depth) != ''">
|
|
17382
17644
|
<xsl:value-of select="../@depth"/>
|
|
17383
17645
|
</xsl:when>
|
|
@@ -18222,6 +18484,23 @@
|
|
|
18222
18484
|
</xsl:choose>
|
|
18223
18485
|
</xsl:template>
|
|
18224
18486
|
|
|
18487
|
+
<xsl:template name="getVariable">
|
|
18488
|
+
<xsl:param name="variable"/>
|
|
18489
|
+
<!-- Note: need insert <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/> before
|
|
18490
|
+
in the iteration <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma"> -->
|
|
18491
|
+
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
18492
|
+
<xsl:value-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]"/>
|
|
18493
|
+
</xsl:template>
|
|
18494
|
+
|
|
18495
|
+
<!-- get variable value with the internal elements(nodes), e.g. formatting -->
|
|
18496
|
+
<xsl:template name="getVariableCopyOf">
|
|
18497
|
+
<xsl:param name="variable"/>
|
|
18498
|
+
<!-- Note: need insert <xsl:variable name="setVariable" select="java:org.metanorma.fop.global.Variables.setVariable('num', $num)"/> before
|
|
18499
|
+
in the iteration <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma"> -->
|
|
18500
|
+
<xsl:variable name="num" select="number(java:org.metanorma.fop.global.Variables.getVariable('num'))"/>
|
|
18501
|
+
<xsl:copy-of select="$variables/mnx:doc[@num = $num]/*[local-name() = $variable]/node()"/>
|
|
18502
|
+
</xsl:template>
|
|
18503
|
+
|
|
18225
18504
|
<!-- ============================================= -->
|
|
18226
18505
|
<!-- mode="print_as_xml", for debug purposes -->
|
|
18227
18506
|
<!-- ============================================= -->
|