metanorma-bipm 2.7.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -432,7 +432,9 @@
432
432
  </redirect:write>
433
433
  </xsl:if>
434
434
 
435
- <xsl:message>START flatxml_</xsl:message>
435
+ <xsl:if test="$debug = 'true'">
436
+ <xsl:message>START flatxml_</xsl:message>
437
+ </xsl:if>
436
438
  <xsl:variable name="startTime2" select="java:getTime(java:java.util.Date.new())"/>
437
439
  <xsl:variable name="flatxml__">
438
440
  <!-- <xsl:apply-templates select="xalan:nodeset($title_eref)" mode="flatxml"/> -->
@@ -451,16 +453,44 @@
451
453
  <xsl:with-param name="filepath" select="$updated_flatxml_filename"/>
452
454
  </xsl:call-template>
453
455
  <xsl:variable name="endTime2" select="java:getTime(java:java.util.Date.new())"/>
456
+ <xsl:if test="$debug = 'true'">
457
+ <xsl:message>DEBUG: processing time <xsl:value-of select="$endTime2 - $startTime2"/> msec.</xsl:message>
458
+ <xsl:message>END flatxml_</xsl:message>
459
+ </xsl:if>
460
+
461
+ <xsl:if test="$debug = 'true'">
462
+ <redirect:write file="flatxml.xml">
463
+ <xsl:copy-of select="xalan:nodeset($flatxml_)"/>
464
+ </redirect:write>
465
+ </xsl:if>
454
466
 
467
+ <xsl:if test="$debug = 'true'">
468
+ <xsl:message>START flatxml</xsl:message>
469
+ </xsl:if>
470
+ <xsl:variable name="startTime3" select="java:getTime(java:java.util.Date.new())"/>
455
471
  <xsl:variable name="flatxml">
456
472
  <xsl:apply-templates select="xalan:nodeset($flatxml_)" mode="pagebreak"/>
457
473
  </xsl:variable>
474
+ <xsl:variable name="endTime3" select="java:getTime(java:java.util.Date.new())"/>
475
+ <xsl:if test="$debug = 'true'">
476
+ <xsl:message>DEBUG: processing time <xsl:value-of select="$endTime3 - $startTime3"/> msec.</xsl:message>
477
+ <xsl:message>END flatxml</xsl:message>
478
+ </xsl:if>
458
479
 
459
480
  <!-- flatxml=<xsl:copy-of select="$flatxml"/> -->
460
481
 
482
+ <xsl:if test="$debug = 'true'">
483
+ <xsl:message>START bipm-standard</xsl:message>
484
+ </xsl:if>
485
+ <xsl:variable name="startTime4" select="java:getTime(java:java.util.Date.new())"/>
461
486
  <xsl:apply-templates select="xalan:nodeset($flatxml)/mn:metanorma" mode="bipm-standard">
462
487
  <xsl:with-param name="curr_docnum" select="$num"/>
463
488
  </xsl:apply-templates>
489
+ <xsl:variable name="endTime4" select="java:getTime(java:java.util.Date.new())"/>
490
+ <xsl:if test="$debug = 'true'">
491
+ <xsl:message>DEBUG: processing time <xsl:value-of select="$endTime4 - $startTime4"/> msec.</xsl:message>
492
+ <xsl:message>END bipm-standard</xsl:message>
493
+ </xsl:if>
464
494
 
465
495
  </xsl:for-each>
466
496
  </xsl:when>
@@ -1025,7 +1055,7 @@
1025
1055
  </xsl:attribute>
1026
1056
  </xsl:if>
1027
1057
 
1028
- <xsl:call-template name="insertFootnoteSeparator"/>
1058
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1029
1059
 
1030
1060
  <xsl:call-template name="insertHeaderDraftWatermark">
1031
1061
  <xsl:with-param name="lang" select="$curr_lang"/>
@@ -1101,7 +1131,7 @@
1101
1131
 
1102
1132
  <xsl:if test="mn:preface/*[not(self::mn:note or self::mn:admonition)]">
1103
1133
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1104
- <xsl:call-template name="insertFootnoteSeparator"/>
1134
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1105
1135
 
1106
1136
  <xsl:variable name="header-title">
1107
1137
  <xsl:choose>
@@ -1130,7 +1160,7 @@
1130
1160
  </xsl:variable>
