metanorma-iec 1.4.1 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Rakefile +1 -1
- data/lib/asciidoctor/iec/converter.rb +43 -26
- data/lib/asciidoctor/iec/front.rb +2 -3
- data/lib/asciidoctor/iec/iec.rng +48 -0
- data/lib/asciidoctor/iec/isodoc.rng +61 -18
- data/lib/asciidoctor/iec/isostandard.rng +14 -0
- data/lib/isodoc/iec/base_convert.rb +23 -58
- data/lib/isodoc/iec/html/htmlstyle.css +37 -5
- data/lib/isodoc/iec/html/htmlstyle.scss +34 -5
- data/lib/isodoc/iec/html/isodoc.css +1 -2
- data/lib/isodoc/iec/html/isodoc.scss +1 -2
- data/lib/isodoc/iec/html/scripts.html +0 -1
- data/lib/isodoc/iec/html/wordstyle.css +13 -11
- data/lib/isodoc/iec/html/wordstyle.scss +13 -11
- data/lib/isodoc/iec/iec.international-standard.xsl +428 -111
- data/lib/isodoc/iec/presentation_xml_convert.rb +193 -5
- data/lib/metanorma/iec/processor.rb +15 -8
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +2 -2
- data/spec/asciidoctor/base_spec.rb +0 -4
- data/spec/asciidoctor/cleanup_spec.rb +231 -202
- data/spec/asciidoctor/iev_spec.rb +195 -190
- data/spec/isodoc/iev_spec.rb +459 -118
- data/spec/isodoc/postproc_spec.rb +2 -5
- data/spec/isodoc/terms_spec.rb +183 -181
- data/spec/metanorma/processor_spec.rb +139 -44
- data/spec/spec_helper.rb +10 -12
- metadata +6 -6
@@ -7,6 +7,8 @@
|
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
8
|
<xsl:param name="basepath"/>
|
9
9
|
|
10
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
|
11
|
+
|
10
12
|
|
11
13
|
|
12
14
|
<xsl:param name="additionalXMLs" select="''"/> <!-- iec-rice.fr.xml -->
|
@@ -137,6 +139,7 @@
|
|
137
139
|
<contents>
|
138
140
|
<xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
|
139
141
|
<xsl:call-template name="processMainSectionsDefault_Contents"/>
|
142
|
+
<xsl:apply-templates select="//iec:indexsect" mode="contents"/>
|
140
143
|
<xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
|
141
144
|
<figure id="{@id}">
|
142
145
|
<title><xsl:value-of select="*[local-name() = 'name']/text()"/></title>
|
@@ -157,6 +160,8 @@
|
|
157
160
|
<xsl:call-template name="getLang"/>
|
158
161
|
</xsl:variable>
|
159
162
|
|
163
|
+
<xsl:variable name="isIEV" select="normalize-space((//iec:iec-standard/iec:bibdata/iec:title[@language = 'en' and @type = 'title-main'] = 'International Electrotechnical Vocabulary') and 1 = 1)"/>
|
164
|
+
|
160
165
|
<xsl:template match="/">
|
161
166
|
<xsl:call-template name="namespaceCheck"/>
|
162
167
|
<!-- https://stackoverflow.com/questions/25261949/xsl-fo-letter-spacing-with-text-align -->
|
@@ -1088,6 +1093,9 @@
|
|
1088
1093
|
<xsl:if test="$num = '1'">
|
1089
1094
|
<xsl:attribute name="initial-page-number">2</xsl:attribute>
|
1090
1095
|
</xsl:if>
|
1096
|
+
<xsl:if test="$isIEV = 'true'">
|
1097
|
+
<xsl:attribute name="format">I</xsl:attribute>
|
1098
|
+
</xsl:if>
|
1091
1099
|
|
1092
1100
|
<xsl:call-template name="insertHeaderFooter"/>
|
1093
1101
|
<fo:flow flow-name="xsl-region-body">
|
@@ -1445,9 +1453,12 @@
|
|
1445
1453
|
<xsl:if test="@level = 2">
|
1446
1454
|
<xsl:attribute name="margin-bottom">3pt</xsl:attribute>
|
1447
1455
|
</xsl:if>
|
1448
|
-
<xsl:if test="@level
|
1456
|
+
<xsl:if test="@level >= 3">
|
1449
1457
|
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
1450
1458
|
</xsl:if>
|
1459
|
+
<xsl:if test="@type = 'indexsect'">
|
1460
|
+
<xsl:attribute name="space-before">16pt</xsl:attribute>
|
1461
|
+
</xsl:if>
|
1451
1462
|
<!-- <xsl:if test="@level >= 2 and @section != ''">
|
1452
1463
|
<xsl:attribute name="margin-left">5mm</xsl:attribute>
|
1453
1464
|
</xsl:if> -->
|
@@ -1458,7 +1469,7 @@
|
|
1458
1469
|
<xsl:attribute name="margin-left">
|
1459
1470
|
<xsl:choose>
|
1460
1471
|
<xsl:when test="@level = 2">8mm</xsl:when>
|
1461
|
-
<xsl:when test="@level
|
1472
|
+
<xsl:when test="@level >= 3"><xsl:value-of select="(@level - 2) * 23"/>mm</xsl:when>
|
1462
1473
|
<xsl:otherwise>0mm</xsl:otherwise>
|
1463
1474
|
</xsl:choose>
|
1464
1475
|
</xsl:attribute>
|
@@ -1467,7 +1478,7 @@
|
|
1467
1478
|
<xsl:when test="@section = ''">0mm</xsl:when>
|
1468
1479
|
<xsl:when test="@level = 1">8mm</xsl:when>
|
1469
1480
|
<xsl:when test="@level = 2">15mm</xsl:when>
|
1470
|
-
<xsl:when test="@level
|
1481
|
+
<xsl:when test="@level >= 3"><xsl:value-of select="(@level - 2) * 19"/>mm</xsl:when>
|
1471
1482
|
<xsl:otherwise>0mm</xsl:otherwise>
|
1472
1483
|
</xsl:choose>
|
1473
1484
|
</xsl:attribute>
|
@@ -1570,7 +1581,10 @@
|
|
1570
1581
|
<xsl:template name="insertBodypages">
|
1571
1582
|
<xsl:param name="lang" select="'en'"/>
|
1572
1583
|
<!-- BODY -->
|
1573
|
-
<fo:page-sequence master-reference="document" force-page-count="no-force">
|
1584
|
+
<fo:page-sequence master-reference="document" force-page-count="no-force">
|
1585
|
+
<xsl:if test="$isIEV = 'true'">
|
1586
|
+
<xsl:attribute name="initial-page-number">1</xsl:attribute>
|
1587
|
+
</xsl:if>
|
1574
1588
|
<fo:static-content flow-name="xsl-footnote-separator">
|
1575
1589
|
<fo:block>
|
1576
1590
|
<fo:leader leader-pattern="rule" leader-length="30%"/>
|
@@ -1612,6 +1626,10 @@
|
|
1612
1626
|
|
1613
1627
|
</fo:flow>
|
1614
1628
|
</fo:page-sequence>
|
1629
|
+
|
1630
|
+
<!-- Index -->
|
1631
|
+
<xsl:apply-templates select="//iec:indexsect" mode="index"/>
|
1632
|
+
|
1615
1633
|
</xsl:template>
|
1616
1634
|
|
1617
1635
|
|
@@ -1712,7 +1730,7 @@
|
|
1712
1730
|
|
1713
1731
|
<xsl:variable name="display">
|
1714
1732
|
<xsl:choose>
|
1715
|
-
<xsl:when test="$level >
|
1733
|
+
<xsl:when test="$level > $toc_level">false</xsl:when>
|
1716
1734
|
<xsl:when test="$section = '' and $type = 'clause'">false</xsl:when><!-- don't show clause with number only in title -->
|
1717
1735
|
<xsl:otherwise>true</xsl:otherwise>
|
1718
1736
|
</xsl:choose>
|
@@ -1737,9 +1755,15 @@
|
|
1737
1755
|
<xsl:if test="$type ='appendix'">
|
1738
1756
|
<xsl:attribute name="section"/>
|
1739
1757
|
</xsl:if>
|
1758
|
+
<xsl:if test="$type ='indexsect'">
|
1759
|
+
<xsl:attribute name="level">1</xsl:attribute>
|
1760
|
+
</xsl:if>
|
1740
1761
|
<title>
|
1741
1762
|
<xsl:choose>
|
1742
|
-
<xsl:when test="$type = 'foreword' or $type = 'introduction'">
|
1763
|
+
<!-- <xsl:when test="$type = 'foreword' or $type = 'introduction'">
|
1764
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
|
1765
|
+
</xsl:when> -->
|
1766
|
+
<xsl:when test="$type = 'indexsect'">
|
1743
1767
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($title))"/>
|
1744
1768
|
</xsl:when>
|
1745
1769
|
<xsl:when test="$type = 'appendix'">
|
@@ -1750,7 +1774,9 @@
|
|
1750
1774
|
</xsl:otherwise>
|
1751
1775
|
</xsl:choose>
|
1752
1776
|
</title>
|
1753
|
-
<xsl:
|
1777
|
+
<xsl:if test="$type != 'indexsect'">
|
1778
|
+
<xsl:apply-templates mode="contents"/>
|
1779
|
+
</xsl:if>
|
1754
1780
|
</item>
|
1755
1781
|
|
1756
1782
|
</xsl:if>
|
@@ -1850,7 +1876,8 @@
|
|
1850
1876
|
<xsl:template match="iec:iec-standard/iec:preface/iec:foreword" priority="3">
|
1851
1877
|
<fo:block id="{@id}" margin-bottom="12pt" font-size="12pt" text-align="center">
|
1852
1878
|
<xsl:call-template name="addLetterSpacing">
|
1853
|
-
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(iec:title))"/>
|
1879
|
+
<!-- <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(iec:title))"/> -->
|
1880
|
+
<xsl:with-param name="text" select="iec:title"/>
|
1854
1881
|
</xsl:call-template>
|
1855
1882
|
</fo:block>
|
1856
1883
|
<fo:block font-size="8.2pt" text-align="justify"> <!-- margin-left="6.3mm" -->
|
@@ -1910,7 +1937,8 @@
|
|
1910
1937
|
</xsl:template>
|
1911
1938
|
<xsl:template match="iec:introduction/iec:title/text()">
|
1912
1939
|
<xsl:call-template name="addLetterSpacing">
|
1913
|
-
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(.))"/>
|
1940
|
+
<!-- <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(.))"/> -->
|
1941
|
+
<xsl:with-param name="text" select="."/>
|
1914
1942
|
</xsl:call-template>
|
1915
1943
|
</xsl:template>
|
1916
1944
|
|
@@ -1934,7 +1962,7 @@
|
|
1934
1962
|
</xsl:template>
|
1935
1963
|
|
1936
1964
|
|
1937
|
-
<xsl:template match="iec:title">
|
1965
|
+
<xsl:template match="iec:title" name="title">
|
1938
1966
|
|
1939
1967
|
<xsl:variable name="level">
|
1940
1968
|
<xsl:call-template name="getLevel"/>
|
@@ -2030,6 +2058,7 @@
|
|
2030
2058
|
<!-- <xsl:if test="ancestor::iec:dl and ancestor::iec:figure">
|
2031
2059
|
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
|
2032
2060
|
</xsl:if> -->
|
2061
|
+
<xsl:apply-templates select="@language"/>
|
2033
2062
|
<xsl:apply-templates/>
|
2034
2063
|
</xsl:element>
|
2035
2064
|
</xsl:when>
|
@@ -2052,37 +2081,6 @@
|
|
2052
2081
|
</xsl:if> -->
|
2053
2082
|
</xsl:template>
|
2054
2083
|
|
2055
|
-
<!--
|
2056
|
-
<fn reference="1">
|
2057
|
-
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
2058
|
-
</fn>
|
2059
|
-
-->
|
2060
|
-
<xsl:template match="iec:p/iec:fn" priority="2">
|
2061
|
-
<fo:footnote>
|
2062
|
-
<xsl:variable name="number">
|
2063
|
-
<xsl:number level="any" count="iec:p/iec:fn"/>
|
2064
|
-
</xsl:variable>
|
2065
|
-
<xsl:variable name="lang">
|
2066
|
-
<xsl:call-template name="getLang"/>
|
2067
|
-
</xsl:variable>
|
2068
|
-
<fo:inline font-size="8pt" keep-with-previous.within-line="always" baseline-shift="15%"> <!-- font-size="80%" vertical-align="super"-->
|
2069
|
-
<fo:basic-link internal-destination="{$lang}_footnote_{@reference}" fox:alt-text="footnote {@reference}">
|
2070
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
2071
|
-
<xsl:value-of select="$number + count(//iec:bibitem/iec:note)"/><!-- <xsl:text>)</xsl:text> -->
|
2072
|
-
</fo:basic-link>
|
2073
|
-
</fo:inline>
|
2074
|
-
<fo:footnote-body>
|
2075
|
-
<fo:block font-size="8pt" margin-bottom="5pt">
|
2076
|
-
<fo:inline id="{$lang}_footnote_{@reference}" keep-with-next.within-line="always" baseline-shift="15%" padding-right="3mm"> <!-- padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
|
2077
|
-
<xsl:value-of select="$number + count(//iec:bibitem/iec:note)"/><!-- <xsl:text>)</xsl:text> -->
|
2078
|
-
</fo:inline>
|
2079
|
-
<!-- <xsl:for-each select="iec:p"> -->
|
2080
|
-
<xsl:apply-templates/>
|
2081
|
-
<!-- </xsl:for-each> -->
|
2082
|
-
</fo:block>
|
2083
|
-
</fo:footnote-body>
|
2084
|
-
</fo:footnote>
|
2085
|
-
</xsl:template>
|
2086
2084
|
|
2087
2085
|
<xsl:template match="iec:p/iec:fn/iec:p">
|
2088
2086
|
<xsl:apply-templates/>
|
@@ -2165,12 +2163,11 @@
|
|
2165
2163
|
<xsl:template match="iec:li">
|
2166
2164
|
<fo:list-item>
|
2167
2165
|
<fo:list-item-label end-indent="label-end()">
|
2168
|
-
<xsl:if test="local-name(..) = 'ul'">
|
2169
|
-
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2170
|
-
</xsl:if>
|
2171
2166
|
<fo:block>
|
2172
2167
|
<xsl:choose>
|
2173
|
-
<xsl:when test="local-name(..) = 'ul'"
|
2168
|
+
<xsl:when test="local-name(..) = 'ul'">
|
2169
|
+
<xsl:call-template name="setULLabel"/>
|
2170
|
+
</xsl:when>
|
2174
2171
|
<xsl:otherwise> <!-- for ordered lists -->
|
2175
2172
|
<xsl:choose>
|
2176
2173
|
<xsl:when test="../@type = 'arabic'">
|
@@ -2222,10 +2219,13 @@
|
|
2222
2219
|
<xsl:call-template name="getLevelTermName"/>
|
2223
2220
|
</xsl:variable>
|
2224
2221
|
<fo:block line-height="1.1" space-before="14pt" role="H{$levelTerm}">
|
2222
|
+
<xsl:if test="parent::iec:term">
|
2223
|
+
<fo:block font-weight="bold" keep-with-next="always">
|
2224
|
+
<xsl:apply-templates select="ancestor::iec:term[1]/iec:name" mode="presentation"/>
|
2225
|
+
</fo:block>
|
2226
|
+
</xsl:if>
|
2225
2227
|
<fo:block font-weight="bold" keep-with-next="always">
|
2226
|
-
<xsl:
|
2227
|
-
</fo:block>
|
2228
|
-
<fo:block font-weight="bold" keep-with-next="always">
|
2228
|
+
<xsl:call-template name="setStyle_preferred"/>
|
2229
2229
|
<xsl:apply-templates/>
|
2230
2230
|
</fo:block>
|
2231
2231
|
</fo:block>
|
@@ -2335,7 +2335,63 @@
|
|
2335
2335
|
</fo:block>
|
2336
2336
|
</xsl:template>
|
2337
2337
|
|
2338
|
+
<!-- =================== -->
|
2339
|
+
<!-- Index processing -->
|
2340
|
+
<!-- =================== -->
|
2341
|
+
|
2342
|
+
<xsl:template match="iec:indexsect"/>
|
2343
|
+
<xsl:template match="iec:indexsect" mode="index">
|
2344
|
+
|
2345
|
+
<fo:page-sequence master-reference="document" force-page-count="no-force">
|
2346
|
+
<xsl:call-template name="insertHeaderFooter"/>
|
2347
|
+
<fo:flow flow-name="xsl-region-body">
|
2348
|
+
<fo:block id="{@id}" span="all">
|
2349
|
+
<xsl:apply-templates select="iec:title"/>
|
2350
|
+
</fo:block>
|
2351
|
+
<fo:block role="Index">
|
2352
|
+
<xsl:apply-templates select="*[not(local-name() = 'title')]"/>
|
2353
|
+
</fo:block>
|
2354
|
+
</fo:flow>
|
2355
|
+
</fo:page-sequence>
|
2356
|
+
</xsl:template>
|
2357
|
+
|
2358
|
+
<xsl:template match="iec:indexsect/iec:title" priority="4">
|
2359
|
+
<fo:block font-size="12pt" font-weight="bold" margin-bottom="84pt" role="H1">
|
2360
|
+
<!-- Index -->
|
2361
|
+
<xsl:apply-templates/>
|
2362
|
+
</fo:block>
|
2363
|
+
</xsl:template>
|
2364
|
+
|
2365
|
+
<xsl:template match="iec:indexsect/iec:title/text()" priority="4">
|
2366
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
|
2367
|
+
</xsl:template>
|
2338
2368
|
|
2369
|
+
<xsl:template match="iec:indexsect/iec:clause/iec:title" priority="4">
|
2370
|
+
<!-- Letter A, B, C, ... -->
|
2371
|
+
<fo:block font-size="10pt" font-weight="bold" margin-bottom="3pt" keep-with-next="always">
|
2372
|
+
<xsl:apply-templates/>
|
2373
|
+
</fo:block>
|
2374
|
+
</xsl:template>
|
2375
|
+
|
2376
|
+
<xsl:template match="iec:indexsect//iec:li/text()">
|
2377
|
+
<!-- to split by '_' and other chars -->
|
2378
|
+
<xsl:call-template name="add-zero-spaces-java"/>
|
2379
|
+
</xsl:template>
|
2380
|
+
|
2381
|
+
<xsl:template match="iec:xref[@pagenumber = 'true']" priority="2">
|
2382
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
2383
|
+
<fo:inline>
|
2384
|
+
<xsl:if test="@id">
|
2385
|
+
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
2386
|
+
</xsl:if>
|
2387
|
+
<fo:page-number-citation ref-id="{@target}"/>
|
2388
|
+
</fo:inline>
|
2389
|
+
</fo:basic-link>
|
2390
|
+
</xsl:template>
|
2391
|
+
|
2392
|
+
<!-- =================== -->
|
2393
|
+
<!-- End of Index processing -->
|
2394
|
+
<!-- =================== -->
|
2339
2395
|
|
2340
2396
|
<xsl:template name="insertHeaderFooter">
|
2341
2397
|
<fo:static-content flow-name="header-even" role="artifact">
|
@@ -3058,6 +3114,77 @@
|
|
3058
3114
|
|
3059
3115
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
3060
3116
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
3117
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
3118
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
3119
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
3120
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
3121
|
+
|
3122
|
+
|
3123
|
+
|
3124
|
+
|
3125
|
+
|
3126
|
+
|
3127
|
+
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
3128
|
+
<xsl:attribute name="baseline-shift">15%</xsl:attribute>
|
3129
|
+
|
3130
|
+
|
3131
|
+
|
3132
|
+
|
3133
|
+
|
3134
|
+
|
3135
|
+
|
3136
|
+
|
3137
|
+
|
3138
|
+
|
3139
|
+
|
3140
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
3141
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
3142
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
3143
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
3144
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
3145
|
+
|
3146
|
+
|
3147
|
+
|
3148
|
+
|
3149
|
+
|
3150
|
+
|
3151
|
+
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
3152
|
+
<xsl:attribute name="margin-bottom">5pt</xsl:attribute>
|
3153
|
+
|
3154
|
+
|
3155
|
+
|
3156
|
+
|
3157
|
+
|
3158
|
+
|
3159
|
+
|
3160
|
+
|
3161
|
+
|
3162
|
+
|
3163
|
+
|
3164
|
+
|
3165
|
+
|
3166
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
3167
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
3168
|
+
|
3169
|
+
|
3170
|
+
|
3171
|
+
|
3172
|
+
|
3173
|
+
|
3174
|
+
<xsl:attribute name="baseline-shift">15%</xsl:attribute>
|
3175
|
+
<xsl:attribute name="padding-right">3mm</xsl:attribute>
|
3176
|
+
|
3177
|
+
|
3178
|
+
|
3179
|
+
|
3180
|
+
|
3181
|
+
|
3182
|
+
|
3183
|
+
|
3184
|
+
|
3185
|
+
|
3186
|
+
|
3187
|
+
|
3061
3188
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
|
3062
3189
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
3063
3190
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -3083,7 +3210,8 @@
|
|
3083
3210
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
3084
3211
|
|
3085
3212
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
3086
|
-
|
3213
|
+
|
3214
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
|
3087
3215
|
<xsl:sort select="@displayorder" data-type="number"/>
|
3088
3216
|
<xsl:apply-templates select="." mode="contents"/>
|
3089
3217
|
</xsl:for-each>
|
@@ -3093,7 +3221,7 @@
|
|
3093
3221
|
<xsl:apply-templates select="." mode="contents"/>
|
3094
3222
|
</xsl:for-each>
|
3095
3223
|
|
3096
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
3224
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
3097
3225
|
<xsl:sort select="@displayorder" data-type="number"/>
|
3098
3226
|
<xsl:apply-templates select="." mode="contents"/>
|
3099
3227
|
</xsl:for-each>
|
@@ -4047,6 +4175,102 @@
|
|
4047
4175
|
|
4048
4176
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
|
4049
4177
|
<xsl:apply-templates/>
|
4178
|
+
</xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
|
4179
|
+
|
4180
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
4181
|
+
<xsl:variable name="p_fn_">
|
4182
|
+
<xsl:choose>
|
4183
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
4184
|
+
<fn gen_id="{generate-id(.)}">
|
4185
|
+
<xsl:copy-of select="@*"/>
|
4186
|
+
<xsl:copy-of select="node()"/>
|
4187
|
+
</fn>
|
4188
|
+
</xsl:when>
|
4189
|
+
<xsl:otherwise>
|
4190
|
+
<!-- itetation for:
|
4191
|
+
footnotes in bibdata/title
|
4192
|
+
footnotes in bibliography
|
4193
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
4194
|
+
-->
|
4195
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
4196
|
+
<fn gen_id="{generate-id(.)}">
|
4197
|
+
<xsl:copy-of select="@*"/>
|
4198
|
+
<xsl:copy-of select="node()"/>
|
4199
|
+
</fn>
|
4200
|
+
</xsl:for-each>
|
4201
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
|
4202
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
4203
|
+
<xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
4204
|
+
<!-- copy unique fn -->
|
4205
|
+
<fn gen_id="{generate-id(.)}">
|
4206
|
+
<xsl:copy-of select="@*"/>
|
4207
|
+
<xsl:copy-of select="node()"/>
|
4208
|
+
</fn>
|
4209
|
+
</xsl:for-each>
|
4210
|
+
</xsl:for-each>
|
4211
|
+
</xsl:otherwise>
|
4212
|
+
</xsl:choose>
|
4213
|
+
</xsl:variable>
|
4214
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
4215
|
+
|
4216
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
4217
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
4218
|
+
<xsl:variable name="reference" select="@reference"/>
|
4219
|
+
<!-- fn sequence number in document -->
|
4220
|
+
<xsl:variable name="current_fn_number">
|
4221
|
+
<xsl:choose>
|
4222
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
4223
|
+
<xsl:otherwise>
|
4224
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
4225
|
+
</xsl:otherwise>
|
4226
|
+
</xsl:choose>
|
4227
|
+
</xsl:variable>
|
4228
|
+
<xsl:variable name="current_fn_number_text">
|
4229
|
+
<xsl:value-of select="$current_fn_number"/>
|
4230
|
+
|
4231
|
+
|
4232
|
+
</xsl:variable>
|
4233
|
+
|
4234
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
4235
|
+
<xsl:variable name="footnote_inline">
|
4236
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
4237
|
+
|
4238
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
4239
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
4240
|
+
</fo:basic-link>
|
4241
|
+
</fo:inline>
|
4242
|
+
</xsl:variable>
|
4243
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
4244
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
4245
|
+
<xsl:choose>
|
4246
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
4247
|
+
<xsl:copy-of select="$footnote_inline"/>
|
4248
|
+
</xsl:when>
|
4249
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
4250
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
4251
|
+
<xsl:copy-of select="$footnote_inline"/>
|
4252
|
+
<fo:footnote-body>
|
4253
|
+
|
4254
|
+
<fo:block-container text-indent="0" start-indent="0">
|
4255
|
+
|
4256
|
+
|
4257
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
4258
|
+
|
4259
|
+
|
4260
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
4261
|
+
|
4262
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
4263
|
+
</fo:inline>
|
4264
|
+
<xsl:apply-templates/>
|
4265
|
+
</fo:block>
|
4266
|
+
</fo:block-container>
|
4267
|
+
</fo:footnote-body>
|
4268
|
+
</fo:footnote>
|
4269
|
+
</xsl:when>
|
4270
|
+
<xsl:otherwise>
|
4271
|
+
<xsl:copy-of select="$footnote_inline"/>
|
4272
|
+
</xsl:otherwise>
|
4273
|
+
</xsl:choose>
|
4050
4274
|
</xsl:template><xsl:template name="fn_display">
|
4051
4275
|
<xsl:variable name="references">
|
4052
4276
|
|
@@ -4260,6 +4484,8 @@
|
|
4260
4484
|
|
4261
4485
|
</fo:basic-link>
|
4262
4486
|
</fo:inline>
|
4487
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
4488
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
4263
4489
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
4264
4490
|
<fo:inline>
|
4265
4491
|
<xsl:apply-templates/>
|
@@ -4637,6 +4863,7 @@
|
|
4637
4863
|
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
4638
4864
|
<xsl:apply-templates/>
|
4639
4865
|
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
4866
|
+
<xsl:apply-templates select="@language"/>
|
4640
4867
|
<xsl:apply-templates/>
|
4641
4868
|
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
4642
4869
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
@@ -5274,22 +5501,6 @@
|
|
5274
5501
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
5275
5502
|
<xsl:apply-templates/>
|
5276
5503
|
</fo:inline>
|
5277
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
5278
|
-
<xsl:variable name="title-modified">
|
5279
|
-
|
5280
|
-
|
5281
|
-
<xsl:call-template name="getTitle">
|
5282
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
5283
|
-
</xsl:call-template>
|
5284
|
-
|
5285
|
-
</xsl:variable>
|
5286
|
-
|
5287
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
5288
|
-
<xsl:choose>
|
5289
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
5290
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
5291
|
-
</xsl:choose>
|
5292
|
-
<xsl:apply-templates/>
|
5293
5504
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
5294
5505
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
5295
5506
|
|
@@ -5856,12 +6067,12 @@
|
|
5856
6067
|
</xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
5857
6068
|
<xsl:apply-templates mode="contents"/>
|
5858
6069
|
<xsl:text> </xsl:text>
|
5859
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
6070
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
|
5860
6071
|
<xsl:apply-templates mode="bookmarks"/>
|
5861
6072
|
<xsl:text> </xsl:text>
|
5862
6073
|
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
5863
6074
|
<xsl:value-of select="."/>
|
5864
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
6075
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
5865
6076
|
<xsl:value-of select="."/>
|
5866
6077
|
</xsl:template><xsl:template match="node()" mode="contents">
|
5867
6078
|
<xsl:apply-templates mode="contents"/>
|
@@ -6131,6 +6342,8 @@
|
|
6131
6342
|
|
6132
6343
|
|
6133
6344
|
|
6345
|
+
|
6346
|
+
|
6134
6347
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
6135
6348
|
<xsl:variable name="_font-size">
|
6136
6349
|
|
@@ -6164,13 +6377,17 @@
|
|
6164
6377
|
|
6165
6378
|
|
6166
6379
|
|
6380
|
+
|
6381
|
+
|
6167
6382
|
<xsl:apply-templates/>
|
6168
6383
|
</fo:block>
|
6169
|
-
|
6384
|
+
|
6170
6385
|
|
6171
6386
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
6172
6387
|
|
6173
6388
|
|
6389
|
+
|
6390
|
+
|
6174
6391
|
</fo:block-container>
|
6175
6392
|
</fo:block-container>
|
6176
6393
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -6517,62 +6734,69 @@
|
|
6517
6734
|
<xsl:variable name="termsource_text">
|
6518
6735
|
<xsl:apply-templates/>
|
6519
6736
|
</xsl:variable>
|
6520
|
-
|
6521
|
-
<xsl:choose>
|
6737
|
+
<xsl:copy-of select="$termsource_text"/>
|
6738
|
+
<!-- <xsl:choose>
|
6522
6739
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
6523
|
-
<!-- <xsl:apply-templates /> -->
|
6524
6740
|
<xsl:copy-of select="$termsource_text"/>
|
6525
6741
|
</xsl:when>
|
6526
6742
|
<xsl:otherwise>
|
6527
|
-
|
6528
|
-
|
6743
|
+
<xsl:if test="$namespace = 'bsi'">
|
6744
|
+
<xsl:choose>
|
6745
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
6746
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
6747
|
+
</xsl:choose>
|
6748
|
+
</xsl:if>
|
6749
|
+
<xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
|
6529
6750
|
<xsl:text>[</xsl:text>
|
6530
|
-
|
6531
|
-
<!-- <xsl:apply-templates /> -->
|
6751
|
+
</xsl:if>
|
6532
6752
|
<xsl:copy-of select="$termsource_text"/>
|
6533
|
-
|
6534
|
-
|
6753
|
+
<xsl:if test="$namespace = 'bsi'">
|
6754
|
+
<xsl:choose>
|
6755
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
6756
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
6757
|
+
</xsl:choose>
|
6758
|
+
</xsl:if>
|
6759
|
+
<xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
|
6535
6760
|
<xsl:text>]</xsl:text>
|
6536
|
-
|
6761
|
+
</xsl:if>
|
6537
6762
|
</xsl:otherwise>
|
6538
|
-
</xsl:choose>
|
6763
|
+
</xsl:choose> -->
|
6539
6764
|
</fo:block>
|
6540
6765
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
6541
6766
|
<xsl:if test="normalize-space() != ''">
|
6542
6767
|
<xsl:value-of select="."/>
|
6543
6768
|
</xsl:if>
|
6544
|
-
</xsl:template><xsl:
|
6545
|
-
<
|
6546
|
-
|
6547
|
-
|
6548
|
-
|
6769
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
6770
|
+
<fo:inline>
|
6771
|
+
|
6772
|
+
|
6773
|
+
<xsl:value-of select="."/>
|
6774
|
+
</fo:inline>
|
6775
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
6549
6776
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
6550
6777
|
<xsl:if test="normalize-space(@citeas) = ''">
|
6551
6778
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
6552
6779
|
</xsl:if>
|
6553
|
-
|
6554
|
-
|
6555
|
-
<fo:inline>
|
6556
|
-
|
6557
|
-
|
6558
|
-
|
6559
|
-
|
6560
|
-
|
6561
|
-
|
6562
|
-
|
6563
|
-
<xsl:call-template name="getTitle">
|
6564
|
-
<xsl:with-param name="name" select="'title-source'"/>
|
6565
|
-
</xsl:call-template>
|
6566
|
-
<xsl:text>: </xsl:text>
|
6567
|
-
|
6568
|
-
|
6569
|
-
</fo:inline>
|
6570
|
-
|
6571
6780
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
6572
6781
|
<xsl:apply-templates/>
|
6573
6782
|
</fo:inline>
|
6783
|
+
</fo:basic-link>
|
6784
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
6785
|
+
<xsl:variable name="title-modified">
|
6574
6786
|
|
6575
|
-
|
6787
|
+
|
6788
|
+
<xsl:call-template name="getTitle">
|
6789
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
6790
|
+
</xsl:call-template>
|
6791
|
+
|
6792
|
+
</xsl:variable>
|
6793
|
+
|
6794
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
6795
|
+
<xsl:choose>
|
6796
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
6797
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
6798
|
+
</xsl:choose>
|
6799
|
+
<xsl:apply-templates/>
|
6576
6800
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
6577
6801
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
6578
6802
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -6756,24 +6980,29 @@
|
|
6756
6980
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
6757
6981
|
<xsl:variable name="title-deprecated">
|
6758
6982
|
|
6759
|
-
|
6760
|
-
|
6761
|
-
<xsl:with-param name="name" select="'title-deprecated'"/>
|
6983
|
+
<xsl:call-template name="getLocalizedString">
|
6984
|
+
<xsl:with-param name="key">deprecated</xsl:with-param>
|
6762
6985
|
</xsl:call-template>
|
6763
6986
|
|
6987
|
+
|
6764
6988
|
</xsl:variable>
|
6765
6989
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
6766
6990
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
6767
6991
|
</fo:block>
|
6992
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
6993
|
+
<xsl:if test="*[local-name() = 'strong']">
|
6994
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
6995
|
+
</xsl:if>
|
6768
6996
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
6769
6997
|
<fo:block xsl:use-attribute-sets="definition-style">
|
6770
6998
|
<xsl:apply-templates/>
|
6771
6999
|
</fo:block>
|
6772
7000
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
6773
7001
|
<xsl:apply-templates/>
|
6774
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
7002
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
6775
7003
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
6776
|
-
<fo:block
|
7004
|
+
<!-- <fo:block> </fo:block> -->
|
7005
|
+
<fo:block/>
|
6777
7006
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
6778
7007
|
|
6779
7008
|
<fo:block>
|
@@ -6829,6 +7058,53 @@
|
|
6829
7058
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
6830
7059
|
<!-- 0xA0 to space replacement -->
|
6831
7060
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
7061
|
+
</xsl:template><xsl:variable name="ul_labels_">
|
7062
|
+
|
7063
|
+
|
7064
|
+
|
7065
|
+
|
7066
|
+
|
7067
|
+
<label level="1" font-size="10pt">•</label>
|
7068
|
+
<label level="2" font-size="10pt">—</label><!-- em dash -->
|
7069
|
+
<label level="3" font-size="75%">o</label> <!-- white circle -->
|
7070
|
+
|
7071
|
+
|
7072
|
+
|
7073
|
+
|
7074
|
+
|
7075
|
+
|
7076
|
+
|
7077
|
+
|
7078
|
+
|
7079
|
+
|
7080
|
+
|
7081
|
+
|
7082
|
+
|
7083
|
+
</xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
|
7084
|
+
<xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
7085
|
+
<xsl:variable name="list_level">
|
7086
|
+
<xsl:choose>
|
7087
|
+
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
7088
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
|
7089
|
+
</xsl:choose>
|
7090
|
+
</xsl:variable>
|
7091
|
+
<xsl:choose>
|
7092
|
+
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
7093
|
+
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
7094
|
+
</xsl:when>
|
7095
|
+
<xsl:when test="$list_level mod 3 = 0">
|
7096
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
7097
|
+
</xsl:when>
|
7098
|
+
<xsl:when test="$list_level mod 2 = 0">
|
7099
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
7100
|
+
</xsl:when>
|
7101
|
+
<xsl:otherwise>
|
7102
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
7103
|
+
</xsl:otherwise>
|
7104
|
+
</xsl:choose>
|
7105
|
+
</xsl:template><xsl:template match="label" mode="ul_labels">
|
7106
|
+
<xsl:copy-of select="@*[not(local-name() = 'level')]"/>
|
7107
|
+
<xsl:value-of select="."/>
|
6832
7108
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
6833
7109
|
<xsl:choose>
|
6834
7110
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
@@ -7167,7 +7443,31 @@
|
|
7167
7443
|
<fo:block-container border="1pt solid black" width="50%">
|
7168
7444
|
<fo:block> </fo:block>
|
7169
7445
|
</fo:block-container>
|
7170
|
-
</xsl:template><xsl:
|
7446
|
+
</xsl:template><xsl:variable name="toc_level">
|
7447
|
+
<xsl:choose>
|
7448
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
7449
|
+
<xsl:otherwise><!-- default value -->
|
7450
|
+
|
7451
|
+
|
7452
|
+
|
7453
|
+
|
7454
|
+
|
7455
|
+
3
|
7456
|
+
|
7457
|
+
|
7458
|
+
|
7459
|
+
|
7460
|
+
|
7461
|
+
|
7462
|
+
|
7463
|
+
|
7464
|
+
|
7465
|
+
|
7466
|
+
|
7467
|
+
|
7468
|
+
</xsl:otherwise>
|
7469
|
+
</xsl:choose>
|
7470
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
7171
7471
|
<xsl:param name="colwidths"/>
|
7172
7472
|
<xsl:variable name="colwidths_">
|
7173
7473
|
<xsl:choose>
|
@@ -7258,6 +7558,10 @@
|
|
7258
7558
|
</svg>
|
7259
7559
|
</fo:instream-foreign-object>
|
7260
7560
|
</fo:inline>
|
7561
|
+
</xsl:template><xsl:template match="@language">
|
7562
|
+
<xsl:copy-of select="."/>
|
7563
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
|
7564
|
+
<xsl:call-template name="title"/>
|
7261
7565
|
</xsl:template><xsl:template name="convertDate">
|
7262
7566
|
<xsl:param name="date"/>
|
7263
7567
|
<xsl:param name="format" select="'short'"/>
|
@@ -7702,12 +8006,15 @@
|
|
7702
8006
|
<xsl:param name="default">left</xsl:param>
|
7703
8007
|
<xsl:attribute name="text-align">
|
7704
8008
|
<xsl:choose>
|
7705
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
8009
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
7706
8010
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
7707
8011
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
7708
8012
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
7709
8013
|
</xsl:choose>
|
7710
8014
|
</xsl:attribute>
|
8015
|
+
<xsl:if test="@align = 'indent'">
|
8016
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
8017
|
+
</xsl:if>
|
7711
8018
|
</xsl:template><xsl:template name="number-to-words">
|
7712
8019
|
<xsl:param name="number"/>
|
7713
8020
|
<xsl:param name="first"/>
|
@@ -7804,4 +8111,14 @@
|
|
7804
8111
|
</xsl:otherwise>
|
7805
8112
|
</xsl:choose>
|
7806
8113
|
</xsl:if>
|
8114
|
+
</xsl:template><xsl:template name="setAltText">
|
8115
|
+
<xsl:param name="value"/>
|
8116
|
+
<xsl:attribute name="fox:alt-text">
|
8117
|
+
<xsl:choose>
|
8118
|
+
<xsl:when test="normalize-space($value) != ''">
|
8119
|
+
<xsl:value-of select="$value"/>
|
8120
|
+
</xsl:when>
|
8121
|
+
<xsl:otherwise>_</xsl:otherwise>
|
8122
|
+
</xsl:choose>
|
8123
|
+
</xsl:attribute>
|
7807
8124
|
</xsl:template></xsl:stylesheet>
|