metanorma-un 0.5.3 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +62 -0
- data/README.adoc +2 -4
- data/lib/asciidoctor/un/basicdoc.rng +4 -11
- data/lib/asciidoctor/un/boilerplate.xml +7 -5
- data/lib/asciidoctor/un/isodoc.rng +27 -50
- data/lib/asciidoctor/un/un.rng +7 -0
- data/lib/isodoc/un/html/html_unece_plenary_titlepage.html +17 -1
- data/lib/isodoc/un/html/html_unece_titlepage.html +20 -1
- data/lib/isodoc/un/html/htmlstyle.css +11 -4
- data/lib/isodoc/un/html/htmlstyle.scss +6 -2
- data/lib/isodoc/un/html/unece.css +19 -20
- data/lib/isodoc/un/html/unece.scss +19 -20
- data/lib/isodoc/un/html/word_unece_plenary_titlepage.html +17 -1
- data/lib/isodoc/un/html/word_unece_titlepage.html +17 -1
- data/lib/isodoc/un/html/wordstyle.css +17 -17
- data/lib/isodoc/un/html/wordstyle.scss +17 -17
- data/lib/isodoc/un/html_convert.rb +3 -1
- data/lib/isodoc/un/i18n-en.yaml +1 -0
- data/lib/isodoc/un/pdf_convert.rb +2 -2
- data/lib/isodoc/un/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/un/un.plenary-attachment.xsl +647 -96
- data/lib/isodoc/un/un.plenary.xsl +647 -96
- data/lib/isodoc/un/un.recommendation.xsl +546 -89
- data/lib/isodoc/un/word_convert.rb +5 -1
- data/lib/isodoc/un/xref.rb +5 -5
- data/lib/metanorma/un/fonts_manifest.yaml +6 -0
- data/lib/metanorma/un/processor.rb +0 -8
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-unece.gemspec +2 -2
- metadata +8 -9
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
<xsl:template match="/">
|
41
41
|
<xsl:call-template name="namespaceCheck"/>
|
42
|
-
<fo:root font-family="Times New Roman,
|
42
|
+
<fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
|
43
43
|
<fo:layout-master-set>
|
44
44
|
<!-- Cover page -->
|
45
45
|
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
@@ -85,6 +85,9 @@
|
|
85
85
|
|
86
86
|
<xsl:call-template name="addPDFUAmeta"/>
|
87
87
|
|
88
|
+
<xsl:call-template name="addBookmarks">
|
89
|
+
<xsl:with-param name="contents" select="$contents"/>
|
90
|
+
</xsl:call-template>
|
88
91
|
|
89
92
|
<!-- Cover Page -->
|
90
93
|
<fo:page-sequence master-reference="cover-page" force-page-count="even">
|
@@ -197,7 +200,7 @@
|
|
197
200
|
</xsl:variable>
|
198
201
|
<fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-page"/></fo:block>
|
199
202
|
<fo:block>
|
200
|
-
<xsl:for-each select="xalan:nodeset($contents)//item[not (@type = 'annex' or @parent = 'annex')]">
|
203
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[not (@type = 'annex' or @parent = 'annex') and @display = 'true']">
|
201
204
|
|
202
205
|
<fo:block>
|
203
206
|
|
@@ -208,7 +211,7 @@
|
|
208
211
|
<xsl:if test="@level >= 3 and @section != ''">
|
209
212
|
<xsl:attribute name="margin-left">28mm</xsl:attribute>
|
210
213
|
</xsl:if>
|
211
|
-
<fo:basic-link internal-destination="{@id}" fox:alt-text="{
|
214
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
212
215
|
<xsl:if test="@section != ''">
|
213
216
|
<fo:inline>
|
214
217
|
<xsl:attribute name="padding-right">
|
@@ -222,7 +225,7 @@
|
|
222
225
|
</fo:inline>
|
223
226
|
</xsl:if>
|
224
227
|
|
225
|
-
<xsl:apply-templates/>
|
228
|
+
<xsl:apply-templates select="title"/>
|
226
229
|
<xsl:text> </xsl:text>
|
227
230
|
|
228
231
|
<fo:inline keep-together.within-line="always">
|
@@ -235,12 +238,12 @@
|
|
235
238
|
|
236
239
|
</xsl:for-each>
|
237
240
|
|
238
|
-
<xsl:if test="xalan:nodeset($contents)//item[@type = 'annex']">
|
241
|
+
<xsl:if test="xalan:nodeset($contents)//item[@type = 'annex' and @display = 'true']">
|
239
242
|
<fo:block text-align="center" margin-top="12pt" margin-bottom="12pt">ANNEXES</fo:block>
|
240
|
-
<xsl:for-each select="xalan:nodeset($contents)//item[@type = 'annex']">
|
243
|
+
<xsl:for-each select="xalan:nodeset($contents)//item[@type = 'annex' and @display = 'true']">
|
241
244
|
<fo:block>
|
242
245
|
<fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
|
243
|
-
<fo:basic-link internal-destination="{@id}" fox:alt-text="{
|
246
|
+
<fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
|
244
247
|
<xsl:if test="@section != ''">
|
245
248
|
<fo:inline padding-right="3mm">
|
246
249
|
<xsl:choose>
|
@@ -349,9 +352,7 @@
|
|
349
352
|
|
350
353
|
|
351
354
|
<xsl:variable name="display">
|
352
|
-
<xsl:choose>
|
353
|
-
<xsl:when test="ancestor-or-self::un:bibitem">false</xsl:when>
|
354
|
-
<xsl:when test="ancestor-or-self::un:term">false</xsl:when>
|
355
|
+
<xsl:choose>
|
355
356
|
<xsl:when test="ancestor-or-self::un:annex and $level >= 2">false</xsl:when>
|
356
357
|
<xsl:when test="$level > 3">false</xsl:when>
|
357
358
|
<xsl:when test="@inline-header='true'">false</xsl:when>
|
@@ -359,6 +360,14 @@
|
|
359
360
|
</xsl:choose>
|
360
361
|
</xsl:variable>
|
361
362
|
|
363
|
+
<xsl:variable name="skip">
|
364
|
+
<xsl:choose>
|
365
|
+
<xsl:when test="ancestor-or-self::un:bibitem">true</xsl:when>
|
366
|
+
<xsl:when test="ancestor-or-self::un:term">true</xsl:when>
|
367
|
+
<xsl:when test="@inline-header='true'">true</xsl:when>
|
368
|
+
<xsl:otherwise>false</xsl:otherwise>
|
369
|
+
</xsl:choose>
|
370
|
+
</xsl:variable>
|
362
371
|
|
363
372
|
<xsl:if test="$display = 'true'">
|
364
373
|
|
@@ -374,10 +383,13 @@
|
|
374
383
|
<xsl:value-of select="local-name()"/>
|
375
384
|
</xsl:variable>
|
376
385
|
|
377
|
-
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
|
378
|
-
<
|
386
|
+
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
|
387
|
+
<title>
|
388
|
+
<xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
|
389
|
+
</title>
|
390
|
+
<xsl:apply-templates mode="contents"/>
|
379
391
|
</item>
|
380
|
-
|
392
|
+
|
381
393
|
</xsl:if>
|
382
394
|
|
383
395
|
</xsl:template>
|
@@ -1055,6 +1067,12 @@
|
|
1055
1067
|
|
1056
1068
|
</title-edition>
|
1057
1069
|
|
1070
|
+
<title-edition lang="fr">
|
1071
|
+
|
1072
|
+
<xsl:text>Édition </xsl:text>
|
1073
|
+
|
1074
|
+
</title-edition>
|
1075
|
+
|
1058
1076
|
|
1059
1077
|
<title-toc lang="en">
|
1060
1078
|
|
@@ -1063,7 +1081,12 @@
|
|
1063
1081
|
|
1064
1082
|
|
1065
1083
|
</title-toc>
|
1066
|
-
<title-toc lang="fr">
|
1084
|
+
<title-toc lang="fr">
|
1085
|
+
|
1086
|
+
<xsl:text>Sommaire</xsl:text>
|
1087
|
+
|
1088
|
+
|
1089
|
+
</title-toc>
|
1067
1090
|
|
1068
1091
|
<title-toc lang="zh">Contents</title-toc>
|
1069
1092
|
|
@@ -1083,13 +1106,22 @@
|
|
1083
1106
|
<title-part lang="en">
|
1084
1107
|
|
1085
1108
|
|
1109
|
+
|
1086
1110
|
</title-part>
|
1087
1111
|
<title-part lang="fr">
|
1088
1112
|
|
1089
1113
|
|
1114
|
+
|
1090
1115
|
</title-part>
|
1091
1116
|
<title-part lang="zh">第 # 部分:</title-part>
|
1092
1117
|
|
1118
|
+
<title-subpart lang="en">
|
1119
|
+
|
1120
|
+
</title-subpart>
|
1121
|
+
<title-subpart lang="fr">
|
1122
|
+
|
1123
|
+
</title-subpart>
|
1124
|
+
|
1093
1125
|
<title-modified lang="en">modified</title-modified>
|
1094
1126
|
<title-modified lang="fr">modifiée</title-modified>
|
1095
1127
|
|
@@ -1151,10 +1183,19 @@
|
|
1151
1183
|
|
1152
1184
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
1153
1185
|
<xsl:param name="name"/>
|
1154
|
-
<xsl:
|
1155
|
-
|
1186
|
+
<xsl:param name="lang"/>
|
1187
|
+
<xsl:variable name="lang_">
|
1188
|
+
<xsl:choose>
|
1189
|
+
<xsl:when test="$lang != ''">
|
1190
|
+
<xsl:value-of select="$lang"/>
|
1191
|
+
</xsl:when>
|
1192
|
+
<xsl:otherwise>
|
1193
|
+
<xsl:call-template name="getLang"/>
|
1194
|
+
</xsl:otherwise>
|
1195
|
+
</xsl:choose>
|
1156
1196
|
</xsl:variable>
|
1157
|
-
<xsl:variable name="
|
1197
|
+
<xsl:variable name="language" select="normalize-space($lang_)"/>
|
1198
|
+
<xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
|
1158
1199
|
<xsl:choose>
|
1159
1200
|
<xsl:when test="normalize-space($title_) != ''">
|
1160
1201
|
<xsl:value-of select="$title_"/>
|
@@ -1163,7 +1204,9 @@
|
|
1163
1204
|
<xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
|
1164
1205
|
</xsl:otherwise>
|
1165
1206
|
</xsl:choose>
|
1166
|
-
</xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'
'"/><xsl:attribute-set name="
|
1207
|
+
</xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'
'"/><xsl:attribute-set name="root-style">
|
1208
|
+
|
1209
|
+
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1167
1210
|
|
1168
1211
|
|
1169
1212
|
|
@@ -1297,6 +1340,7 @@
|
|
1297
1340
|
<xsl:attribute name="text-indent">0mm</xsl:attribute>
|
1298
1341
|
|
1299
1342
|
|
1343
|
+
|
1300
1344
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1301
1345
|
|
1302
1346
|
|
@@ -1332,6 +1376,7 @@
|
|
1332
1376
|
<xsl:attribute name="border-top">0.1mm solid black</xsl:attribute>
|
1333
1377
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1334
1378
|
|
1379
|
+
|
1335
1380
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
1336
1381
|
|
1337
1382
|
|
@@ -1399,6 +1444,7 @@
|
|
1399
1444
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1400
1445
|
|
1401
1446
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1447
|
+
|
1402
1448
|
|
1403
1449
|
|
1404
1450
|
|
@@ -1520,6 +1566,10 @@
|
|
1520
1566
|
|
1521
1567
|
|
1522
1568
|
|
1569
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1570
|
+
<fo:block> </fo:block>
|
1571
|
+
</xsl:if> -->
|
1572
|
+
|
1523
1573
|
<!-- $namespace = 'iso' or -->
|
1524
1574
|
|
1525
1575
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -1557,6 +1607,7 @@
|
|
1557
1607
|
<xsl:with-param name="table" select="$simple-table"/>
|
1558
1608
|
</xsl:call-template>
|
1559
1609
|
</xsl:variable>
|
1610
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1560
1611
|
|
1561
1612
|
<!-- <xsl:variable name="colwidths2">
|
1562
1613
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1578,37 +1629,59 @@
|
|
1578
1629
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1579
1630
|
|
1580
1631
|
|
1632
|
+
|
1581
1633
|
|
1582
1634
|
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
1635
|
+
<xsl:if test="not(ancestor::*[local-name()='sections'])">
|
1636
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1637
|
+
</xsl:if>
|
1638
|
+
|
1639
|
+
|
1583
1640
|
|
1584
1641
|
|
1642
|
+
|
1585
1643
|
|
1586
|
-
|
1587
1644
|
|
1588
1645
|
|
1589
1646
|
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1647
|
+
|
1648
|
+
|
1649
|
+
|
1650
|
+
<xsl:variable name="table_attributes">
|
1651
|
+
<attribute name="table-layout">fixed</attribute>
|
1652
|
+
<attribute name="width">100%</attribute>
|
1653
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1654
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1593
1655
|
|
1594
1656
|
|
1595
1657
|
|
1596
1658
|
|
1659
|
+
|
1597
1660
|
|
1598
1661
|
<xsl:if test="ancestor::*[local-name()='sections']">
|
1599
|
-
<
|
1600
|
-
<
|
1601
|
-
</xsl:if>
|
1602
|
-
|
1603
|
-
|
1604
|
-
</xsl:if>
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1662
|
+
<attribute name="border-top">1.5pt solid black</attribute>
|
1663
|
+
<attribute name="border-bottom">1.5pt solid black</attribute>
|
1664
|
+
</xsl:if>
|
1665
|
+
|
1666
|
+
|
1608
1667
|
|
1668
|
+
|
1609
1669
|
|
1670
|
+
</xsl:variable>
|
1671
|
+
|
1672
|
+
|
1673
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1610
1674
|
|
1675
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1676
|
+
<xsl:attribute name="{@name}">
|
1677
|
+
<xsl:value-of select="."/>
|
1678
|
+
</xsl:attribute>
|
1679
|
+
</xsl:for-each>
|
1611
1680
|
|
1681
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1682
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1683
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1684
|
+
</xsl:if>
|
1612
1685
|
|
1613
1686
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1614
1687
|
<xsl:choose>
|
@@ -1632,6 +1705,33 @@
|
|
1632
1705
|
|
1633
1706
|
</fo:table>
|
1634
1707
|
|
1708
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1709
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1710
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1711
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1712
|
+
</xsl:call-template>
|
1713
|
+
</xsl:for-each>
|
1714
|
+
|
1715
|
+
<!-- insert footer as table -->
|
1716
|
+
<!-- <fo:table>
|
1717
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1718
|
+
<xsl:attribute name="{@name}">
|
1719
|
+
<xsl:value-of select="."/>
|
1720
|
+
</xsl:attribute>
|
1721
|
+
</xsl:for-each>
|
1722
|
+
|
1723
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1724
|
+
<xsl:choose>
|
1725
|
+
<xsl:when test=". = 1 or . = 0">
|
1726
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1727
|
+
</xsl:when>
|
1728
|
+
<xsl:otherwise>
|
1729
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1730
|
+
</xsl:otherwise>
|
1731
|
+
</xsl:choose>
|
1732
|
+
</xsl:for-each>
|
1733
|
+
</fo:table>-->
|
1734
|
+
|
1635
1735
|
|
1636
1736
|
|
1637
1737
|
|
@@ -1641,6 +1741,7 @@
|
|
1641
1741
|
<xsl:if test="normalize-space() != ''">
|
1642
1742
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1643
1743
|
|
1744
|
+
|
1644
1745
|
<xsl:apply-templates/>
|
1645
1746
|
</fo:block>
|
1646
1747
|
</xsl:if>
|
@@ -1696,6 +1797,13 @@
|
|
1696
1797
|
<xsl:for-each select="xalan:nodeset($table)//tr">
|
1697
1798
|
<xsl:variable name="td_text">
|
1698
1799
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1800
|
+
|
1801
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1802
|
+
<xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
|
1803
|
+
<word><xsl:value-of select="normalize-space(.)"/></word>
|
1804
|
+
</xsl:for-each>
|
1805
|
+
</xsl:if> -->
|
1806
|
+
|
1699
1807
|
</xsl:variable>
|
1700
1808
|
<xsl:variable name="words">
|
1701
1809
|
<xsl:variable name="string_with_added_zerospaces">
|
@@ -1755,11 +1863,14 @@
|
|
1755
1863
|
<xsl:value-of select="*[local-name()='origin']/@citeas"/>
|
1756
1864
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
1757
1865
|
<xsl:value-of select="@target"/>
|
1866
|
+
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
1867
|
+
<xsl:variable name="math_text" select="normalize-space(.)"/>
|
1868
|
+
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
1758
1869
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
1759
1870
|
<xsl:param name="cols-count"/>
|
1760
1871
|
<!-- font-weight="bold" -->
|
1761
1872
|
<fo:table-header>
|
1762
|
-
|
1873
|
+
|
1763
1874
|
<xsl:apply-templates/>
|
1764
1875
|
</fo:table-header>
|
1765
1876
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -1784,6 +1895,13 @@
|
|
1784
1895
|
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
|
1785
1896
|
<xsl:apply-templates/>
|
1786
1897
|
</xsl:template><xsl:template name="insertTableFooter">
|
1898
|
+
<xsl:param name="cols-count"/>
|
1899
|
+
<xsl:if test="../*[local-name()='tfoot']">
|
1900
|
+
<fo:table-footer>
|
1901
|
+
<xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
|
1902
|
+
</fo:table-footer>
|
1903
|
+
</xsl:if>
|
1904
|
+
</xsl:template><xsl:template name="insertTableFooter2">
|
1787
1905
|
<xsl:param name="cols-count"/>
|
1788
1906
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1789
1907
|
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
|
@@ -1805,11 +1923,29 @@
|
|
1805
1923
|
<!-- fn will be processed inside 'note' processing -->
|
1806
1924
|
|
1807
1925
|
|
1926
|
+
|
1927
|
+
|
1928
|
+
|
1929
|
+
|
1808
1930
|
<!-- except gb -->
|
1809
1931
|
|
1810
1932
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1811
1933
|
|
1812
1934
|
|
1935
|
+
<!-- show Note under table in preface (ex. abstract) sections -->
|
1936
|
+
<!-- empty, because notes show at page side in main sections -->
|
1937
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1938
|
+
<xsl:choose>
|
1939
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
1940
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1941
|
+
</xsl:when>
|
1942
|
+
<xsl:otherwise>
|
1943
|
+
<fo:block/>
|
1944
|
+
</xsl:otherwise>
|
1945
|
+
</xsl:choose>
|
1946
|
+
</xsl:if> -->
|
1947
|
+
|
1948
|
+
|
1813
1949
|
<!-- horizontal row separator -->
|
1814
1950
|
|
1815
1951
|
|
@@ -1823,6 +1959,88 @@
|
|
1823
1959
|
</fo:table-footer>
|
1824
1960
|
|
1825
1961
|
</xsl:if>
|
1962
|
+
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1963
|
+
<xsl:param name="table_attributes"/>
|
1964
|
+
<xsl:param name="colwidths"/>
|
1965
|
+
|
1966
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1967
|
+
|
1968
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1969
|
+
|
1970
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
|
1971
|
+
|
1972
|
+
<fo:table keep-with-previous="always">
|
1973
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1974
|
+
<xsl:choose>
|
1975
|
+
<xsl:when test="@name = 'border-top'">
|
1976
|
+
<xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
|
1977
|
+
</xsl:when>
|
1978
|
+
<xsl:when test="@name = 'border'">
|
1979
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
1980
|
+
<xsl:attribute name="border-top">0pt solid black</xsl:attribute>
|
1981
|
+
</xsl:when>
|
1982
|
+
<xsl:otherwise>
|
1983
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
1984
|
+
</xsl:otherwise>
|
1985
|
+
</xsl:choose>
|
1986
|
+
</xsl:for-each>
|
1987
|
+
|
1988
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1989
|
+
<xsl:choose>
|
1990
|
+
<xsl:when test=". = 1 or . = 0">
|
1991
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1992
|
+
</xsl:when>
|
1993
|
+
<xsl:otherwise>
|
1994
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1995
|
+
</xsl:otherwise>
|
1996
|
+
</xsl:choose>
|
1997
|
+
</xsl:for-each>
|
1998
|
+
|
1999
|
+
<fo:table-body>
|
2000
|
+
<fo:table-row>
|
2001
|
+
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
2002
|
+
|
2003
|
+
|
2004
|
+
|
2005
|
+
<!-- fn will be processed inside 'note' processing -->
|
2006
|
+
|
2007
|
+
|
2008
|
+
|
2009
|
+
|
2010
|
+
|
2011
|
+
|
2012
|
+
|
2013
|
+
<!-- except gb -->
|
2014
|
+
|
2015
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
2016
|
+
|
2017
|
+
|
2018
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2019
|
+
<xsl:choose>
|
2020
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
2021
|
+
show Note under table in preface (ex. abstract) sections
|
2022
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
2023
|
+
</xsl:when>
|
2024
|
+
<xsl:otherwise>
|
2025
|
+
empty, because notes show at page side in main sections
|
2026
|
+
<fo:block/>
|
2027
|
+
</xsl:otherwise>
|
2028
|
+
</xsl:choose>
|
2029
|
+
</xsl:if> -->
|
2030
|
+
|
2031
|
+
|
2032
|
+
<!-- horizontal row separator -->
|
2033
|
+
|
2034
|
+
|
2035
|
+
<!-- fn processing -->
|
2036
|
+
<xsl:call-template name="fn_display"/>
|
2037
|
+
|
2038
|
+
</fo:table-cell>
|
2039
|
+
</fo:table-row>
|
2040
|
+
</fo:table-body>
|
2041
|
+
|
2042
|
+
</fo:table>
|
2043
|
+
</xsl:if>
|
1826
2044
|
</xsl:template><xsl:template match="*[local-name()='tbody']">
|
1827
2045
|
|
1828
2046
|
<xsl:variable name="cols-count">
|
@@ -1875,8 +2093,12 @@
|
|
1875
2093
|
|
1876
2094
|
</xsl:if>
|
1877
2095
|
|
1878
|
-
|
1879
|
-
|
2096
|
+
|
2097
|
+
|
2098
|
+
|
2099
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2100
|
+
<xsl:attribute name="height">8mm</xsl:attribute>
|
2101
|
+
</xsl:if> -->
|
1880
2102
|
|
1881
2103
|
<xsl:apply-templates/>
|
1882
2104
|
</fo:table-row>
|
@@ -1916,6 +2138,7 @@
|
|
1916
2138
|
|
1917
2139
|
|
1918
2140
|
|
2141
|
+
|
1919
2142
|
<xsl:if test="@colspan">
|
1920
2143
|
<xsl:attribute name="number-columns-spanned">
|
1921
2144
|
<xsl:value-of select="@colspan"/>
|
@@ -1955,7 +2178,7 @@
|
|
1955
2178
|
|
1956
2179
|
|
1957
2180
|
|
1958
|
-
|
2181
|
+
|
1959
2182
|
|
1960
2183
|
|
1961
2184
|
|
@@ -1968,6 +2191,7 @@
|
|
1968
2191
|
|
1969
2192
|
|
1970
2193
|
|
2194
|
+
|
1971
2195
|
<xsl:if test="@colspan">
|
1972
2196
|
<xsl:attribute name="number-columns-spanned">
|
1973
2197
|
<xsl:value-of select="@colspan"/>
|
@@ -1979,7 +2203,8 @@
|
|
1979
2203
|
</xsl:attribute>
|
1980
2204
|
</xsl:if>
|
1981
2205
|
<xsl:call-template name="display-align"/>
|
1982
|
-
<fo:block>
|
2206
|
+
<fo:block>
|
2207
|
+
|
1983
2208
|
<xsl:apply-templates/>
|
1984
2209
|
</fo:block>
|
1985
2210
|
</fo:table-cell>
|
@@ -1991,6 +2216,8 @@
|
|
1991
2216
|
|
1992
2217
|
|
1993
2218
|
|
2219
|
+
|
2220
|
+
|
1994
2221
|
<fo:inline padding-right="2mm">
|
1995
2222
|
|
1996
2223
|
|
@@ -2005,10 +2232,11 @@
|
|
2005
2232
|
</fo:inline> -->
|
2006
2233
|
</xsl:if>
|
2007
2234
|
|
2008
|
-
|
2235
|
+
|
2009
2236
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
2010
2237
|
|
2011
2238
|
</fo:inline>
|
2239
|
+
|
2012
2240
|
<xsl:apply-templates mode="process"/>
|
2013
2241
|
</fo:block>
|
2014
2242
|
|
@@ -2032,6 +2260,7 @@
|
|
2032
2260
|
|
2033
2261
|
|
2034
2262
|
|
2263
|
+
|
2035
2264
|
<fo:inline font-size="80%" padding-right="5mm" id="{@id}">
|
2036
2265
|
|
2037
2266
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
@@ -2041,12 +2270,15 @@
|
|
2041
2270
|
|
2042
2271
|
|
2043
2272
|
|
2273
|
+
|
2044
2274
|
<xsl:value-of select="@reference"/>
|
2045
2275
|
|
2276
|
+
|
2046
2277
|
</fo:inline>
|
2047
2278
|
<fo:inline>
|
2048
2279
|
|
2049
|
-
<xsl:apply-templates/>
|
2280
|
+
<!-- <xsl:apply-templates /> -->
|
2281
|
+
<xsl:copy-of select="./node()"/>
|
2050
2282
|
</fo:inline>
|
2051
2283
|
</fo:block>
|
2052
2284
|
</xsl:if>
|
@@ -2083,7 +2315,20 @@
|
|
2083
2315
|
<xsl:variable name="following_dl_colwidths">
|
2084
2316
|
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
2085
2317
|
<xsl:variable name="html-table">
|
2086
|
-
<xsl:variable name="
|
2318
|
+
<xsl:variable name="doc_ns">
|
2319
|
+
|
2320
|
+
</xsl:variable>
|
2321
|
+
<xsl:variable name="ns">
|
2322
|
+
<xsl:choose>
|
2323
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
2324
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
2325
|
+
</xsl:when>
|
2326
|
+
<xsl:otherwise>
|
2327
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
2328
|
+
</xsl:otherwise>
|
2329
|
+
</xsl:choose>
|
2330
|
+
</xsl:variable>
|
2331
|
+
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2087
2332
|
<xsl:element name="{$ns}:table">
|
2088
2333
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2089
2334
|
<tbody>
|
@@ -2148,7 +2393,8 @@
|
|
2148
2393
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
2149
2394
|
</xsl:if>
|
2150
2395
|
|
2151
|
-
<xsl:apply-templates/>
|
2396
|
+
<!-- <xsl:apply-templates /> -->
|
2397
|
+
<xsl:copy-of select="./node()"/>
|
2152
2398
|
</fo:block>
|
2153
2399
|
</fo:table-cell>
|
2154
2400
|
</fo:table-row>
|
@@ -2167,9 +2413,12 @@
|
|
2167
2413
|
|
2168
2414
|
|
2169
2415
|
|
2416
|
+
|
2170
2417
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
2171
2418
|
|
2419
|
+
|
2172
2420
|
<xsl:value-of select="@reference"/>
|
2421
|
+
|
2173
2422
|
</fo:basic-link>
|
2174
2423
|
</fo:inline>
|
2175
2424
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -2177,7 +2426,11 @@
|
|
2177
2426
|
<xsl:apply-templates/>
|
2178
2427
|
</fo:inline>
|
2179
2428
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2180
|
-
<fo:block-container
|
2429
|
+
<fo:block-container>
|
2430
|
+
|
2431
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2432
|
+
|
2433
|
+
|
2181
2434
|
<xsl:if test="parent::*[local-name() = 'note']">
|
2182
2435
|
<xsl:attribute name="margin-left">
|
2183
2436
|
<xsl:choose>
|
@@ -2187,8 +2440,11 @@
|
|
2187
2440
|
</xsl:attribute>
|
2188
2441
|
|
2189
2442
|
</xsl:if>
|
2190
|
-
<fo:block-container
|
2191
|
-
|
2443
|
+
<fo:block-container>
|
2444
|
+
|
2445
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2446
|
+
|
2447
|
+
|
2192
2448
|
<xsl:variable name="parent" select="local-name(..)"/>
|
2193
2449
|
|
2194
2450
|
<xsl:variable name="key_iso">
|
@@ -2202,9 +2458,12 @@
|
|
2202
2458
|
<fo:block margin-bottom="12pt" text-align="left">
|
2203
2459
|
|
2204
2460
|
<xsl:variable name="title-where">
|
2205
|
-
|
2206
|
-
|
2207
|
-
|
2461
|
+
|
2462
|
+
|
2463
|
+
<xsl:call-template name="getTitle">
|
2464
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2465
|
+
</xsl:call-template>
|
2466
|
+
|
2208
2467
|
</xsl:variable>
|
2209
2468
|
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
2210
2469
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
@@ -2220,9 +2479,12 @@
|
|
2220
2479
|
|
2221
2480
|
|
2222
2481
|
<xsl:variable name="title-where">
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2482
|
+
|
2483
|
+
|
2484
|
+
<xsl:call-template name="getTitle">
|
2485
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2486
|
+
</xsl:call-template>
|
2487
|
+
|
2226
2488
|
</xsl:variable>
|
2227
2489
|
<xsl:value-of select="$title-where"/>
|
2228
2490
|
</fo:block>
|
@@ -2233,9 +2495,12 @@
|
|
2233
2495
|
|
2234
2496
|
|
2235
2497
|
<xsl:variable name="title-key">
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2498
|
+
|
2499
|
+
|
2500
|
+
<xsl:call-template name="getTitle">
|
2501
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
2502
|
+
</xsl:call-template>
|
2503
|
+
|
2239
2504
|
</xsl:variable>
|
2240
2505
|
<xsl:value-of select="$title-key"/>
|
2241
2506
|
</fo:block>
|
@@ -2267,7 +2532,20 @@
|
|
2267
2532
|
</xsl:choose>
|
2268
2533
|
<!-- create virtual html table for dl/[dt and dd] -->
|
2269
2534
|
<xsl:variable name="html-table">
|
2270
|
-
<xsl:variable name="
|
2535
|
+
<xsl:variable name="doc_ns">
|
2536
|
+
|
2537
|
+
</xsl:variable>
|
2538
|
+
<xsl:variable name="ns">
|
2539
|
+
<xsl:choose>
|
2540
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
2541
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
2542
|
+
</xsl:when>
|
2543
|
+
<xsl:otherwise>
|
2544
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
2545
|
+
</xsl:otherwise>
|
2546
|
+
</xsl:choose>
|
2547
|
+
</xsl:variable>
|
2548
|
+
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2271
2549
|
<xsl:element name="{$ns}:table">
|
2272
2550
|
<tbody>
|
2273
2551
|
<xsl:apply-templates mode="dl"/>
|
@@ -2411,6 +2689,7 @@
|
|
2411
2689
|
|
2412
2690
|
|
2413
2691
|
|
2692
|
+
|
2414
2693
|
<xsl:apply-templates/>
|
2415
2694
|
<!-- <xsl:if test="$namespace = 'gb'">
|
2416
2695
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -2464,6 +2743,7 @@
|
|
2464
2743
|
</fo:inline>
|
2465
2744
|
</xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
|
2466
2745
|
<fo:inline font-weight="bold">
|
2746
|
+
|
2467
2747
|
<xsl:apply-templates/>
|
2468
2748
|
</fo:inline>
|
2469
2749
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
@@ -2477,18 +2757,18 @@
|
|
2477
2757
|
</xsl:template><xsl:template match="*[local-name()='tt']">
|
2478
2758
|
<fo:inline xsl:use-attribute-sets="tt-style">
|
2479
2759
|
<xsl:variable name="_font-size">
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
2760
|
|
2484
2761
|
|
2485
2762
|
|
2486
2763
|
|
2487
2764
|
|
2488
2765
|
|
2489
|
-
|
2490
2766
|
|
2491
|
-
|
2767
|
+
|
2768
|
+
|
2769
|
+
|
2770
|
+
|
2771
|
+
|
2492
2772
|
|
2493
2773
|
|
2494
2774
|
</xsl:variable>
|
@@ -2792,7 +3072,18 @@
|
|
2792
3072
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
2793
3073
|
</xsl:apply-templates>
|
2794
3074
|
</xsl:template><xsl:template name="getLang">
|
2795
|
-
<xsl:variable name="
|
3075
|
+
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3076
|
+
<xsl:variable name="language">
|
3077
|
+
<xsl:choose>
|
3078
|
+
<xsl:when test="$language_current != ''">
|
3079
|
+
<xsl:value-of select="$language_current"/>
|
3080
|
+
</xsl:when>
|
3081
|
+
<xsl:otherwise>
|
3082
|
+
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3083
|
+
</xsl:otherwise>
|
3084
|
+
</xsl:choose>
|
3085
|
+
</xsl:variable>
|
3086
|
+
|
2796
3087
|
<xsl:choose>
|
2797
3088
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
2798
3089
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
@@ -2826,7 +3117,8 @@
|
|
2826
3117
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
2827
3118
|
<xsl:value-of select="substring($str, 2)"/>
|
2828
3119
|
</xsl:template><xsl:template match="mathml:math">
|
2829
|
-
<fo:inline font-family="
|
3120
|
+
<fo:inline font-family="STIX Two Math"> <!-- -->
|
3121
|
+
|
2830
3122
|
<xsl:variable name="mathml">
|
2831
3123
|
<xsl:apply-templates select="." mode="mathml"/>
|
2832
3124
|
</xsl:variable>
|
@@ -2856,6 +3148,7 @@
|
|
2856
3148
|
</xsl:choose>
|
2857
3149
|
</xsl:variable>
|
2858
3150
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3151
|
+
|
2859
3152
|
<xsl:choose>
|
2860
3153
|
<xsl:when test="$target = ''">
|
2861
3154
|
<xsl:apply-templates/>
|
@@ -2909,10 +3202,14 @@
|
|
2909
3202
|
</fo:inline>
|
2910
3203
|
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
2911
3204
|
<xsl:variable name="title-modified">
|
2912
|
-
|
2913
|
-
|
2914
|
-
|
3205
|
+
|
3206
|
+
|
3207
|
+
<xsl:call-template name="getTitle">
|
3208
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
3209
|
+
</xsl:call-template>
|
3210
|
+
|
2915
3211
|
</xsl:variable>
|
3212
|
+
|
2916
3213
|
<xsl:choose>
|
2917
3214
|
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
2918
3215
|
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
@@ -2920,7 +3217,7 @@
|
|
2920
3217
|
<xsl:apply-templates/>
|
2921
3218
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
2922
3219
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
2923
|
-
|
3220
|
+
|
2924
3221
|
<xsl:apply-templates/>
|
2925
3222
|
</fo:basic-link>
|
2926
3223
|
</xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
|
@@ -2986,6 +3283,8 @@
|
|
2986
3283
|
|
2987
3284
|
|
2988
3285
|
|
3286
|
+
|
3287
|
+
|
2989
3288
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
2990
3289
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
2991
3290
|
</fo:inline>
|
@@ -3078,7 +3377,8 @@
|
|
3078
3377
|
</fo:inline>
|
3079
3378
|
</xsl:if>
|
3080
3379
|
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3081
|
-
<fo:block-container id="{@id}">
|
3380
|
+
<fo:block-container id="{@id}">
|
3381
|
+
|
3082
3382
|
<fo:block>
|
3083
3383
|
<xsl:apply-templates/>
|
3084
3384
|
</fo:block>
|
@@ -3118,15 +3418,109 @@
|
|
3118
3418
|
|
3119
3419
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3120
3420
|
</fo:block>
|
3121
|
-
</xsl:template><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">
|
3421
|
+
</xsl:template><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">
|
3122
3422
|
<xsl:apply-templates mode="contents"/>
|
3123
3423
|
<xsl:text> </xsl:text>
|
3124
|
-
</xsl:template><xsl:template match="
|
3424
|
+
</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">
|
3425
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3426
|
+
<xsl:text> </xsl:text>
|
3427
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3428
|
+
<xsl:value-of select="."/>
|
3429
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3125
3430
|
<xsl:value-of select="."/>
|
3126
|
-
</xsl:template><xsl:template match="
|
3431
|
+
</xsl:template><xsl:template match="node()" mode="contents">
|
3432
|
+
<xsl:apply-templates mode="contents"/>
|
3433
|
+
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3434
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3435
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3436
|
+
<xsl:apply-templates select="."/>
|
3437
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3438
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3439
|
+
</xsl:template><xsl:template name="addBookmarks">
|
3440
|
+
<xsl:param name="contents"/>
|
3441
|
+
<xsl:if test="xalan:nodeset($contents)//item">
|
3442
|
+
<fo:bookmark-tree>
|
3443
|
+
<xsl:choose>
|
3444
|
+
<xsl:when test="xalan:nodeset($contents)/doc">
|
3445
|
+
<xsl:choose>
|
3446
|
+
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3447
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3448
|
+
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
3449
|
+
<fo:bookmark-title>
|
3450
|
+
<xsl:variable name="bookmark-title_">
|
3451
|
+
<xsl:call-template name="getLangVersion">
|
3452
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3453
|
+
</xsl:call-template>
|
3454
|
+
</xsl:variable>
|
3455
|
+
<xsl:choose>
|
3456
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
3457
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
3458
|
+
</xsl:when>
|
3459
|
+
<xsl:otherwise>
|
3460
|
+
<xsl:choose>
|
3461
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
3462
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
3463
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3464
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3465
|
+
</xsl:choose>
|
3466
|
+
</xsl:otherwise>
|
3467
|
+
</xsl:choose>
|
3468
|
+
</fo:bookmark-title>
|
3469
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3470
|
+
</fo:bookmark>
|
3471
|
+
|
3472
|
+
</xsl:for-each>
|
3473
|
+
</xsl:when>
|
3474
|
+
<xsl:otherwise>
|
3475
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3476
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3477
|
+
</xsl:for-each>
|
3478
|
+
</xsl:otherwise>
|
3479
|
+
</xsl:choose>
|
3480
|
+
</xsl:when>
|
3481
|
+
<xsl:otherwise>
|
3482
|
+
<xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
|
3483
|
+
</xsl:otherwise>
|
3484
|
+
</xsl:choose>
|
3485
|
+
|
3486
|
+
|
3487
|
+
|
3488
|
+
|
3489
|
+
|
3490
|
+
|
3491
|
+
|
3492
|
+
|
3493
|
+
</fo:bookmark-tree>
|
3494
|
+
</xsl:if>
|
3495
|
+
</xsl:template><xsl:template name="getLangVersion">
|
3496
|
+
<xsl:param name="lang"/>
|
3497
|
+
<xsl:choose>
|
3498
|
+
<xsl:when test="$lang = 'en'">
|
3499
|
+
|
3500
|
+
|
3501
|
+
</xsl:when>
|
3502
|
+
<xsl:when test="$lang = 'fr'">
|
3503
|
+
|
3504
|
+
|
3505
|
+
</xsl:when>
|
3506
|
+
<xsl:when test="$lang = 'de'">Deutsche</xsl:when>
|
3507
|
+
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
3508
|
+
</xsl:choose>
|
3509
|
+
</xsl:template><xsl:template match="item" mode="bookmark">
|
3510
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
3511
|
+
<fo:bookmark-title>
|
3512
|
+
<xsl:if test="@section != ''">
|
3513
|
+
<xsl:value-of select="@section"/>
|
3514
|
+
<xsl:text> </xsl:text>
|
3515
|
+
</xsl:if>
|
3516
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3517
|
+
</fo:bookmark-title>
|
3518
|
+
<xsl:apply-templates mode="bookmark"/>
|
3519
|
+
</fo:bookmark>
|
3520
|
+
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
3127
3521
|
<xsl:if test="normalize-space() != ''">
|
3128
3522
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
3129
|
-
|
3523
|
+
|
3130
3524
|
<xsl:apply-templates/>
|
3131
3525
|
</fo:block>
|
3132
3526
|
</xsl:if>
|
@@ -3181,7 +3575,7 @@
|
|
3181
3575
|
<xsl:apply-templates/>
|
3182
3576
|
</xsl:otherwise>
|
3183
3577
|
</xsl:choose>
|
3184
|
-
</xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
|
3578
|
+
</xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
|
3185
3579
|
<xsl:text> </xsl:text>
|
3186
3580
|
</xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
3187
3581
|
<xsl:copy>
|
@@ -3711,9 +4105,12 @@
|
|
3711
4105
|
</fo:block>
|
3712
4106
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
3713
4107
|
<xsl:variable name="title-deprecated">
|
3714
|
-
|
3715
|
-
|
3716
|
-
|
4108
|
+
|
4109
|
+
|
4110
|
+
<xsl:call-template name="getTitle">
|
4111
|
+
<xsl:with-param name="name" select="'title-deprecated'"/>
|
4112
|
+
</xsl:call-template>
|
4113
|
+
|
3717
4114
|
</xsl:variable>
|
3718
4115
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
3719
4116
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
@@ -3762,13 +4159,14 @@
|
|
3762
4159
|
</xsl:template><xsl:template match="*[local-name() = 'clause']">
|
3763
4160
|
<fo:block>
|
3764
4161
|
<xsl:call-template name="setId"/>
|
4162
|
+
|
3765
4163
|
<xsl:apply-templates/>
|
3766
4164
|
</fo:block>
|
3767
4165
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
3768
4166
|
<fo:block id="{@id}">
|
3769
4167
|
<xsl:apply-templates/>
|
3770
4168
|
</fo:block>
|
3771
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4169
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
3772
4170
|
|
3773
4171
|
<fo:block id="{@id}">
|
3774
4172
|
<xsl:apply-templates/>
|
@@ -3792,20 +4190,30 @@
|
|
3792
4190
|
<!-- 0xA0 to space replacement -->
|
3793
4191
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
3794
4192
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
3795
|
-
<
|
3796
|
-
<xsl:
|
3797
|
-
<
|
3798
|
-
<xsl:
|
3799
|
-
<xsl:
|
3800
|
-
|
3801
|
-
|
3802
|
-
|
3803
|
-
|
3804
|
-
|
3805
|
-
|
3806
|
-
|
3807
|
-
|
3808
|
-
|
4193
|
+
<xsl:choose>
|
4194
|
+
<xsl:when test="parent::*[local-name() = 'note']">
|
4195
|
+
<fo:block-container>
|
4196
|
+
<xsl:attribute name="margin-left">
|
4197
|
+
<xsl:choose>
|
4198
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
4199
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
4200
|
+
</xsl:choose>
|
4201
|
+
</xsl:attribute>
|
4202
|
+
|
4203
|
+
|
4204
|
+
<fo:block-container margin-left="0mm">
|
4205
|
+
<fo:block>
|
4206
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
4207
|
+
</fo:block>
|
4208
|
+
</fo:block-container>
|
4209
|
+
</fo:block-container>
|
4210
|
+
</xsl:when>
|
4211
|
+
<xsl:otherwise>
|
4212
|
+
<fo:block>
|
4213
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
4214
|
+
</fo:block>
|
4215
|
+
</xsl:otherwise>
|
4216
|
+
</xsl:choose>
|
3809
4217
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
3810
4218
|
<!-- <row>
|
3811
4219
|
<date>05-07-2013</date>
|
@@ -3978,6 +4386,7 @@
|
|
3978
4386
|
|
3979
4387
|
|
3980
4388
|
|
4389
|
+
|
3981
4390
|
|
3982
4391
|
</xsl:variable>
|
3983
4392
|
<xsl:choose>
|
@@ -3992,6 +4401,7 @@
|
|
3992
4401
|
<dc:creator>
|
3993
4402
|
|
3994
4403
|
|
4404
|
+
|
3995
4405
|
</dc:creator>
|
3996
4406
|
<dc:description>
|
3997
4407
|
<xsl:variable name="abstract">
|
@@ -4001,6 +4411,7 @@
|
|
4001
4411
|
<xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4002
4412
|
|
4003
4413
|
|
4414
|
+
|
4004
4415
|
</xsl:variable>
|
4005
4416
|
<xsl:value-of select="normalize-space($abstract)"/>
|
4006
4417
|
</dc:description>
|
@@ -4072,13 +4483,22 @@
|
|
4072
4483
|
</xsl:template><xsl:template name="split">
|
4073
4484
|
<xsl:param name="pText" select="."/>
|
4074
4485
|
<xsl:param name="sep" select="','"/>
|
4486
|
+
<xsl:param name="normalize-space" select="'true'"/>
|
4075
4487
|
<xsl:if test="string-length($pText) >0">
|
4076
4488
|
<item>
|
4077
|
-
<xsl:
|
4489
|
+
<xsl:choose>
|
4490
|
+
<xsl:when test="$normalize-space = 'true'">
|
4491
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
4492
|
+
</xsl:when>
|
4493
|
+
<xsl:otherwise>
|
4494
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
4495
|
+
</xsl:otherwise>
|
4496
|
+
</xsl:choose>
|
4078
4497
|
</item>
|
4079
4498
|
<xsl:call-template name="split">
|
4080
4499
|
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
4081
4500
|
<xsl:with-param name="sep" select="$sep"/>
|
4501
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
4082
4502
|
</xsl:call-template>
|
4083
4503
|
</xsl:if>
|
4084
4504
|
</xsl:template><xsl:template name="getDocumentId">
|
@@ -4101,6 +4521,7 @@
|
|
4101
4521
|
|
4102
4522
|
|
4103
4523
|
|
4524
|
+
|
4104
4525
|
</xsl:variable>
|
4105
4526
|
<xsl:if test="$documentNS != $XSLNS">
|
4106
4527
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
@@ -4126,4 +4547,40 @@
|
|
4126
4547
|
</xsl:otherwise>
|
4127
4548
|
</xsl:choose>
|
4128
4549
|
</xsl:attribute>
|
4550
|
+
</xsl:template><xsl:template name="add-letter-spacing">
|
4551
|
+
<xsl:param name="text"/>
|
4552
|
+
<xsl:param name="letter-spacing" select="'0.15'"/>
|
4553
|
+
<xsl:if test="string-length($text) > 0">
|
4554
|
+
<xsl:variable name="char" select="substring($text, 1, 1)"/>
|
4555
|
+
<fo:inline padding-right="{$letter-spacing}mm">
|
4556
|
+
<xsl:if test="$char = '®'">
|
4557
|
+
<xsl:attribute name="font-size">58%</xsl:attribute>
|
4558
|
+
<xsl:attribute name="baseline-shift">30%</xsl:attribute>
|
4559
|
+
</xsl:if>
|
4560
|
+
<xsl:value-of select="$char"/>
|
4561
|
+
</fo:inline>
|
4562
|
+
<xsl:call-template name="add-letter-spacing">
|
4563
|
+
<xsl:with-param name="text" select="substring($text, 2)"/>
|
4564
|
+
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4565
|
+
</xsl:call-template>
|
4566
|
+
</xsl:if>
|
4567
|
+
</xsl:template><xsl:template name="repeat">
|
4568
|
+
<xsl:param name="char" select="'*'"/>
|
4569
|
+
<xsl:param name="count"/>
|
4570
|
+
<xsl:if test="$count > 0">
|
4571
|
+
<xsl:value-of select="$char"/>
|
4572
|
+
<xsl:call-template name="repeat">
|
4573
|
+
<xsl:with-param name="char" select="$char"/>
|
4574
|
+
<xsl:with-param name="count" select="$count - 1"/>
|
4575
|
+
</xsl:call-template>
|
4576
|
+
</xsl:if>
|
4577
|
+
</xsl:template><xsl:template name="getLocalizedString">
|
4578
|
+
<xsl:param name="key"/>
|
4579
|
+
|
4580
|
+
<xsl:variable name="curr_lang">
|
4581
|
+
<xsl:call-template name="getLang"/>
|
4582
|
+
</xsl:variable>
|
4583
|
+
|
4584
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4585
|
+
|
4129
4586
|
</xsl:template></xsl:stylesheet>
|