1131
1161
 
1132
1162
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1133
- <xsl:call-template name="insertFootnoteSeparator"/>
1163
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
1134
1164
 
1135
1165
  <xsl:variable name="title-toc">
1136
1166
  <fo:inline>
@@ -1145,74 +1175,10 @@
1145
1175
 
1146
1176
  <fo:flow flow-name="xsl-region-body">
1147
1177
 
1148
- <fo:block-container margin-left="-14mm" margin-right="0mm">
1149
- <fo:block-container margin-left="0mm" margin-right="0mm">
1150
- <fo:block font-family="Arial" font-size="16pt" font-weight="bold" text-align-last="justify" margin-bottom="82pt" role="H1">
1151
- <fo:inline><xsl:value-of select="//mn:metanorma/mn:bibdata/mn:title[@language = $curr_lang and @type='title-main']"/></fo:inline>
1152
- <fo:inline keep-together.within-line="always">
1153
- <fo:leader leader-pattern="space"/>
1154
- <fo:inline>
1155
- <xsl:value-of select="$title-toc"/>
1156
- </fo:inline>
1157
- </fo:inline>
1158
- </fo:block>
1159
- </fo:block-container>
1160
- </fo:block-container>
1161
-
1162
- <fo:block-container line-height="135%">
1163
- <fo:block role="TOC">
1164
- <!-- <xsl:copy-of select="$contents"/> -->
1165
-
1166
- <xsl:if test="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true']">
1167
- <fo:table table-layout="fixed" width="100%" id="__internal_layout__toc_{generate-id()}" role="SKIP">
1168
- <fo:table-column column-width="127mm"/>
1169
- <fo:table-column column-width="12mm"/>
1170
- <fo:table-body role="SKIP">
1171
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and not(@type = 'annex') and not(@type = 'index') and not(@parent = 'annex')]">
1172
- <xsl:call-template name="insertContentItem"/>
1173
- </xsl:for-each>
1174
- <!-- insert page break between main sections and appendixes in ToC -->
1175
- <!-- <xsl:if test="$doctype ='brochure'">
1176
- <fo:table-row>
1177
- <fo:table-cell number-columns-spanned="2">
1178
- <fo:block break-after="page"/>
1179
- </fo:table-cell>
1180
- </fo:table-row>
1181
- </xsl:if> -->
1182
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'annex')]"> <!-- or (@level = 2 and @parent = 'annex') -->
1183
- <xsl:call-template name="insertContentItem">
1184
- <xsl:with-param name="keep-with-next">true</xsl:with-param>
1185
- </xsl:call-template>
1186
- </xsl:for-each>
1187
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'index')]">
1188
- <xsl:call-template name="insertContentItem"/>
1189
- </xsl:for-each>
1190
-
1191
- <!-- List of Tables -->
1192
- <xsl:if test="$contents/mnx:doc[@id = $docid]//mnx:tables/mnx:table">
1193
- <xsl:call-template name="insertListOf_Title">
1194
- <xsl:with-param name="title" select="$title-list-tables"/>
1195
- </xsl:call-template>
1196
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:tables/mnx:table">
1197
- <xsl:call-template name="insertListOf_Item"/>
1198
- </xsl:for-each>
1199
- </xsl:if>
1200
-
1201
- <!-- List of Figures -->
1202
- <xsl:if test="$contents/doc[@id = $docid]//mnx:figures/mnx:figure">
1203
- <xsl:call-template name="insertListOf_Title">
1204
- <xsl:with-param name="title" select="$title-list-figures"/>
1205
- </xsl:call-template>
1206
- <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:figures/mnx:figure">
1207
- <xsl:call-template name="insertListOf_Item"/>
1208
- </xsl:for-each>
1209
- </xsl:if>
1210
-
1211
- </fo:table-body>
1212
- </fo:table>
1213
- </xsl:if>
1214
- </fo:block>
1215
- </fo:block-container>
1178
+ <xsl:call-template name="toc">
1179
+ <xsl:with-param name="docid" select="$docid"/>
1180
+ <xsl:with-param name="curr_lang" select="$curr_lang"/>
1181
+ </xsl:call-template>
1216
1182
 
1217
1183
  </fo:flow>
1218
1184
 
@@ -1237,6 +1203,7 @@
1237
1203
  <!-- Document Control -->
