metanorma-plateau 0.1.15 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/plateau/plateau.international-standard.xsl +431 -86
- data/lib/metanorma/plateau/biblio.rng +2 -0
- data/lib/metanorma/plateau/isodoc.rng +12 -6
- data/lib/metanorma/plateau/isostandard.rng +30 -33
- data/lib/metanorma/plateau/jis.rng +33 -36
- data/lib/metanorma/plateau/plateau.rng +34 -38
- data/lib/metanorma/plateau/version.rb +1 -1
- data/metanorma-plateau.gemspec +1 -1
- metadata +4 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:plateau="https://www.metanorma.org/ns/
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:plateau="https://www.metanorma.org/ns/standoc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:java="http://xml.apache.org/xalan/java" xmlns:jeuclid="http://jeuclid.sf.net/ns/ext" xmlns:barcode="http://barcode4j.krysalis.org/ns" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java redirect" extension-element-prefixes="redirect" version="1.0">
|
2
2
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<!-- <xsl:variable name="isIgnoreComplexScripts">true</xsl:variable> -->
|
10
10
|
|
11
|
-
<xsl:variable name="doctype" select="//plateau:
|
11
|
+
<xsl:variable name="doctype" select="//plateau:metanorma[1]/plateau:bibdata/plateau:ext/plateau:doctype[@language = '' or not(@language)]"/>
|
12
12
|
|
13
13
|
<xsl:variable name="i18n_doctype_dict_annex"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">doctype_dict.annex</xsl:with-param></xsl:call-template></xsl:variable>
|
14
14
|
<xsl:variable name="i18n_doctype_dict_technical_report"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">doctype_dict.technical-report</xsl:with-param></xsl:call-template></xsl:variable>
|
@@ -26,14 +26,14 @@
|
|
26
26
|
</xsl:variable>
|
27
27
|
|
28
28
|
<xsl:variable name="contents_">
|
29
|
-
<xsl:variable name="bundle" select="count(//plateau:
|
29
|
+
<xsl:variable name="bundle" select="count(//plateau:metanorma) > 1"/>
|
30
30
|
|
31
31
|
<xsl:if test="normalize-space($bundle) = 'true'">
|
32
32
|
<collection firstpage_id="firstpage_id_0"/>
|
33
33
|
</xsl:if>
|
34
34
|
|
35
|
-
<xsl:for-each select="//plateau:
|
36
|
-
<xsl:variable name="num"><xsl:number level="any" count="plateau:
|
35
|
+
<xsl:for-each select="//plateau:metanorma">
|
36
|
+
<xsl:variable name="num"><xsl:number level="any" count="plateau:metanorma"/></xsl:variable>
|
37
37
|
<xsl:variable name="docnumber"><xsl:value-of select="plateau:bibdata/plateau:docidentifier[@type = 'JIS']"/></xsl:variable>
|
38
38
|
<xsl:variable name="current_document">
|
39
39
|
<xsl:copy-of select="."/>
|
@@ -214,8 +214,8 @@
|
|
214
214
|
</redirect:write>
|
215
215
|
<xsl:message>end redirect</xsl:message> -->
|
216
216
|
|
217
|
-
<xsl:for-each select="$updated_xml_step2//plateau:
|
218
|
-
<xsl:variable name="num"><xsl:number level="any" count="plateau:
|
217
|
+
<xsl:for-each select="$updated_xml_step2//plateau:metanorma">
|
218
|
+
<xsl:variable name="num"><xsl:number level="any" count="plateau:metanorma"/></xsl:variable>
|
219
219
|
|
220
220
|
<!-- <xsl:variable name="current_document">
|
221
221
|
<xsl:copy-of select="."/>
|
@@ -379,7 +379,7 @@
|
|
379
379
|
|
380
380
|
</xsl:for-each>
|
381
381
|
|
382
|
-
<xsl:if test="not(//plateau:
|
382
|
+
<xsl:if test="not(//plateau:metanorma)">
|
383
383
|
<fo:page-sequence master-reference="document" force-page-count="no-force">
|
384
384
|
<fo:flow flow-name="xsl-region-body">
|
385
385
|
<fo:block><!-- prevent fop error for empty document --></fo:block>
|
@@ -1213,6 +1213,13 @@
|
|
1213
1213
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
1214
1214
|
</xsl:if>
|
1215
1215
|
|
1216
|
+
<xsl:if test="(ancestor::*[local-name() = 'td' or local-name() = 'th']) and (.//*[local-name() = 'font_en' or local-name() = 'font_en_bold'])">
|
1217
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
1218
|
+
<xsl:attribute name="language">en</xsl:attribute>
|
1219
|
+
<xsl:attribute name="hyphenate">true</xsl:attribute>
|
1220
|
+
</xsl:if>
|
1221
|
+
</xsl:if>
|
1222
|
+
|
1216
1223
|
<xsl:if test="parent::plateau:clause or (ancestor::plateau:note and not(ancestor::plateau:table))">
|
1217
1224
|
<xsl:text> </xsl:text>
|
1218
1225
|
</xsl:if>
|
@@ -1483,7 +1490,7 @@
|
|
1483
1490
|
<xsl:param name="structured_xml"/>
|
1484
1491
|
<xsl:choose>
|
1485
1492
|
<xsl:when test="not(xalan:nodeset($structured_xml)/*[local-name()='pagebreak'])">
|
1486
|
-
<xsl:element name="page" namespace="
|
1493
|
+
<xsl:element name="page" namespace="{$namespace_full}">
|
1487
1494
|
<xsl:copy-of select="xalan:nodeset($structured_xml)"/>
|
1488
1495
|
</xsl:element>
|
1489
1496
|
</xsl:when>
|
@@ -1493,7 +1500,7 @@
|
|
1493
1500
|
<xsl:variable name="pagebreak_id" select="generate-id()"/>
|
1494
1501
|
|
1495
1502
|
<!-- copy elements before pagebreak -->
|
1496
|
-
<xsl:element name="page" namespace="
|
1503
|
+
<xsl:element name="page" namespace="{$namespace_full}">
|
1497
1504
|
<xsl:if test="not(preceding-sibling::plateau:pagebreak)">
|
1498
1505
|
<xsl:copy-of select="../@*"/>
|
1499
1506
|
</xsl:if>
|
@@ -1505,7 +1512,7 @@
|
|
1505
1512
|
|
1506
1513
|
<!-- copy elements after last page break -->
|
1507
1514
|
<xsl:if test="position() = last() and following-sibling::node()">
|
1508
|
-
<xsl:element name="page" namespace="
|
1515
|
+
<xsl:element name="page" namespace="{$namespace_full}">
|
1509
1516
|
<xsl:copy-of select="@orientation"/>
|
1510
1517
|
<xsl:copy-of select="following-sibling::node()"/>
|
1511
1518
|
</xsl:element>
|
@@ -1560,7 +1567,7 @@
|
|
1560
1567
|
<!-- plateau:term/plateau:preferred2//text() | -->
|
1561
1568
|
|
1562
1569
|
<!-- <name>注記 1</name> to <name>注記<font_en> 1</font_en></name> -->
|
1563
|
-
<xsl:template match="plateau:title/text() | plateau:note/plateau:name/text() | plateau:termnote/plateau:name/text() | plateau:table/plateau:name/text() | plateau:figure/plateau:name/text() | plateau:termexample/plateau:name/text() | plateau:xref//text() | plateau:origin/text()" mode="update_xml_step1">
|
1570
|
+
<xsl:template match="plateau:title/text() | plateau:fmt-title/text() | plateau:note/plateau:name/text() | plateau:note/plateau:fmt-name/text() | plateau:termnote/plateau:name/text() | plateau:termnote/plateau:fmt-name/text() | plateau:table/plateau:name/text() | plateau:table/plateau:fmt-name/text() | plateau:figure/plateau:name/text() | plateau:figure/plateau:fmt-name/text() | plateau:termexample/plateau:name/text() | plateau:termexample/plateau:fmt-name/text() | plateau:xref//text() | plateau:fmt-xref//text() | plateau:origin/text() | plateau:fmt-origin/text()" mode="update_xml_step1">
|
1564
1571
|
<xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new(.), $regex_en, concat($tag_font_en_bold_open,'$1',$tag_font_en_bold_close))"/>
|
1565
1572
|
<xsl:variable name="text_en">
|
1566
1573
|
<xsl:element name="text" namespace="{$namespace_full}">
|
@@ -1591,22 +1598,43 @@
|
|
1591
1598
|
</xsl:template>
|
1592
1599
|
|
1593
1600
|
<!-- move example title to the first paragraph -->
|
1594
|
-
|
1601
|
+
<!-- Example:
|
1602
|
+
<example id="_7569d639-c245-acb6-2141-3b746374a9e1" autonum="1">
|
1603
|
+
<name id="_8eac959b-b129-4892-b8bb-fcca2914bd39">(可能性の例)</name>
|
1604
|
+
<fmt-name>
|
1605
|
+
<span class="fmt-caption-label">
|
1606
|
+
<span class="fmt-element-name">例</span>
|
1607
|
+
<semx element="autonum" source="_7569d639-c245-acb6-2141-3b746374a9e1">1</semx>
|
1608
|
+
</span>
|
1609
|
+
<span class="fmt-caption-delim"> — </span>
|
1610
|
+
<semx element="name" source="_8eac959b-b129-4892-b8bb-fcca2914bd39">(可能性の例)</semx>
|
1611
|
+
</fmt-name>
|
1612
|
+
-->
|
1613
|
+
<!-- <xsl:template match="plateau:example[contains(plateau:name/text(), ' — ')]" mode="update_xml_step1"> -->
|
1614
|
+
<xsl:template match="plateau:example[plateau:fmt-name[contains(plateau:span/text(), ' — ')]]" mode="update_xml_step1">
|
1595
1615
|
<xsl:copy>
|
1596
1616
|
<xsl:copy-of select="@*"/>
|
1597
|
-
<xsl:element name="p" namespace="
|
1598
|
-
<xsl:value-of select="substring-after(plateau:name/text(), ' — ')"/>
|
1617
|
+
<xsl:element name="p" namespace="{$namespace_full}">
|
1618
|
+
<!-- <xsl:value-of select="substring-after(plateau:name/text(), ' — ')"/> -->
|
1619
|
+
<xsl:apply-templates select="plateau:fmt-name/plateau:span[contains(., ' — ')][1]/following-sibling::node()" mode="update_xml_step1"/>
|
1599
1620
|
</xsl:element>
|
1600
1621
|
<xsl:apply-templates mode="update_xml_step1"/>
|
1601
1622
|
</xsl:copy>
|
1602
1623
|
</xsl:template>
|
1624
|
+
<xsl:template match="plateau:example/plateau:fmt-name[contains(plateau:span/text(), ' — ')]" mode="update_xml_step1" priority="2">
|
1625
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
1626
|
+
<xsl:copy-of select="@*"/>
|
1627
|
+
<xsl:apply-templates select="*[1]" mode="update_xml_step1"/>
|
1628
|
+
</xsl:element>
|
1629
|
+
</xsl:template>
|
1603
1630
|
<xsl:template match="plateau:example/plateau:name/text()" mode="update_xml_step1">
|
1604
|
-
<xsl:variable name="example_name"
|
1631
|
+
<xsl:variable name="example_name" select="."/>
|
1632
|
+
<!--
|
1605
1633
|
<xsl:choose>
|
1606
1634
|
<xsl:when test="contains(., ' — ')"><xsl:value-of select="substring-before(., ' — ')"/></xsl:when>
|
1607
1635
|
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
1608
1636
|
</xsl:choose>
|
1609
|
-
</xsl:variable>
|
1637
|
+
</xsl:variable> -->
|
1610
1638
|
<xsl:variable name="text_en_" select="java:replaceAll(java:java.lang.String.new($example_name), $regex_en, concat($tag_font_en_bold_open,'$1',$tag_font_en_bold_close))"/>
|
1611
1639
|
<xsl:variable name="text_en">
|
1612
1640
|
<xsl:element name="text" namespace="{$namespace_full}">
|
@@ -1670,8 +1698,20 @@
|
|
1670
1698
|
<!-- Key title after the table -->
|
1671
1699
|
<xsl:template match="plateau:table/plateau:p[@class = 'ListTitle']" priority="2" mode="update_xml_step1"/>
|
1672
1700
|
|
1701
|
+
<!-- added to fix conflict with previous update in update_xml_pres -->
|
1702
|
+
<xsl:template match="*[local-name() = 'preferred'] | *[local-name() = 'admitted'] | *[local-name() = 'deprecates'] | *[local-name() = 'definition'] | *[local-name() = 'termsource'] | *[local-name() = 'termsource'] | *[local-name() = 'term'][@unnumbered = 'true']" mode="update_xml_step1" priority="2">
|
1703
|
+
<xsl:copy>
|
1704
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
|
1705
|
+
</xsl:copy>
|
1706
|
+
</xsl:template>
|
1707
|
+
|
1673
1708
|
<xsl:template match="*[local-name() = 'font_en_bold'][normalize-space() != '']">
|
1674
|
-
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"
|
1709
|
+
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
|
1710
|
+
<xsl:choose>
|
1711
|
+
<xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
|
1712
|
+
<xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
|
1713
|
+
</xsl:choose>
|
1714
|
+
</xsl:if>
|
1675
1715
|
<fo:inline font-family="Noto Sans Condensed" font-weight="300"> <!-- font-weight="bold" -->
|
1676
1716
|
<!-- <xsl:if test="ancestor::*[local-name() = 'preferred']">
|
1677
1717
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
@@ -1690,11 +1730,21 @@
|
|
1690
1730
|
|
1691
1731
|
<xsl:apply-templates/>
|
1692
1732
|
</fo:inline>
|
1693
|
-
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"
|
1733
|
+
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
|
1734
|
+
<xsl:choose>
|
1735
|
+
<xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
|
1736
|
+
<xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
|
1737
|
+
</xsl:choose>
|
1738
|
+
</xsl:if>
|
1694
1739
|
</xsl:template>
|
1695
1740
|
|
1696
1741
|
<xsl:template match="*[local-name() = 'font_en'][normalize-space() != '']">
|
1697
|
-
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"
|
1742
|
+
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
|
1743
|
+
<xsl:choose>
|
1744
|
+
<xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
|
1745
|
+
<xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
|
1746
|
+
</xsl:choose>
|
1747
|
+
</xsl:if>
|
1698
1748
|
<fo:inline>
|
1699
1749
|
<xsl:if test="not(ancestor::plateau:p[@class = 'zzSTDTitle2']) and not(ancestor::plateau:span[@class = 'JIS'])">
|
1700
1750
|
<xsl:attribute name="font-family">Noto Sans Condensed</xsl:attribute>
|
@@ -1705,7 +1755,12 @@
|
|
1705
1755
|
</xsl:if>
|
1706
1756
|
<xsl:apply-templates/>
|
1707
1757
|
</fo:inline>
|
1708
|
-
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"
|
1758
|
+
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
|
1759
|
+
<xsl:choose>
|
1760
|
+
<xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
|
1761
|
+
<xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
|
1762
|
+
</xsl:choose>
|
1763
|
+
</xsl:if>
|
1709
1764
|
</xsl:template>
|
1710
1765
|
|
1711
1766
|
<!-- ========================= -->
|
@@ -1908,21 +1963,21 @@
|
|
1908
1963
|
|
1909
1964
|
<xsl:variable name="namespace_full_">
|
1910
1965
|
<xsl:choose>
|
1911
|
-
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[
|
1912
|
-
<xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/
|
1966
|
+
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[local-name() = 'metanorma'][1])"/></xsl:when>
|
1967
|
+
<xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/standoc -->
|
1913
1968
|
</xsl:choose>
|
1914
1969
|
</xsl:variable>
|
1915
1970
|
<xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
|
1916
1971
|
|
1917
1972
|
<xsl:variable name="root_element_">
|
1918
1973
|
<xsl:choose>
|
1919
|
-
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[
|
1920
|
-
<xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
|
1974
|
+
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[local-name() = 'metanorma'][1])"/></xsl:when>
|
1975
|
+
<xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: metanorma (former iso-standard) -->
|
1921
1976
|
</xsl:choose>
|
1922
1977
|
</xsl:variable>
|
1923
1978
|
<xsl:variable name="root_element" select="normalize-space($root_element_)"/>
|
1924
1979
|
|
1925
|
-
<xsl:variable name="document_scheme" select="normalize-space(//*[
|
1980
|
+
<xsl:variable name="document_scheme" select="normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
|
1926
1981
|
|
1927
1982
|
<!-- external parameters -->
|
1928
1983
|
|
@@ -2023,7 +2078,7 @@
|
|
2023
2078
|
</metanorma-extension>
|
2024
2079
|
-->
|
2025
2080
|
|
2026
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[
|
2081
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
2027
2082
|
<xsl:variable name="papersize_width_">
|
2028
2083
|
<xsl:choose>
|
2029
2084
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -2105,7 +2160,7 @@
|
|
2105
2160
|
<xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
|
2106
2161
|
|
2107
2162
|
<xsl:variable name="layout_columns_default">1</xsl:variable>
|
2108
|
-
<xsl:variable name="layout_columns_" select="normalize-space((//*[
|
2163
|
+
<xsl:variable name="layout_columns_" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
|
2109
2164
|
<xsl:variable name="layout_columns">
|
2110
2165
|
<xsl:choose>
|
2111
2166
|
<xsl:when test="$layout_columns_ != ''"><xsl:value-of select="$layout_columns_"/></xsl:when>
|
@@ -2166,7 +2221,7 @@
|
|
2166
2221
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
2167
2222
|
|
2168
2223
|
<xsl:variable name="title-list-tables">
|
2169
|
-
<xsl:variable name="toc_table_title" select="//*[
|
2224
|
+
<xsl:variable name="toc_table_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
2170
2225
|
<xsl:value-of select="$toc_table_title"/>
|
2171
2226
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
2172
2227
|
<xsl:call-template name="getLocalizedString">
|
@@ -2176,7 +2231,7 @@
|
|
2176
2231
|
</xsl:variable>
|
2177
2232
|
|
2178
2233
|
<xsl:variable name="title-list-figures">
|
2179
|
-
<xsl:variable name="toc_figure_title" select="//*[
|
2234
|
+
<xsl:variable name="toc_figure_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
2180
2235
|
<xsl:value-of select="$toc_figure_title"/>
|
2181
2236
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
2182
2237
|
<xsl:call-template name="getLocalizedString">
|
@@ -2186,7 +2241,7 @@
|
|
2186
2241
|
</xsl:variable>
|
2187
2242
|
|
2188
2243
|
<xsl:variable name="title-list-recommendations">
|
2189
|
-
<xsl:variable name="toc_requirement_title" select="//*[
|
2244
|
+
<xsl:variable name="toc_requirement_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
2190
2245
|
<xsl:value-of select="$toc_requirement_title"/>
|
2191
2246
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
2192
2247
|
<xsl:call-template name="getLocalizedString">
|
@@ -2196,8 +2251,8 @@
|
|
2196
2251
|
</xsl:variable>
|
2197
2252
|
|
2198
2253
|
<xsl:variable name="bibdata">
|
2199
|
-
<xsl:copy-of select="//*[
|
2200
|
-
<xsl:copy-of select="//*[
|
2254
|
+
<xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']"/>
|
2255
|
+
<xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'localized-strings']"/>
|
2201
2256
|
</xsl:variable>
|
2202
2257
|
|
2203
2258
|
<!-- Characters -->
|
@@ -2262,7 +2317,7 @@
|
|
2262
2317
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
2263
2318
|
|
2264
2319
|
<xsl:variable name="additional_fonts_">
|
2265
|
-
<xsl:for-each select="//*[
|
2320
|
+
<xsl:for-each select="//*[local-name() = 'metanorma'][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[local-name() = 'metanorma'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
2266
2321
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
2267
2322
|
</xsl:for-each>
|
2268
2323
|
</xsl:variable>
|
@@ -3551,10 +3606,10 @@
|
|
3551
3606
|
|
3552
3607
|
<xsl:template name="processTablesFigures_Contents">
|
3553
3608
|
<xsl:param name="always"/>
|
3554
|
-
<xsl:if test="(//*[
|
3609
|
+
<xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
3555
3610
|
<xsl:call-template name="processTables_Contents"/>
|
3556
3611
|
</xsl:if>
|
3557
|
-
<xsl:if test="(//*[
|
3612
|
+
<xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
3558
3613
|
<xsl:call-template name="processFigures_Contents"/>
|
3559
3614
|
</xsl:if>
|
3560
3615
|
</xsl:template>
|
@@ -3634,7 +3689,7 @@
|
|
3634
3689
|
</xsl:template><!-- END: processMainSectionsDefault -->
|
3635
3690
|
|
3636
3691
|
<!-- Example:
|
3637
|
-
<
|
3692
|
+
<metanorma>
|
3638
3693
|
<preface>
|
3639
3694
|
<page_sequence>
|
3640
3695
|
<clause...
|
@@ -3657,7 +3712,7 @@
|
|
3657
3712
|
<page_sequence>
|
3658
3713
|
<annex ..
|
3659
3714
|
</page_sequence>
|
3660
|
-
</
|
3715
|
+
</metanorma>
|
3661
3716
|
-->
|
3662
3717
|
<xsl:template name="processPrefaceAndMainSectionsDefault_items">
|
3663
3718
|
|
@@ -3700,15 +3755,8 @@
|
|
3700
3755
|
</xsl:template> <!-- END: insertPrefaceSectionsPageSequences -->
|
3701
3756
|
|
3702
3757
|
<xsl:template name="insertMainSectionsPageSequences">
|
3703
|
-
<xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
|
3704
|
-
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
3705
|
-
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
3706
|
-
<xsl:sort select="@displayorder" data-type="number"/>
|
3707
|
-
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
3708
3758
|
|
3709
|
-
|
3710
|
-
</xsl:element>
|
3711
|
-
</xsl:element>
|
3759
|
+
<xsl:call-template name="insertSectionsInPageSequence"/>
|
3712
3760
|
|
3713
3761
|
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
3714
3762
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
@@ -3727,6 +3775,18 @@
|
|
3727
3775
|
</xsl:element>
|
3728
3776
|
</xsl:template> <!-- END: insertMainSectionsPageSequences -->
|
3729
3777
|
|
3778
|
+
<xsl:template name="insertSectionsInPageSequence">
|
3779
|
+
<xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
|
3780
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
3781
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
3782
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
3783
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
3784
|
+
|
3785
|
+
</xsl:for-each>
|
3786
|
+
</xsl:element>
|
3787
|
+
</xsl:element>
|
3788
|
+
</xsl:template>
|
3789
|
+
|
3730
3790
|
<xsl:template name="insertMainSectionsInSeparatePageSequences">
|
3731
3791
|
<xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
|
3732
3792
|
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
@@ -5240,7 +5300,7 @@
|
|
5240
5300
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
5241
5301
|
|
5242
5302
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
5243
|
-
<xsl:variable name="lang" select="ancestor::*[
|
5303
|
+
<xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
5244
5304
|
<xsl:variable name="reference_">
|
5245
5305
|
<xsl:value-of select="@reference"/>
|
5246
5306
|
<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
|
@@ -5361,13 +5421,13 @@
|
|
5361
5421
|
footnotes in bibliography
|
5362
5422
|
footnotes in document's body (except table's head/body/foot and figure text)
|
5363
5423
|
-->
|
5364
|
-
<xsl:for-each select="ancestor::*[
|
5424
|
+
<xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
5365
5425
|
<fn gen_id="{generate-id(.)}">
|
5366
5426
|
<xsl:copy-of select="@*"/>
|
5367
5427
|
<xsl:copy-of select="node()"/>
|
5368
5428
|
</fn>
|
5369
5429
|
</xsl:for-each>
|
5370
|
-
<xsl:for-each select="ancestor::*[
|
5430
|
+
<xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name()='boilerplate']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='preface']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='sections']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='annex'] | ancestor::*[local-name() = 'metanorma']//*[local-name()='bibliography']/*">
|
5371
5431
|
<xsl:sort select="@displayorder" data-type="number"/>
|
5372
5432
|
<!-- commented:
|
5373
5433
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
@@ -7109,9 +7169,14 @@
|
|
7109
7169
|
|
7110
7170
|
<xsl:variable name="simple-table">
|
7111
7171
|
|
7172
|
+
<xsl:variable name="table_without_semantic_elements">
|
7173
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
7174
|
+
</xsl:variable>
|
7175
|
+
|
7112
7176
|
<!-- Step 0. replace <br/> to <p>...</p> -->
|
7113
7177
|
<xsl:variable name="table_without_br">
|
7114
|
-
<xsl:apply-templates mode="table-without-br"/>
|
7178
|
+
<!-- <xsl:apply-templates mode="table-without-br"/> -->
|
7179
|
+
<xsl:apply-templates select="xalan:nodeset($table_without_semantic_elements)" mode="table-without-br"/>
|
7115
7180
|
</xsl:variable>
|
7116
7181
|
|
7117
7182
|
<!-- Step 1. colspan processing -->
|
@@ -7727,6 +7792,8 @@
|
|
7727
7792
|
<!-- ======================================= -->
|
7728
7793
|
<!-- math -->
|
7729
7794
|
<!-- ======================================= -->
|
7795
|
+
<xsl:template match="*[local-name() = 'stem'][following-sibling::*[1][local-name() = 'fmt-stem']]"/> <!-- for tablesonly.xml generated by mn2pdf -->
|
7796
|
+
|
7730
7797
|
<xsl:template match="mathml:math">
|
7731
7798
|
<xsl:variable name="isAdded" select="@added"/>
|
7732
7799
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -8086,10 +8153,10 @@
|
|
8086
8153
|
<xsl:template match="*[local-name()='localityStack']"/>
|
8087
8154
|
|
8088
8155
|
<xsl:variable name="pdfAttachmentsList_">
|
8089
|
-
<xsl:for-each select="//*[
|
8156
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8090
8157
|
<attachment filename="{@name}"/>
|
8091
8158
|
</xsl:for-each>
|
8092
|
-
<xsl:if test="not(//*[
|
8159
|
+
<xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
8093
8160
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
8094
8161
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
8095
8162
|
<attachment filename="{$attachment_path}"/>
|
@@ -9555,7 +9622,9 @@
|
|
9555
9622
|
<xsl:apply-templates mode="bookmarks"/>
|
9556
9623
|
</xsl:template>
|
9557
9624
|
|
9558
|
-
<xsl:template match="*[local-name() = '
|
9625
|
+
<xsl:template match="*[local-name() = 'stem']" mode="contents"/>
|
9626
|
+
|
9627
|
+
<xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'fmt-stem']" mode="contents">
|
9559
9628
|
<xsl:apply-templates select="."/>
|
9560
9629
|
</xsl:template>
|
9561
9630
|
|
@@ -9572,7 +9641,15 @@
|
|
9572
9641
|
<xsl:apply-templates mode="contents"/>
|
9573
9642
|
</xsl:template>
|
9574
9643
|
|
9575
|
-
<xsl:template match="*[local-name() = '
|
9644
|
+
<xsl:template match="*[local-name() = 'concept']" mode="contents"/>
|
9645
|
+
<xsl:template match="*[local-name() = 'eref']" mode="contents"/>
|
9646
|
+
<xsl:template match="*[local-name() = 'xref']" mode="contents"/>
|
9647
|
+
<xsl:template match="*[local-name() = 'link']" mode="contents"/>
|
9648
|
+
<xsl:template match="*[local-name() = 'origin']" mode="contents"/>
|
9649
|
+
<xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
|
9650
|
+
|
9651
|
+
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
|
9652
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
|
9576
9653
|
<xsl:apply-templates mode="bookmarks"/>
|
9577
9654
|
</xsl:template>
|
9578
9655
|
|
@@ -9585,6 +9662,13 @@
|
|
9585
9662
|
<xsl:apply-templates mode="bookmarks"/>
|
9586
9663
|
</xsl:template>
|
9587
9664
|
|
9665
|
+
<xsl:template match="*[local-name() = 'concept']" mode="bookmarks"/>
|
9666
|
+
<xsl:template match="*[local-name() = 'eref']" mode="bookmarks"/>
|
9667
|
+
<xsl:template match="*[local-name() = 'xref']" mode="bookmarks"/>
|
9668
|
+
<xsl:template match="*[local-name() = 'link']" mode="bookmarks"/>
|
9669
|
+
<xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
|
9670
|
+
<xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
|
9671
|
+
|
9588
9672
|
<!-- Bookmarks -->
|
9589
9673
|
<xsl:template name="addBookmarks">
|
9590
9674
|
<xsl:param name="contents"/>
|
@@ -9869,6 +9953,13 @@
|
|
9869
9953
|
|
9870
9954
|
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
|
9871
9955
|
|
9956
|
+
<xsl:template match="*[local-name() = 'concept']" mode="contents_item"/>
|
9957
|
+
<xsl:template match="*[local-name() = 'eref']" mode="contents_item"/>
|
9958
|
+
<xsl:template match="*[local-name() = 'xref']" mode="contents_item"/>
|
9959
|
+
<xsl:template match="*[local-name() = 'link']" mode="contents_item"/>
|
9960
|
+
<xsl:template match="*[local-name() = 'origin']" mode="contents_item"/>
|
9961
|
+
<xsl:template match="*[local-name() = 'erefstack ']" mode="contents_item"/>
|
9962
|
+
|
9872
9963
|
<xsl:template name="getSection">
|
9873
9964
|
<xsl:choose>
|
9874
9965
|
<xsl:when test="*[local-name() = 'fmt-title']">
|
@@ -9988,7 +10079,8 @@
|
|
9988
10079
|
</xsl:copy>
|
9989
10080
|
</xsl:template>
|
9990
10081
|
|
9991
|
-
<xsl:template match="*[local-name() = 'stem']" mode="contents_item"
|
10082
|
+
<xsl:template match="*[local-name() = 'stem']" mode="contents_item"/>
|
10083
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="contents_item">
|
9992
10084
|
<xsl:copy-of select="."/>
|
9993
10085
|
</xsl:template>
|
9994
10086
|
|
@@ -10052,7 +10144,7 @@
|
|
10052
10144
|
<!-- sourcecode -->
|
10053
10145
|
<!-- =============== -->
|
10054
10146
|
|
10055
|
-
<xsl:variable name="source-highlighter-css_" select="//*[
|
10147
|
+
<xsl:variable name="source-highlighter-css_" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
10056
10148
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
10057
10149
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
10058
10150
|
|
@@ -11495,7 +11587,7 @@
|
|
11495
11587
|
|
11496
11588
|
</xsl:template> <!-- sections_element_style -->
|
11497
11589
|
|
11498
|
-
<xsl:template match="//*[
|
11590
|
+
<xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
|
11499
11591
|
|
11500
11592
|
<fo:block break-after="page"/>
|
11501
11593
|
|
@@ -11599,7 +11691,7 @@
|
|
11599
11691
|
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11600
11692
|
</xsl:when>
|
11601
11693
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
11602
|
-
<xsl:when test="ancestor::*[
|
11694
|
+
<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
|
11603
11695
|
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11604
11696
|
</xsl:when>
|
11605
11697
|
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
@@ -12954,7 +13046,7 @@
|
|
12954
13046
|
<xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
|
12955
13047
|
|
12956
13048
|
<!-- move section 'Normative references' inside 'sections' -->
|
12957
|
-
<xsl:for-each select="* | ancestor::*[
|
13049
|
+
<xsl:for-each select="* | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
|
12958
13050
|
<xsl:sort select="@displayorder" data-type="number"/>
|
12959
13051
|
|
12960
13052
|
<!-- process Section's title -->
|
@@ -13015,10 +13107,126 @@
|
|
13015
13107
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
13016
13108
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
|
13017
13109
|
|
13018
|
-
<xsl:template match="*[local-name() = 'stem']
|
13110
|
+
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
13111
|
+
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
13112
|
+
|
13113
|
+
<xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
|
13114
|
+
<xsl:element name="stem" namespace="{$namespace_full}">
|
13115
|
+
<xsl:copy-of select="@*"/>
|
13116
|
+
<xsl:choose>
|
13117
|
+
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
13118
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
13119
|
+
</xsl:when>
|
13120
|
+
<xsl:otherwise>
|
13121
|
+
<xsl:copy-of select="node()"/>
|
13122
|
+
</xsl:otherwise>
|
13123
|
+
</xsl:choose>
|
13124
|
+
</xsl:element>
|
13125
|
+
</xsl:template>
|
13126
|
+
<xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
|
13127
|
+
<xsl:element name="stem" namespace="{$namespace_full}">
|
13128
|
+
<xsl:copy-of select="@*"/>
|
13129
|
+
<xsl:choose>
|
13130
|
+
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
13131
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
13132
|
+
</xsl:when>
|
13133
|
+
<xsl:otherwise>
|
13134
|
+
<xsl:copy-of select="node()"/>
|
13135
|
+
</xsl:otherwise>
|
13136
|
+
</xsl:choose>
|
13137
|
+
</xsl:element>
|
13138
|
+
</xsl:template>
|
13139
|
+
|
13140
|
+
<xsl:template match="*[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13019
13141
|
<xsl:copy-of select="."/>
|
13020
13142
|
</xsl:template>
|
13021
13143
|
|
13144
|
+
<!-- https://github.com/metanorma/isodoc/issues/651 -->
|
13145
|
+
<!-- *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] -->
|
13146
|
+
<xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_step1">
|
13147
|
+
<xsl:copy>
|
13148
|
+
<xsl:copy-of select="@*"/>
|
13149
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
13150
|
+
<xsl:choose>
|
13151
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode']">
|
13152
|
+
<xsl:choose>
|
13153
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
|
13154
|
+
<xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
|
13155
|
+
</xsl:when>
|
13156
|
+
<xsl:otherwise>
|
13157
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_step1"/>
|
13158
|
+
</xsl:otherwise>
|
13159
|
+
</xsl:choose>
|
13160
|
+
</xsl:when>
|
13161
|
+
<xsl:otherwise> <!-- If fmt-sourcecode is not present -->
|
13162
|
+
<xsl:choose>
|
13163
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
|
13164
|
+
<xsl:copy-of select="node()"/>
|
13165
|
+
</xsl:when>
|
13166
|
+
<xsl:otherwise>
|
13167
|
+
<xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_step1"/>
|
13168
|
+
</xsl:otherwise>
|
13169
|
+
</xsl:choose>
|
13170
|
+
</xsl:otherwise>
|
13171
|
+
</xsl:choose>
|
13172
|
+
</xsl:copy>
|
13173
|
+
</xsl:template>
|
13174
|
+
<xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_pres">
|
13175
|
+
<xsl:copy>
|
13176
|
+
<xsl:copy-of select="@*"/>
|
13177
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
|
13178
|
+
<xsl:choose>
|
13179
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode']">
|
13180
|
+
<xsl:choose>
|
13181
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
|
13182
|
+
<xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
|
13183
|
+
</xsl:when>
|
13184
|
+
<xsl:otherwise>
|
13185
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_pres"/>
|
13186
|
+
</xsl:otherwise>
|
13187
|
+
</xsl:choose>
|
13188
|
+
</xsl:when>
|
13189
|
+
<xsl:otherwise> <!-- If fmt-sourcecode is not present -->
|
13190
|
+
<xsl:choose>
|
13191
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
|
13192
|
+
<xsl:copy-of select="node()"/>
|
13193
|
+
</xsl:when>
|
13194
|
+
<xsl:otherwise>
|
13195
|
+
<xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_pres"/>
|
13196
|
+
</xsl:otherwise>
|
13197
|
+
</xsl:choose>
|
13198
|
+
</xsl:otherwise>
|
13199
|
+
</xsl:choose>
|
13200
|
+
</xsl:copy>
|
13201
|
+
</xsl:template>
|
13202
|
+
|
13203
|
+
<!-- https://github.com/metanorma/isodoc/issues/651 -->
|
13204
|
+
<xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_step1" priority="2">
|
13205
|
+
<xsl:copy>
|
13206
|
+
<xsl:copy-of select="@*"/>
|
13207
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
13208
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_step1"/>
|
13209
|
+
</xsl:copy>
|
13210
|
+
</xsl:template>
|
13211
|
+
<xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_pres" priority="2">
|
13212
|
+
<xsl:copy>
|
13213
|
+
<xsl:copy-of select="@*"/>
|
13214
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
|
13215
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_pres"/>
|
13216
|
+
</xsl:copy>
|
13217
|
+
</xsl:template>
|
13218
|
+
|
13219
|
+
<!-- https://github.com/metanorma/isodoc/issues/652 -->
|
13220
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']"/>
|
13221
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']"/>
|
13222
|
+
<xsl:template match="*[local-name() = 'amend']"/>
|
13223
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_step1"/>
|
13224
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_step1"/>
|
13225
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_pres"/>
|
13226
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
|
13227
|
+
<xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
|
13228
|
+
<xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
|
13229
|
+
|
13022
13230
|
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
13023
13231
|
<xsl:copy>
|
13024
13232
|
<xsl:copy-of select="@*"/>
|
@@ -13049,7 +13257,7 @@
|
|
13049
13257
|
<!-- add @id - first element with @id plus '_element_name' -->
|
13050
13258
|
<xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
|
13051
13259
|
<xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
|
13052
|
-
<xsl:variable name="document_suffix" select="ancestor::*[
|
13260
|
+
<xsl:variable name="document_suffix" select="ancestor::*[local-name() = 'metanorma']/@document_suffix"/>
|
13053
13261
|
<xsl:attribute name="id"><xsl:value-of select="concat($prefix_id, '_', local-name(), '_', $document_suffix)"/></xsl:attribute>
|
13054
13262
|
</xsl:if>
|
13055
13263
|
</xsl:template>
|
@@ -13164,16 +13372,30 @@
|
|
13164
13372
|
|
13165
13373
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
13166
13374
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
13167
|
-
<xsl:
|
13168
|
-
<xsl:
|
13169
|
-
|
13170
|
-
|
13375
|
+
<xsl:choose>
|
13376
|
+
<xsl:when test="local-name(..) = 'p' and ancestor::*[local-name() = 'table']">
|
13377
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13378
|
+
</xsl:when>
|
13379
|
+
<xsl:otherwise>
|
13380
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
13381
|
+
<xsl:copy-of select="@*"/>
|
13382
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13383
|
+
</xsl:element>
|
13384
|
+
</xsl:otherwise>
|
13385
|
+
</xsl:choose>
|
13171
13386
|
</xsl:template>
|
13172
13387
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
|
13173
|
-
<xsl:
|
13174
|
-
<xsl:
|
13175
|
-
|
13176
|
-
|
13388
|
+
<xsl:choose>
|
13389
|
+
<xsl:when test="local-name(..) = 'p' and ancestor::*[local-name() = 'table']">
|
13390
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13391
|
+
</xsl:when>
|
13392
|
+
<xsl:otherwise>
|
13393
|
+
<xsl:element name="name" namespace="{$namespace_full}">
|
13394
|
+
<xsl:copy-of select="@*"/>
|
13395
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13396
|
+
</xsl:element>
|
13397
|
+
</xsl:otherwise>
|
13398
|
+
</xsl:choose>
|
13177
13399
|
</xsl:template>
|
13178
13400
|
|
13179
13401
|
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
|
@@ -13271,6 +13493,9 @@
|
|
13271
13493
|
<xsl:apply-templates mode="update_xml_pres"/>
|
13272
13494
|
</xsl:template>
|
13273
13495
|
|
13496
|
+
<xsl:template match="*[local-name() = 'semx']">
|
13497
|
+
<xsl:apply-templates/>
|
13498
|
+
</xsl:template>
|
13274
13499
|
<xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
|
13275
13500
|
<xsl:apply-templates mode="update_xml_step1"/>
|
13276
13501
|
</xsl:template>
|
@@ -13282,6 +13507,126 @@
|
|
13282
13507
|
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
|
13283
13508
|
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
|
13284
13509
|
|
13510
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_step1">
|
13511
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13512
|
+
</xsl:template>
|
13513
|
+
|
13514
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_pres">
|
13515
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13516
|
+
</xsl:template>
|
13517
|
+
|
13518
|
+
<xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_step1"/>
|
13519
|
+
|
13520
|
+
<xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_pres"/>
|
13521
|
+
|
13522
|
+
<xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_step1">
|
13523
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13524
|
+
</xsl:template>
|
13525
|
+
<xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_pres">
|
13526
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13527
|
+
</xsl:template>
|
13528
|
+
|
13529
|
+
<xsl:template match="*[local-name() = 'identifier']" mode="update_xml_step1"/>
|
13530
|
+
<xsl:template match="*[local-name() = 'identifier']" mode="update_xml_pres"/>
|
13531
|
+
<xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_step1">
|
13532
|
+
<xsl:element name="identifier" namespace="{$namespace_full}">
|
13533
|
+
<xsl:copy-of select="@*"/>
|
13534
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13535
|
+
</xsl:element>
|
13536
|
+
</xsl:template>
|
13537
|
+
<xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_pres">
|
13538
|
+
<xsl:element name="identifier" namespace="{$namespace_full}">
|
13539
|
+
<xsl:copy-of select="@*"/>
|
13540
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13541
|
+
</xsl:element>
|
13542
|
+
</xsl:template>
|
13543
|
+
|
13544
|
+
<xsl:template match="*[local-name() = 'concept']"/>
|
13545
|
+
<xsl:template match="*[local-name() = 'concept']" mode="update_xml_step1"/>
|
13546
|
+
<xsl:template match="*[local-name() = 'concept']" mode="update_xml_pres"/>
|
13547
|
+
|
13548
|
+
<xsl:template match="*[local-name() = 'fmt-concept']">
|
13549
|
+
<xsl:apply-templates/>
|
13550
|
+
</xsl:template>
|
13551
|
+
<xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_step1">
|
13552
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13553
|
+
</xsl:template>
|
13554
|
+
<xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_pres">
|
13555
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13556
|
+
</xsl:template>
|
13557
|
+
|
13558
|
+
<xsl:template match="*[local-name() = 'eref']" mode="update_xml_step1"/>
|
13559
|
+
<xsl:template match="*[local-name() = 'eref']" mode="update_xml_pres"/>
|
13560
|
+
|
13561
|
+
<xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_step1">
|
13562
|
+
<xsl:element name="eref" namespace="{$namespace_full}">
|
13563
|
+
<xsl:copy-of select="@*"/>
|
13564
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13565
|
+
</xsl:element>
|
13566
|
+
</xsl:template>
|
13567
|
+
<xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_pres">
|
13568
|
+
<xsl:element name="eref" namespace="{$namespace_full}">
|
13569
|
+
<xsl:copy-of select="@*"/>
|
13570
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13571
|
+
</xsl:element>
|
13572
|
+
</xsl:template>
|
13573
|
+
|
13574
|
+
<xsl:template match="*[local-name() = 'xref']" mode="update_xml_step1"/>
|
13575
|
+
<xsl:template match="*[local-name() = 'xref']" mode="update_xml_pres"/>
|
13576
|
+
|
13577
|
+
<xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_step1">
|
13578
|
+
<xsl:element name="xref" namespace="{$namespace_full}">
|
13579
|
+
<xsl:copy-of select="@*"/>
|
13580
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13581
|
+
</xsl:element>
|
13582
|
+
</xsl:template>
|
13583
|
+
<xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_pres">
|
13584
|
+
<xsl:element name="xref" namespace="{$namespace_full}">
|
13585
|
+
<xsl:copy-of select="@*"/>
|
13586
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13587
|
+
</xsl:element>
|
13588
|
+
</xsl:template>
|
13589
|
+
|
13590
|
+
<xsl:template match="*[local-name() = 'link']" mode="update_xml_step1"/>
|
13591
|
+
<xsl:template match="*[local-name() = 'link']" mode="update_xml_pres"/>
|
13592
|
+
|
13593
|
+
<xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_step1">
|
13594
|
+
<xsl:element name="link" namespace="{$namespace_full}">
|
13595
|
+
<xsl:copy-of select="@*"/>
|
13596
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13597
|
+
</xsl:element>
|
13598
|
+
</xsl:template>
|
13599
|
+
<xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_pres">
|
13600
|
+
<xsl:element name="link" namespace="{$namespace_full}">
|
13601
|
+
<xsl:copy-of select="@*"/>
|
13602
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13603
|
+
</xsl:element>
|
13604
|
+
</xsl:template>
|
13605
|
+
|
13606
|
+
<xsl:template match="*[local-name() = 'origin']" mode="update_xml_step1"/>
|
13607
|
+
<xsl:template match="*[local-name() = 'origin']" mode="update_xml_pres"/>
|
13608
|
+
|
13609
|
+
<xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_step1">
|
13610
|
+
<xsl:element name="origin" namespace="{$namespace_full}">
|
13611
|
+
<xsl:copy-of select="@*"/>
|
13612
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13613
|
+
</xsl:element>
|
13614
|
+
</xsl:template>
|
13615
|
+
<xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_pres">
|
13616
|
+
<xsl:element name="origin" namespace="{$namespace_full}">
|
13617
|
+
<xsl:copy-of select="@*"/>
|
13618
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
13619
|
+
</xsl:element>
|
13620
|
+
</xsl:template>
|
13621
|
+
|
13622
|
+
<xsl:template match="*[local-name() = 'erefstack']"/>
|
13623
|
+
<xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_step1"/>
|
13624
|
+
<xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_pres"/>
|
13625
|
+
|
13626
|
+
<xsl:template match="*[local-name() = 'svgmap']"/>
|
13627
|
+
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
|
13628
|
+
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
|
13629
|
+
|
13285
13630
|
<!-- END: update new Presentation XML -->
|
13286
13631
|
|
13287
13632
|
<!-- =========================================================================== -->
|
@@ -13354,7 +13699,7 @@
|
|
13354
13699
|
|
13355
13700
|
<xsl:choose>
|
13356
13701
|
<xsl:when test="$page_sequence_at_top = 'true'">
|
13357
|
-
<xsl:for-each select="ancestor::*[ancestor::*[
|
13702
|
+
<xsl:for-each select="ancestor::*[ancestor::*[local-name() = 'metanorma']]">
|
13358
13703
|
<element pos="{position()}">
|
13359
13704
|
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
13360
13705
|
<xsl:value-of select="name()"/>
|
@@ -13886,7 +14231,7 @@
|
|
13886
14231
|
</xsl:when>
|
13887
14232
|
<xsl:when test="contains($text, $replace)">
|
13888
14233
|
<xsl:value-of select="substring-before($text,$replace)"/>
|
13889
|
-
<xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/
|
14234
|
+
<xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/standoc"><xsl:value-of select="$by"/></xsl:element>
|
13890
14235
|
<xsl:call-template name="replaceChar">
|
13891
14236
|
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
|
13892
14237
|
<xsl:with-param name="replace" select="$replace"/>
|
@@ -13923,7 +14268,7 @@
|
|
13923
14268
|
</xsl:variable>
|
13924
14269
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
13925
14270
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
13926
|
-
<xsl:variable name="lang" select="ancestor::*[
|
14271
|
+
<xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
13927
14272
|
<xsl:variable name="reference" select="@reference"/>
|
13928
14273
|
<!-- fn sequence number in document -->
|
13929
14274
|
<xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
@@ -13971,7 +14316,7 @@
|
|
13971
14316
|
</xsl:template>
|
13972
14317
|
|
13973
14318
|
<xsl:template name="printEdition">
|
13974
|
-
<xsl:variable name="edition_i18n" select="normalize-space((//*[
|
14319
|
+
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
13975
14320
|
|
13976
14321
|
<xsl:choose>
|
13977
14322
|
<xsl:when test="$edition_i18n != ''">
|
@@ -13981,7 +14326,7 @@
|
|
13981
14326
|
</xsl:call-template>
|
13982
14327
|
</xsl:when>
|
13983
14328
|
<xsl:otherwise>
|
13984
|
-
<xsl:variable name="edition" select="normalize-space((//*[
|
14329
|
+
<xsl:variable name="edition" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
|
13985
14330
|
<xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
|
13986
14331
|
<xsl:call-template name="capitalize">
|
13987
14332
|
<xsl:with-param name="str">
|
@@ -14115,7 +14460,7 @@
|
|
14115
14460
|
<xsl:param name="charDelim" select="', '"/>
|
14116
14461
|
<xsl:choose>
|
14117
14462
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
14118
|
-
<xsl:for-each select="//*[
|
14463
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
14119
14464
|
<xsl:sort data-type="text" order="ascending"/>
|
14120
14465
|
<xsl:call-template name="insertKeyword">
|
14121
14466
|
<xsl:with-param name="meta" select="$meta"/>
|
@@ -14125,7 +14470,7 @@
|
|
14125
14470
|
</xsl:for-each>
|
14126
14471
|
</xsl:when>
|
14127
14472
|
<xsl:otherwise>
|
14128
|
-
<xsl:for-each select="//*[
|
14473
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
14129
14474
|
<xsl:call-template name="insertKeyword">
|
14130
14475
|
<xsl:with-param name="meta" select="$meta"/>
|
14131
14476
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -14200,7 +14545,7 @@
|
|
14200
14545
|
<!-- Dublin Core properties go here -->
|
14201
14546
|
<dc:title>
|
14202
14547
|
<xsl:variable name="title">
|
14203
|
-
<xsl:for-each select="(//*[
|
14548
|
+
<xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
|
14204
14549
|
|
14205
14550
|
<xsl:choose>
|
14206
14551
|
<xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
|
@@ -14227,7 +14572,7 @@
|
|
14227
14572
|
</rdf:Alt>
|
14228
14573
|
</dc:title>
|
14229
14574
|
<xsl:variable name="dc_creator">
|
14230
|
-
<xsl:for-each select="(//*[
|
14575
|
+
<xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
|
14231
14576
|
|
14232
14577
|
<rdf:Seq>
|
14233
14578
|
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
@@ -14249,7 +14594,7 @@
|
|
14249
14594
|
<xsl:variable name="dc_description">
|
14250
14595
|
<xsl:variable name="abstract">
|
14251
14596
|
|
14252
|
-
<xsl:copy-of select="//*[
|
14597
|
+
<xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
|
14253
14598
|
|
14254
14599
|
</xsl:variable>
|
14255
14600
|
<rdf:Alt>
|
@@ -14277,7 +14622,7 @@
|
|
14277
14622
|
</rdf:RDF>
|
14278
14623
|
</x:xmpmeta>
|
14279
14624
|
<!-- add attachments -->
|
14280
|
-
<xsl:for-each select="//*[
|
14625
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
14281
14626
|
<xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
|
14282
14627
|
<xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
|
14283
14628
|
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
|
@@ -14311,7 +14656,7 @@
|
|
14311
14656
|
</pdf:embedded-file>
|
14312
14657
|
</xsl:for-each>
|
14313
14658
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
14314
|
-
<xsl:if test="not(//*[
|
14659
|
+
<xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
14315
14660
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
14316
14661
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
14317
14662
|
<xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
|
@@ -14513,9 +14858,9 @@
|
|
14513
14858
|
<xsl:variable name="XSLNS">
|
14514
14859
|
|
14515
14860
|
</xsl:variable>
|
14516
|
-
<xsl:if test="$documentNS != $XSLNS">
|
14861
|
+
<!-- <xsl:if test="$documentNS != $XSLNS">
|
14517
14862
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
14518
|
-
</xsl:if>
|
14863
|
+
</xsl:if> -->
|
14519
14864
|
</xsl:template> <!-- namespaceCheck -->
|
14520
14865
|
|
14521
14866
|
<xsl:template name="getLanguage">
|
@@ -14594,10 +14939,10 @@
|
|
14594
14939
|
|
14595
14940
|
<xsl:variable name="data_value">
|
14596
14941
|
<xsl:choose>
|
14597
|
-
<xsl:when test="$formatted = 'true' and string-length($bibdata_updated) !=
|
14942
|
+
<xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != 0">
|
14598
14943
|
<xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
14599
14944
|
</xsl:when>
|
14600
|
-
<xsl:when test="string-length($bibdata_updated) !=
|
14945
|
+
<xsl:when test="string-length($bibdata_updated) != 0">
|
14601
14946
|
<xsl:value-of select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
14602
14947
|
</xsl:when>
|
14603
14948
|
<xsl:when test="$formatted = 'true'">
|
@@ -14735,7 +15080,7 @@
|
|
14735
15080
|
<!-- background image -->
|
14736
15081
|
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
|
14737
15082
|
<fo:block>
|
14738
|
-
<xsl:for-each select="/*[
|
15083
|
+
<xsl:for-each select="/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
|
14739
15084
|
<xsl:choose>
|
14740
15085
|
<xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
|
14741
15086
|
<fo:instream-foreign-object fox:alt-text="Image Front">
|