metanorma-nist 1.2.3 → 1.2.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/.github/workflows/release.yml +36 -0
- data/README.adoc +3 -4
- data/lib/asciidoctor/nist/basicdoc.rng +4 -11
- data/lib/asciidoctor/nist/cleanup.rb +1 -0
- data/lib/asciidoctor/nist/converter.rb +2 -0
- data/lib/asciidoctor/nist/isodoc.rng +27 -50
- data/lib/asciidoctor/nist/nist.rng +9 -1
- data/lib/isodoc/nist/base_convert.rb +0 -1
- data/lib/isodoc/nist/fonts_manifest.yaml +4 -0
- data/lib/isodoc/nist/html/htmlstyle.css +226 -222
- data/lib/isodoc/nist/html/htmlstyle.scss +5 -6
- data/lib/isodoc/nist/html/nist.css +49 -50
- data/lib/isodoc/nist/html/nist.scss +49 -50
- data/lib/isodoc/nist/html/nist_cswp.css +48 -49
- data/lib/isodoc/nist/html/nist_cswp.scss +48 -49
- data/lib/isodoc/nist/html/wordstyle.css +42 -42
- data/lib/isodoc/nist/html/wordstyle.scss +42 -42
- data/lib/isodoc/nist/html/wordstyle_cswp.css +52 -52
- data/lib/isodoc/nist/html/wordstyle_cswp.scss +52 -52
- data/lib/isodoc/nist/html_convert.rb +12 -1
- data/lib/isodoc/nist/metadata.rb +1 -0
- data/lib/isodoc/nist/metadata_id.rb +2 -0
- data/lib/isodoc/nist/nist.cswp.xsl +546 -88
- data/lib/isodoc/nist/nist.sp.xsl +578 -93
- data/lib/isodoc/nist/refs.rb +2 -0
- data/lib/isodoc/nist/render.rb +0 -4
- data/lib/isodoc/nist/word_convert.rb +6 -1
- data/lib/metanorma/nist/fonts_manifest.yaml +6 -0
- data/lib/metanorma/nist/processor.rb +0 -8
- data/lib/metanorma/nist/version.rb +1 -1
- data/metanorma-nist.gemspec +2 -2
- metadata +10 -9
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
@@ -25,7 +25,10 @@ module IsoDoc
|
|
25
25
|
'"Libre Baskerville",serif'),
|
26
26
|
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
|
27
27
|
'"Libre Baskerville",serif'),
|
28
|
-
monospacefont: '"Space Mono",monospace'
|
28
|
+
monospacefont: '"Space Mono",monospace',
|
29
|
+
normalfontsize: "14px",
|
30
|
+
footnotefontsize: "0.9em",
|
31
|
+
monospacefontsize: "0.8em",
|
29
32
|
}
|
30
33
|
end
|
31
34
|
|
@@ -46,6 +49,14 @@ module IsoDoc
|
|
46
49
|
HEAD
|
47
50
|
end
|
48
51
|
|
52
|
+
def html_head()
|
53
|
+
super + <<~HEAD.freeze
|
54
|
+
<link rel="stylesheet" href="https://pages.nist.gov/nist-header-footer/css/nist-combined.css">
|
55
|
+
<script src="https://pages.nist.gov/nist-header-footer/js/jquery-1.9.0.min.js" type="text/javascript" defer="defer"></script>
|
56
|
+
<script src="https://pages.nist.gov/nist-header-footer/js/nist-header-footer.js" type="text/javascript" defer="defer"></script>
|
57
|
+
HEAD
|
58
|
+
end
|
59
|
+
|
49
60
|
def toclevel
|
50
61
|
ret = toclevel_classes.map do |l|
|
51
62
|
"#{l}:not(:empty):not(.TermNum):not(.noTOC):not(.AbstractTitle):"\
|
data/lib/isodoc/nist/metadata.rb
CHANGED
@@ -51,7 +51,7 @@
|
|
51
51
|
|
52
52
|
<xsl:template match="/">
|
53
53
|
<xsl:call-template name="namespaceCheck"/>
|
54
|
-
<fo:root font-family="Times New Roman,
|
54
|
+
<fo:root font-family="Times New Roman, STIX Two Math" font-size="12pt" xml:lang="{$lang}">
|
55
55
|
<fo:layout-master-set>
|
56
56
|
<!-- Cover pages -->
|
57
57
|
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
@@ -83,6 +83,10 @@
|
|
83
83
|
</fo:layout-master-set>
|
84
84
|
|
85
85
|
<xsl:call-template name="addPDFUAmeta"/>
|
86
|
+
|
87
|
+
<xsl:call-template name="addBookmarks">
|
88
|
+
<xsl:with-param name="contents" select="$contents"/>
|
89
|
+
</xsl:call-template>
|
86
90
|
|
87
91
|
<!-- cover page -->
|
88
92
|
<fo:page-sequence master-reference="cover-page" force-page-count="no-force">
|
@@ -429,9 +433,17 @@
|
|
429
433
|
<xsl:otherwise>true</xsl:otherwise>
|
430
434
|
</xsl:choose>
|
431
435
|
</xsl:variable>
|
436
|
+
|
437
|
+
|
438
|
+
<xsl:variable name="skip">
|
439
|
+
<xsl:choose>
|
440
|
+
<xsl:when test="ancestor-or-self::nist:bibitem">true</xsl:when>
|
441
|
+
<xsl:when test="ancestor-or-self::nist:term">true</xsl:when>
|
442
|
+
<xsl:otherwise>false</xsl:otherwise>
|
443
|
+
</xsl:choose>
|
444
|
+
</xsl:variable>
|
432
445
|
|
433
|
-
|
434
|
-
<xsl:if test="$display = 'true'">
|
446
|
+
<xsl:if test="$skip = 'false'">
|
435
447
|
|
436
448
|
<xsl:variable name="section">
|
437
449
|
<xsl:call-template name="getSection"/>
|
@@ -445,12 +457,13 @@
|
|
445
457
|
<xsl:value-of select="local-name()"/>
|
446
458
|
</xsl:variable>
|
447
459
|
|
448
|
-
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
|
449
|
-
<
|
460
|
+
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
|
461
|
+
<title>
|
462
|
+
<xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
|
463
|
+
</title>
|
464
|
+
<xsl:apply-templates mode="contents"/>
|
450
465
|
</item>
|
451
|
-
|
452
|
-
</xsl:if>
|
453
|
-
|
466
|
+
</xsl:if>
|
454
467
|
</xsl:template>
|
455
468
|
|
456
469
|
|
@@ -1090,6 +1103,12 @@
|
|
1090
1103
|
|
1091
1104
|
</title-edition>
|
1092
1105
|
|
1106
|
+
<title-edition lang="fr">
|
1107
|
+
|
1108
|
+
<xsl:text>Édition </xsl:text>
|
1109
|
+
|
1110
|
+
</title-edition>
|
1111
|
+
|
1093
1112
|
|
1094
1113
|
<title-toc lang="en">
|
1095
1114
|
|
@@ -1098,7 +1117,12 @@
|
|
1098
1117
|
|
1099
1118
|
|
1100
1119
|
</title-toc>
|
1101
|
-
<title-toc lang="fr">
|
1120
|
+
<title-toc lang="fr">
|
1121
|
+
|
1122
|
+
<xsl:text>Sommaire</xsl:text>
|
1123
|
+
|
1124
|
+
|
1125
|
+
</title-toc>
|
1102
1126
|
|
1103
1127
|
<title-toc lang="zh">Contents</title-toc>
|
1104
1128
|
|
@@ -1118,13 +1142,22 @@
|
|
1118
1142
|
<title-part lang="en">
|
1119
1143
|
|
1120
1144
|
|
1145
|
+
|
1121
1146
|
</title-part>
|
1122
1147
|
<title-part lang="fr">
|
1123
1148
|
|
1124
1149
|
|
1150
|
+
|
1125
1151
|
</title-part>
|
1126
1152
|
<title-part lang="zh">第 # 部分:</title-part>
|
1127
1153
|
|
1154
|
+
<title-subpart lang="en">
|
1155
|
+
|
1156
|
+
</title-subpart>
|
1157
|
+
<title-subpart lang="fr">
|
1158
|
+
|
1159
|
+
</title-subpart>
|
1160
|
+
|
1128
1161
|
<title-modified lang="en">modified</title-modified>
|
1129
1162
|
<title-modified lang="fr">modifiée</title-modified>
|
1130
1163
|
|
@@ -1186,10 +1219,19 @@
|
|
1186
1219
|
|
1187
1220
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
1188
1221
|
<xsl:param name="name"/>
|
1189
|
-
<xsl:
|
1190
|
-
|
1222
|
+
<xsl:param name="lang"/>
|
1223
|
+
<xsl:variable name="lang_">
|
1224
|
+
<xsl:choose>
|
1225
|
+
<xsl:when test="$lang != ''">
|
1226
|
+
<xsl:value-of select="$lang"/>
|
1227
|
+
</xsl:when>
|
1228
|
+
<xsl:otherwise>
|
1229
|
+
<xsl:call-template name="getLang"/>
|
1230
|
+
</xsl:otherwise>
|
1231
|
+
</xsl:choose>
|
1191
1232
|
</xsl:variable>
|
1192
|
-
<xsl:variable name="
|
1233
|
+
<xsl:variable name="language" select="normalize-space($lang_)"/>
|
1234
|
+
<xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
|
1193
1235
|
<xsl:choose>
|
1194
1236
|
<xsl:when test="normalize-space($title_) != ''">
|
1195
1237
|
<xsl:value-of select="$title_"/>
|
@@ -1198,7 +1240,9 @@
|
|
1198
1240
|
<xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
|
1199
1241
|
</xsl:otherwise>
|
1200
1242
|
</xsl:choose>
|
1201
|
-
</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="
|
1243
|
+
</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">
|
1244
|
+
|
1245
|
+
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
1202
1246
|
|
1203
1247
|
|
1204
1248
|
|
@@ -1333,6 +1377,7 @@
|
|
1333
1377
|
|
1334
1378
|
|
1335
1379
|
|
1380
|
+
|
1336
1381
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1337
1382
|
|
1338
1383
|
|
@@ -1372,6 +1417,7 @@
|
|
1372
1417
|
|
1373
1418
|
|
1374
1419
|
|
1420
|
+
|
1375
1421
|
</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">
|
1376
1422
|
|
1377
1423
|
|
@@ -1435,6 +1481,7 @@
|
|
1435
1481
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1436
1482
|
|
1437
1483
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1484
|
+
|
1438
1485
|
|
1439
1486
|
|
1440
1487
|
|
@@ -1553,6 +1600,10 @@
|
|
1553
1600
|
|
1554
1601
|
|
1555
1602
|
|
1603
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1604
|
+
<fo:block> </fo:block>
|
1605
|
+
</xsl:if> -->
|
1606
|
+
|
1556
1607
|
<!-- $namespace = 'iso' or -->
|
1557
1608
|
|
1558
1609
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -1588,6 +1639,7 @@
|
|
1588
1639
|
<xsl:with-param name="table" select="$simple-table"/>
|
1589
1640
|
</xsl:call-template>
|
1590
1641
|
</xsl:variable>
|
1642
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1591
1643
|
|
1592
1644
|
<!-- <xsl:variable name="colwidths2">
|
1593
1645
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1608,40 +1660,62 @@
|
|
1608
1660
|
|
1609
1661
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1610
1662
|
|
1663
|
+
|
1611
1664
|
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
1612
1665
|
|
1666
|
+
|
1667
|
+
|
1668
|
+
|
1613
1669
|
|
1614
1670
|
|
1671
|
+
<xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
|
1672
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
1673
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1674
|
+
</xsl:if>
|
1675
|
+
<xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
|
1676
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
1677
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
1678
|
+
</xsl:if>
|
1679
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1615
1680
|
|
1681
|
+
|
1616
1682
|
|
1617
|
-
|
1618
1683
|
|
1619
1684
|
|
1620
1685
|
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
1630
|
-
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1631
|
-
</xsl:if>
|
1632
|
-
<xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
|
1633
|
-
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
1634
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
1635
|
-
</xsl:if>
|
1636
|
-
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1686
|
+
|
1687
|
+
|
1688
|
+
|
1689
|
+
<xsl:variable name="table_attributes">
|
1690
|
+
<attribute name="table-layout">fixed</attribute>
|
1691
|
+
<attribute name="width">100%</attribute>
|
1692
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1693
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1637
1694
|
|
1638
1695
|
|
1639
1696
|
|
1640
1697
|
|
1698
|
+
|
1699
|
+
|
1700
|
+
|
1641
1701
|
|
1702
|
+
|
1642
1703
|
|
1704
|
+
</xsl:variable>
|
1705
|
+
|
1706
|
+
|
1707
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1643
1708
|
|
1709
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1710
|
+
<xsl:attribute name="{@name}">
|
1711
|
+
<xsl:value-of select="."/>
|
1712
|
+
</xsl:attribute>
|
1713
|
+
</xsl:for-each>
|
1644
1714
|
|
1715
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1716
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1717
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1718
|
+
</xsl:if>
|
1645
1719
|
|
1646
1720
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1647
1721
|
<xsl:choose>
|
@@ -1665,6 +1739,33 @@
|
|
1665
1739
|
|
1666
1740
|
</fo:table>
|
1667
1741
|
|
1742
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1743
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1744
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1745
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1746
|
+
</xsl:call-template>
|
1747
|
+
</xsl:for-each>
|
1748
|
+
|
1749
|
+
<!-- insert footer as table -->
|
1750
|
+
<!-- <fo:table>
|
1751
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1752
|
+
<xsl:attribute name="{@name}">
|
1753
|
+
<xsl:value-of select="."/>
|
1754
|
+
</xsl:attribute>
|
1755
|
+
</xsl:for-each>
|
1756
|
+
|
1757
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1758
|
+
<xsl:choose>
|
1759
|
+
<xsl:when test=". = 1 or . = 0">
|
1760
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1761
|
+
</xsl:when>
|
1762
|
+
<xsl:otherwise>
|
1763
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1764
|
+
</xsl:otherwise>
|
1765
|
+
</xsl:choose>
|
1766
|
+
</xsl:for-each>
|
1767
|
+
</fo:table>-->
|
1768
|
+
|
1668
1769
|
|
1669
1770
|
|
1670
1771
|
|
@@ -1674,6 +1775,7 @@
|
|
1674
1775
|
<xsl:if test="normalize-space() != ''">
|
1675
1776
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1676
1777
|
|
1778
|
+
|
1677
1779
|
<xsl:apply-templates/>
|
1678
1780
|
</fo:block>
|
1679
1781
|
</xsl:if>
|
@@ -1729,6 +1831,13 @@
|
|
1729
1831
|
<xsl:for-each select="xalan:nodeset($table)//tr">
|
1730
1832
|
<xsl:variable name="td_text">
|
1731
1833
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1834
|
+
|
1835
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1836
|
+
<xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
|
1837
|
+
<word><xsl:value-of select="normalize-space(.)"/></word>
|
1838
|
+
</xsl:for-each>
|
1839
|
+
</xsl:if> -->
|
1840
|
+
|
1732
1841
|
</xsl:variable>
|
1733
1842
|
<xsl:variable name="words">
|
1734
1843
|
<xsl:variable name="string_with_added_zerospaces">
|
@@ -1788,11 +1897,14 @@
|
|
1788
1897
|
<xsl:value-of select="*[local-name()='origin']/@citeas"/>
|
1789
1898
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
1790
1899
|
<xsl:value-of select="@target"/>
|
1900
|
+
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
1901
|
+
<xsl:variable name="math_text" select="normalize-space(.)"/>
|
1902
|
+
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
1791
1903
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
1792
1904
|
<xsl:param name="cols-count"/>
|
1793
1905
|
<!-- font-weight="bold" -->
|
1794
1906
|
<fo:table-header>
|
1795
|
-
|
1907
|
+
|
1796
1908
|
<xsl:apply-templates/>
|
1797
1909
|
</fo:table-header>
|
1798
1910
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -1817,6 +1929,13 @@
|
|
1817
1929
|
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
|
1818
1930
|
<xsl:apply-templates/>
|
1819
1931
|
</xsl:template><xsl:template name="insertTableFooter">
|
1932
|
+
<xsl:param name="cols-count"/>
|
1933
|
+
<xsl:if test="../*[local-name()='tfoot']">
|
1934
|
+
<fo:table-footer>
|
1935
|
+
<xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
|
1936
|
+
</fo:table-footer>
|
1937
|
+
</xsl:if>
|
1938
|
+
</xsl:template><xsl:template name="insertTableFooter2">
|
1820
1939
|
<xsl:param name="cols-count"/>
|
1821
1940
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1822
1941
|
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
|
@@ -1838,11 +1957,29 @@
|
|
1838
1957
|
<!-- fn will be processed inside 'note' processing -->
|
1839
1958
|
|
1840
1959
|
|
1960
|
+
|
1961
|
+
|
1962
|
+
|
1963
|
+
|
1841
1964
|
<!-- except gb -->
|
1842
1965
|
|
1843
1966
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1844
1967
|
|
1845
1968
|
|
1969
|
+
<!-- show Note under table in preface (ex. abstract) sections -->
|
1970
|
+
<!-- empty, because notes show at page side in main sections -->
|
1971
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1972
|
+
<xsl:choose>
|
1973
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
1974
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1975
|
+
</xsl:when>
|
1976
|
+
<xsl:otherwise>
|
1977
|
+
<fo:block/>
|
1978
|
+
</xsl:otherwise>
|
1979
|
+
</xsl:choose>
|
1980
|
+
</xsl:if> -->
|
1981
|
+
|
1982
|
+
|
1846
1983
|
<!-- horizontal row separator -->
|
1847
1984
|
|
1848
1985
|
|
@@ -1856,6 +1993,88 @@
|
|
1856
1993
|
</fo:table-footer>
|
1857
1994
|
|
1858
1995
|
</xsl:if>
|
1996
|
+
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1997
|
+
<xsl:param name="table_attributes"/>
|
1998
|
+
<xsl:param name="colwidths"/>
|
1999
|
+
|
2000
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2001
|
+
|
2002
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
2003
|
+
|
2004
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
|
2005
|
+
|
2006
|
+
<fo:table keep-with-previous="always">
|
2007
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
2008
|
+
<xsl:choose>
|
2009
|
+
<xsl:when test="@name = 'border-top'">
|
2010
|
+
<xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
|
2011
|
+
</xsl:when>
|
2012
|
+
<xsl:when test="@name = 'border'">
|
2013
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
2014
|
+
<xsl:attribute name="border-top">0pt solid black</xsl:attribute>
|
2015
|
+
</xsl:when>
|
2016
|
+
<xsl:otherwise>
|
2017
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
2018
|
+
</xsl:otherwise>
|
2019
|
+
</xsl:choose>
|
2020
|
+
</xsl:for-each>
|
2021
|
+
|
2022
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2023
|
+
<xsl:choose>
|
2024
|
+
<xsl:when test=". = 1 or . = 0">
|
2025
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2026
|
+
</xsl:when>
|
2027
|
+
<xsl:otherwise>
|
2028
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2029
|
+
</xsl:otherwise>
|
2030
|
+
</xsl:choose>
|
2031
|
+
</xsl:for-each>
|
2032
|
+
|
2033
|
+
<fo:table-body>
|
2034
|
+
<fo:table-row>
|
2035
|
+
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
2036
|
+
|
2037
|
+
|
2038
|
+
|
2039
|
+
<!-- fn will be processed inside 'note' processing -->
|
2040
|
+
|
2041
|
+
|
2042
|
+
|
2043
|
+
|
2044
|
+
|
2045
|
+
|
2046
|
+
|
2047
|
+
<!-- except gb -->
|
2048
|
+
|
2049
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
2050
|
+
|
2051
|
+
|
2052
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2053
|
+
<xsl:choose>
|
2054
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
2055
|
+
show Note under table in preface (ex. abstract) sections
|
2056
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
2057
|
+
</xsl:when>
|
2058
|
+
<xsl:otherwise>
|
2059
|
+
empty, because notes show at page side in main sections
|
2060
|
+
<fo:block/>
|
2061
|
+
</xsl:otherwise>
|
2062
|
+
</xsl:choose>
|
2063
|
+
</xsl:if> -->
|
2064
|
+
|
2065
|
+
|
2066
|
+
<!-- horizontal row separator -->
|
2067
|
+
|
2068
|
+
|
2069
|
+
<!-- fn processing -->
|
2070
|
+
<xsl:call-template name="fn_display"/>
|
2071
|
+
|
2072
|
+
</fo:table-cell>
|
2073
|
+
</fo:table-row>
|
2074
|
+
</fo:table-body>
|
2075
|
+
|
2076
|
+
</fo:table>
|
2077
|
+
</xsl:if>
|
1859
2078
|
</xsl:template><xsl:template match="*[local-name()='tbody']">
|
1860
2079
|
|
1861
2080
|
<xsl:variable name="cols-count">
|
@@ -1911,8 +2130,12 @@
|
|
1911
2130
|
|
1912
2131
|
</xsl:if>
|
1913
2132
|
|
1914
|
-
|
1915
|
-
|
2133
|
+
|
2134
|
+
|
2135
|
+
|
2136
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2137
|
+
<xsl:attribute name="height">8mm</xsl:attribute>
|
2138
|
+
</xsl:if> -->
|
1916
2139
|
|
1917
2140
|
<xsl:apply-templates/>
|
1918
2141
|
</fo:table-row>
|
@@ -1940,6 +2163,7 @@
|
|
1940
2163
|
|
1941
2164
|
|
1942
2165
|
|
2166
|
+
|
1943
2167
|
<xsl:if test="@colspan">
|
1944
2168
|
<xsl:attribute name="number-columns-spanned">
|
1945
2169
|
<xsl:value-of select="@colspan"/>
|
@@ -1979,7 +2203,7 @@
|
|
1979
2203
|
|
1980
2204
|
|
1981
2205
|
|
1982
|
-
|
2206
|
+
|
1983
2207
|
|
1984
2208
|
|
1985
2209
|
|
@@ -1990,6 +2214,7 @@
|
|
1990
2214
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1991
2215
|
</xsl:if>
|
1992
2216
|
|
2217
|
+
|
1993
2218
|
<xsl:if test="@colspan">
|
1994
2219
|
<xsl:attribute name="number-columns-spanned">
|
1995
2220
|
<xsl:value-of select="@colspan"/>
|
@@ -2001,7 +2226,8 @@
|
|
2001
2226
|
</xsl:attribute>
|
2002
2227
|
</xsl:if>
|
2003
2228
|
<xsl:call-template name="display-align"/>
|
2004
|
-
<fo:block>
|
2229
|
+
<fo:block>
|
2230
|
+
|
2005
2231
|
<xsl:apply-templates/>
|
2006
2232
|
</fo:block>
|
2007
2233
|
</fo:table-cell>
|
@@ -2013,14 +2239,17 @@
|
|
2013
2239
|
|
2014
2240
|
|
2015
2241
|
|
2242
|
+
|
2243
|
+
|
2016
2244
|
<fo:inline padding-right="2mm">
|
2017
2245
|
|
2018
2246
|
|
2019
2247
|
|
2020
|
-
|
2248
|
+
|
2021
2249
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
2022
2250
|
|
2023
2251
|
</fo:inline>
|
2252
|
+
|
2024
2253
|
<xsl:apply-templates mode="process"/>
|
2025
2254
|
</fo:block>
|
2026
2255
|
|
@@ -2044,6 +2273,7 @@
|
|
2044
2273
|
|
2045
2274
|
|
2046
2275
|
|
2276
|
+
|
2047
2277
|
<fo:inline font-size="80%" padding-right="5mm" id="{@id}">
|
2048
2278
|
|
2049
2279
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
@@ -2055,14 +2285,17 @@
|
|
2055
2285
|
|
2056
2286
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2057
2287
|
|
2288
|
+
|
2058
2289
|
<xsl:value-of select="@reference"/>
|
2059
2290
|
|
2291
|
+
|
2060
2292
|
</fo:inline>
|
2061
2293
|
<fo:inline>
|
2062
2294
|
|
2063
2295
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2064
2296
|
|
2065
|
-
<xsl:apply-templates/>
|
2297
|
+
<!-- <xsl:apply-templates /> -->
|
2298
|
+
<xsl:copy-of select="./node()"/>
|
2066
2299
|
</fo:inline>
|
2067
2300
|
</fo:block>
|
2068
2301
|
</xsl:if>
|
@@ -2099,7 +2332,20 @@
|
|
2099
2332
|
<xsl:variable name="following_dl_colwidths">
|
2100
2333
|
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
2101
2334
|
<xsl:variable name="html-table">
|
2102
|
-
<xsl:variable name="
|
2335
|
+
<xsl:variable name="doc_ns">
|
2336
|
+
|
2337
|
+
</xsl:variable>
|
2338
|
+
<xsl:variable name="ns">
|
2339
|
+
<xsl:choose>
|
2340
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
2341
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
2342
|
+
</xsl:when>
|
2343
|
+
<xsl:otherwise>
|
2344
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
2345
|
+
</xsl:otherwise>
|
2346
|
+
</xsl:choose>
|
2347
|
+
</xsl:variable>
|
2348
|
+
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2103
2349
|
<xsl:element name="{$ns}:table">
|
2104
2350
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2105
2351
|
<tbody>
|
@@ -2164,7 +2410,8 @@
|
|
2164
2410
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
2165
2411
|
</xsl:if>
|
2166
2412
|
|
2167
|
-
<xsl:apply-templates/>
|
2413
|
+
<!-- <xsl:apply-templates /> -->
|
2414
|
+
<xsl:copy-of select="./node()"/>
|
2168
2415
|
</fo:block>
|
2169
2416
|
</fo:table-cell>
|
2170
2417
|
</fo:table-row>
|
@@ -2188,9 +2435,12 @@
|
|
2188
2435
|
|
2189
2436
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2190
2437
|
|
2438
|
+
|
2191
2439
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
2192
2440
|
|
2441
|
+
|
2193
2442
|
<xsl:value-of select="@reference"/>
|
2443
|
+
|
2194
2444
|
</fo:basic-link>
|
2195
2445
|
</fo:inline>
|
2196
2446
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -2198,7 +2448,11 @@
|
|
2198
2448
|
<xsl:apply-templates/>
|
2199
2449
|
</fo:inline>
|
2200
2450
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2201
|
-
<fo:block-container
|
2451
|
+
<fo:block-container>
|
2452
|
+
|
2453
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2454
|
+
|
2455
|
+
|
2202
2456
|
<xsl:if test="parent::*[local-name() = 'note']">
|
2203
2457
|
<xsl:attribute name="margin-left">
|
2204
2458
|
<xsl:choose>
|
@@ -2208,8 +2462,11 @@
|
|
2208
2462
|
</xsl:attribute>
|
2209
2463
|
|
2210
2464
|
</xsl:if>
|
2211
|
-
<fo:block-container
|
2212
|
-
|
2465
|
+
<fo:block-container>
|
2466
|
+
|
2467
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2468
|
+
|
2469
|
+
|
2213
2470
|
<xsl:variable name="parent" select="local-name(..)"/>
|
2214
2471
|
|
2215
2472
|
<xsl:variable name="key_iso">
|
@@ -2223,9 +2480,12 @@
|
|
2223
2480
|
<fo:block margin-bottom="12pt" text-align="left">
|
2224
2481
|
|
2225
2482
|
<xsl:variable name="title-where">
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2483
|
+
|
2484
|
+
|
2485
|
+
<xsl:call-template name="getTitle">
|
2486
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2487
|
+
</xsl:call-template>
|
2488
|
+
|
2229
2489
|
</xsl:variable>
|
2230
2490
|
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
2231
2491
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
@@ -2241,9 +2501,12 @@
|
|
2241
2501
|
|
2242
2502
|
|
2243
2503
|
<xsl:variable name="title-where">
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2504
|
+
|
2505
|
+
|
2506
|
+
<xsl:call-template name="getTitle">
|
2507
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2508
|
+
</xsl:call-template>
|
2509
|
+
|
2247
2510
|
</xsl:variable>
|
2248
2511
|
<xsl:value-of select="$title-where"/>
|
2249
2512
|
</fo:block>
|
@@ -2254,9 +2517,12 @@
|
|
2254
2517
|
|
2255
2518
|
|
2256
2519
|
<xsl:variable name="title-key">
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2520
|
+
|
2521
|
+
|
2522
|
+
<xsl:call-template name="getTitle">
|
2523
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
2524
|
+
</xsl:call-template>
|
2525
|
+
|
2260
2526
|
</xsl:variable>
|
2261
2527
|
<xsl:value-of select="$title-key"/>
|
2262
2528
|
</fo:block>
|
@@ -2296,7 +2562,20 @@
|
|
2296
2562
|
</xsl:choose>
|
2297
2563
|
<!-- create virtual html table for dl/[dt and dd] -->
|
2298
2564
|
<xsl:variable name="html-table">
|
2299
|
-
<xsl:variable name="
|
2565
|
+
<xsl:variable name="doc_ns">
|
2566
|
+
|
2567
|
+
</xsl:variable>
|
2568
|
+
<xsl:variable name="ns">
|
2569
|
+
<xsl:choose>
|
2570
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
2571
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
2572
|
+
</xsl:when>
|
2573
|
+
<xsl:otherwise>
|
2574
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
2575
|
+
</xsl:otherwise>
|
2576
|
+
</xsl:choose>
|
2577
|
+
</xsl:variable>
|
2578
|
+
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2300
2579
|
<xsl:element name="{$ns}:table">
|
2301
2580
|
<tbody>
|
2302
2581
|
<xsl:apply-templates mode="dl"/>
|
@@ -2456,6 +2735,7 @@
|
|
2456
2735
|
|
2457
2736
|
|
2458
2737
|
|
2738
|
+
|
2459
2739
|
<xsl:apply-templates/>
|
2460
2740
|
<!-- <xsl:if test="$namespace = 'gb'">
|
2461
2741
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -2509,6 +2789,7 @@
|
|
2509
2789
|
</fo:inline>
|
2510
2790
|
</xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
|
2511
2791
|
<fo:inline font-weight="bold">
|
2792
|
+
|
2512
2793
|
<xsl:apply-templates/>
|
2513
2794
|
</fo:inline>
|
2514
2795
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
@@ -2522,18 +2803,18 @@
|
|
2522
2803
|
</xsl:template><xsl:template match="*[local-name()='tt']">
|
2523
2804
|
<fo:inline xsl:use-attribute-sets="tt-style">
|
2524
2805
|
<xsl:variable name="_font-size">
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
2806
|
|
2529
2807
|
|
2530
2808
|
|
2531
2809
|
|
2532
2810
|
|
2533
2811
|
|
2534
|
-
|
2535
2812
|
|
2536
|
-
|
2813
|
+
|
2814
|
+
|
2815
|
+
|
2816
|
+
|
2817
|
+
|
2537
2818
|
|
2538
2819
|
|
2539
2820
|
</xsl:variable>
|
@@ -2837,7 +3118,18 @@
|
|
2837
3118
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
2838
3119
|
</xsl:apply-templates>
|
2839
3120
|
</xsl:template><xsl:template name="getLang">
|
2840
|
-
<xsl:variable name="
|
3121
|
+
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
3122
|
+
<xsl:variable name="language">
|
3123
|
+
<xsl:choose>
|
3124
|
+
<xsl:when test="$language_current != ''">
|
3125
|
+
<xsl:value-of select="$language_current"/>
|
3126
|
+
</xsl:when>
|
3127
|
+
<xsl:otherwise>
|
3128
|
+
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
3129
|
+
</xsl:otherwise>
|
3130
|
+
</xsl:choose>
|
3131
|
+
</xsl:variable>
|
3132
|
+
|
2841
3133
|
<xsl:choose>
|
2842
3134
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
2843
3135
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
@@ -2871,7 +3163,8 @@
|
|
2871
3163
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
2872
3164
|
<xsl:value-of select="substring($str, 2)"/>
|
2873
3165
|
</xsl:template><xsl:template match="mathml:math">
|
2874
|
-
<fo:inline font-family="
|
3166
|
+
<fo:inline font-family="STIX Two Math"> <!-- -->
|
3167
|
+
|
2875
3168
|
<xsl:variable name="mathml">
|
2876
3169
|
<xsl:apply-templates select="." mode="mathml"/>
|
2877
3170
|
</xsl:variable>
|
@@ -2901,6 +3194,7 @@
|
|
2901
3194
|
</xsl:choose>
|
2902
3195
|
</xsl:variable>
|
2903
3196
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3197
|
+
|
2904
3198
|
<xsl:choose>
|
2905
3199
|
<xsl:when test="$target = ''">
|
2906
3200
|
<xsl:apply-templates/>
|
@@ -2954,10 +3248,14 @@
|
|
2954
3248
|
</fo:inline>
|
2955
3249
|
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
2956
3250
|
<xsl:variable name="title-modified">
|
2957
|
-
|
2958
|
-
|
2959
|
-
|
3251
|
+
|
3252
|
+
|
3253
|
+
<xsl:call-template name="getTitle">
|
3254
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
3255
|
+
</xsl:call-template>
|
3256
|
+
|
2960
3257
|
</xsl:variable>
|
3258
|
+
|
2961
3259
|
<xsl:choose>
|
2962
3260
|
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
2963
3261
|
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
@@ -2965,7 +3263,7 @@
|
|
2965
3263
|
<xsl:apply-templates/>
|
2966
3264
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
2967
3265
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
2968
|
-
|
3266
|
+
|
2969
3267
|
<xsl:apply-templates/>
|
2970
3268
|
</fo:basic-link>
|
2971
3269
|
</xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
|
@@ -3018,6 +3316,8 @@
|
|
3018
3316
|
|
3019
3317
|
|
3020
3318
|
|
3319
|
+
|
3320
|
+
|
3021
3321
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
3022
3322
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3023
3323
|
</fo:inline>
|
@@ -3110,7 +3410,8 @@
|
|
3110
3410
|
</fo:inline>
|
3111
3411
|
</xsl:if>
|
3112
3412
|
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3113
|
-
<fo:block-container id="{@id}">
|
3413
|
+
<fo:block-container id="{@id}">
|
3414
|
+
|
3114
3415
|
<fo:block>
|
3115
3416
|
<xsl:apply-templates/>
|
3116
3417
|
</fo:block>
|
@@ -3145,19 +3446,113 @@
|
|
3145
3446
|
|
3146
3447
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3147
3448
|
</fo:block>
|
3148
|
-
</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">
|
3449
|
+
</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">
|
3149
3450
|
<xsl:apply-templates mode="contents"/>
|
3150
3451
|
<xsl:text> </xsl:text>
|
3151
|
-
</xsl:template><xsl:template match="
|
3452
|
+
</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">
|
3453
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3454
|
+
<xsl:text> </xsl:text>
|
3455
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
|
3456
|
+
<xsl:value-of select="."/>
|
3457
|
+
</xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
|
3152
3458
|
<xsl:value-of select="."/>
|
3153
|
-
</xsl:template><xsl:template match="
|
3459
|
+
</xsl:template><xsl:template match="node()" mode="contents">
|
3460
|
+
<xsl:apply-templates mode="contents"/>
|
3461
|
+
</xsl:template><xsl:template match="node()" mode="bookmarks">
|
3462
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3463
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3464
|
+
<xsl:apply-templates select="."/>
|
3465
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3466
|
+
<xsl:apply-templates mode="bookmarks"/>
|
3467
|
+
</xsl:template><xsl:template name="addBookmarks">
|
3468
|
+
<xsl:param name="contents"/>
|
3469
|
+
<xsl:if test="xalan:nodeset($contents)//item">
|
3470
|
+
<fo:bookmark-tree>
|
3471
|
+
<xsl:choose>
|
3472
|
+
<xsl:when test="xalan:nodeset($contents)/doc">
|
3473
|
+
<xsl:choose>
|
3474
|
+
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3475
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3476
|
+
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
3477
|
+
<fo:bookmark-title>
|
3478
|
+
<xsl:variable name="bookmark-title_">
|
3479
|
+
<xsl:call-template name="getLangVersion">
|
3480
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3481
|
+
</xsl:call-template>
|
3482
|
+
</xsl:variable>
|
3483
|
+
<xsl:choose>
|
3484
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
3485
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
3486
|
+
</xsl:when>
|
3487
|
+
<xsl:otherwise>
|
3488
|
+
<xsl:choose>
|
3489
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
3490
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
3491
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
3492
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
3493
|
+
</xsl:choose>
|
3494
|
+
</xsl:otherwise>
|
3495
|
+
</xsl:choose>
|
3496
|
+
</fo:bookmark-title>
|
3497
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3498
|
+
</fo:bookmark>
|
3499
|
+
|
3500
|
+
</xsl:for-each>
|
3501
|
+
</xsl:when>
|
3502
|
+
<xsl:otherwise>
|
3503
|
+
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3504
|
+
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3505
|
+
</xsl:for-each>
|
3506
|
+
</xsl:otherwise>
|
3507
|
+
</xsl:choose>
|
3508
|
+
</xsl:when>
|
3509
|
+
<xsl:otherwise>
|
3510
|
+
<xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
|
3511
|
+
</xsl:otherwise>
|
3512
|
+
</xsl:choose>
|
3513
|
+
|
3514
|
+
|
3515
|
+
|
3516
|
+
|
3517
|
+
|
3518
|
+
|
3519
|
+
|
3520
|
+
|
3521
|
+
</fo:bookmark-tree>
|
3522
|
+
</xsl:if>
|
3523
|
+
</xsl:template><xsl:template name="getLangVersion">
|
3524
|
+
<xsl:param name="lang"/>
|
3525
|
+
<xsl:choose>
|
3526
|
+
<xsl:when test="$lang = 'en'">
|
3527
|
+
|
3528
|
+
|
3529
|
+
</xsl:when>
|
3530
|
+
<xsl:when test="$lang = 'fr'">
|
3531
|
+
|
3532
|
+
|
3533
|
+
</xsl:when>
|
3534
|
+
<xsl:when test="$lang = 'de'">Deutsche</xsl:when>
|
3535
|
+
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
3536
|
+
</xsl:choose>
|
3537
|
+
</xsl:template><xsl:template match="item" mode="bookmark">
|
3538
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
3539
|
+
<fo:bookmark-title>
|
3540
|
+
<xsl:if test="@section != ''">
|
3541
|
+
<xsl:value-of select="@section"/>
|
3542
|
+
<xsl:text> </xsl:text>
|
3543
|
+
</xsl:if>
|
3544
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3545
|
+
</fo:bookmark-title>
|
3546
|
+
<xsl:apply-templates mode="bookmark"/>
|
3547
|
+
</fo:bookmark>
|
3548
|
+
</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">
|
3154
3549
|
<xsl:if test="normalize-space() != ''">
|
3155
3550
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
3156
3551
|
|
3157
3552
|
<xsl:if test="nist:dl">
|
3158
3553
|
<xsl:attribute name="space-before">12pt</xsl:attribute>
|
3159
3554
|
</xsl:if>
|
3160
|
-
|
3555
|
+
|
3161
3556
|
<xsl:apply-templates/>
|
3162
3557
|
</fo:block>
|
3163
3558
|
</xsl:if>
|
@@ -3212,7 +3607,7 @@
|
|
3212
3607
|
<xsl:apply-templates/>
|
3213
3608
|
</xsl:otherwise>
|
3214
3609
|
</xsl:choose>
|
3215
|
-
</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">
|
3610
|
+
</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">
|
3216
3611
|
<xsl:text> </xsl:text>
|
3217
3612
|
</xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
|
3218
3613
|
<xsl:copy>
|
@@ -3744,9 +4139,12 @@
|
|
3744
4139
|
</fo:block>
|
3745
4140
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
3746
4141
|
<xsl:variable name="title-deprecated">
|
3747
|
-
|
3748
|
-
|
3749
|
-
|
4142
|
+
|
4143
|
+
|
4144
|
+
<xsl:call-template name="getTitle">
|
4145
|
+
<xsl:with-param name="name" select="'title-deprecated'"/>
|
4146
|
+
</xsl:call-template>
|
4147
|
+
|
3750
4148
|
</xsl:variable>
|
3751
4149
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
3752
4150
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
@@ -3792,13 +4190,14 @@
|
|
3792
4190
|
</xsl:template><xsl:template match="*[local-name() = 'clause']">
|
3793
4191
|
<fo:block>
|
3794
4192
|
<xsl:call-template name="setId"/>
|
4193
|
+
|
3795
4194
|
<xsl:apply-templates/>
|
3796
4195
|
</fo:block>
|
3797
4196
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
3798
4197
|
<fo:block id="{@id}">
|
3799
4198
|
<xsl:apply-templates/>
|
3800
4199
|
</fo:block>
|
3801
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4200
|
+
</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']">
|
3802
4201
|
|
3803
4202
|
<fo:block break-after="page"/>
|
3804
4203
|
|
@@ -3819,20 +4218,30 @@
|
|
3819
4218
|
<!-- 0xA0 to space replacement -->
|
3820
4219
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
3821
4220
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
3822
|
-
<
|
3823
|
-
<xsl:
|
3824
|
-
<
|
3825
|
-
<xsl:
|
3826
|
-
<xsl:
|
3827
|
-
|
3828
|
-
|
3829
|
-
|
3830
|
-
|
3831
|
-
|
3832
|
-
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
4221
|
+
<xsl:choose>
|
4222
|
+
<xsl:when test="parent::*[local-name() = 'note']">
|
4223
|
+
<fo:block-container>
|
4224
|
+
<xsl:attribute name="margin-left">
|
4225
|
+
<xsl:choose>
|
4226
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
4227
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
4228
|
+
</xsl:choose>
|
4229
|
+
</xsl:attribute>
|
4230
|
+
|
4231
|
+
|
4232
|
+
<fo:block-container margin-left="0mm">
|
4233
|
+
<fo:block>
|
4234
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
4235
|
+
</fo:block>
|
4236
|
+
</fo:block-container>
|
4237
|
+
</fo:block-container>
|
4238
|
+
</xsl:when>
|
4239
|
+
<xsl:otherwise>
|
4240
|
+
<fo:block>
|
4241
|
+
<xsl:apply-templates select="." mode="ul_ol"/>
|
4242
|
+
</fo:block>
|
4243
|
+
</xsl:otherwise>
|
4244
|
+
</xsl:choose>
|
3836
4245
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
3837
4246
|
<!-- <row>
|
3838
4247
|
<date>05-07-2013</date>
|
@@ -4005,6 +4414,7 @@
|
|
4005
4414
|
|
4006
4415
|
|
4007
4416
|
|
4417
|
+
|
4008
4418
|
|
4009
4419
|
</xsl:variable>
|
4010
4420
|
<xsl:choose>
|
@@ -4019,6 +4429,7 @@
|
|
4019
4429
|
<dc:creator>
|
4020
4430
|
|
4021
4431
|
|
4432
|
+
|
4022
4433
|
<xsl:for-each select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4023
4434
|
<xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
|
4024
4435
|
<xsl:if test="position() != last()">; </xsl:if>
|
@@ -4033,6 +4444,7 @@
|
|
4033
4444
|
<xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4034
4445
|
|
4035
4446
|
|
4447
|
+
|
4036
4448
|
</xsl:variable>
|
4037
4449
|
<xsl:value-of select="normalize-space($abstract)"/>
|
4038
4450
|
</dc:description>
|
@@ -4104,13 +4516,22 @@
|
|
4104
4516
|
</xsl:template><xsl:template name="split">
|
4105
4517
|
<xsl:param name="pText" select="."/>
|
4106
4518
|
<xsl:param name="sep" select="','"/>
|
4519
|
+
<xsl:param name="normalize-space" select="'true'"/>
|
4107
4520
|
<xsl:if test="string-length($pText) >0">
|
4108
4521
|
<item>
|
4109
|
-
<xsl:
|
4522
|
+
<xsl:choose>
|
4523
|
+
<xsl:when test="$normalize-space = 'true'">
|
4524
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
4525
|
+
</xsl:when>
|
4526
|
+
<xsl:otherwise>
|
4527
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
4528
|
+
</xsl:otherwise>
|
4529
|
+
</xsl:choose>
|
4110
4530
|
</item>
|
4111
4531
|
<xsl:call-template name="split">
|
4112
4532
|
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
4113
4533
|
<xsl:with-param name="sep" select="$sep"/>
|
4534
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
4114
4535
|
</xsl:call-template>
|
4115
4536
|
</xsl:if>
|
4116
4537
|
</xsl:template><xsl:template name="getDocumentId">
|
@@ -4133,6 +4554,7 @@
|
|
4133
4554
|
|
4134
4555
|
|
4135
4556
|
|
4557
|
+
|
4136
4558
|
</xsl:variable>
|
4137
4559
|
<xsl:if test="$documentNS != $XSLNS">
|
4138
4560
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
@@ -4158,4 +4580,40 @@
|
|
4158
4580
|
</xsl:otherwise>
|
4159
4581
|
</xsl:choose>
|
4160
4582
|
</xsl:attribute>
|
4583
|
+
</xsl:template><xsl:template name="add-letter-spacing">
|
4584
|
+
<xsl:param name="text"/>
|
4585
|
+
<xsl:param name="letter-spacing" select="'0.15'"/>
|
4586
|
+
<xsl:if test="string-length($text) > 0">
|
4587
|
+
<xsl:variable name="char" select="substring($text, 1, 1)"/>
|
4588
|
+
<fo:inline padding-right="{$letter-spacing}mm">
|
4589
|
+
<xsl:if test="$char = '®'">
|
4590
|
+
<xsl:attribute name="font-size">58%</xsl:attribute>
|
4591
|
+
<xsl:attribute name="baseline-shift">30%</xsl:attribute>
|
4592
|
+
</xsl:if>
|
4593
|
+
<xsl:value-of select="$char"/>
|
4594
|
+
</fo:inline>
|
4595
|
+
<xsl:call-template name="add-letter-spacing">
|
4596
|
+
<xsl:with-param name="text" select="substring($text, 2)"/>
|
4597
|
+
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4598
|
+
</xsl:call-template>
|
4599
|
+
</xsl:if>
|
4600
|
+
</xsl:template><xsl:template name="repeat">
|
4601
|
+
<xsl:param name="char" select="'*'"/>
|
4602
|
+
<xsl:param name="count"/>
|
4603
|
+
<xsl:if test="$count > 0">
|
4604
|
+
<xsl:value-of select="$char"/>
|
4605
|
+
<xsl:call-template name="repeat">
|
4606
|
+
<xsl:with-param name="char" select="$char"/>
|
4607
|
+
<xsl:with-param name="count" select="$count - 1"/>
|
4608
|
+
</xsl:call-template>
|
4609
|
+
</xsl:if>
|
4610
|
+
</xsl:template><xsl:template name="getLocalizedString">
|
4611
|
+
<xsl:param name="key"/>
|
4612
|
+
|
4613
|
+
<xsl:variable name="curr_lang">
|
4614
|
+
<xsl:call-template name="getLang"/>
|
4615
|
+
</xsl:variable>
|
4616
|
+
|
4617
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4618
|
+
|
4161
4619
|
</xsl:template></xsl:stylesheet>
|