1238
1204
  <xsl:apply-templates select="mn:doccontrol | mn:colophon" mode="sections"/>
1239
1205
 
1206
+ <!-- indexes=<xsl:copy-of select="$indexes"/> -->
1240
1207
  <!-- Index -->
1241
1208
  <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//mn:indexsect" mode="index">
1242
1209
  <xsl:with-param name="isDraft" select="normalize-space(//mn:metanorma/mn:bibdata/mn:version/mn:draft or contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'draft') or contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'projet'))"/>
@@ -1894,9 +1861,85 @@
1894
1861
  </xsl:choose>
1895
1862
  </xsl:template>
1896
1863
 
1864
+ <xsl:template name="toc">
1865
+ <xsl:param name="curr_lang"/>
1866
+ <xsl:param name="docid"/>
1867
+
1868
+ <xsl:variable name="title-toc"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">table_of_contents</xsl:with-param></xsl:call-template></xsl:variable>
1869
+
1870
+ <!-- <fo:block-container margin-left="-14mm" margin-right="0mm">
1871
+ <fo:block-container margin-left="0mm" margin-right="0mm"> -->
1872
+ <fo:block xsl:use-attribute-sets="toc-title-style">
1873
+ <fo:inline><xsl:value-of select="//mn:metanorma/mn:bibdata/mn:title[@language = $curr_lang and @type='title-main']"/></fo:inline>
1874
+ <fo:inline keep-together.within-line="always">
1875
+ <fo:leader leader-pattern="space"/>
1876
+ <fo:inline>
1877
+ <xsl:value-of select="$title-toc"/>
1878
+ </fo:inline>
1879
+ </fo:inline>
1880
+ </fo:block>
1881
+ <!-- </fo:block-container>
1882
+ </fo:block-container> -->
1883
+
1884
+ <fo:block-container xsl:use-attribute-sets="toc-style">
1885
+ <fo:block role="TOC">
1886
+ <!-- <xsl:copy-of select="$contents"/> -->
1887
+
1888
+ <xsl:if test="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true']">
1889
+ <fo:table table-layout="fixed" width="100%" id="__internal_layout__toc_{generate-id()}" role="SKIP">
1890
+ <fo:table-column column-width="127mm"/>
1891
+ <fo:table-column column-width="12mm"/>
1892
+ <fo:table-body role="SKIP">
1893
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and not(@type = 'annex') and not(@type = 'index') and not(@parent = 'annex')]">
1894
+ <xsl:call-template name="insertContentItem"/>
1895
+ </xsl:for-each>
1896
+ <!-- insert page break between main sections and appendixes in ToC -->
1897
+ <!-- <xsl:if test="$doctype ='brochure'">
1898
+ <fo:table-row>
1899
+ <fo:table-cell number-columns-spanned="2">
1900
+ <fo:block break-after="page"/>
1901
+ </fo:table-cell>
1902
+ </fo:table-row>
1903
+ </xsl:if> -->
1904
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'annex')]"> <!-- or (@level = 2 and @parent = 'annex') -->
1905
+ <xsl:call-template name="insertContentItem">
1906
+ <xsl:with-param name="keep-with-next">true</xsl:with-param>
1907
+ </xsl:call-template>
1908
+ </xsl:for-each>
1909
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:item[@display='true' and (@type = 'index')]">
1910
+ <xsl:call-template name="insertContentItem"/>
1911
+ </xsl:for-each>
1912
+
1913
+ <!-- List of Tables -->
1914
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:tables/mnx:table">
1915
+ <xsl:if test="position() = 1">
1916
+ <xsl:call-template name="insertListOf_Title">
1917
+ <xsl:with-param name="title" select="$title-list-tables"/>
1918
+ </xsl:call-template>
1919
+ </xsl:if>
1920
+ <xsl:call-template name="insertListOf_Item"/>
1921
+ </xsl:for-each>
1922
+
1923
+ <!-- List of Figures -->
1924
+ <xsl:for-each select="$contents/mnx:doc[@id = $docid]//mnx:figures/mnx:figure">
1925
+ <xsl:if test="position() = 1">
1926
+ <xsl:call-template name="insertListOf_Title">
1927
+ <xsl:with-param name="title" select="$title-list-figures"/>
1928
+ </xsl:call-template>
1929
+ </xsl:if>
1930
+ <xsl:call-template name="insertListOf_Item"/>
1931
+ </xsl:for-each>
1932
+
1933
+ </fo:table-body>
1934
+ </fo:table>
1935
+ </xsl:if>
1936
+ </fo:block>
1937
+ </fo:block-container>
1938
+ </xsl:template>
1939
+
1897
1940
  <xsl:template name="insertContentItem">
1898
1941
  <xsl:param name="keep-with-next"/>
1899
- <fo:table-row role="TOCI">
1942
+ <fo:table-row xsl:use-attribute-sets="toc-item-style">
1900
1943
  <xsl:if test="$keep-with-next = 'true'">
1901
1944
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1902
1945
  </xsl:if>
@@ -1922,32 +1965,8 @@
1922
1965
  <xsl:attribute name="padding-bottom"><xsl:value-of select="normalize-space($space-after)"/></xsl:attribute>
1923
1966
  </xsl:if>
1924
1967
  <fo:block role="SKIP">
1925
- <xsl:if test="@level = 1">
1926
- <xsl:attribute name="font-family">Arial</xsl:attribute>
1927
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1928
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1929
- </xsl:if>
1930
- <xsl:if test="@level &gt;= 2 and not(@parent = 'annex')">
1931
- <xsl:attribute name="font-size">10.5pt</xsl:attribute>
1932
- </xsl:if>
1933
- <xsl:if test="@level = 2">
1934
- <xsl:attribute name="margin-left">8mm</xsl:attribute>
1935
- </xsl:if>
1936
- <xsl:if test="@level &gt; 2">
1937
- <xsl:attribute name="margin-left">9mm</xsl:attribute>
1938
- </xsl:if>
1939
- <xsl:if test="@level &gt;= 2 and @parent = 'annex'">
1940
- <xsl:attribute name="font-family">Arial</xsl:attribute>
1941
- <xsl:attribute name="font-size">8pt</xsl:attribute>
1942
- <xsl:attribute name="margin-left">25mm</xsl:attribute>
1943
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1944
- </xsl:if>
1945
- <xsl:if test="@type = 'index'">
1946
- <xsl:attribute name="font-family">Arial</xsl:attribute>
1947
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1948
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1949
- <xsl:attribute name="space-before">14pt</xsl:attribute>
1950
- </xsl:if>
1968
+
1969
+ <xsl:call-template name="refine_toc-item-style"/>
1951
1970
 
1952
1971
  <fo:list-block role="SKIP">
1953
1972
  <xsl:attribute name="provisional-distance-between-starts">
@@ -1961,15 +1980,16 @@
1961
1980
  </xsl:attribute>
1962
1981
 
1963
1982
  <fo:list-item role="SKIP">
1983
+
1964
1984
  <fo:list-item-label end-indent="label-end()" role="SKIP">
1965
1985
  <fo:block role="SKIP">
1966
1986
  <xsl:if test="@level = 1 or (@level = 2 and not(@parent = 'annex'))">
1967
1987
  <xsl:value-of select="@section"/>
1968
1988
  <xsl:if test="normalize-space(@section) != '' and @type = 'annex'">.</xsl:if>
1969
1989
  </xsl:if>
1970
-
1971
1990
  </fo:block>
1972
1991
  </fo:list-item-label>
1992
+
1973
1993
  <fo:list-item-body start-indent="body-start()" role="SKIP">
1974
1994
  <fo:block role="SKIP">
1975
1995
  <xsl:if test="@level &gt;= 3">
@@ -2001,7 +2021,7 @@
2001
2021
  </xsl:if>
2002
2022
  <fo:block role="SKIP">
2003
2023
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}" role="SKIP">
2004
- <fo:inline font-family="Arial" font-weight="bold" font-size="10pt" role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
2024
+ <fo:inline xsl:use-attribute-sets="toc-pagenumber-style" role="SKIP"><fo:wrapper role="artifact"><fo:page-number-citation ref-id="{@id}"/></fo:wrapper></fo:inline>
2005
2025
  </fo:basic-link>
2006
2026
  </fo:block>
2007
2027
  </fo:table-cell>
@@ -2011,7 +2031,7 @@
2011
2031
  <xsl:template name="insertListOf_Title">
2012
2032
  <xsl:param name="title"/>
2013
2033
  <fo:table-row keep-with-next="always">
2014
- <fo:table-cell font-family="Arial" font-weight="bold" font-size="10pt" padding-top="14pt" padding-bottom="6pt">
2034
+ <fo:table-cell xsl:use-attribute-sets="toc-listof-title-style">
2015
2035
  <fo:block role="TOCI">
2016
2036
  <xsl:value-of select="$title"/>
2017
2037
  </fo:block>
@@ -2025,7 +2045,7 @@
2025
2045
  <xsl:template name="insertListOf_Item">
2026
2046
  <fo:table-row>
2027
2047
  <fo:table-cell>
2028
- <fo:block role="TOCI" font-size="10.5pt" margin-left="8mm">
2048
+ <fo:block xsl:use-attribute-sets="toc-listof-item-style">
2029
2049
  <fo:list-block provisional-distance-between-starts="8mm">
2030
2050
  <fo:list-item>
2031
2051
  <fo:list-item-label end-indent="label-end()">
@@ -2047,7 +2067,7 @@
2047
2067
  </fo:list-block>
2048
2068
  </fo:block>
2049
2069
  </fo:table-cell>
2050
- <fo:table-cell text-align="right" font-family="Arial" font-weight="bold" font-size="10pt">
2070
+ <fo:table-cell xsl:use-attribute-sets="toc-pagenumber-style" text-align="right">
2051
2071
  <fo:block>
2052
2072
  <fo:basic-link internal-destination="{@id}">
2053
2073
  <xsl:call-template name="setAltText">
@@ -2137,7 +2157,7 @@
2137
2157
  <xsl:attribute name="master-reference">document-landscape</xsl:attribute>
2138
2158
  </xsl:if>
2139
2159
 
2140
- <xsl:call-template name="insertFootnoteSeparator"/>
2160
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2141
2161
 
2142
2162
  <xsl:variable name="header-title">
2143
2163
  <xsl:choose>
@@ -2194,7 +2214,7 @@
2194
2214
 
2195
2215
  <xsl:template name="sections_appendix">
2196
2216
  <fo:page-sequence master-reference="document" force-page-count="no-force">
2197
- <xsl:call-template name="insertFootnoteSeparator"/>
2217
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
2198
2218
 
2199
2219
  <xsl:variable name="curr_lang" select="/mn:metanorma/mn:bibdata/mn:language[@current = 'true']"/>
2200
2220
 
@@ -3405,7 +3425,7 @@
3405
3425
  <fo:table-column column-width="100%"/>
3406
3426
  <fo:table-header role="SKIP">
3407
3427
  <fo:table-row font-weight="bold" role="SKIP">
3408
- <fo:table-cell text-align="right" font-size="9pt" font-family="Arial" role="SKIP">
3428
+ <fo:table-cell xsl:use-attribute-sets="toc-title-page-style">
3409
3429
  <fo:block role="Caption">
3410
3430
  <xsl:variable name="page">
3411
3431
  <xsl:call-template name="getLocalizedString">
@@ -3643,14 +3663,6 @@
3643
3663
  </xsl:choose>
3644
3664
  </xsl:template>
3645
3665
 
3646
- <xsl:template name="insertFootnoteSeparator">
3647
- <fo:static-content flow-name="xsl-footnote-separator">
3648
- <fo:block>
3649
- <fo:leader leader-pattern="rule" leader-length="30%"/>
3650
- </fo:block>
3651
- </fo:static-content>
3652
- </xsl:template>
3653
-
3654
3666
  <!-- =================== -->
3655
3667
  <!-- Index processing -->
3656
3668
  <!-- =================== -->
@@ -9067,6 +9079,16 @@
9067
9079
  </xsl:variable>
9068
9080
  <xsl:variable name="quot">"</xsl:variable>
9069
9081
  <xsl:variable name="styles_">
9082
+ <!-- PDF: Borderless tables https://github.com/metanorma/metanorma-jis/issues/344 -->
9083
+ <xsl:if test="@plain = 'true' or ancestor::mn:table/@plain = 'true'">
9084
+ <style name="border-top">none</style>
9085
+ <style name="border-right">none</style>
9086
+ <style name="border-left">none</style>
9087
+ <style name="border-bottom">none</style>
9088
+ <style name="color">inherit</style>
9089
+ <style name="background-color">transparent</style>
9090
+ </xsl:if>
9091
+
9070
9092
  <xsl:for-each select="xalan:nodeset($styles__)/mnx:item">
9071
9093
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
9072
9094
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
@@ -11085,7 +11107,10 @@
11085
11107
 
11086
11108
  <xsl:call-template name="setNamedDestination"/>
11087
11109
 
11088
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
11110
+ <fo:block-container xsl:use-attribute-sets="note-style" role="SKIP">
11111
+ <xsl:if test="not(parent::mn:references)">
11112
+ <xsl:copy-of select="@id"/>
11113
+ </xsl:if>
11089
11114
 
11090
11115
  <xsl:call-template name="setBlockSpanAll"/>
11091
11116
 
@@ -13582,7 +13607,7 @@
13582
13607
 
13583
13608
  <xsl:template name="insertFootnoteSeparatorCommon">
13584
13609
  <xsl:param name="leader_length">30%</xsl:param>
13585
- <fo:static-content flow-name="xsl-footnote-separator">
13610
+ <fo:static-content flow-name="xsl-footnote-separator" role="artifact">
13586
13611
  <fo:block>
13587
13612
  <fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
13588
13613
  </fo:block>
@@ -13818,8 +13843,8 @@
13818
13843
  </xsl:template> <!-- bibitem -->
13819
13844
 
13820
13845
  <!-- Bibliography (non-normative references) -->
13821
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
13822
- <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
13846
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
13847
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
13823
13848
  <!-- start BIPM bibitem processing -->
13824
13849
  <xsl:call-template name="setNamedDestination"/>
13825
13850
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
@@ -13871,7 +13896,7 @@
13871
13896
  </fo:list-item>
13872
13897
  </xsl:otherwise>
13873
13898
  </xsl:choose>
13874
- <xsl:apply-templates select="following-sibling::*[1][self::mn:bibitem]">
13899
+ <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
13875
13900
  <xsl:with-param name="skip">false</xsl:with-param>
13876
13901
  </xsl:apply-templates>
13877
13902
  </xsl:template>
@@ -13888,8 +13913,26 @@
13888
13913
  </xsl:apply-templates>
13889
13914
  <xsl:apply-templates select="mn:formattedref"/>
13890
13915
  <!-- end bibitem processing -->
13916
+
13917
+ <xsl:call-template name="processBibliographyNote"/>
13891
13918
  </xsl:template> <!-- processBibitem (bibitem) -->
13892
13919
 
13920
+ <xsl:template name="processBibliographyNote">
13921
+ <xsl:if test="self::mn:note">
13922
+ <xsl:variable name="note_node">
13923
+ <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
13924
+ <xsl:copy> <!-- skip @id -->
13925
+ <xsl:copy-of select="node()"/>
13926
+ </xsl:copy>
13927
+ </xsl:element>
13928
+ </xsl:variable>
13929
+ <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
13930
+ <xsl:call-template name="note"/>
13931
+ </xsl:for-each> -->
13932
+ <xsl:call-template name="note"/>
13933
+ </xsl:if>
13934
+ </xsl:template>
13935
+
13893
13936
  <xsl:template match="mn:title" mode="title">
13894
13937
  <fo:inline><xsl:apply-templates/></fo:inline>
13895
13938
  </xsl:template>
@@ -14442,6 +14485,105 @@
14442
14485
  <!-- End Form's elements processing -->
14443
14486
  <!-- =================== -->
14444
14487
 
14488
+ <xsl:attribute-set name="toc-style">
14489
+ <xsl:attribute name="line-height">135%</xsl:attribute>
14490
+ </xsl:attribute-set>
14491
+
14492
+ <xsl:template name="refine_toc-style">
14493
+ </xsl:template>
14494
+
14495
+ <xsl:attribute-set name="toc-title-style">
14496
+ <xsl:attribute name="margin-left">-14mm</xsl:attribute>
14497
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14498
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
14499
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14500
+ <xsl:attribute name="text-align-last">justify</xsl:attribute>
14501
+ <xsl:attribute name="margin-bottom">82pt</xsl:attribute>
14502
+ <xsl:attribute name="role">H1</xsl:attribute>
14503
+ </xsl:attribute-set>
14504
+
14505
+ <xsl:template name="refine_toc-title-style">
14506
+ </xsl:template>
14507
+
14508
+ <xsl:attribute-set name="toc-title-page-style">
14509
+ <xsl:attribute name="text-align">right</xsl:attribute>
14510
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
14511
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14512
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14513
+ </xsl:attribute-set> <!-- toc-title-page-style -->
14514
+
14515
+ <xsl:template name="refine_toc-title-page-style">
14516
+ </xsl:template>
14517
+
14518
+ <xsl:attribute-set name="toc-item-block-style">
14519
+ </xsl:attribute-set>
14520
+
14521
+ <xsl:template name="refine_toc-item-block-style">
14522
+ </xsl:template>
14523
+
14524
+ <xsl:attribute-set name="toc-item-style">
14525
+ <xsl:attribute name="role">TOCI</xsl:attribute>
14526
+ </xsl:attribute-set> <!-- END: toc-item-style -->
14527
+
14528
+ <xsl:template name="refine_toc-item-style">
14529
+ <xsl:if test="@level = 1">
14530
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14531
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
14532
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14533
+ </xsl:if>
14534
+ <xsl:if test="@level &gt;= 2 and not(@parent = 'annex')">
14535
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
14536
+ </xsl:if>
14537
+ <xsl:if test="@level = 2">
14538
+ <xsl:attribute name="margin-left">8mm</xsl:attribute>
14539
+ </xsl:if>
14540
+ <xsl:if test="@level &gt; 2">
14541
+ <xsl:attribute name="margin-left">9mm</xsl:attribute>
14542
+ </xsl:if>
14543
+ <xsl:if test="@level &gt;= 2 and @parent = 'annex'">
14544
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14545
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
14546
+ <xsl:attribute name="margin-left">25mm</xsl:attribute>
14547
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14548
+ </xsl:if>
14549
+ <xsl:if test="@type = 'index'">
14550
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14551
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
14552
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14553
+ <xsl:attribute name="space-before">14pt</xsl:attribute>
14554
+ </xsl:if>
14555
+ </xsl:template> <!-- END: refine_toc-item-style -->
14556
+
14557
+ <xsl:attribute-set name="toc-leader-style">
14558
+ </xsl:attribute-set> <!-- END: toc-leader-style -->
14559
+
14560
+ <xsl:attribute-set name="toc-pagenumber-style">
14561
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14562
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14563
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
14564
+ </xsl:attribute-set>
14565
+
14566
+ <!-- List of Figures, Tables -->
14567
+ <xsl:attribute-set name="toc-listof-title-style">
14568
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
14569
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14570
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
14571
+ <xsl:attribute name="padding-top">14pt</xsl:attribute>
14572
+ <xsl:attribute name="padding-bottom">6pt</xsl:attribute>
14573
+ </xsl:attribute-set>
14574
+
14575
+ <xsl:template name="refine_toc-listof-title-style">
14576
+ </xsl:template>
14577
+
14578
+ <xsl:attribute-set name="toc-listof-item-block-style">
14579
+ </xsl:attribute-set>
14580
+
14581
+ <xsl:attribute-set name="toc-listof-item-style">
14582
+ <xsl:attribute name="role">TOCI</xsl:attribute>
14583
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
14584
+ <xsl:attribute name="margin-left">8mm</xsl:attribute>
14585
+ </xsl:attribute-set>
14586
+
14445
14587
  <xsl:template name="processPrefaceSectionsDefault_Contents">
14446
14588
  <xsl:variable name="nodes_preface_">
14447
14589
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -14779,7 +14921,7 @@
14779
14921
  </xsl:if>
14780
14922
 
14781
14923
  <xsl:for-each select="$contents_nodes/mnx:doc">
14782
- <fo:bookmark internal-destination="{contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
14924
+ <fo:bookmark internal-destination="{mnx:contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
14783
14925
  <xsl:if test="@bundle = 'true'">
14784
14926
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
14785
14927
  </xsl:if>
@@ -14813,7 +14955,7 @@
14813
14955
  </xsl:choose>
14814
14956
  </fo:bookmark-title>
14815
14957
 
14816
- <xsl:apply-templates select="contents/mnx:item" mode="bookmark"/>
14958
+ <xsl:apply-templates select="mnx:contents/mnx:item" mode="bookmark"/>
14817
14959
 
14818
14960
  <xsl:call-template name="insertFigureBookmarks">
14819
14961
  <xsl:with-param name="contents" select="mnx:contents"/>