metanorma-bipm 0.0.3 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -47,6 +55,13 @@
47
55
  <param name="pattern">\i\c*|\c+#\c+</param>
48
56
  </data>
49
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
50
65
  <optional>
51
66
  <attribute name="type">
52
67
  <ref name="ReferenceFormat"/>
@@ -141,6 +156,11 @@
141
156
  <data type="boolean"/>
142
157
  </attribute>
143
158
  </optional>
159
+ <optional>
160
+ <attribute name="key">
161
+ <data type="boolean"/>
162
+ </attribute>
163
+ </optional>
144
164
  <oneOrMore>
145
165
  <ref name="dt"/>
146
166
  <ref name="dd"/>
@@ -233,6 +253,12 @@
233
253
  <data type="boolean"/>
234
254
  </attribute>
235
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
259
+ <optional>
260
+ <ref name="colgroup"/>
261
+ </optional>
236
262
  <optional>
237
263
  <ref name="tname"/>
238
264
  </optional>
@@ -751,6 +777,18 @@
751
777
  </define>
752
778
  </include>
753
779
  <!-- end overrides -->
780
+ <define name="colgroup">
781
+ <element name="colgroup">
782
+ <oneOrMore>
783
+ <ref name="col"/>
784
+ </oneOrMore>
785
+ </element>
786
+ </define>
787
+ <define name="col">
788
+ <element name="col">
789
+ <attribute name="width"/>
790
+ </element>
791
+ </define>
754
792
  <define name="TextElement" combine="choice">
755
793
  <ref name="concept"/>
756
794
  </define>
@@ -801,6 +839,9 @@
801
839
  <data type="boolean"/>
802
840
  </attribute>
803
841
  </optional>
842
+ <optional>
843
+ <attribute name="number"/>
844
+ </optional>
804
845
  <optional>
805
846
  <attribute name="obligation">
806
847
  <choice>
@@ -856,9 +897,11 @@
856
897
  <element name="code">
857
898
  <text/>
858
899
  </element>
859
- <element name="text">
860
- <text/>
861
- </element>
900
+ <optional>
901
+ <element name="text">
902
+ <text/>
903
+ </element>
904
+ </optional>
862
905
  </element>
863
906
  </define>
864
907
  <define name="standard-document">
@@ -1028,6 +1071,9 @@
1028
1071
  </choice>
1029
1072
  </attribute>
1030
1073
  </optional>
1074
+ <optional>
1075
+ <attribute name="number"/>
1076
+ </optional>
1031
1077
  <optional>
1032
1078
  <attribute name="type"/>
1033
1079
  </optional>
@@ -1081,6 +1127,9 @@
1081
1127
  <optional>
1082
1128
  <attribute name="type"/>
1083
1129
  </optional>
1130
+ <optional>
1131
+ <attribute name="number"/>
1132
+ </optional>
1084
1133
  <optional>
1085
1134
  <ref name="section-title"/>
1086
1135
  </optional>
@@ -1183,6 +1232,9 @@
1183
1232
  <optional>
1184
1233
  <attribute name="type"/>
1185
1234
  </optional>
1235
+ <optional>
1236
+ <attribute name="number"/>
1237
+ </optional>
1186
1238
  <optional>
1187
1239
  <attribute name="obligation">
1188
1240
  <choice>
@@ -1511,6 +1563,7 @@
1511
1563
  <value>add</value>
1512
1564
  <value>modify</value>
1513
1565
  <value>delete</value>
1566
+ <value>replace</value>
1514
1567
  </choice>
1515
1568
  </attribute>
1516
1569
  <optional>
@@ -1541,6 +1594,11 @@
1541
1594
  </optional>
1542
1595
  <optional>
1543
1596
  <element name="newcontent">
1597
+ <optional>
1598
+ <attribute name="id">
1599
+ <data type="ID"/>
1600
+ </attribute>
1601
+ </optional>
1544
1602
  <zeroOrMore>
1545
1603
  <ref name="BasicBlock"/>
1546
1604
  </zeroOrMore>
@@ -7,9 +7,64 @@ module IsoDoc
7
7
  Metanorma::BIPM.configuration
8
8
  end
9
9
 
10
- def ol_attrs(node)
11
- super.merge(attr_code(type: ol_style((node["type"] || "arabic").to_sym),
12
- start: node["start"]))
10
+ def convert1(docxml, filename, dir)
11
+ @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/@acronym"))&.value == "JCGM"
12
+ super
13
+ end
14
+
15
+ def middle(isoxml, out)
16
+ if @jcgm
17
+ super
18
+ else
19
+ middle_title(isoxml, out)
20
+ middle_admonitions(isoxml, out)
21
+ clause isoxml, out
22
+ annex isoxml, out
23
+ bibliography isoxml, out
24
+ end
25
+ end
26
+
27
+ def middle_clause(docxml)
28
+ if @jcgm
29
+ super
30
+ else
31
+ "//sections/*"
32
+ end
33
+ end
34
+
35
+ def render_identifier(id)
36
+ ret = super
37
+ ret[1] = nil if !id[1].nil? && id[1]["type"] == "BIPM"
38
+ ret[2] = nil if !id[2].nil? && id[2]["type"] == "BIPM"
39
+ ret
40
+ end
41
+
42
+ def nonstd_bibitem(list, b, ordinal, biblio)
43
+ list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
44
+ ids = bibitem_ref_code(b)
45
+ identifiers = render_identifier(ids)
46
+ if biblio then ref_entry_code(ref, ordinal, identifiers, ids)
47
+ else
48
+ ref << "#{identifiers[0] || identifiers[1]}"
49
+ ref << " #{identifiers[1]}" if identifiers[0] && identifiers[1]
50
+ end
51
+ ref << " " unless biblio && !identifiers[1]
52
+ reference_format(b, ref)
53
+ end
54
+ end
55
+
56
+ def std_bibitem_entry(list, b, ordinal, biblio)
57
+ list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
58
+ identifiers = render_identifier(bibitem_ref_code(b))
59
+ if biblio then ref_entry_code(ref, ordinal, identifiers, nil)
60
+ else
61
+ ref << "#{identifiers[0] || identifiers[1]}"
62
+ ref << " #{identifiers[1]}" if identifiers[0] && identifiers[1]
63
+ end
64
+ date_note_process(b, ref)
65
+ ref << " " unless biblio && !identifiers[1]
66
+ reference_format(b, ref)
67
+ end
13
68
  end
14
69
  end
15
70
  end
@@ -8,6 +8,13 @@
8
8
  <xsl:param name="initial_page_number"/>
9
9
  <xsl:param name="doc_split_by_language"/>
10
10
 
11
+ <!-- <item id="#">N_page</item> -->
12
+ <!-- param for second pass -->
13
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
14
+ <xsl:variable name="index" select="document($external_index)"/>
15
+
16
+ <xsl:variable name="first_pass" select="count($index//item) = 0"/>
17
+
11
18
  <xsl:variable name="pageWidth" select="'210mm'"/>
12
19
  <xsl:variable name="pageHeight" select="'297mm'"/>
13
20
 
@@ -22,7 +29,7 @@
22
29
 
23
30
  <xsl:variable name="copyrightYear" select="//bipm:bipm-standard/bipm:bibdata/bipm:copyright/bipm:from"/>
24
31
 
25
- <xsl:variable name="doc_first_language" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:language"/>
32
+ <xsl:variable name="doc_first_language" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:language[@current = 'true']"/>
26
33
 
27
34
  <xsl:variable name="lang">
28
35
  <xsl:call-template name="getLang"/>
@@ -31,38 +38,40 @@
31
38
  <xsl:variable name="root-element" select="local-name(/*)"/>
32
39
 
33
40
  <xsl:variable name="contents">
34
-
35
41
  <xsl:choose>
36
42
  <xsl:when test="$root-element = 'metanorma-collection'">
37
-
38
43
  <xsl:choose>
39
44
  <xsl:when test="$doc_split_by_language = ''"><!-- all documents -->
40
45
  <xsl:for-each select="//bipm:bipm-standard">
41
- <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language']"/>
46
+ <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
42
47
  <xsl:variable name="num"><xsl:number level="any" count="bipm:bipm-standard"/></xsl:variable>
48
+ <xsl:variable name="title-part"><xsl:value-of select="bipm:bibdata/bipm:title[@type = 'part']"/></xsl:variable>
43
49
  <xsl:variable name="current_document">
44
- <xsl:apply-templates select="." mode="change_id">
50
+ <!-- <xsl:apply-templates select="." mode="change_id">
45
51
  <xsl:with-param name="lang" select="$lang"/>
46
- </xsl:apply-templates>
52
+ <xsl:with-param name="ignoreReferenceFrom" select="'true'"/>
53
+ </xsl:apply-templates> -->
54
+ <xsl:copy-of select="."/>
47
55
  </xsl:variable>
48
56
  <xsl:for-each select="xalan:nodeset($current_document)">
49
57
  <xsl:variable name="docid">
50
58
  <xsl:call-template name="getDocumentId"/>
51
59
  </xsl:variable>
52
- <doc id="{$docid}" lang="{$lang}">
60
+ <doc id="{$docid}" lang="{$lang}" doctype="{$doctype}" title-part="{$title-part}">
53
61
  <xsl:call-template name="generateContents"/>
54
62
  </doc>
55
63
  </xsl:for-each>
56
64
  </xsl:for-each>
57
65
  </xsl:when>
58
66
  <xsl:otherwise>
59
- <xsl:for-each select="(//bipm:bipm-standard)[*[local-name()='bibdata']/*[local-name()='language'] = $doc_split_by_language]">
60
- <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language']"/>
67
+ <xsl:for-each select="(//bipm:bipm-standard)[*[local-name()='bibdata']/*[local-name()='language'][@current = 'true'] = $doc_split_by_language]">
68
+ <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
61
69
  <xsl:variable name="num"><xsl:number level="any" count="bipm:bipm-standard"/></xsl:variable>
62
70
  <xsl:variable name="current_document">
63
- <xsl:apply-templates select="." mode="change_id">
71
+ <!-- <xsl:apply-templates select="." mode="change_id">
64
72
  <xsl:with-param name="lang" select="$lang"/>
65
- </xsl:apply-templates>
73
+ </xsl:apply-templates> -->
74
+ <xsl:copy-of select="."/>
66
75
  </xsl:variable>
67
76
  <xsl:for-each select="xalan:nodeset($current_document)">
68
77
  <xsl:variable name="docid">
@@ -86,17 +95,107 @@
86
95
  </doc>
87
96
  </xsl:otherwise>
88
97
  </xsl:choose>
89
-
90
98
  </xsl:variable>
91
99
 
92
- <!-- <xsl:variable name="independentAppendix" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/> -->
93
- <xsl:variable name="independentAppendix" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'appendix'])"/>
100
+ <xsl:variable name="indexes">
101
+ <xsl:choose>
102
+ <xsl:when test="$doc_split_by_language = ''"><!-- all documents -->
103
+ <xsl:for-each select="//bipm:bipm-standard">
104
+
105
+ <xsl:variable name="current_document">
106
+ <xsl:copy-of select="."/>
107
+ </xsl:variable>
108
+
109
+ <xsl:for-each select="xalan:nodeset($current_document)">
110
+
111
+ <xsl:variable name="docid">
112
+ <xsl:call-template name="getDocumentId"/>
113
+ </xsl:variable>
114
+
115
+ <!-- add id to xref and split xref with @to into two xref -->
116
+ <xsl:variable name="current_document_index_id">
117
+ <xsl:apply-templates select=".//bipm:clause[@type = 'index']" mode="index_add_id"/>
118
+ </xsl:variable>
119
+
120
+ <xsl:variable name="current_document_index">
121
+ <xsl:apply-templates select="xalan:nodeset($current_document_index_id)" mode="index_update"/>
122
+ </xsl:variable>
123
+
124
+ <xsl:for-each select="xalan:nodeset($current_document_index)">
125
+ <doc id="{$docid}">
126
+ <xsl:copy-of select="."/>
127
+ </doc>
128
+ </xsl:for-each>
129
+
130
+ </xsl:for-each>
131
+
132
+ </xsl:for-each>
133
+ </xsl:when>
134
+ <xsl:otherwise>
135
+ <xsl:for-each select="(//bipm:bipm-standard)[*[local-name()='bibdata']/*[local-name()='language'][@current = 'true'] = $doc_split_by_language]">
136
+
137
+ <xsl:variable name="current_document">
138
+ <xsl:copy-of select="."/>
139
+ </xsl:variable>
140
+
141
+ <xsl:for-each select="xalan:nodeset($current_document)">
142
+
143
+ <xsl:variable name="docid">
144
+ <xsl:call-template name="getDocumentId"/>
145
+ </xsl:variable>
146
+
147
+ <xsl:variable name="current_document_index_id">
148
+ <xsl:apply-templates select=".//bipm:clause[@type = 'index']" mode="index_add_id"/>
149
+ </xsl:variable>
150
+
151
+ <xsl:variable name="current_document_index">
152
+ <xsl:apply-templates select="xalan:nodeset($current_document_index_id)" mode="index_update"/>
153
+ </xsl:variable>
154
+
155
+ <xsl:for-each select="xalan:nodeset($current_document_index)">
156
+ <doc id="{$docid}">
157
+ <xsl:copy-of select="."/>
158
+ </doc>
159
+ </xsl:for-each>
160
+
161
+ </xsl:for-each>
162
+
163
+ </xsl:for-each>
164
+ </xsl:otherwise>
165
+ </xsl:choose>
166
+ </xsl:variable>
94
167
 
168
+ <xsl:variable name="dash" select="'–'"/>
169
+
170
+ <xsl:variable name="ids">
171
+ <xsl:for-each select="//*[@id]">
172
+ <id><xsl:value-of select="@id"/></id>
173
+ </xsl:for-each>
174
+ <xsl:for-each select="//bipm:locality[@type='anchor']/bipm:referenceFrom">
175
+ <referenceFrom><xsl:value-of select="."/></referenceFrom>
176
+ </xsl:for-each>
177
+ </xsl:variable>
178
+
179
+
180
+
181
+ <xsl:variable name="independentAppendix" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
182
+ <!-- <xsl:variable name="independentAppendix" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'appendix'])"/> -->
183
+
184
+ <xsl:variable name="doctype" select="//bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:doctype"/>
95
185
 
96
186
  <xsl:template name="generateContents">
97
187
  <contents>
98
- <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
99
- <xsl:call-template name="processMainSectionsDefault_Contents"/>
188
+
189
+ <xsl:apply-templates select="/*/bipm:preface/*[position() &gt; 1]" mode="contents"/>
190
+
191
+ <xsl:apply-templates select="/*/bipm:sections/*" mode="contents"/>
192
+ <xsl:apply-templates select="/*/bipm:bibliography/bipm:references[@normative='true']" mode="contents"/>
193
+ <xsl:apply-templates select="/*/bipm:annex" mode="contents"/>
194
+ <xsl:apply-templates select="/*/bipm:bibliography/bipm:references[not(@normative='true')]" mode="contents"/>
195
+
196
+ <!-- Index -->
197
+ <xsl:apply-templates select="//bipm:clause[@type = 'index']" mode="contents"/>
198
+
100
199
  </contents>
101
200
  </xsl:template>
102
201
 
@@ -136,14 +235,14 @@
136
235
  <fo:simple-page-master master-name="document-odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
137
236
  <fo:region-body margin-top="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="40mm"/>
138
237
  <fo:region-before region-name="header-odd" extent="25.4mm"/>
139
- <fo:region-after region-name="footer" extent="22mm"/>
238
+ <fo:region-after region-name="footer" extent="22mm"/> <!-- debug: background-color="green" -->
140
239
  <fo:region-start region-name="left-region" extent="17mm"/>
141
240
  <fo:region-end region-name="right-region" extent="26.5mm"/>
142
241
  </fo:simple-page-master>
143
242
  <fo:simple-page-master master-name="document-even" page-width="{$pageWidth}" page-height="{$pageHeight}">
144
243
  <fo:region-body margin-top="25.4mm" margin-bottom="22mm" margin-left="31.7mm" margin-right="40mm"/>
145
244
  <fo:region-before region-name="header-even" extent="25.4mm"/>
146
- <fo:region-after region-name="footer" extent="22mm"/>
245
+ <fo:region-after region-name="footer" extent="22mm"/> <!-- debug: background-color="green" -->
147
246
  <fo:region-start region-name="left-region" extent="17mm"/>
148
247
  <fo:region-end region-name="right-region" extent="26.5mm"/>
149
248
  </fo:simple-page-master>
@@ -176,15 +275,6 @@
176
275
  </fo:repeatable-page-master-alternatives>
177
276
  </fo:page-sequence-master>
178
277
 
179
- <!-- Independent Appendix pages -->
180
- <!-- <fo:simple-page-master master-name="appendix" page-width="{$pageWidth}" page-height="{$pageHeight}">
181
- <fo:region-body margin-top="25mm" margin-bottom="25mm" margin-left="25mm" margin-right="25mm"/>
182
- <fo:region-before region-name="header-appendix" extent="25mm"/>
183
- <fo:region-after region-name="footer-appendix" extent="25mm"/>
184
- <fo:region-start region-name="left-region" extent="25mm"/>
185
- <fo:region-end region-name="right-region" extent="25mm"/>
186
- </fo:simple-page-master> -->
187
-
188
278
 
189
279
  </fo:layout-master-set>
190
280
 
@@ -199,14 +289,21 @@
199
289
  <xsl:copy-of select="$contents"/>
200
290
  </contents> -->
201
291
 
202
- <xsl:if test="$independentAppendix = ''">
203
- <xsl:call-template name="insertCoverPage"/>
204
- <xsl:call-template name="insertInnerCoverPage"/>
205
- </xsl:if>
292
+ <xsl:choose>
206
293
 
207
- <xsl:if test="$independentAppendix != ''">
208
- <xsl:call-template name="insertCoverPageAppendix"/>
209
- </xsl:if>
294
+ <xsl:when test="$doctype = 'guide'">
295
+ <xsl:call-template name="insertCoverPageAppendix"/>
296
+ </xsl:when>
297
+
298
+ <xsl:when test="$independentAppendix = ''">
299
+ <xsl:call-template name="insertCoverPage"/>
300
+ <xsl:call-template name="insertInnerCoverPage"/>
301
+ </xsl:when>
302
+
303
+ <xsl:when test="$independentAppendix != ''">
304
+ <xsl:call-template name="insertCoverPageAppendix"/>
305
+ </xsl:when>
306
+ </xsl:choose>
210
307
 
211
308
 
212
309
  <xsl:choose>
@@ -216,17 +313,22 @@
216
313
  <xsl:choose>
217
314
  <xsl:when test="$doc_split_by_language = ''"><!-- all documents -->
218
315
  <xsl:for-each select="//bipm:bipm-standard">
219
- <xsl:variable name="lang" select="*[local-name()='bibdata']//*[local-name()='language']"/>
316
+ <xsl:variable name="lang" select="*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
220
317
  <xsl:variable name="num"><xsl:number level="any" count="bipm:bipm-standard"/></xsl:variable>
221
318
  <!-- change id to prevent identical id in different documents in one container -->
222
- <xsl:variable name="current_document">
319
+ <!-- <xsl:variable name="current_document">
223
320
  <xsl:apply-templates select="." mode="change_id">
224
321
  <xsl:with-param name="lang" select="$lang"/>
322
+ <xsl:with-param name="ignoreReferenceFrom" select="'true'"/>
225
323
  </xsl:apply-templates>
226
324
  </xsl:variable>
227
325
 
228
326
  <xsl:variable name="flatxml">
229
327
  <xsl:apply-templates select="xalan:nodeset($current_document)" mode="flatxml"/>
328
+ </xsl:variable> -->
329
+
330
+ <xsl:variable name="flatxml">
331
+ <xsl:apply-templates select="." mode="flatxml"/>
230
332
  </xsl:variable>
231
333
 
232
334
  <!-- flatxml=<xsl:copy-of select="$flatxml"/> -->
@@ -238,11 +340,11 @@
238
340
  </xsl:for-each>
239
341
  </xsl:when>
240
342
  <xsl:otherwise>
241
- <xsl:for-each select="(//bipm:bipm-standard)[*[local-name()='bibdata']/*[local-name()='language'] = $doc_split_by_language]">
242
- <xsl:variable name="lang" select="*[local-name()='bibdata']//*[local-name()='language']"/>
343
+ <xsl:for-each select="(//bipm:bipm-standard)[*[local-name()='bibdata']/*[local-name()='language'][@current = 'true'] = $doc_split_by_language]">
344
+ <xsl:variable name="lang" select="*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
243
345
  <xsl:variable name="num"><xsl:number level="any" count="bipm:bipm-standard"/></xsl:variable>
244
346
  <!-- change id to prevent identical id in different documents in one container -->
245
- <xsl:variable name="current_document">
347
+ <!-- <xsl:variable name="current_document">
246
348
  <xsl:apply-templates select="." mode="change_id">
247
349
  <xsl:with-param name="lang" select="$lang"/>
248
350
  </xsl:apply-templates>
@@ -250,6 +352,10 @@
250
352
 
251
353
  <xsl:variable name="flatxml">
252
354
  <xsl:apply-templates select="xalan:nodeset($current_document)" mode="flatxml"/>
355
+ </xsl:variable> -->
356
+
357
+ <xsl:variable name="flatxml">
358
+ <xsl:apply-templates select="." mode="flatxml"/>
253
359
  </xsl:variable>
254
360
 
255
361
  <xsl:apply-templates select="xalan:nodeset($flatxml)/bipm:bipm-standard" mode="bipm-standard">
@@ -269,6 +375,9 @@
269
375
  </xsl:variable>
270
376
 
271
377
  <!-- flatxml=<xsl:copy-of select="$flatxml"/> -->
378
+
379
+ <!-- indexes=<xsl:copy-of select="$indexes"/> -->
380
+
272
381
 
273
382
  <xsl:apply-templates select="xalan:nodeset($flatxml)/bipm:bipm-standard" mode="bipm-standard">
274
383
  <xsl:with-param name="curr_docnum" select="1"/>
@@ -280,7 +389,10 @@
280
389
  </fo:root>
281
390
  </xsl:template>
282
391
 
283
- <!-- flat xml for fit notes at page sides -->
392
+
393
+ <!-- ================================= -->
394
+ <!-- Flattening xml for fit notes at page sides (margins) -->
395
+ <!-- ================================= -->
284
396
  <xsl:template match="@*|node()" mode="flatxml">
285
397
  <xsl:copy>
286
398
  <xsl:if test="ancestor::bipm:quote">
@@ -290,23 +402,127 @@
290
402
  </xsl:copy>
291
403
  </xsl:template>
292
404
 
293
- <!-- flat clauses from 2nd level -->
405
+ <!-- enclosing starting elements annex/... in clause -->
406
+ <xsl:template match="bipm:annex" mode="flatxml">
407
+ <xsl:copy>
408
+ <xsl:apply-templates select="@*" mode="flatxml"/>
409
+
410
+ <xsl:variable name="pos_first_clause_" select="count(bipm:clause[1]/preceding-sibling::*)"/>
411
+ <!-- pos_first_clause=<xsl:value-of select="$pos_first_clause"/> -->
412
+
413
+ <xsl:variable name="pos_first_clause">
414
+ <xsl:choose>
415
+ <xsl:when test="$pos_first_clause_ = 0">
416
+ <xsl:value-of select="count(*)"/>
417
+ </xsl:when>
418
+ <xsl:otherwise>
419
+ <xsl:value-of select="$pos_first_clause_"/>
420
+ </xsl:otherwise>
421
+ </xsl:choose>
422
+ </xsl:variable>
423
+ <xsl:choose>
424
+
425
+ <xsl:when test="$pos_first_clause &gt; 0">
426
+ <xsl:element name="clause" namespace="https://www.metanorma.org/ns/bipm">
427
+ <xsl:attribute name="id"><xsl:value-of select="concat(@id,'_clause')"/></xsl:attribute>
428
+ <xsl:for-each select="*[position() &gt; 0 and position() &lt;= $pos_first_clause]">
429
+ <xsl:apply-templates select="." mode="flatxml"/>
430
+ </xsl:for-each>
431
+ </xsl:element>
432
+ <xsl:for-each select="*[position() &gt; $pos_first_clause]">
433
+ <xsl:apply-templates select="." mode="flatxml"/>
434
+ </xsl:for-each>
435
+ </xsl:when>
436
+ <xsl:otherwise>
437
+ <xsl:apply-templates mode="flatxml"/>
438
+ </xsl:otherwise>
439
+ </xsl:choose>
440
+
441
+ </xsl:copy>
442
+ </xsl:template>
443
+
444
+ <xsl:template match="bipm:annex/bipm:title" mode="flatxml">
445
+ <xsl:copy>
446
+ <xsl:apply-templates select="@*" mode="flatxml"/>
447
+ <xsl:attribute name="depth">1</xsl:attribute>
448
+ <xsl:apply-templates mode="flatxml"/>
449
+ </xsl:copy>
450
+ </xsl:template>
451
+
452
+
453
+ <!-- flattening clauses from 2nd level -->
294
454
  <!-- <xsl:template match="bipm:clause[not(parent::bipm:sections) and not(parent::bipm:annex) and not(parent::bipm:abstract) and not(ancestor::bipm:boilerplate)]" mode="flatxml"> -->
295
455
  <xsl:template match="bipm:clause[not(parent::bipm:sections) and not(parent::bipm:annex) and not(parent::bipm:preface) and not(ancestor::bipm:boilerplate)]" mode="flatxml">
296
456
  <xsl:copy>
297
457
  <xsl:apply-templates select="@*" mode="flatxml"/>
298
- </xsl:copy>
458
+
459
+ <!-- add note_side inside empty clause to show near the title -->
460
+ <!-- <xsl:variable name="curr_id" select="@id"/>
461
+ <xsl:for-each select=".//bipm:quote[ancestor::bipm:clause[1][@id = $curr_id]]//bipm:fn">
462
+ <xsl:element name="note_side" namespace="https://www.metanorma.org/ns/bipm">
463
+
464
+ <xsl:attribute name="id">
465
+ <xsl:call-template name="fn_reference_to_xref_target"/>
466
+ </xsl:attribute>
467
+
468
+ <xsl:variable name="num" select="position()"/>
469
+
470
+ <xsl:variable name="asterisks">
471
+ <xsl:call-template name="repeat">
472
+ <xsl:with-param name="char" select="'*'"/>
473
+ <xsl:with-param name="count" select="$num + 1"/>
474
+ </xsl:call-template>
475
+ </xsl:variable>
476
+ <xsl:value-of select="$asterisks"/>
477
+
478
+ <xsl:text> </xsl:text>
479
+ <xsl:apply-templates mode="flatxml"/>
480
+ </xsl:element>
481
+ </xsl:for-each> -->
482
+ </xsl:copy>
299
483
  <xsl:apply-templates mode="flatxml"/>
300
484
  </xsl:template>
301
485
 
486
+
487
+ <!-- move note(s) inside element -->
488
+ <!-- but ignore quote, move inside element which before quote -->
489
+ <xsl:template match="bipm:clause/* [not(local-name() = 'quote')] [following-sibling::* [not(local-name()='quote')] [1][local-name() = 'note']]" mode="flatxml"> <!-- find element, which has next 'note' -->
490
+ <xsl:copy>
491
+ <xsl:apply-templates select="@*|node()" mode="flatxml"/>
492
+ <xsl:variable name="element-id" select="generate-id(.)"/>
493
+ <xsl:for-each select="following-sibling::bipm:note[generate-id(preceding-sibling::*[not(local-name()='note') and not(local-name()='quote')][1]) = $element-id]">
494
+ <xsl:call-template name="change_note_kind"/>
495
+ </xsl:for-each>
496
+
497
+ <!-- if current node is title level is 3 with notes, and next level is 4 -->
498
+ <xsl:if test="local-name() = 'title' and @depth = 3 and ../bipm:clause/bipm:title/@depth = 4 and count(following-sibling::*[1][local-name() = 'note']) &gt; 0">
499
+ <!-- then move here footnotes from clause level 4 -->
500
+ <xsl:for-each select="../bipm:clause//bipm:fn[ancestor::bipm:quote or not(ancestor::bipm:table)]">
501
+ <xsl:call-template name="fn_to_note_side"/>
502
+ </xsl:for-each>
503
+ </xsl:if>
504
+
505
+ </xsl:copy>
506
+ </xsl:template>
507
+
508
+ <!-- remove note(s), which was moved into element in previous template -->
509
+ <xsl:template match="bipm:clause/bipm:note" mode="flatxml" priority="2"/>
510
+
511
+
302
512
  <!-- move clause/note inside title, p, ul or ol -->
303
- <xsl:template match="bipm:clause/*[local-name() != 'quote' and local-name() != 'note' and local-name() != 'clause'][last()]" mode="flatxml">
513
+ <xsl:template match="bipm:clause2/*[local-name() != 'quote' and local-name() != 'note' and local-name() != 'clause'][last()]" mode="flatxml">
304
514
  <xsl:copy>
305
515
  <xsl:apply-templates select="@*|node()" mode="flatxml"/>
306
516
  <!-- <xsl:copy-of select="following-sibling::*[local-name() = 'note']"/> -->
307
517
  <xsl:for-each select="following-sibling::*[local-name() = 'note']">
308
518
  <xsl:call-template name="change_note_kind"/>
309
519
  </xsl:for-each>
520
+ <xsl:if test="@depth = 3 and local-name() = 'title' and ../bipm:clause/bipm:title/@depth = 4 and count(following-sibling::*[1][local-name() = 'note']) &gt; 0"> <!-- it means that current node is title level is 3 with notes, next level is 4 -->
521
+ <!-- <put_note_side_level4_here/> -->
522
+ <xsl:for-each select="../bipm:clause//bipm:fn[ancestor::bipm:quote or not(ancestor::bipm:table)]"> <!-- move here footnotes from clause level 4 -->
523
+ <xsl:call-template name="fn_to_note_side"/>
524
+ </xsl:for-each>
525
+ </xsl:if>
310
526
  </xsl:copy>
311
527
  </xsl:template>
312
528
 
@@ -318,7 +534,7 @@
318
534
  </xsl:template> -->
319
535
 
320
536
  <!-- <xsl:template match="bipm:clause/bipm:note[count(following-sibling::*) = 0]" mode="flatxml"/> -->
321
- <xsl:template match="bipm:clause/bipm:note[count(following-sibling::*[local-name() != 'clause' and local-name() != 'note']) = 0]" mode="flatxml" priority="2"/>
537
+ <!-- <xsl:template match="bipm:clause/bipm:note[count(following-sibling::*[local-name() != 'clause' and local-name() != 'note']) = 0]" mode="flatxml" priority="2"/> -->
322
538
 
323
539
 
324
540
  <xsl:template match="bipm:note" name="change_note_kind" mode="flatxml">
@@ -340,23 +556,93 @@
340
556
  </xsl:template>
341
557
 
342
558
 
343
- <xsl:template match="bipm:fn[ancestor::bipm:quote]" mode="flatxml">
344
- <xsl:element name="note_side" namespace="https://www.metanorma.org/ns/bipm">
345
- <xsl:apply-templates mode="flatxml"/>
346
- </xsl:element>
559
+ <!-- change fn to xref with asterisks --> <!-- all fn except fn in table (but not quote table) -->
560
+ <xsl:template match="bipm:fn[ancestor::bipm:quote or not(ancestor::bipm:table)]" mode="flatxml">
561
+ <xsl:choose>
562
+ <!-- see template above with @depth = 4 -->
563
+ <xsl:when test="ancestor::bipm:clause[1]/bipm:title/@depth = 4 and count(ancestor::bipm:clause[2]/bipm:title[@depth = 3]/following-sibling::*[1][local-name() = 'note']) &gt; 0">
564
+ <xsl:apply-templates select="." mode="fn_to_xref"/>
565
+ </xsl:when>
566
+ <xsl:when test="ancestor::bipm:li">
567
+ <xsl:apply-templates select="." mode="fn_to_xref"/> <!-- displays asterisks with link to side note -->
568
+ </xsl:when>
569
+ <xsl:otherwise>
570
+ <xsl:apply-templates select="." mode="fn_to_xref"/> <!-- displays asterisks with link to side note -->
571
+ <xsl:call-template name="fn_to_note_side"/> <!-- convert footnote to side note with asterisk at start -->
572
+ <!-- <xsl:element name="note_side" namespace="https://www.metanorma.org/ns/bipm">
573
+ <xsl:apply-templates mode="flatxml"/>
574
+ </xsl:element> -->
575
+ </xsl:otherwise>
576
+ </xsl:choose>
347
577
  </xsl:template>
348
578
 
349
- <xsl:template match="bipm:fn[ancestor::bipm:quote]" mode="flatxml_list">
350
- <xsl:element name="note_side" namespace="https://www.metanorma.org/ns/bipm">
351
- <xsl:apply-templates mode="flatxml_list"/>
579
+ <!-- change fn to xref with asterisks --> <!-- all fn except fn in table (but not quote table) -->
580
+ <xsl:template match="bipm:fn[ancestor::bipm:quote or not(ancestor::bipm:table)]" mode="flatxml_list">
581
+ <xsl:choose>
582
+ <!-- see template above with @depth = 4 -->
583
+ <xsl:when test="ancestor::bipm:clause[1]/bipm:title/@depth = 4 and count(ancestor::bipm:clause[2]/bipm:title[@depth = 3]/following-sibling::*[1][local-name() = 'note']) &gt; 0">
584
+ <xsl:apply-templates select="." mode="fn_to_xref"/>
585
+ </xsl:when>
586
+ <xsl:when test="ancestor::bipm:li">
587
+ <xsl:apply-templates select="." mode="fn_to_xref"/> <!-- displays asterisks with link to side note -->
588
+ </xsl:when>
589
+ <xsl:otherwise>
590
+ <xsl:apply-templates select="." mode="fn_to_xref"/> <!-- displays asterisks with link to side note -->
591
+ <xsl:call-template name="fn_to_note_side"/> <!-- convert footnote to side note with asterisk at start -->
592
+ <!-- <xsl:element name="note_side" namespace="https://www.metanorma.org/ns/bipm">
593
+ <xsl:apply-templates mode="flatxml"/>
594
+ </xsl:element> -->
595
+ </xsl:otherwise>
596
+ </xsl:choose>
597
+ </xsl:template>
598
+
599
+ <xsl:template match="bipm:fn" mode="fn_to_xref">
600
+ <xsl:element name="xref" namespace="https://www.metanorma.org/ns/bipm">
601
+
602
+ <xsl:attribute name="target">
603
+ <xsl:call-template name="fn_reference_to_xref_target"/>
604
+ </xsl:attribute>
605
+
606
+ <xsl:variable name="curr_clause_id" select="normalize-space(ancestor::bipm:clause[1]/@id)"/>
607
+ <xsl:variable name="curr_annex_id" select="normalize-space(ancestor::bipm:annex[1]/@id)"/>
608
+
609
+ <xsl:variable name="number">
610
+ <xsl:choose>
611
+ <xsl:when test="$curr_clause_id != ''">
612
+ <xsl:number count="bipm:fn[ancestor::bipm:clause[1]/@id = $curr_clause_id][ancestor::bipm:quote or not(ancestor::bipm:table)]" level="any"/>
613
+ </xsl:when>
614
+ <xsl:otherwise>
615
+ <xsl:number count="bipm:fn[ancestor::bipm:annex[1]/@id = $curr_annex_id]"/>
616
+ </xsl:otherwise>
617
+ </xsl:choose>
618
+ </xsl:variable>
619
+
620
+ <!-- <xsl:variable name="asterisks">
621
+ <xsl:call-template name="repeat">
622
+ <xsl:with-param name="char" select="'*'"/>
623
+ <xsl:with-param name="count" select="$number + 1"/>
624
+ </xsl:call-template>
625
+ </xsl:variable>
626
+ <xsl:value-of select="$asterisks"/> -->
627
+ <xsl:element name="sup_fn" namespace="https://www.metanorma.org/ns/bipm">
628
+ <xsl:value-of select="concat('(',$number,')')"/>
629
+ </xsl:element>
630
+ <!-- <xsl:text> </xsl:text> -->
631
+
352
632
  </xsl:element>
353
633
  </xsl:template>
354
634
 
355
- <!-- envelope standalone note in p -->
356
- <!-- <p>
357
- <xsl:copy-of select="."/>
358
- </p>
359
- </xsl:template> -->
635
+ <xsl:template name="fn_reference_to_xref_target">
636
+ <xsl:variable name="lang" select="ancestor::bipm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
637
+ <xsl:variable name="gen_id" select="generate-id()"/>
638
+ <xsl:variable name="curr_clause_id" select="ancestor::bipm:clause[1]/@id"/>
639
+ <xsl:variable name="number">
640
+ <xsl:number count="bipm:fn[ancestor::bipm:clause[1]/@id = $curr_clause_id][ancestor::bipm:quote or not(ancestor::bipm:table)]" level="any"/>
641
+ </xsl:variable>
642
+ <xsl:value-of select="concat($lang, '_footnote_', @reference, '_', $number, '_', $gen_id)"/>
643
+ </xsl:template>
644
+
645
+
360
646
  <xsl:template match="bipm:preface/bipm:clause[position() &gt; 1]" mode="flatxml">
361
647
  <xsl:copy-of select="."/>
362
648
  </xsl:template>
@@ -380,44 +666,30 @@
380
666
  </xsl:copy>
381
667
  </xsl:template>
382
668
 
383
-
384
- <!-- <xsl:template match="bipm:li[last()]" mode="flatxml_list">
385
- <xsl:copy>
386
- <xsl:apply-templates select="@*" mode="flatxml_list"/>
387
- <xsl:attribute name="list_type">
388
- <xsl:value-of select="local-name(..)"/>
389
- </xsl:attribute>
390
- <xsl:attribute name="label">
391
- <xsl:call-template name="setListItemLabel"/>
392
- </xsl:attribute>
393
- <xsl:apply-templates select="node()" mode="flatxml_list"/>
394
- <xsl:copy-of select="following-sibling::*"/>
395
- </xsl:copy>
396
- </xsl:template> -->
397
-
398
669
  <!-- copy 'ol' 'ul' properties to each 'li' -->
399
- <!-- move note for list (list level note) into latest 'li' -->
400
- <!-- move note for list (list level note) into first 'li' -->
401
- <xsl:template match="bipm:li" mode="flatxml_list">
670
+ <!-- OBSOLETE: move note for list (list level note) into latest 'li' -->
671
+ <!-- NOW: move note for list (list level note) into first 'li' -->
672
+ <!-- move fn for list-item (list-item level footnote) into first 'li' -->
673
+ <xsl:template match="bipm:li" mode="flatxml_list">
402
674
  <xsl:copy>
403
675
  <xsl:apply-templates select="@*" mode="flatxml_list"/>
404
676
  <xsl:attribute name="list_type">
405
677
  <xsl:value-of select="local-name(..)"/>
406
678
  </xsl:attribute>
407
- <xsl:attribute name="label">
408
- <xsl:call-template name="setListItemLabel"/>
409
- </xsl:attribute>
679
+ <!-- <xsl:attribute name="label"> -->
680
+ <xsl:call-template name="setListItemLabel"/>
681
+ <!-- </xsl:attribute> -->
410
682
  <xsl:if test="ancestor::bipm:quote">
411
- <xsl:attribute name="parent-type">quote</xsl:attribute>
683
+ <xsl:attribute name="parent-type">quote</xsl:attribute>
412
684
  </xsl:if>
413
685
  <xsl:apply-templates mode="flatxml_list"/>
414
686
 
415
- <!-- move note for list (list level note) into first 'li' -->
687
+
416
688
  <!-- if current li is first -->
417
689
  <xsl:if test="not(preceding-sibling::*[local-name() = 'li'])">
418
690
  <!-- <xsl:copy-of select="following-sibling::bipm:li[last()]/following-sibling::*"/> -->
419
691
 
420
-
692
+ <!-- move note for list (list level note) into first 'li' -->
421
693
  <xsl:for-each select="following-sibling::bipm:li[last()]/following-sibling::*">
422
694
  <xsl:choose>
423
695
  <xsl:when test="local-name() = 'note'">
@@ -429,6 +701,36 @@
429
701
  </xsl:choose>
430
702
  </xsl:for-each>
431
703
 
704
+ <!-- move note(s) after ul/ol into first 'li' -->
705
+ <xsl:if test="not(ancestor::bipm:quote)">
706
+ <xsl:variable name="list_id" select="generate-id(..)"/>
707
+ <xsl:for-each select="../following-sibling::bipm:note[generate-id(preceding-sibling::*[not(local-name()='note') and not(local-name()='quote')][1]) = $list_id]">
708
+ <xsl:call-template name="change_note_kind"/>
709
+ </xsl:for-each>
710
+ </xsl:if>
711
+
712
+
713
+ <xsl:if test="ancestor::bipm:quote or not(ancestor::bipm:table)">
714
+
715
+ <xsl:choose>
716
+ <!-- see template above with @depth = 4 -->
717
+ <xsl:when test="ancestor::bipm:clause[1]/bipm:title/@depth = 4 and count(ancestor::bipm:clause[2]/bipm:title[@depth = 3]/following-sibling::*[1][local-name() = 'note']) &gt; 0"/>
718
+ <xsl:otherwise>
719
+
720
+ <!-- move all footnotes in the current list (not only current list item) into first 'li' -->
721
+ <xsl:variable name="curr_list_id" select="../@id"/>
722
+ <xsl:for-each select="..//bipm:fn[ancestor::bipm:ol[1]/@id = $curr_list_id or ancestor::bipm:ul[1]/@id = $curr_list_id]">
723
+
724
+ <xsl:call-template name="fn_to_note_side"/>
725
+
726
+
727
+ </xsl:for-each>
728
+
729
+ </xsl:otherwise>
730
+ </xsl:choose>
731
+
732
+ </xsl:if>
733
+
432
734
  </xsl:if>
433
735
 
434
736
  <!-- move note for list (list level note) into latest 'li' -->
@@ -438,36 +740,126 @@
438
740
  </xsl:copy>
439
741
  </xsl:template>
440
742
 
441
- <!-- remove latest element (after li), because they moved into latest 'li' -->
442
- <xsl:template match="bipm:ul/*[not(local-name() = 'li') and not(following-sibling::*[local-name() = 'li'])]" mode="flatxml_list"/>
443
- <xsl:template match="bipm:ol/*[not(local-name() = 'li') and not(following-sibling::*[local-name() = 'li'])]" mode="flatxml_list"/>
444
743
 
445
- <xsl:template name="setListItemLabel">
446
- <xsl:choose>
447
- <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">—</xsl:when> <!-- &#x2014; dash -->
448
- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
449
- <xsl:otherwise> <!-- for ordered lists -->
744
+ <xsl:template name="fn_to_note_side">
745
+ <xsl:element name="note_side" namespace="https://www.metanorma.org/ns/bipm">
746
+
747
+ <xsl:attribute name="id">
748
+ <xsl:call-template name="fn_reference_to_xref_target"/>
749
+ </xsl:attribute>
750
+
751
+ <xsl:variable name="curr_clause_id" select="normalize-space(ancestor::bipm:clause[1]/@id)"/>
752
+ <xsl:variable name="curr_annex_id" select="normalize-space(ancestor::bipm:annex[1]/@id)"/>
753
+
754
+ <xsl:variable name="number">
450
755
  <xsl:choose>
451
- <xsl:when test="../@type = 'arabic'">
452
- <xsl:number format="1."/>
453
- </xsl:when>
454
- <xsl:when test="../@type = 'alphabet'">
455
- <xsl:number format="a)"/>
456
- </xsl:when>
457
- <xsl:when test="../@type = 'alphabet_upper'">
458
- <xsl:number format="A)"/>
459
- </xsl:when>
460
- <xsl:when test="../@type = 'roman'">
461
- <xsl:number format="i)"/>
756
+ <xsl:when test="$curr_clause_id != ''">
757
+ <xsl:number count="bipm:fn[ancestor::bipm:clause[1]/@id = $curr_clause_id][ancestor::bipm:quote or not(ancestor::bipm:table)]" level="any"/>
462
758
  </xsl:when>
463
759
  <xsl:otherwise>
464
- <xsl:number format="1)"/>
760
+ <xsl:number count="bipm:fn[ancestor::bipm:annex[1]/@id = $curr_annex_id]"/>
465
761
  </xsl:otherwise>
466
762
  </xsl:choose>
467
- </xsl:otherwise>
763
+ </xsl:variable>
764
+
765
+ <!-- <xsl:variable name="asterisks">
766
+ <xsl:call-template name="repeat">
767
+ <xsl:with-param name="char" select="'*'"/>
768
+ <xsl:with-param name="count" select="$number + 1"/>
769
+ </xsl:call-template>
770
+ </xsl:variable>
771
+ <xsl:value-of select="$asterisks"/> -->
772
+ <xsl:element name="sup_fn" namespace="https://www.metanorma.org/ns/bipm">
773
+ <xsl:value-of select="concat('(',$number,')')"/>
774
+ </xsl:element>
775
+ <xsl:text> </xsl:text>
776
+
777
+ <xsl:apply-templates mode="flatxml"/>
778
+ </xsl:element>
779
+ </xsl:template>
780
+
781
+ <!-- remove latest elements (after li), because they moved into latest 'li' -->
782
+ <xsl:template match="bipm:ul/*[not(local-name() = 'li') and not(following-sibling::*[local-name() = 'li'])]" mode="flatxml_list"/>
783
+ <xsl:template match="bipm:ol/*[not(local-name() = 'li') and not(following-sibling::*[local-name() = 'li'])]" mode="flatxml_list"/>
784
+
785
+ <xsl:template name="setListItemLabel">
786
+ <xsl:attribute name="label">
787
+ <xsl:choose>
788
+ <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">−</xsl:when> <!-- &#x2212; - minus sign. &#x2014; - dash -->
789
+ <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
790
+ <xsl:otherwise> <!-- for ordered lists -->
791
+ <xsl:variable name="start_value">
792
+ <xsl:choose>
793
+ <xsl:when test="normalize-space(../@start) != ''">
794
+ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 -->
795
+ </xsl:when>
796
+ <xsl:otherwise>0</xsl:otherwise>
797
+ </xsl:choose>
798
+ </xsl:variable>
799
+
800
+ <xsl:variable name="curr_value">
801
+ <xsl:number/>
802
+ </xsl:variable>
803
+
804
+ <xsl:variable name="format">
805
+ <xsl:choose>
806
+ <xsl:when test="../@type = 'arabic'">1.</xsl:when>
807
+ <xsl:when test="../@type = 'alphabet'">a)</xsl:when>
808
+ <!-- <xsl:choose>
809
+ <xsl:when test="$independentAppendix = ''">a)</xsl:when>
810
+ <xsl:otherwise>(a)</xsl:otherwise>
811
+ </xsl:choose>
812
+ </xsl:when> -->
813
+ <xsl:when test="../@type = 'alphabet_upper'">A.</xsl:when>
814
+ <xsl:when test="../@type = 'roman'">(i)</xsl:when>
815
+ <xsl:when test="../@type = 'roman_upper'">I.</xsl:when>
816
+ <xsl:otherwise>1.</xsl:otherwise>
817
+ </xsl:choose>
818
+ </xsl:variable>
819
+
820
+ <xsl:number value="$start_value + $curr_value" format="{$format}" lang="en"/>
821
+
822
+ </xsl:otherwise>
823
+ </xsl:choose>
824
+ </xsl:attribute>
825
+ <xsl:choose>
826
+ <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul"/> <!-- &#x2014; dash -->
827
+ <xsl:when test="local-name(..) = 'ul'">
828
+ <xsl:attribute name="font-size">15pt</xsl:attribute>
829
+ </xsl:when>
468
830
  </xsl:choose>
469
831
  </xsl:template>
470
832
 
833
+ <xsl:template match="bipm:clause[@type = 'index']" mode="flatxml"/>
834
+ <!-- <xsl:template match="bipm:clause[@type = 'index']" mode="flatxml">
835
+ <xsl:copy>
836
+ <xsl:apply-templates select="@*" mode="flatxml_index"/>
837
+ <xsl:apply-templates mode="flatxml_index"/>
838
+ </xsl:copy>
839
+ </xsl:template>
840
+
841
+ <xsl:template match="@*|node()" mode="flatxml_index">
842
+ <xsl:copy>
843
+ <xsl:apply-templates select="@*|node()" mode="flatxml_index"/>
844
+ </xsl:copy>
845
+ </xsl:template>
846
+
847
+ <xsl:template match="bipm:xref" mode="flatxml_index">
848
+ <xsl:copy>
849
+ <xsl:apply-templates select="@*" mode="flatxml_index"/>
850
+ <xsl:attribute name="id">
851
+ <xsl:value-of select="generate-id(.)"/>
852
+ </xsl:attribute>
853
+ <xsl:apply-templates mode="flatxml_index"/>
854
+ </xsl:copy>
855
+ </xsl:template> -->
856
+
857
+ <!-- ================================= -->
858
+ <!-- END: Flattening xml for fit notes at page sides (margins) -->
859
+ <!-- ================================= -->
860
+
861
+
862
+
471
863
 
472
864
  <xsl:template match="bipm:bipm-standard"/>
473
865
  <xsl:template match="bipm:bipm-standard" mode="bipm-standard">
@@ -479,7 +871,7 @@
479
871
  <xsl:call-template name="namespaceCheck"/>
480
872
  </xsl:for-each>
481
873
 
482
- <xsl:variable name="curr_lang" select="bipm:bibdata/bipm:language"/>
874
+ <xsl:variable name="curr_lang" select="bipm:bibdata/bipm:language[@current = 'true']"/>
483
875
 
484
876
  <xsl:if test="$debug = 'true'">
485
877
  <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
@@ -490,7 +882,7 @@
490
882
 
491
883
 
492
884
  <xsl:choose>
493
- <xsl:when test="$independentAppendix = ''">
885
+ <xsl:when test="$independentAppendix = '' and not($doctype = 'guide')">
494
886
 
495
887
  <!-- Document pages -->
496
888
  <fo:page-sequence master-reference="document" force-page-count="no-force">
@@ -556,26 +948,47 @@
556
948
  <xsl:apply-templates select="bipm:boilerplate/bipm:license-statement"/>
557
949
 
558
950
  <fo:block-container absolute-position="fixed" top="200mm" height="69mm" font-family="Times New Roman" text-align="center" display-align="after">
559
- <xsl:apply-templates select="bipm:boilerplate/bipm:feedback-statement"/>
560
- <fo:block margin-top="15mm">
561
- <xsl:text>ISBN </xsl:text><xsl:value-of select="bipm:bibdata/bipm:docidentifier[@type='ISBN']"/>
951
+ <fo:block>
952
+ <xsl:apply-templates select="bipm:boilerplate/bipm:feedback-statement"/>
953
+ <xsl:variable name="ISBN" select="normalize-space(bipm:bibdata/bipm:docidentifier[@type='ISBN'])"/>
954
+ <xsl:if test="$ISBN != ''">
955
+ <fo:block margin-top="15mm">
956
+ <xsl:text>ISBN </xsl:text><xsl:value-of select="$ISBN"/>
957
+ </fo:block>
958
+ </xsl:if>
562
959
  </fo:block>
563
960
  </fo:block-container>
564
961
 
565
962
  </fo:flow>
566
963
  </fo:page-sequence>
567
964
 
568
- <fo:page-sequence master-reference="document" force-page-count="no-force">
569
- <xsl:call-template name="insertFootnoteSeparator"/>
570
- <xsl:call-template name="insertHeaderFooter"/>
571
- <fo:flow flow-name="xsl-region-body">
572
- <fo:block line-height="135%">
573
- <!-- <xsl:apply-templates select="bipm:preface/bipm:abstract" /> -->
574
- <xsl:apply-templates select="bipm:preface/*[1]"/>
575
- </fo:block>
576
- </fo:flow>
577
- </fo:page-sequence>
578
-
965
+
966
+ <xsl:if test="bipm:preface/*">
967
+ <fo:page-sequence master-reference="document" force-page-count="no-force">
968
+ <xsl:call-template name="insertFootnoteSeparator"/>
969
+
970
+ <xsl:variable name="header-title">
971
+ <xsl:choose>
972
+ <xsl:when test="bipm:preface/*[1]/bipm:title[1]/*[local-name() = 'tab']">
973
+ <xsl:apply-templates select="bipm:preface/*[1]/bipm:title[1]/*[local-name() = 'tab'][1]/following-sibling::node()" mode="header"/>
974
+ </xsl:when>
975
+ <xsl:otherwise>
976
+ <xsl:apply-templates select="bipm:preface/*[1]/bipm:title[1]" mode="header"/>
977
+ </xsl:otherwise>
978
+ </xsl:choose>
979
+ </xsl:variable>
980
+ <xsl:call-template name="insertHeaderFooter">
981
+ <xsl:with-param name="header-title" select="$header-title"/>
982
+ </xsl:call-template>
983
+
984
+ <fo:flow flow-name="xsl-region-body">
985
+ <fo:block line-height="135%">
986
+ <!-- <xsl:apply-templates select="bipm:preface/bipm:abstract" /> -->
987
+ <xsl:apply-templates select="bipm:preface/*[1]"/>
988
+ </fo:block>
989
+ </fo:flow>
990
+ </fo:page-sequence>
991
+ </xsl:if>
579
992
 
580
993
 
581
994
  <xsl:variable name="docid">
@@ -584,18 +997,24 @@
584
997
 
585
998
  <fo:page-sequence master-reference="document" force-page-count="no-force">
586
999
  <xsl:call-template name="insertFootnoteSeparator"/>
587
- <xsl:call-template name="insertHeaderFooter"/>
1000
+
1001
+ <xsl:variable name="title-toc">
1002
+ <fo:inline>
1003
+ <xsl:call-template name="getTitle">
1004
+ <xsl:with-param name="name" select="'title-toc'"/>
1005
+ </xsl:call-template>
1006
+ </fo:inline>
1007
+ </xsl:variable>
1008
+ <xsl:call-template name="insertHeaderFooter">
1009
+ <xsl:with-param name="header-title"><xsl:value-of select="$title-toc"/></xsl:with-param>
1010
+ </xsl:call-template>
1011
+
588
1012
  <fo:flow flow-name="xsl-region-body">
589
1013
 
590
1014
  <fo:block-container margin-left="-14mm" margin-right="0mm">
591
1015
  <fo:block-container margin-left="0mm" margin-right="0mm">
592
- <fo:block font-family="Arial" font-size="16pt" font-weight="bold" text-align-last="justify" margin-bottom="84pt">
593
- <xsl:variable name="title-toc">
594
- <xsl:call-template name="getTitle">
595
- <xsl:with-param name="name" select="'title-toc'"/>
596
- </xsl:call-template>
597
- </xsl:variable>
598
- <fo:marker marker-class-name="header-title"><xsl:value-of select="$title-toc"/></fo:marker>
1016
+ <fo:block font-family="Arial" font-size="16pt" font-weight="bold" text-align-last="justify" margin-bottom="82pt">
1017
+ <!-- <fo:marker marker-class-name="header-title"><xsl:value-of select="$title-toc"/></fo:marker> -->
599
1018
  <fo:inline><xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']"/></fo:inline>
600
1019
  <fo:inline keep-together.within-line="always">
601
1020
  <fo:leader leader-pattern="space"/>
@@ -611,12 +1030,31 @@
611
1030
  <fo:block>
612
1031
  <!-- <xsl:copy-of select="$contents"/> -->
613
1032
 
614
- <xsl:for-each select="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true' and not(@type = 'annex') and not(@parent = 'annex')]">
615
- <xsl:call-template name="insertContentItem"/>
616
- </xsl:for-each>
617
- <xsl:for-each select="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true' and (@type = 'annex' or (@level = 2 and @parent = 'annex'))]">
618
- <xsl:call-template name="insertContentItem"/>
619
- </xsl:for-each>
1033
+ <xsl:if test="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true']">
1034
+ <fo:table table-layout="fixed" width="100%">
1035
+ <fo:table-column column-width="127mm"/>
1036
+ <fo:table-column column-width="12mm"/>
1037
+ <fo:table-body>
1038
+ <xsl:for-each select="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true' and not(@type = 'annex') and not(@type = 'index') and not(@parent = 'annex')]">
1039
+ <xsl:call-template name="insertContentItem"/>
1040
+ </xsl:for-each>
1041
+ <xsl:if test="$doctype ='brochure'">
1042
+ <!-- insert page break between main sections and appendixes in ToC -->
1043
+ <fo:table-row>
1044
+ <fo:table-cell number-columns-spanned="2">
1045
+ <fo:block break-after="page"/>
1046
+ </fo:table-cell>
1047
+ </fo:table-row>
1048
+ </xsl:if>
1049
+ <xsl:for-each select="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true' and (@type = 'annex')]"> <!-- or (@level = 2 and @parent = 'annex') -->
1050
+ <xsl:call-template name="insertContentItem"/>
1051
+ </xsl:for-each>
1052
+ <xsl:for-each select="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true' and (@type = 'index')]">
1053
+ <xsl:call-template name="insertContentItem"/>
1054
+ </xsl:for-each>
1055
+ </fo:table-body>
1056
+ </fo:table>
1057
+ </xsl:if>
620
1058
  </fo:block>
621
1059
  </fo:block-container>
622
1060
 
@@ -639,52 +1077,14 @@
639
1077
  <!-- Normative references -->
640
1078
  <xsl:apply-templates select="bipm:bibliography/bipm:references[@normative='true']" mode="sections"/>
641
1079
 
642
-
643
- <!-- Table of Contents for Annexes -->
644
- <!-- <fo:page-sequence master-reference="document" force-page-count="no-force">
645
- <xsl:call-template name="insertHeaderFooter"/>
646
- <fo:flow flow-name="xsl-region-body">
647
-
648
- <fo:block-container margin-left="-18mm" margin-right="-1mm">
649
- <fo:block-container margin-left="0mm" margin-right="0mm">
650
- <fo:block font-family="Arial" font-size="16pt" font-weight="bold" text-align-last="justify" margin-bottom="84pt">
651
- <xsl:variable name="title-toc">
652
- <xsl:call-template name="getTitle">
653
- <xsl:with-param name="name" select="'title-toc'"/>
654
- </xsl:call-template>
655
- </xsl:variable>
656
- <fo:marker marker-class-name="header-title"><xsl:value-of select="$title-toc"/></fo:marker>
657
- <fo:inline><xsl:value-of select="$title-fr"/></fo:inline>
658
- <fo:inline keep-together.within-line="always">
659
- <fo:leader leader-pattern="space"/>
660
- <fo:inline>
661
- <xsl:value-of select="$title-toc"/>
662
- </fo:inline>
663
- </fo:inline>
664
- </fo:block>
665
- </fo:block-container>
666
- </fo:block-container>
667
-
668
- <fo:block-container line-height="130%">
669
- <fo:block>
670
- <xsl:for-each select="xalan:nodeset($contents)/doc[@id = $docid]//item[@display='true' and @type = 'annex']">
671
-
672
- <xsl:call-template name="insertContentItem"/>
673
-
674
- </xsl:for-each>
675
- </fo:block>
676
- </fo:block-container>
677
-
678
- </fo:flow>
679
-
680
- </fo:page-sequence> -->
681
-
682
-
683
1080
  <xsl:apply-templates select="bipm:annex" mode="sections"/>
684
1081
 
685
1082
  <!-- Bibliography -->
686
1083
  <xsl:apply-templates select="bipm:bibliography/bipm:references[not(@normative='true')]" mode="sections"/>
687
1084
 
1085
+ <!-- Index -->
1086
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index"/>
1087
+
688
1088
  <!-- End Document Pages -->
689
1089
 
690
1090
 
@@ -695,32 +1095,10 @@
695
1095
  </xsl:when>
696
1096
  <xsl:otherwise> <!-- independentAppendix != '' -->
697
1097
 
698
-
699
- <!-- <fo:page-sequence master-reference="appendix" initial-page-number="1" force-page-count="no-force">
700
- <xsl:call-template name="insertFootnoteSeparator"/>
701
- <xsl:call-template name="insertHeaderFooterAppendix"/>
702
- <fo:flow flow-name="xsl-region-body" font-family="Times New Roman">
703
- <fo:block-container border-bottom="1.5pt solid rgb(79, 129, 189)" margin-bottom="36pt">
704
- <fo:block font-family="Arial" font-size="24pt" font-weight="bold" color="rgb(23, 54, 93)">
705
- <fo:block>
706
- <xsl:choose>
707
- <xsl:when test="$lang = 'fr'">Annexe </xsl:when>
708
- <xsl:otherwise>Appendix </xsl:otherwise>
709
- </xsl:choose>
710
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix"/>
711
- <xsl:text>. </xsl:text>
712
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'appendix' and @language = $lang]"/>
713
- </fo:block>
714
- </fo:block>
715
- </fo:block-container>
716
-
717
- <fo:block line-height="130%">
718
- <xsl:apply-templates select="bipm:sections/*"/>
719
- </fo:block>
720
-
721
- <fo:block id="theLastPage"/>
722
- </fo:flow>
723
- </fo:page-sequence> -->
1098
+
1099
+ <xsl:variable name="docid">
1100
+ <xsl:call-template name="getDocumentId"/>
1101
+ </xsl:variable>
724
1102
 
725
1103
  <fo:page-sequence master-reference="document" force-page-count="no-force">
726
1104
 
@@ -747,12 +1125,64 @@
747
1125
  </fo:block-container>
748
1126
 
749
1127
  <fo:block-container font-size="18pt" font-weight="bold" text-align="center">
750
- <fo:block>
751
- <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']"/>
1128
+ <fo:block>
1129
+
1130
+ <!-- <xsl:variable name="title"> -->
1131
+ <xsl:choose>
1132
+ <xsl:when test="$independentAppendix != ''">
1133
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']" mode="title"/>
1134
+ <fo:block>
1135
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='annex']" mode="title"/>
1136
+ </fo:block>
1137
+ </xsl:when>
1138
+ <xsl:otherwise> <!-- doctype = 'guide' -->
1139
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']" mode="title"/>
1140
+ </xsl:otherwise>
1141
+ </xsl:choose>
1142
+ <!-- </xsl:variable> -->
1143
+
1144
+
1145
+ <!-- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1146
+
1147
+ <xsl:choose>
1148
+ <xsl:when test="$curr_lang = 'en' and contains($title, $mep_text)">
1149
+ <xsl:value-of select="substring-before($title, $mep_text)"/>
1150
+ <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1151
+ <xsl:value-of select="substring-after($title, $mep_text)"/>
1152
+ </xsl:when>
1153
+ <xsl:otherwise>
1154
+ <xsl:value-of select="$title"/>
1155
+ </xsl:otherwise>
1156
+ </xsl:choose> -->
1157
+
752
1158
  </fo:block>
1159
+
1160
+
1161
+ <xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1162
+ <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']">
1163
+ <fo:block>
1164
+ <xsl:if test="$part_num != ''">
1165
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$curr_lang]),'#',$part_num)"/>
1166
+ </xsl:if>
1167
+ <xsl:text>: </xsl:text>
1168
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']" mode="title"/>
1169
+ </fo:block>
1170
+ </xsl:if>
1171
+ <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1172
+ <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']">
1173
+ <fo:block>
1174
+ <xsl:if test="$subpart_num != ''">
1175
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang=$curr_lang]),'#',$subpart_num)"/>
1176
+ </xsl:if>
1177
+ <xsl:text>: </xsl:text>
1178
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']" mode="title"/>
1179
+ </fo:block>
1180
+ </xsl:if>
1181
+
1182
+
753
1183
  <fo:block> </fo:block>
754
1184
  <fo:block font-size="9pt">
755
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee"/>
1185
+ <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = $curr_lang]"/>
756
1186
  </fo:block>
757
1187
  </fo:block-container>
758
1188
 
@@ -774,11 +1204,15 @@
774
1204
  <fo:block> </fo:block>
775
1205
  <fo:block> </fo:block>
776
1206
  <fo:block text-align-last="justify">
777
- <xsl:choose>
778
- <xsl:when test="$lang = 'fr'">Annexe </xsl:when>
779
- <xsl:otherwise>Appendix </xsl:otherwise>
780
- </xsl:choose>
781
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix"/>
1207
+ <fo:inline>
1208
+ <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix">
1209
+ <xsl:choose>
1210
+ <xsl:when test="$lang = 'fr'">Annexe </xsl:when>
1211
+ <xsl:otherwise>Appendix </xsl:otherwise>
1212
+ </xsl:choose>
1213
+ <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix"/>
1214
+ </xsl:if>
1215
+ </fo:inline>
782
1216
  <fo:inline keep-together.within-line="always">
783
1217
  <fo:leader leader-pattern="space"/>
784
1218
  <xsl:call-template name="printRevisionDate">
@@ -802,6 +1236,7 @@
802
1236
  <!-- Document Pages -->
803
1237
 
804
1238
  <xsl:apply-templates select="bipm:sections/*" mode="sections"/>
1239
+ <!-- <xsl:call-template name="sections_appendix"/> --> <!-- without pagebreaks -->
805
1240
 
806
1241
  <!-- Normative references -->
807
1242
  <xsl:apply-templates select="bipm:bibliography/bipm:references[@normative='true']" mode="sections"/>
@@ -811,6 +1246,8 @@
811
1246
 
812
1247
  <xsl:apply-templates select="bipm:bibliography/bipm:references[not(@normative='true')]" mode="sections"/>
813
1248
 
1249
+ <!-- Index -->
1250
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index"/>
814
1251
 
815
1252
  </xsl:otherwise>
816
1253
  </xsl:choose>
@@ -829,7 +1266,7 @@
829
1266
  <xsl:call-template name="insertCoverPageCommon"/>
830
1267
 
831
1268
  <fo:block-container height="100%" display-align="center" border="0pt solid black"><!-- -->
832
- <fo:block font-family="WorkSans" font-size="50pt" line-height="115%">
1269
+ <fo:block font-family="Work Sans" font-size="50pt" line-height="115%">
833
1270
 
834
1271
  <xsl:variable name="languages">
835
1272
  <xsl:call-template name="getLanguages"/>
@@ -900,7 +1337,7 @@
900
1337
 
901
1338
  <fo:page-sequence master-reference="cover-page-appendix" force-page-count="even" initial-page-number="1">
902
1339
 
903
- <fo:flow flow-name="xsl-region-body" font-family="WorkSans">
1340
+ <fo:flow flow-name="xsl-region-body" font-family="Work Sans">
904
1341
 
905
1342
  <xsl:call-template name="insertCoverPageCommon"/>
906
1343
 
@@ -908,33 +1345,183 @@
908
1345
  <xsl:variable name="weight-bold">500</xsl:variable>
909
1346
 
910
1347
  <fo:block-container absolute-position="fixed" left="12.5mm" top="60mm">
911
- <fo:block font-size="22.2pt" font-weight="{$weight-normal}">Le Système international d’unités</fo:block>
912
- <fo:block font-size="22.2pt" font-weight="{$weight-bold}" margin-top="1mm">The International System of Units</fo:block>
1348
+
1349
+ <fo:block font-size="22.2pt" font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'main']"/></fo:block>
1350
+ <fo:block font-size="22.2pt" font-weight="{$weight-bold}" margin-top="1mm"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'main']"/></fo:block>
1351
+
913
1352
  <xsl:variable name="edition_str">édition</xsl:variable>
914
1353
  <!-- <xsl:choose>
915
1354
  <xsl:when test="$lang = 'fr'">édition</xsl:when>
916
1355
  <xsl:otherwise>edition</xsl:otherwise>
917
1356
  </xsl:choose>
918
1357
  </xsl:variable> -->
919
- <fo:block font-size="14pt" font-weight="{$weight-bold}" margin-top="4mm"><xsl:value-of select="concat(/bipm:bipm-standard/bipm:bibdata/bipm:edition, ' ', $edition_str, ' ', $copyrightYear)"/></fo:block>
1358
+ <fo:block font-size="14pt" font-weight="{$weight-bold}" margin-top="4mm"><xsl:value-of select="concat((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:edition, ' ', $edition_str, ' ', $copyrightYear)"/></fo:block>
920
1359
  </fo:block-container>
921
1360
 
922
- <fo:block-container height="98%" display-align="center">
923
- <xsl:variable name="appendix_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
924
- <xsl:if test="$appendix_num != ''">
925
- <fo:block font-size="17pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
926
- <fo:block font-size="17pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
927
- </xsl:if>
928
- <fo:block font-size="30.4pt">
929
- <fo:block> </fo:block>
930
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']"/></fo:block>
931
- <fo:block> </fo:block>
932
- <fo:block font-weight="{$weight-bold}"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']"/></fo:block>
1361
+ <!-- <fo:block-container height="98%" display-align="center"> -->
1362
+ <fo:block-container absolute-position="fixed" left="12.5mm" top="92mm" height="170mm" width="144mm" display-align="center">
1363
+ <fo:block>
1364
+
1365
+ <xsl:variable name="title_appendix_fr">
1366
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']" mode="title"/>
1367
+ </xsl:variable>
1368
+ <xsl:variable name="title_appendix_en">
1369
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']" mode="title"/>
1370
+ </xsl:variable>
1371
+ <xsl:variable name="title_annex_fr">
1372
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'annex']" mode="title"/>
1373
+ </xsl:variable>
1374
+ <xsl:variable name="title_annex_en">
1375
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'annex']" mode="title"/>
1376
+ </xsl:variable>
1377
+ <xsl:variable name="title_part_fr">
1378
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']" mode="title"/>
1379
+ </xsl:variable>
1380
+ <xsl:variable name="title_part_en">
1381
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']" mode="title"/>
1382
+ </xsl:variable>
1383
+ <xsl:variable name="title_subpart_fr">
1384
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']" mode="title"/>
1385
+ </xsl:variable>
1386
+ <xsl:variable name="title_subpart_en">
1387
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']" mode="title"/>
1388
+ </xsl:variable>
1389
+
1390
+ <xsl:variable name="titles_length" select="string-length($title_appendix_fr) + string-length($title_appendix_en) + string-length($title_annex_fr) + string-length($title_annex_en) + string-length($title_part_fr) + string-length($title_part_en) + string-length($title_subpart_fr) + string-length($title_subpart_fr)"/>
1391
+
1392
+ <xsl:variable name="font-size-number-factor">
1393
+ <xsl:choose>
1394
+ <xsl:when test="$titles_length &gt; 350">0.7</xsl:when>
1395
+ <xsl:when test="$titles_length &gt; 250">0.85</xsl:when>
1396
+ <xsl:otherwise>1</xsl:otherwise>
1397
+ </xsl:choose>
1398
+ </xsl:variable>
1399
+
1400
+ <xsl:variable name="space-factor">
1401
+ <xsl:choose>
1402
+ <xsl:when test="$titles_length &gt; 250">0.3</xsl:when>
1403
+ <xsl:otherwise>1</xsl:otherwise>
1404
+ </xsl:choose>
1405
+ </xsl:variable>
1406
+
1407
+ <xsl:variable name="font-size-factor">
1408
+ <xsl:choose>
1409
+ <xsl:when test="$titles_length &gt; 350">0.5</xsl:when>
1410
+ <xsl:when test="$titles_length &gt; 250">0.65</xsl:when>
1411
+ <xsl:otherwise>1</xsl:otherwise>
1412
+ </xsl:choose>
1413
+ </xsl:variable>
1414
+
1415
+ <!-- Appendix titles processing -->
1416
+ <xsl:variable name="appendix_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
1417
+ <xsl:if test="$appendix_num != ''">
1418
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1419
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1420
+ </xsl:if>
1421
+
1422
+
1423
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'appendix']">
1424
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1425
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1426
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_appendix_fr"/></fo:block>
1427
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1428
+ <fo:block font-weight="{$weight-bold}">
1429
+ <xsl:copy-of select="$title_appendix_en"/>
1430
+ </fo:block>
1431
+ </fo:block>
1432
+ </xsl:if>
1433
+ <!-- End Appendix titles processing -->
1434
+
1435
+ <!-- Annex title processing -->
1436
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'annex']">
1437
+ <xsl:variable name="annex_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:annexid)"/>
1438
+ <xsl:if test="$annex_num != ''">
1439
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1440
+ <!-- Annexe -->
1441
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$annex_num"/></fo:block>
1442
+ <!-- Annex -->
1443
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Annex <xsl:value-of select="$annex_num"/></fo:block>
1444
+ </xsl:if>
1445
+
1446
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1447
+
1448
+ <xsl:if test="normalize-space($title_annex_fr) != ''">
1449
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1450
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_annex_fr"/></fo:block>
1451
+ </xsl:if>
1452
+
1453
+ <xsl:if test="normalize-space($title_annex_en) != ''">
1454
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1455
+ <fo:block font-weight="{$weight-bold}">
1456
+ <xsl:copy-of select="$title_annex_en"/>
1457
+ </fo:block>
1458
+ </xsl:if>
1459
+ </fo:block>
1460
+ </xsl:if>
1461
+ <!-- End Annex titles processing -->
1462
+
1463
+ <!-- Part titles processing -->
1464
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'part']">
1465
+ <xsl:variable name="part_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1466
+ <xsl:if test="$part_num != ''">
1467
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1468
+ <!-- Part -->
1469
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/></fo:block>
1470
+ <!-- Partie -->
1471
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/></fo:block>
1472
+ </xsl:if>
1473
+
1474
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1475
+
1476
+ <xsl:if test="normalize-space($title_part_fr) != ''">
1477
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1478
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_part_fr"/></fo:block>
1479
+ </xsl:if>
1480
+
1481
+ <xsl:if test="normalize-space($title_part_en) != ''">
1482
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1483
+ <fo:block font-weight="{$weight-bold}">
1484
+ <xsl:copy-of select="$title_part_en"/>
1485
+ </fo:block>
1486
+ </xsl:if>
1487
+ </fo:block>
1488
+ </xsl:if>
1489
+ <!-- End Part titles processing -->
1490
+
1491
+ <!-- Sub-part titles processing -->
1492
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'subpart']">
1493
+ <xsl:variable name="subpart_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1494
+ <xsl:if test="$subpart_num != ''">
1495
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1496
+ <!-- Sub-part -->
1497
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='fr']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1498
+ <!-- Partie de sub -->
1499
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='en']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1500
+ </xsl:if>
1501
+
1502
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1503
+
1504
+ <xsl:if test="normalize-space($title_subpart_fr) != ''">
1505
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1506
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_subpart_fr"/></fo:block>
1507
+ </xsl:if>
1508
+
1509
+ <xsl:if test="normalize-space($title_subpart_en) != ''">
1510
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1511
+ <fo:block font-weight="{$weight-bold}">
1512
+ <xsl:copy-of select="$title_subpart_en"/>
1513
+
1514
+ </fo:block>
1515
+ </xsl:if>
1516
+ </fo:block>
1517
+ </xsl:if>
1518
+ <!-- End Sub-part titles processing -->
1519
+
933
1520
  </fo:block>
934
1521
  </fo:block-container>
935
1522
 
936
1523
  <!-- <fo:block-container>
937
- <fo:block font-family="WorkSans" font-size="16pt" line-height="120%" font-weight="400" margin-top="20mm">
1524
+ <fo:block font-family="Work Sans" font-size="16pt" line-height="120%" font-weight="400" margin-top="20mm">
938
1525
  <fo:block>
939
1526
  <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $lang]"/>
940
1527
  <xsl:text> (</xsl:text>
@@ -954,26 +1541,26 @@
954
1541
  <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix"/>
955
1542
  </fo:block>
956
1543
  </fo:block>
957
- <fo:block font-family="WorkSans" font-size="36pt" font-weight="600" margin-top="15mm">
1544
+ <fo:block font-family="Work Sans" font-size="36pt" font-weight="600" margin-top="15mm">
958
1545
  <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'appendix' and @language = $lang]"/>
959
1546
  </fo:block>
960
1547
  </fo:block-container> -->
961
1548
 
962
- <fo:block-container absolute-position="fixed" left="12mm" top="242mm" height="42mm" display-align="after">
1549
+ <fo:block-container absolute-position="fixed" left="12mm" top="242mm" height="42mm" width="140mm" display-align="after">
963
1550
  <fo:block font-size="12pt">
964
- <fo:block>Comité consultatif du temps et des fréquences</fo:block>
965
- <fo:block><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee"/></fo:block>
1551
+ <fo:block><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = 'fr']"/></fo:block>
1552
+ <fo:block><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = 'en']"/></fo:block>
966
1553
  <fo:block> </fo:block>
967
1554
  <!-- <fo:block>BIPM SI MEP S1</fo:block> -->
968
1555
  <fo:block>
969
1556
  <xsl:call-template name="printRevisionDate">
970
- <xsl:with-param name="date" select="/bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:revision-date"/>
1557
+ <xsl:with-param name="date" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:version/bipm:revision-date"/>
971
1558
  <xsl:with-param name="lang" select="'en'"/>
972
1559
  </xsl:call-template>
973
1560
  </fo:block>
974
1561
  <fo:block>
975
1562
  <xsl:call-template name="printRevisionDate">
976
- <xsl:with-param name="date" select="/bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:revision-date"/>
1563
+ <xsl:with-param name="date" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:version/bipm:revision-date"/>
977
1564
  <xsl:with-param name="lang" select="'fr'"/>
978
1565
  </xsl:call-template>
979
1566
  </fo:block>
@@ -1015,74 +1602,95 @@
1015
1602
  </xsl:template>
1016
1603
 
1017
1604
  <xsl:template name="insertInnerCoverPage">
1018
- <fo:page-sequence master-reference="title-page" format="1" initial-page-number="1" force-page-count="even">
1019
-
1020
- <fo:flow flow-name="xsl-region-body" font-family="Arial">
1021
-
1022
- <xsl:variable name="languages">
1023
- <xsl:call-template name="getLanguages"/>
1024
- </xsl:variable>
1025
-
1026
- <xsl:variable name="titles">
1027
- <xsl:for-each select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title">
1028
- <xsl:copy-of select="."/>
1029
- </xsl:for-each>
1030
- </xsl:variable>
1031
-
1032
- <xsl:for-each select="xalan:nodeset($languages)/lang">
1033
- <xsl:variable name="curr_lang" select="."/>
1034
- <xsl:variable name="title" select="xalan:nodeset($titles)//bipm:title[@language = $curr_lang and @type='cover']"/>
1035
- <xsl:choose>
1036
- <xsl:when test="position() = 1">
1037
- <fo:block-container font-size="12pt" font-weight="bold" width="55mm">
1038
- <fo:block>
1039
- <xsl:call-template name="add-letter-spacing">
1040
- <xsl:with-param name="text" select="$title"/>
1041
- <xsl:with-param name="letter-spacing" select="0.09"/>
1042
- </xsl:call-template>
1043
- </fo:block>
1044
- <fo:block font-size="10pt">
1045
- <fo:block margin-bottom="6pt"> </fo:block>
1046
- <fo:block margin-bottom="6pt"> </fo:block>
1047
- <fo:block margin-bottom="6pt"> </fo:block>
1048
- <fo:block margin-bottom="6pt" line-height="2.4"> </fo:block>
1049
- </fo:block>
1050
- </fo:block-container>
1051
- </xsl:when>
1052
- <xsl:otherwise>
1053
- <fo:block font-size="10pt" margin-bottom="3pt">
1054
- <xsl:variable name="lang_version">
1055
- <xsl:call-template name="getLangVersion">
1056
- <xsl:with-param name="lang" select="$curr_lang"/>
1057
- </xsl:call-template>
1058
- </xsl:variable>
1059
- <xsl:call-template name="add-letter-spacing">
1060
- <xsl:with-param name="text" select="normalize-space($lang_version)"/>
1061
- <xsl:with-param name="letter-spacing" select="0.09"/>
1062
- </xsl:call-template>
1063
- </fo:block>
1064
- <fo:block-container font-size="12pt" font-weight="bold" border-top="0.5pt solid black" padding-top="2mm" width="45mm">
1065
- <fo:block>
1066
- <xsl:call-template name="add-letter-spacing">
1067
- <xsl:with-param name="text" select="$title"/>
1068
- <xsl:with-param name="letter-spacing" select="0.09"/>
1069
- </xsl:call-template>
1070
- </fo:block>
1071
- </fo:block-container>
1072
- </xsl:otherwise>
1073
-
1074
- </xsl:choose>
1075
- </xsl:for-each>
1605
+
1606
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type='cover']">
1607
+
1608
+ <fo:page-sequence master-reference="title-page" format="1" initial-page-number="1" force-page-count="even">
1076
1609
 
1610
+ <fo:flow flow-name="xsl-region-body" font-family="Arial">
1077
1611
 
1612
+ <xsl:variable name="languages">
1613
+ <xsl:call-template name="getLanguages"/>
1614
+ </xsl:variable>
1078
1615
 
1616
+ <xsl:variable name="titles">
1617
+ <xsl:for-each select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title">
1618
+ <xsl:copy-of select="."/>
1619
+ </xsl:for-each>
1620
+ </xsl:variable>
1079
1621
 
1080
- </fo:flow>
1081
- </fo:page-sequence>
1082
-
1622
+ <xsl:for-each select="xalan:nodeset($languages)/lang">
1623
+ <xsl:variable name="curr_lang" select="."/>
1624
+ <xsl:variable name="title" select="xalan:nodeset($titles)//bipm:title[@language = $curr_lang and @type='cover']"/>
1625
+ <xsl:choose>
1626
+ <xsl:when test="position() = 1">
1627
+ <fo:block-container font-size="12pt" font-weight="bold" width="55mm">
1628
+ <fo:block>
1629
+ <xsl:call-template name="add-letter-spacing">
1630
+ <xsl:with-param name="text" select="$title"/>
1631
+ <xsl:with-param name="letter-spacing" select="0.09"/>
1632
+ </xsl:call-template>
1633
+ </fo:block>
1634
+ <fo:block font-size="10pt">
1635
+ <fo:block margin-bottom="6pt"> </fo:block>
1636
+ <fo:block margin-bottom="6pt"> </fo:block>
1637
+ <fo:block margin-bottom="6pt"> </fo:block>
1638
+ <fo:block margin-bottom="6pt" line-height="2.4"> </fo:block>
1639
+ </fo:block>
1640
+ </fo:block-container>
1641
+ </xsl:when>
1642
+ <xsl:otherwise>
1643
+ <fo:block font-size="10pt" margin-bottom="3pt">
1644
+ <xsl:variable name="lang_version">
1645
+ <xsl:call-template name="getLangVersion">
1646
+ <xsl:with-param name="lang" select="$curr_lang"/>
1647
+ </xsl:call-template>
1648
+ </xsl:variable>
1649
+ <xsl:call-template name="add-letter-spacing">
1650
+ <xsl:with-param name="text" select="normalize-space($lang_version)"/>
1651
+ <xsl:with-param name="letter-spacing" select="0.09"/>
1652
+ </xsl:call-template>
1653
+ </fo:block>
1654
+ <fo:block-container font-size="12pt" font-weight="bold" border-top="0.5pt solid black" padding-top="2mm" width="45mm">
1655
+ <fo:block>
1656
+ <xsl:call-template name="add-letter-spacing">
1657
+ <xsl:with-param name="text" select="$title"/>
1658
+ <xsl:with-param name="letter-spacing" select="0.09"/>
1659
+ </xsl:call-template>
1660
+ </fo:block>
1661
+ </fo:block-container>
1662
+ </xsl:otherwise>
1663
+
1664
+ </xsl:choose>
1665
+ </xsl:for-each>
1666
+
1667
+
1668
+
1669
+
1670
+ </fo:flow>
1671
+ </fo:page-sequence>
1672
+ </xsl:if>
1083
1673
  </xsl:template>
1084
1674
  <!-- End Cover Pages -->
1085
1675
 
1676
+
1677
+ <xsl:template match="bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en']/text()" priority="3">
1678
+ <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1679
+ <xsl:choose>
1680
+ <xsl:when test="contains(., $mep_text)">
1681
+ <xsl:value-of select="substring-before(., $mep_text)"/>
1682
+ <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1683
+ <xsl:value-of select="substring-after(., $mep_text)"/>
1684
+ </xsl:when>
1685
+ <xsl:otherwise>
1686
+ <xsl:value-of select="."/>
1687
+ </xsl:otherwise>
1688
+ </xsl:choose>
1689
+ </xsl:template>
1690
+
1691
+
1692
+
1693
+
1086
1694
  <xsl:template name="insertSeparatorPage">
1087
1695
  <!-- 3 Pages with BIPM Metro logo -->
1088
1696
  <fo:page-sequence master-reference="document" force-page-count="no-force">
@@ -1107,7 +1715,7 @@
1107
1715
  <xsl:choose>
1108
1716
  <xsl:when test="$doc_split_by_language = ''"><!-- all documents -->
1109
1717
  <xsl:for-each select="//bipm:bipm-standard/bipm:bibdata">
1110
- <lang><xsl:value-of select="bipm:language"/></lang>
1718
+ <lang><xsl:value-of select="bipm:language[@current = 'true']"/></lang>
1111
1719
  </xsl:for-each>
1112
1720
  <!-- <xsl:choose>
1113
1721
  <xsl:when test="count(//bipm:bipm-standard) = 1">
@@ -1131,87 +1739,131 @@
1131
1739
  </xsl:template>
1132
1740
 
1133
1741
  <xsl:template name="insertContentItem">
1134
- <fo:block>
1135
- <xsl:if test="@level = 1">
1136
- <xsl:attribute name="space-after">6pt</xsl:attribute>
1137
- <xsl:attribute name="font-family">Arial</xsl:attribute>
1138
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1139
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1140
- <xsl:if test="@type = 'annex'">
1141
- <xsl:attribute name="space-before">14pt</xsl:attribute>
1142
- <xsl:attribute name="space-after">0pt</xsl:attribute>
1742
+ <fo:table-row>
1743
+ <xsl:variable name="space-before">
1744
+ <xsl:if test="@level = 1">
1745
+ <xsl:if test="@type = 'annex'">14pt</xsl:if>
1143
1746
  </xsl:if>
1144
- </xsl:if>
1145
- <xsl:if test="@level &gt;= 2 and not(@parent = 'annex')">
1146
- <xsl:attribute name="font-size">10.5pt</xsl:attribute>
1147
- </xsl:if>
1148
- <xsl:if test="@level = 2">
1149
- <xsl:attribute name="margin-left">8mm</xsl:attribute>
1150
- </xsl:if>
1151
- <xsl:if test="@level &gt; 2">
1152
- <xsl:attribute name="margin-left">9mm</xsl:attribute>
1153
- </xsl:if>
1154
- <xsl:if test="@level &gt;= 2 and @parent = 'annex'">
1155
- <xsl:attribute name="font-family">Arial</xsl:attribute>
1156
- <xsl:attribute name="font-size">8pt</xsl:attribute>
1157
- <xsl:attribute name="margin-left">25mm</xsl:attribute>
1158
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1159
- </xsl:if>
1160
-
1161
- <xsl:if test="@level = 2 and not(following-sibling::item[@display='true']) and not(item[@display='true'])">
1162
- <xsl:attribute name="space-after">12pt</xsl:attribute>
1163
- </xsl:if>
1164
- <xsl:if test="@level = 3 and not(following-sibling::item[@display='true']) and not(../following-sibling::item[@display='true'])">
1165
- <xsl:attribute name="space-after">12pt</xsl:attribute>
1166
- </xsl:if>
1747
+ </xsl:variable>
1748
+ <xsl:variable name="space-after">
1749
+ <xsl:choose>
1750
+ <xsl:when test="@level = 1 and @type = 'annex'">0pt</xsl:when>
1751
+ <xsl:when test="@level = 1">6pt</xsl:when>
1752
+ <xsl:when test="@level = 2 and not(following-sibling::item[@display='true']) and not(item[@display='true']) and not(position() = last())">12pt</xsl:when>
1753
+ <xsl:when test="@level = 3 and not(following-sibling::item[@display='true']) and not(../following-sibling::item[@display='true']) and not(position() = last())">12pt</xsl:when>
1754
+ </xsl:choose>
1755
+ </xsl:variable>
1167
1756
 
1168
- <fo:list-block>
1169
- <xsl:attribute name="provisional-distance-between-starts">
1170
- <xsl:choose>
1171
- <xsl:when test="@section = '' or @level &gt; 3">0mm</xsl:when>
1172
- <xsl:when test="@level = 2 and @parent = 'annex'">0mm</xsl:when>
1173
- <xsl:when test="@level = 2">8mm</xsl:when>
1174
- <xsl:when test="@type = 'annex' and @level = 1">25mm</xsl:when>
1175
- <xsl:otherwise>7mm</xsl:otherwise>
1176
- </xsl:choose>
1177
- </xsl:attribute>
1178
-
1179
- <fo:list-item>
1180
- <fo:list-item-label end-indent="label-end()">
1181
- <fo:block>
1182
- <xsl:if test="@level = 1 or (@level = 2 and not(@parent = 'annex'))">
1183
- <xsl:value-of select="@section"/>
1184
- </xsl:if>
1185
- <fo:inline font-size="10pt" color="white">Z</fo:inline> <!-- for baseline alignment in string -->
1186
- </fo:block>
1187
- </fo:list-item-label>
1188
- <fo:list-item-body start-indent="body-start()">
1189
- <fo:block text-align-last="justify">
1190
- <xsl:if test="@level &gt;= 3">
1191
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
1192
- <xsl:attribute name="text-indent">-12mm</xsl:attribute>
1193
- </xsl:if>
1194
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1195
- <xsl:if test="@level &gt;= 3">
1196
- <fo:inline padding-right="2mm"><xsl:value-of select="@section"/></fo:inline>
1197
- </xsl:if>
1198
- <xsl:variable name="sectionTitle">
1199
- <xsl:apply-templates select="title"/>
1200
- </xsl:variable>
1201
- <fo:inline>
1202
- <xsl:value-of select="$sectionTitle"/>
1203
- </fo:inline>
1204
- <xsl:text> </xsl:text>
1205
- <fo:inline keep-together.within-line="always">
1206
- <fo:leader leader-pattern="space"/>
1207
- <fo:inline font-family="Arial" font-weight="bold" font-size="10pt"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1208
- </fo:inline>
1209
- </fo:basic-link>
1210
- </fo:block>
1211
- </fo:list-item-body>
1212
- </fo:list-item>
1213
- </fo:list-block>
1214
- </fo:block>
1757
+ <fo:table-cell>
1758
+ <xsl:if test="normalize-space($space-before) != ''">
1759
+ <xsl:attribute name="padding-top"><xsl:value-of select="normalize-space($space-before)"/></xsl:attribute>
1760
+ </xsl:if>
1761
+ <xsl:if test="normalize-space($space-after) != ''">
1762
+ <xsl:attribute name="padding-bottom"><xsl:value-of select="normalize-space($space-after)"/></xsl:attribute>
1763
+ </xsl:if>
1764
+ <fo:block>
1765
+ <xsl:if test="@level = 1">
1766
+ <!-- <xsl:attribute name="space-after">6pt</xsl:attribute> -->
1767
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
1768
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1769
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1770
+ <!-- <xsl:if test="@type = 'annex'">
1771
+ <xsl:attribute name="space-before">14pt</xsl:attribute>
1772
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
1773
+ </xsl:if> -->
1774
+ </xsl:if>
1775
+ <xsl:if test="@level &gt;= 2 and not(@parent = 'annex')">
1776
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
1777
+ </xsl:if>
1778
+ <xsl:if test="@level = 2">
1779
+ <xsl:attribute name="margin-left">8mm</xsl:attribute>
1780
+ </xsl:if>
1781
+ <xsl:if test="@level &gt; 2">
1782
+ <xsl:attribute name="margin-left">9mm</xsl:attribute>
1783
+ </xsl:if>
1784
+ <xsl:if test="@level &gt;= 2 and @parent = 'annex'">
1785
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
1786
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1787
+ <xsl:attribute name="margin-left">25mm</xsl:attribute>
1788
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1789
+ </xsl:if>
1790
+ <xsl:if test="@type = 'index'">
1791
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
1792
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1793
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1794
+ <xsl:attribute name="space-before">14pt</xsl:attribute>
1795
+ </xsl:if>
1796
+ <!-- <xsl:if test="@level = 2 and not(following-sibling::item[@display='true']) and not(item[@display='true'])">
1797
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1798
+ </xsl:if>
1799
+ <xsl:if test="@level = 3 and not(following-sibling::item[@display='true']) and not(../following-sibling::item[@display='true'])">
1800
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1801
+ </xsl:if> -->
1802
+
1803
+ <fo:list-block>
1804
+ <xsl:attribute name="provisional-distance-between-starts">
1805
+ <xsl:choose>
1806
+ <xsl:when test="@section = '' or @level &gt; 3">0mm</xsl:when>
1807
+ <xsl:when test="@level = 2 and @parent = 'annex'">0mm</xsl:when>
1808
+ <xsl:when test="@level = 2">8mm</xsl:when>
1809
+ <xsl:when test="@type = 'annex' and @level = 1">25mm</xsl:when>
1810
+ <xsl:otherwise>7mm</xsl:otherwise>
1811
+ </xsl:choose>
1812
+ </xsl:attribute>
1813
+
1814
+ <fo:list-item>
1815
+ <fo:list-item-label end-indent="label-end()">
1816
+ <fo:block>
1817
+ <xsl:if test="@level = 1 or (@level = 2 and not(@parent = 'annex'))">
1818
+ <xsl:value-of select="@section"/>
1819
+ <xsl:if test="normalize-space(@section) != '' and @type = 'annex'">.</xsl:if>
1820
+ </xsl:if>
1821
+ <!-- <fo:inline font-size="10pt" color="white">Z</fo:inline> --> <!-- for baseline alignment in string -->
1822
+ </fo:block>
1823
+ </fo:list-item-label>
1824
+ <fo:list-item-body start-indent="body-start()">
1825
+ <fo:block> <!-- text-align-last="justify" -->
1826
+ <xsl:if test="@level &gt;= 3">
1827
+ <xsl:attribute name="margin-left">11mm</xsl:attribute>
1828
+ <xsl:attribute name="text-indent">-11mm</xsl:attribute>
1829
+ </xsl:if>
1830
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1831
+ <xsl:if test="@level &gt;= 3">
1832
+ <fo:inline padding-right="2mm"><xsl:value-of select="@section"/></fo:inline>
1833
+ </xsl:if>
1834
+ <xsl:variable name="sectionTitle">
1835
+ <xsl:apply-templates select="title"/>
1836
+ </xsl:variable>
1837
+ <fo:inline>
1838
+ <xsl:value-of select="$sectionTitle"/>
1839
+ </fo:inline>
1840
+ <!-- <xsl:text> </xsl:text> -->
1841
+ <!-- keep-together.within-line="always" -->
1842
+ <!-- <fo:inline >
1843
+ <fo:leader leader-pattern="space"/>
1844
+ <fo:inline font-family="Arial" font-weight="bold" font-size="10pt"><fo:page-number-citation ref-id="{@id}"/>35</fo:inline>
1845
+ </fo:inline> -->
1846
+ </fo:basic-link>
1847
+ </fo:block>
1848
+ </fo:list-item-body>
1849
+ </fo:list-item>
1850
+ </fo:list-block>
1851
+ </fo:block>
1852
+ </fo:table-cell>
1853
+ <fo:table-cell text-align="right">
1854
+ <xsl:if test="normalize-space($space-before) != ''">
1855
+ <xsl:attribute name="padding-top"><xsl:value-of select="normalize-space($space-before)"/></xsl:attribute>
1856
+ </xsl:if>
1857
+ <xsl:if test="normalize-space($space-after) != ''">
1858
+ <xsl:attribute name="padding-bottom"><xsl:value-of select="normalize-space($space-after)"/></xsl:attribute>
1859
+ </xsl:if>
1860
+ <fo:block>
1861
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1862
+ <fo:inline font-family="Arial" font-weight="bold" font-size="10pt"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1863
+ </fo:basic-link>
1864
+ </fo:block>
1865
+ </fo:table-cell>
1866
+ </fo:table-row>
1215
1867
  </xsl:template>
1216
1868
 
1217
1869
 
@@ -1259,7 +1911,10 @@
1259
1911
  </xsl:variable>
1260
1912
 
1261
1913
  <xsl:variable name="type">
1262
- <xsl:value-of select="local-name()"/>
1914
+ <xsl:choose>
1915
+ <xsl:when test="@type = 'index'">index</xsl:when>
1916
+ <xsl:otherwise><xsl:value-of select="local-name()"/></xsl:otherwise>
1917
+ </xsl:choose>
1263
1918
  </xsl:variable>
1264
1919
 
1265
1920
  <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
@@ -1269,7 +1924,9 @@
1269
1924
  <title>
1270
1925
  <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1271
1926
  </title>
1272
- <xsl:apply-templates mode="contents"/>
1927
+ <xsl:if test="$type != 'index'">
1928
+ <xsl:apply-templates mode="contents"/>
1929
+ </xsl:if>
1273
1930
  </item>
1274
1931
  </xsl:if>
1275
1932
  </xsl:template>
@@ -1281,7 +1938,52 @@
1281
1938
  <xsl:template match="node()" mode="sections">
1282
1939
  <fo:page-sequence master-reference="document" force-page-count="no-force">
1283
1940
  <xsl:call-template name="insertFootnoteSeparator"/>
1284
- <xsl:call-template name="insertHeaderFooter"/>
1941
+
1942
+ <xsl:variable name="header-title">
1943
+ <xsl:choose>
1944
+
1945
+ <xsl:when test="local-name(..) = 'sections'">
1946
+ <xsl:choose>
1947
+ <xsl:when test="./bipm:title[1]/*[local-name() = 'tab']">
1948
+ <xsl:apply-templates select="./bipm:title[1]/*[local-name() = 'tab'][1]/following-sibling::node()" mode="header"/>
1949
+ </xsl:when>
1950
+ <xsl:otherwise>
1951
+ <xsl:apply-templates select="./bipm:title[1]" mode="header"/>
1952
+ </xsl:otherwise>
1953
+ </xsl:choose>
1954
+ </xsl:when>
1955
+
1956
+ <xsl:when test="local-name() = 'annex'">
1957
+ <xsl:choose>
1958
+ <xsl:when test="./*[1]/bipm:title[1]/*[local-name() = 'tab']">
1959
+ <xsl:variable name="title_annex">
1960
+ <xsl:value-of select="normalize-space(./*[1]/bipm:title[1]/*[local-name() = 'tab'][1]/preceding-sibling::node())"/>
1961
+ </xsl:variable>
1962
+ <xsl:choose>
1963
+ <xsl:when test="substring($title_annex, string-length($title_annex)) = '.'">
1964
+ <xsl:value-of select="substring($title_annex, 1, string-length($title_annex) - 1)"/>
1965
+ </xsl:when>
1966
+ <xsl:otherwise>
1967
+ <xsl:value-of select="$title_annex"/>
1968
+ </xsl:otherwise>
1969
+ </xsl:choose>
1970
+ </xsl:when>
1971
+ <xsl:otherwise>
1972
+ <xsl:apply-templates select="./*[1]/bipm:title[1]" mode="header"/>
1973
+ </xsl:otherwise>
1974
+ </xsl:choose>
1975
+ </xsl:when>
1976
+
1977
+ <xsl:otherwise>
1978
+ <xsl:apply-templates select="./bipm:title[1]" mode="header"/>
1979
+ </xsl:otherwise>
1980
+
1981
+ </xsl:choose>
1982
+ </xsl:variable>
1983
+ <xsl:call-template name="insertHeaderFooter">
1984
+ <xsl:with-param name="header-title" select="$header-title"/>
1985
+ </xsl:call-template>
1986
+
1285
1987
  <fo:flow flow-name="xsl-region-body">
1286
1988
  <fo:block line-height="125%">
1287
1989
  <xsl:apply-templates select="."/>
@@ -1290,6 +1992,34 @@
1290
1992
  </fo:page-sequence>
1291
1993
  </xsl:template>
1292
1994
 
1995
+ <xsl:template name="sections_appendix">
1996
+ <fo:page-sequence master-reference="document" force-page-count="no-force">
1997
+ <xsl:call-template name="insertFootnoteSeparator"/>
1998
+
1999
+ <xsl:variable name="curr_lang" select="/bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
2000
+
2001
+ <xsl:variable name="header-title">
2002
+ <xsl:choose>
2003
+ <xsl:when test="$lang = 'fr'">Annexe </xsl:when>
2004
+ <xsl:otherwise>Appendix </xsl:otherwise>
2005
+ </xsl:choose>
2006
+ <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix"/>
2007
+ </xsl:variable>
2008
+ <xsl:call-template name="insertHeaderFooter">
2009
+ <xsl:with-param name="header-title" select="$header-title"/>
2010
+ </xsl:call-template>
2011
+
2012
+ <fo:flow flow-name="xsl-region-body">
2013
+ <fo:block line-height="125%">
2014
+
2015
+ <xsl:for-each select=" bipm:sections/*">
2016
+ <xsl:apply-templates select="."/>
2017
+ </xsl:for-each>
2018
+ </fo:block>
2019
+ </fo:flow>
2020
+ </fo:page-sequence>
2021
+ </xsl:template>
2022
+
1293
2023
  <xsl:template match="bipm:bipm-standard/bipm:bibdata/bipm:edition">
1294
2024
  <xsl:param name="font-size" select="'65%'"/>
1295
2025
  <xsl:param name="baseline-shift" select="'30%'"/>
@@ -1328,7 +2058,7 @@
1328
2058
  </xsl:template>
1329
2059
 
1330
2060
  <xsl:template match="bipm:license-statement">
1331
- <fo:block font-size="10.6pt" font-family="Times New Roman">
2061
+ <fo:block font-size="10.5pt" font-family="Times New Roman">
1332
2062
  <xsl:apply-templates/>
1333
2063
  </fo:block>
1334
2064
  </xsl:template>
@@ -1345,7 +2075,7 @@
1345
2075
  </fo:block>
1346
2076
  </xsl:template>
1347
2077
 
1348
- <xsl:template match="bipm:license-statement//bipm:link">
2078
+ <!-- <xsl:template match="bipm:license-statement//bipm:link">
1349
2079
  <fo:inline color="blue" text-decoration="underline">
1350
2080
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
1351
2081
  <xsl:choose>
@@ -1358,7 +2088,7 @@
1358
2088
  </xsl:choose>
1359
2089
  </fo:basic-link>
1360
2090
  </fo:inline>
1361
- </xsl:template>
2091
+ </xsl:template> -->
1362
2092
 
1363
2093
 
1364
2094
  <xsl:template match="bipm:feedback-statement">
@@ -1395,6 +2125,7 @@
1395
2125
  <xsl:when test="$level = 2 and ancestor::bipm:annex">10.5pt</xsl:when>
1396
2126
  <xsl:when test="$level = 2">14pt</xsl:when>
1397
2127
  <xsl:when test="$level = 3 and ancestor::bipm:annex">10pt</xsl:when>
2128
+ <xsl:when test="$level = 4 and ancestor::bipm:annex">9pt</xsl:when>
1398
2129
  <xsl:when test="$level = 3">12pt</xsl:when>
1399
2130
  <xsl:otherwise>11pt</xsl:otherwise>
1400
2131
  </xsl:choose>
@@ -1409,32 +2140,47 @@
1409
2140
  </xsl:variable>
1410
2141
 
1411
2142
  <fo:block-container margin-left="-14mm" font-family="Arial" font-size="{$font-size}" font-weight="bold" keep-with-next="always" line-height="130%"> <!-- line-height="145%" -->
2143
+ <xsl:if test="local-name(preceding-sibling::*[1]) = 'clause'">
2144
+ <xsl:attribute name="id"><xsl:value-of select="preceding-sibling::*[1]/@id"/></xsl:attribute>
2145
+ </xsl:if>
1412
2146
  <xsl:attribute name="margin-bottom">
1413
2147
  <xsl:choose>
1414
- <xsl:when test="$level = 1 and (parent::bipm:annex or parent::bipm:abstract or ancestor::bipm:preface)">84pt</xsl:when>
2148
+ <xsl:when test="$level = 1 and (parent::bipm:annex or ancestor::bipm:annex or parent::bipm:abstract or ancestor::bipm:preface)">84pt</xsl:when>
1415
2149
  <xsl:when test="$level = 1">6pt</xsl:when>
1416
- <xsl:when test="$level = 2 and ancestor::bipm:annex">6pt</xsl:when>
2150
+ <xsl:when test="$level = 2 and ancestor::bipm:annex">6pt</xsl:when> <!-- 6pt 12pt -->
1417
2151
  <!-- <xsl:when test="$level = 2 and $independentAppendix != ''">6pt</xsl:when> -->
1418
2152
  <xsl:when test="$level = 2">10pt</xsl:when>
1419
2153
  <xsl:otherwise>6pt</xsl:otherwise>
1420
2154
  </xsl:choose>
1421
2155
  </xsl:attribute>
1422
2156
  <!-- <xsl:if test="$level = 1 and $independentAppendix != ''">
1423
- <xsl:attribute name="margin-top">24pt</xsl:attribute>
1424
- </xsl:if>
1425
- <xsl:if test="$level = 2 and $independentAppendix != ''">
2157
+ <xsl:attribute name="space-before">24pt</xsl:attribute>
2158
+ </xsl:if> -->
2159
+ <!-- <xsl:if test="$level = 2 and $independentAppendix != ''">
1426
2160
  <xsl:attribute name="margin-top">36pt</xsl:attribute>
1427
2161
  </xsl:if> -->
1428
- <xsl:if test="$level = 2">
1429
- <xsl:attribute name="margin-top">24pt</xsl:attribute>
2162
+ <xsl:if test="$level = 2 and ancestor::bipm:annex">
2163
+ <!-- <xsl:attribute name="margin-top">24pt</xsl:attribute> -->
2164
+ <xsl:attribute name="space-before">18pt</xsl:attribute> <!-- 24 pt -->
2165
+ </xsl:if>
2166
+ <xsl:if test="$level = 2 and not(ancestor::bipm:annex)">
2167
+ <xsl:attribute name="space-before">30pt</xsl:attribute>
2168
+ </xsl:if>
2169
+ <xsl:if test="$level = 3 and ancestor::bipm:annex">
2170
+ <xsl:attribute name="space-before">12pt</xsl:attribute> <!-- 6pt -->
2171
+ </xsl:if>
2172
+ <xsl:if test="$level = 4 and ancestor::bipm:annex">
2173
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
1430
2174
  </xsl:if>
1431
2175
  <xsl:if test="$level = 3 and not(ancestor::bipm:annex)">
1432
- <xsl:attribute name="margin-top">20pt</xsl:attribute>
2176
+ <!-- <xsl:attribute name="margin-top">20pt</xsl:attribute> -->
2177
+ <xsl:attribute name="space-before">20pt</xsl:attribute>
1433
2178
  </xsl:if>
1434
2179
 
1435
2180
  <fo:block-container margin-left="0mm">
1436
2181
 
1437
- <xsl:if test="$level = 1">
2182
+ <!-- marker not working for math -->
2183
+ <!-- <xsl:if test="$level = 1">
1438
2184
  <fo:marker marker-class-name="header-title">
1439
2185
  <xsl:choose>
1440
2186
  <xsl:when test="*[local-name() = 'tab']">
@@ -1445,7 +2191,7 @@
1445
2191
  </xsl:otherwise>
1446
2192
  </xsl:choose>
1447
2193
  </fo:marker>
1448
- </xsl:if>
2194
+ </xsl:if> -->
1449
2195
 
1450
2196
  <xsl:choose>
1451
2197
  <xsl:when test="*[local-name() = 'tab'] and not(ancestor::bipm:annex) "><!-- split number and title --> <!-- and $independentAppendix = '' -->
@@ -1485,6 +2231,10 @@
1485
2231
  </fo:instream-foreign-object>
1486
2232
  </fo:inline>
1487
2233
  </xsl:if>
2234
+ <xsl:if test="$level = 4">
2235
+ <xsl:attribute name="margin-left">14mm</xsl:attribute>
2236
+ <xsl:attribute name="text-align">center</xsl:attribute>
2237
+ </xsl:if>
1488
2238
  <xsl:call-template name="extractTitle"/>
1489
2239
  </xsl:when>
1490
2240
  <xsl:otherwise>
@@ -1518,7 +2268,7 @@
1518
2268
  </xsl:template>
1519
2269
 
1520
2270
  <xsl:template match="*[local-name() = 'stem']" mode="header">
1521
- <xsl:apply-templates select="."/>
2271
+ <xsl:apply-templates/>
1522
2272
  </xsl:template>
1523
2273
 
1524
2274
  <xsl:template match="*[local-name() = 'br']" mode="header">
@@ -1689,123 +2439,100 @@
1689
2439
  <xsl:template match="bipm:sections/bipm:clause | bipm:annex/bipm:clause" priority="3">
1690
2440
  <!-- <xsl:choose>
1691
2441
  <xsl:when test="$independentAppendix = ''"> -->
1692
- <fo:table table-layout="fixed" width="174mm" line-height="135%">
1693
- <xsl:call-template name="setId"/>
1694
- <fo:table-column column-width="137mm"/>
1695
- <fo:table-column column-width="5mm"/>
1696
- <fo:table-column column-width="32mm"/>
1697
- <fo:table-body>
2442
+
2443
+ <xsl:variable name="space-before"> <!-- margin-top for title, see bipm:title -->
2444
+ <xsl:if test="local-name(*[1]) = 'title'">
2445
+ <xsl:if test="*[1]/@depth = 1 and not(*[1]/ancestor::bipm:annex) and $independentAppendix != ''">30pt</xsl:if>
2446
+ <xsl:if test="*[1]/@depth = 2 and not(*[1]/ancestor::bipm:annex)">30pt</xsl:if>
2447
+ <xsl:if test="*[1]/@depth = 2 and *[1]/ancestor::bipm:annex">18pt</xsl:if> <!-- 24pt -->
2448
+ <xsl:if test="*[1]/@depth = 3 and not(*[1]/ancestor::bipm:annex)">20pt</xsl:if>
2449
+ <xsl:if test="*[1]/@depth = 3 and *[1]/ancestor::bipm:annex">6pt</xsl:if> <!-- 6pt-->
2450
+ <xsl:if test="*[1]/@depth = 4 and *[1]/ancestor::bipm:annex">12pt</xsl:if> <!-- 6pt-->
2451
+ </xsl:if>
2452
+ </xsl:variable>
2453
+ <xsl:variable name="space-before-value" select="normalize-space($space-before)"/>
2454
+
2455
+ <fo:table table-layout="fixed" width="174mm" line-height="135%">
2456
+ <xsl:call-template name="setId"/>
2457
+ <xsl:if test="$space-before-value != ''">
2458
+ <xsl:attribute name="space-before"><xsl:value-of select="$space-before-value"/></xsl:attribute>
2459
+ </xsl:if>
2460
+ <fo:table-column column-width="137mm"/>
2461
+ <fo:table-column column-width="5mm"/>
2462
+ <fo:table-column column-width="32mm"/>
2463
+ <fo:table-body>
2464
+
2465
+ <xsl:variable name="total_rows" select="count(*)"/>
2466
+
2467
+ <xsl:variable name="rows_with_notes">
2468
+ <xsl:for-each select="*">
2469
+ <!-- <xsl:if test=".//bipm:note[not(ancestor::bipm:table)]"> -->
2470
+ <xsl:if test=".//bipm:note_side"> <!-- virtual element note_side --> <!-- [not(ancestor::bipm:table)] -->
2471
+ <row_num><xsl:value-of select="position()"/></row_num>
2472
+ </xsl:if>
2473
+ </xsl:for-each>
2474
+ </xsl:variable>
2475
+ <!-- rows_with_notes<xsl:copy-of select="$rows_with_notes"/> -->
2476
+
2477
+ <xsl:variable name="rows3">
2478
+ <xsl:for-each select="xalan:nodeset($rows_with_notes)/row_num">
2479
+ <xsl:variable name="num" select="number(.)"/>
2480
+ <xsl:choose>
2481
+ <xsl:when test="position() = 1">
2482
+ <num span_start="1" span_num="{$num}" display-align="after"/>
2483
+ </xsl:when>
2484
+ <xsl:when test="position() = last()">
2485
+ <num span_start="{$num}" span_num="{$total_rows - $num + 1}" display-align="before"/>
2486
+ </xsl:when>
2487
+ <xsl:otherwise><!-- 2nd, 3rd, ... Nth-1 -->
2488
+ <xsl:variable name="prev_num" select="number(preceding-sibling::*/text())"/>
2489
+ <num span_start="{$prev_num + 1}" span_num="{$num - $prev_num}" display-align="after"/>
2490
+ </xsl:otherwise>
2491
+ </xsl:choose>
2492
+ </xsl:for-each>
2493
+ </xsl:variable>
2494
+
2495
+ <xsl:variable name="rows">
1698
2496
 
1699
- <xsl:variable name="rows2">
1700
- <xsl:for-each select="*">
1701
- <xsl:variable name="position" select="position()"/>
1702
- <!-- if this is first element -->
1703
- <xsl:variable name="isFirstRow" select="not(preceding-sibling::*)"/>
1704
- <!-- first element without note -->
1705
- <xsl:variable name="isFirstCellAfterNote" select="$isFirstRow = true() or count(preceding-sibling::*[1][.//bipm:note]) = 1"/>
1706
- <xsl:variable name="curr_id" select="generate-id()"/>
1707
- <xsl:variable name="rowsUntilNote" select="count(following-sibling::*[.//bipm:note][1]/preceding-sibling::*[preceding-sibling::*[generate-id() = $curr_id]])"/>
1708
-
1709
- <num display-align="after">
1710
- <xsl:if test="$isFirstCellAfterNote = true()">
1711
- <xsl:attribute name="span_start">
1712
- <xsl:value-of select="$position"/>
1713
- </xsl:attribute>
1714
- <xsl:attribute name="span_num">
1715
- <xsl:value-of select="$rowsUntilNote + 2"/>
1716
- </xsl:attribute>
1717
- <xsl:if test="count(following-sibling::*[.//bipm:note]) = 0"><!-- if there aren't notes more, then set -1 -->
1718
- <xsl:attribute name="span_start"><xsl:value-of select="$position"/>_no_more_notes</xsl:attribute>
1719
- </xsl:if>
1720
- <xsl:if test="count(following-sibling::*[.//bipm:note]) = 1"> <!-- if there is only one note, then set -1, because notes will be display near accoring text-->
1721
- <xsl:attribute name="span_start"><xsl:value-of select="$position"/>_last_note</xsl:attribute>
1722
- </xsl:if>
1723
- </xsl:if>
1724
-
1725
- <xsl:if test=".//bipm:note and count(following-sibling::*[.//bipm:note]) = 0"> <!-- if current row there is note, and no more notes below -->
1726
- <xsl:attribute name="span_start">
1727
- <xsl:value-of select="$position"/>
1728
- </xsl:attribute>
1729
- <xsl:attribute name="span_num">
1730
- <xsl:value-of select="count(following-sibling::*) + 1"/>
1731
- </xsl:attribute>
1732
- <xsl:attribute name="display-align">before</xsl:attribute>
1733
- </xsl:if>
1734
-
1735
- <xsl:if test=".//bipm:note and following-sibling::*[1][.//bipm:note] and preceding-sibling::*[1][.//bipm:note]">
1736
- <xsl:attribute name="span_start">
1737
- <xsl:value-of select="$position"/>
1738
- </xsl:attribute>
1739
- <xsl:attribute name="span_num">1</xsl:attribute>
1740
- <xsl:attribute name="display-align">before</xsl:attribute>
1741
- </xsl:if>
1742
-
1743
- <xsl:if test=".//bipm:note and preceding-sibling::*[1][.//bipm:note] and not(following-sibling::*[1][.//bipm:note])">
1744
- <xsl:attribute name="span_start">
1745
- <xsl:value-of select="$position"/>
1746
- </xsl:attribute>
1747
- <xsl:attribute name="span_num">1</xsl:attribute>
1748
- <xsl:attribute name="display-align">before</xsl:attribute>
1749
- </xsl:if>
1750
- </num>
1751
- </xsl:for-each>
1752
- </xsl:variable>
1753
-
1754
-
1755
- <xsl:variable name="total_rows" select="count(*)"/>
1756
-
1757
- <xsl:variable name="rows_with_notes">
1758
- <xsl:for-each select="*">
1759
- <!-- <xsl:if test=".//bipm:note[not(ancestor::bipm:table)]"> -->
1760
- <xsl:if test=".//bipm:note_side"> <!-- virtual element note_side --> <!-- [not(ancestor::bipm:table)] -->
1761
- <row_num><xsl:value-of select="position()"/></row_num>
1762
- </xsl:if>
1763
- </xsl:for-each>
1764
- </xsl:variable>
1765
- <!-- rows_with_notes<xsl:copy-of select="$rows_with_notes"/> -->
1766
-
1767
- <xsl:variable name="rows3">
1768
- <xsl:for-each select="xalan:nodeset($rows_with_notes)/row_num">
1769
- <xsl:variable name="num" select="number(.)"/>
1770
- <xsl:choose>
1771
- <xsl:when test="position() = 1">
1772
- <num span_start="1" span_num="{$num}" display-align="after"/>
1773
- </xsl:when>
1774
- <xsl:when test="position() = last()">
1775
- <num span_start="{$num}" span_num="{$total_rows - $num + 1}" display-align="before"/>
1776
- </xsl:when>
1777
- <xsl:otherwise><!-- 2nd, 3rd, ... Nth-1 -->
1778
- <xsl:variable name="prev_num" select="number(preceding-sibling::*/text())"/>
1779
- <num span_start="{$prev_num + 1}" span_num="{$num - $prev_num}" display-align="after"/>
1780
- </xsl:otherwise>
1781
- </xsl:choose>
1782
- </xsl:for-each>
1783
- </xsl:variable>
1784
-
1785
- <xsl:variable name="rows">
1786
- <xsl:for-each select="xalan:nodeset($rows_with_notes)/row_num">
1787
- <xsl:variable name="num" select="number(.)"/>
1788
- <xsl:choose>
1789
- <xsl:when test="position() = last()">
1790
- <num span_start="{$num}" span_num="{$total_rows - $num + 1}" display-align="before"/>
1791
- </xsl:when>
1792
- <xsl:otherwise><!-- 2nd, 3rd, ... Nth-1 -->
1793
- <xsl:variable name="next_num" select="number(following-sibling::*/text())"/>
1794
- <num span_start="{$num}" span_num="{$next_num - $num}" display-align="before"/>
1795
- </xsl:otherwise>
1796
- </xsl:choose>
1797
- </xsl:for-each>
1798
- </xsl:variable>
1799
-
1800
- <!-- rows=<xsl:copy-of select="$rows"/> -->
1801
-
1802
-
1803
- <xsl:apply-templates mode="clause_table">
1804
- <xsl:with-param name="rows" select="$rows"/>
1805
- </xsl:apply-templates>
1806
-
1807
- </fo:table-body>
1808
- </fo:table>
2497
+ <xsl:variable name="first_num" select="normalize-space(xalan:nodeset($rows_with_notes)/row_num[1])"/>
2498
+ <xsl:choose>
2499
+ <xsl:when test="$first_num = ''">
2500
+ <num span_start="1" span_num="{$total_rows}" display-align="before"/>
2501
+ </xsl:when>
2502
+ <xsl:when test="number($first_num) != 1">
2503
+ <num span_start="1" span_num="{$first_num -1}" display-align="before"/>
2504
+ </xsl:when>
2505
+ </xsl:choose>
2506
+
2507
+ <xsl:for-each select="xalan:nodeset($rows_with_notes)/row_num">
2508
+ <xsl:variable name="num" select="number(.)"/>
2509
+ <xsl:choose>
2510
+ <xsl:when test="position() = last()">
2511
+ <num span_start="{$num}" span_num="{$total_rows - $num + 1}" display-align="before"/>
2512
+ </xsl:when>
2513
+ <xsl:otherwise><!-- 2nd, 3rd, ... Nth-1 -->
2514
+ <xsl:variable name="next_num" select="number(following-sibling::*/text())"/>
2515
+ <num span_start="{$num}" span_num="{$next_num - $num}" display-align="before"/>
2516
+ </xsl:otherwise>
2517
+ </xsl:choose>
2518
+ </xsl:for-each>
2519
+ </xsl:variable>
2520
+
2521
+ <!-- rows=<xsl:copy-of select="$rows"/> -->
2522
+
2523
+ <!-- updated strategy: consolidated show all block with note, instead of spanned rows -->
2524
+
2525
+ <xsl:call-template name="insertClauses">
2526
+ <xsl:with-param name="rows" select="$rows"/>
2527
+ </xsl:call-template>
2528
+
2529
+
2530
+ <!-- <xsl:apply-templates mode="clause_table">
2531
+ <xsl:with-param name="rows" select="$rows"/>
2532
+ </xsl:apply-templates> -->
2533
+
2534
+ </fo:table-body>
2535
+ </fo:table>
1809
2536
 
1810
2537
  <!-- </xsl:when>
1811
2538
  <xsl:otherwise>
@@ -1819,6 +2546,78 @@
1819
2546
  </xsl:template>
1820
2547
 
1821
2548
 
2549
+ <xsl:template name="insertClauses">
2550
+ <xsl:param name="rows"/>
2551
+ <xsl:param name="curr_row_num" select="1"/>
2552
+
2553
+ <xsl:if test="$curr_row_num &lt;= count(xalan:nodeset($rows)/num)">
2554
+ <xsl:variable name="start_row" select="xalan:nodeset($rows)/num[$curr_row_num]/@span_start"/>
2555
+ <xsl:variable name="end_row" select="$start_row + xalan:nodeset($rows)/num[$curr_row_num]/@span_num - 1"/>
2556
+ <fo:table-row> <!-- DEBUG border-top="1.5pt solid blue" border-bottom="1.5pt solid blue" -->
2557
+ <xsl:if test="local-name(*[$end_row]) = 'title'"> <!-- if last element is title, then keep row with next--> <!-- or local-name(*[$end_row]) = 'clause' or clause, then keep row with next -->
2558
+ <xsl:attribute name="keep-with-next.within-page">always</xsl:attribute>
2559
+ </xsl:if>
2560
+
2561
+
2562
+ <xsl:variable name="start_row_next" select="normalize-space(xalan:nodeset($rows)/num[$curr_row_num + 1]/@span_start)"/>
2563
+ <xsl:variable name="start_row_next_num" select="number($start_row_next)"/>
2564
+
2565
+ <xsl:variable name="table-row-padding-bottom">
2566
+ <xsl:if test="$start_row_next != '' and local-name(*[$start_row_next_num]) = 'title'">
2567
+ <xsl:if test="*[$start_row_next_num]/@depth = 2 and not(*[$start_row_next_num]/ancestor::bipm:annex)">30pt</xsl:if>
2568
+ <xsl:if test="*[$start_row_next_num]/@depth = 2 and *[$start_row_next_num]/ancestor::bipm:annex">18pt</xsl:if> <!-- 24pt -->
2569
+ <!-- <xsl:attribute name="padding-bottom">20pt</xsl:attribute> -->
2570
+ <xsl:if test="*[$start_row_next_num]/@depth = 3 and not(*[$start_row_next_num]/ancestor::bipm:annex)">20pt</xsl:if>
2571
+ <xsl:if test="*[$start_row_next_num]/@depth = 3 and *[$start_row_next_num]/ancestor::bipm:annex">6pt</xsl:if> <!-- 6pt -->
2572
+ <xsl:if test="*[$start_row_next_num]/@depth = 4 and *[$start_row_next_num]/ancestor::bipm:annex">12pt</xsl:if> <!-- 6pt -->
2573
+ </xsl:if>
2574
+ </xsl:variable>
2575
+
2576
+ <xsl:variable name="table-row-padding-bottom-value" select="normalize-space($table-row-padding-bottom)"/>
2577
+
2578
+ <fo:table-cell>
2579
+
2580
+ <xsl:if test="$table-row-padding-bottom-value != ''">
2581
+ <xsl:attribute name="padding-bottom"><xsl:value-of select="$table-row-padding-bottom-value"/></xsl:attribute>
2582
+ </xsl:if>
2583
+
2584
+ <!-- <fo:block>$end_row=<xsl:value-of select="$end_row"/>,local-name(*[$end_row])=<xsl:value-of select="local-name(*[$end_row]) "/></fo:block> -->
2585
+
2586
+ <fo:block>
2587
+ <!-- insert elements from sections/clause annex/clause -->
2588
+ <xsl:apply-templates select="*[position() &gt;= number($start_row) and position() &lt;= $end_row]"/>
2589
+ </fo:block>
2590
+ </fo:table-cell>
2591
+ <fo:table-cell>
2592
+ <xsl:if test="$table-row-padding-bottom-value != ''">
2593
+ <xsl:attribute name="padding-bottom"><xsl:value-of select="$table-row-padding-bottom-value"/></xsl:attribute>
2594
+ </xsl:if>
2595
+ <fo:block> </fo:block>
2596
+ </fo:table-cell> <!-- <fo:block/> <fo:block>&#xA0;</fo:block> -->
2597
+ <fo:table-cell font-size="8pt" line-height="120%" display-align="before" padding-bottom="6pt">
2598
+ <xsl:if test="$table-row-padding-bottom-value != ''">
2599
+ <xsl:attribute name="padding-bottom"><xsl:value-of select="$table-row-padding-bottom-value"/></xsl:attribute>
2600
+ </xsl:if>
2601
+
2602
+ <xsl:attribute name="display-align">
2603
+ <xsl:value-of select="xalan:nodeset($rows)/num[$curr_row_num]/@display-align"/>
2604
+ </xsl:attribute>
2605
+
2606
+ <fo:block>
2607
+ <xsl:for-each select="*[position() &gt;= $start_row and position() &lt;= $end_row]//bipm:note_side">
2608
+ <xsl:apply-templates select="." mode="note_side"/>
2609
+ </xsl:for-each>
2610
+ </fo:block>
2611
+ </fo:table-cell>
2612
+ </fo:table-row>
2613
+ <xsl:call-template name="insertClauses">
2614
+ <xsl:with-param name="rows" select="$rows"/>
2615
+ <xsl:with-param name="curr_row_num" select="$curr_row_num + 1"/>
2616
+ </xsl:call-template>
2617
+ </xsl:if>
2618
+
2619
+ </xsl:template>
2620
+
1822
2621
  <xsl:template match="bipm:sections/bipm:clause/* | bipm:annex/bipm:clause/*" mode="clause_table">
1823
2622
  <xsl:param name="rows"/>
1824
2623
 
@@ -1826,35 +2625,13 @@
1826
2625
  <xsl:variable name="current_row"><xsl:number count="*"/></xsl:variable>
1827
2626
 
1828
2627
 
1829
- <fo:table-row> <!-- border="1pt solid black" -->
1830
- <fo:table-cell> <!-- border="1pt solid black" -->
2628
+ <fo:table-row> <!-- border="1pt solid black" -->
2629
+ <fo:table-cell> <!-- border="1pt solid black" -->
1831
2630
  <fo:block>
1832
- <xsl:apply-templates select="."/>
2631
+ <xsl:apply-templates select="."/>
1833
2632
  </fo:block>
1834
2633
  </fo:table-cell>
1835
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
1836
-
1837
-
1838
- <!-- DEBUG -->
1839
- <!-- <fo:table-cell font-size="8pt" line-height="120%" display-align="before" padding-bottom="6pt">
1840
-
1841
- <xsl:variable name="number-rows-spanned" select="xalan:nodeset($rows)/num[@span_start = $current_row]/@span_num"/>
1842
-
1843
-
1844
- <xsl:variable name="start_row" select="$current_row"/>
1845
-
1846
- <xsl:if test=".//bipm:note">
1847
- <fo:block>Note</fo:block>
1848
- </xsl:if>
1849
- <fo:block font-size="6pt" color="red">
1850
- <fo:block>current_row=<xsl:value-of select="$current_row"/></fo:block>
1851
- <xsl:for-each select="xalan:nodeset($rows)/num">
1852
- <fo:block>span_start=<xsl:value-of select="@span_start"/></fo:block>
1853
- <fo:block>span_num=<xsl:value-of select="@span_num"/></fo:block>
1854
- </xsl:for-each>
1855
- </fo:block>
1856
-
1857
- </fo:table-cell> -->
2634
+ <fo:table-cell><fo:block> </fo:block></fo:table-cell> <!-- <fo:block/> <fo:block>&#xA0;</fo:block> -->
1858
2635
 
1859
2636
 
1860
2637
  <xsl:if test="xalan:nodeset($rows)/num[@span_start = $current_row]">
@@ -1885,27 +2662,38 @@
1885
2662
 
1886
2663
  </fo:table-cell>
1887
2664
  </xsl:if>
1888
-
1889
-
1890
- <!--
1891
- <xsl:choose>
1892
- <xsl:when test=".//bipm:note">
1893
- <fo:table-cell font-size="8pt" line-height="120%">
1894
- <xsl:variable name="curr_id" select="@id"/>
1895
- <xsl:attribute name="number-rows-spanned">
1896
- <xsl:value-of select="count(following-sibling::*[.//bipm:note][1]/preceding-sibling::*[preceding-sibling::*[@id = $curr_id]]) + 1"/>
1897
- </xsl:attribute>
2665
+
2666
+ </fo:table-row>
2667
+ </xsl:template>
2668
+
2669
+ <!-- from common.xsl -->
2670
+ <xsl:template match="*[local-name() = 'clause']" priority="2">
2671
+ <xsl:choose>
2672
+ <xsl:when test="count(./node()) = 0"> <!-- if empty clause, then move id into next title -->
2673
+ <xsl:choose>
2674
+ <xsl:when test="local-name(following-sibling::*[1]) = 'title'"/> <!-- id will set in title -->
2675
+ <xsl:otherwise>
1898
2676
  <fo:block>
1899
- <xsl:for-each select=".//bipm:note">
1900
- <xsl:apply-templates select="." mode="note_side"/>
1901
- </xsl:for-each>
2677
+ <xsl:call-template name="setId"/>
2678
+ <xsl:apply-templates/>
1902
2679
  </fo:block>
1903
- </fo:table-cell>
1904
- </xsl:when>
1905
- </xsl:choose> -->
1906
- </fo:table-row>
2680
+ </xsl:otherwise>
2681
+ </xsl:choose>
2682
+ </xsl:when>
2683
+ <xsl:otherwise>
2684
+ <fo:block>
2685
+ <xsl:call-template name="setId"/>
2686
+ <xsl:apply-templates/>
2687
+ </fo:block>
2688
+ </xsl:otherwise>
2689
+ </xsl:choose>
2690
+
2691
+ <!-- <xsl:if test="$namespace = 'bipm'">
2692
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2693
+ </xsl:if> -->
1907
2694
  </xsl:template>
1908
2695
 
2696
+
1909
2697
  <!-- skip, because it process in note_side template -->
1910
2698
  <!-- <xsl:template match="bipm:preface/bipm:abstract//bipm:note[not(ancestor::bipm:table)]" priority="3"/> -->
1911
2699
  <!-- <xsl:template match="bipm:preface/bipm:abstract//bipm:note_side" priority="3"/> -->
@@ -1924,8 +2712,23 @@
1924
2712
 
1925
2713
  <!-- <xsl:template match="bipm:note" mode="note_side"> -->
1926
2714
  <xsl:template match="bipm:note_side" mode="note_side">
1927
- <fo:block line-height-shift-adjustment="disregard-shifts">
1928
- <xsl:if test="ancestor::bipm:title"><fo:inline>* </fo:inline></xsl:if>
2715
+ <fo:block line-height-shift-adjustment="disregard-shifts" space-after="4pt">
2716
+ <xsl:call-template name="setId"/>
2717
+
2718
+ <xsl:if test="ancestor::bipm:table"><!-- move table note lower than title -->
2719
+ <xsl:variable name="table_id" select="ancestor::bipm:table[1]/@id"/>
2720
+ <xsl:variable name="num">
2721
+ <xsl:number count="//bipm:table[@id = $table_id]//bipm:note_side" level="any"/>
2722
+ </xsl:variable>
2723
+ <xsl:if test="$num = 1 and ancestor::bipm:table[1]/bipm:name/bipm:tab">
2724
+ <xsl:attribute name="margin-top">48pt</xsl:attribute>
2725
+ </xsl:if>
2726
+ <!-- <fo:inline>num=<xsl:value-of select="$num"/></fo:inline> -->
2727
+ </xsl:if>
2728
+
2729
+ <!-- if note relates to title, but not fn -->
2730
+ <xsl:if test="ancestor::bipm:title and not(bipm:sup_fn)"><fo:inline>* </fo:inline></xsl:if>
2731
+
1929
2732
  <xsl:apply-templates mode="note_side"/>
1930
2733
  </fo:block>
1931
2734
  </xsl:template>
@@ -1964,7 +2767,7 @@
1964
2767
  <xsl:number count="bipm:fn[not(ancestor::bipm:table)]" level="any"/>
1965
2768
  </xsl:variable>
1966
2769
  <xsl:variable name="gen_id" select="generate-id()"/>
1967
- <xsl:variable name="lang" select="ancestor::bipm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language']"/>
2770
+ <xsl:variable name="lang" select="ancestor::bipm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
1968
2771
  <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
1969
2772
  <fo:basic-link internal-destination="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" fox:alt-text="footnote {@reference}">
1970
2773
  <xsl:value-of select="$number"/><!-- + count(//bipm:bibitem/bipm:note) -->
@@ -2014,6 +2817,7 @@
2014
2817
  <xsl:otherwise>justify</xsl:otherwise>
2015
2818
  </xsl:choose>
2016
2819
  </xsl:attribute>
2820
+ <xsl:copy-of select="@font-family"/>
2017
2821
  <xsl:if test="not(ancestor::bipm:table)">
2018
2822
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2019
2823
  </xsl:if>
@@ -2029,6 +2833,9 @@
2029
2833
  <xsl:if test="@align = 'center'">
2030
2834
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2031
2835
  </xsl:if>
2836
+ <xsl:if test="local-name(*[1]) = 'strong' and normalize-space(.) = normalize-space(*[1])">
2837
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2838
+ </xsl:if>
2032
2839
  <xsl:if test="@parent-type = 'quote'">
2033
2840
  <xsl:attribute name="font-family">Arial</xsl:attribute>
2034
2841
  <xsl:attribute name="font-size">9pt</xsl:attribute>
@@ -2069,18 +2876,31 @@
2069
2876
 
2070
2877
  <!-- process list item as individual list --> <!-- flat list -->
2071
2878
  <xsl:template match="bipm:li">
2072
- <fo:block-container margin-left="0mm">
2879
+ <fo:block-container margin-left="0mm"> <!-- debug: border="0.5pt solid black" -->
2073
2880
  <xsl:if test="ancestor::bipm:li">
2074
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
2881
+ <xsl:attribute name="margin-left">6.5mm</xsl:attribute><!-- 8 mm -->
2075
2882
  </xsl:if>
2076
2883
  <xsl:if test="@parent-type = 'quote'">
2077
2884
  <xsl:attribute name="font-family">Arial</xsl:attribute>
2078
2885
  <xsl:attribute name="font-size">9pt</xsl:attribute>
2079
2886
  <xsl:attribute name="line-height">130%</xsl:attribute>
2080
2887
  </xsl:if>
2888
+
2889
+ <!-- last item -->
2890
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'li'])">
2891
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
2892
+ <xsl:if test="../ancestor::bipm:ul | ../ancestor::bipm:ol">
2893
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
2894
+ </xsl:if>
2895
+ <xsl:if test="../following-sibling::*[1][local-name() = 'ul' or local-name() = 'ol']">
2896
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
2897
+ </xsl:if>
2898
+ </xsl:if>
2899
+
2081
2900
  <fo:block-container margin-left="0mm">
2082
- <fo:list-block provisional-distance-between-starts="8mm">
2083
- <xsl:if test="not(following-sibling::*[1][local-name() = 'li'])"> <!-- last item -->
2901
+ <fo:list-block provisional-distance-between-starts="6.5mm"> <!-- debug: border="0.5pt solid blue" -->
2902
+ <!-- last item -->
2903
+ <!-- <xsl:if test="not(following-sibling::*[1][local-name() = 'li'])">
2084
2904
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2085
2905
  <xsl:if test="../ancestor::bipm:ul | ../ancestor::bipm:ol">
2086
2906
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
@@ -2088,7 +2908,7 @@
2088
2908
  <xsl:if test="../following-sibling::*[1][local-name() = 'ul' or local-name() = 'ol']">
2089
2909
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2090
2910
  </xsl:if>
2091
- </xsl:if>
2911
+ </xsl:if> -->
2092
2912
  <!-- <xsl:if test="../ancestor::bipm:note"> -->
2093
2913
  <xsl:if test="ancestor::bipm:note_side">
2094
2914
  <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
@@ -2096,10 +2916,12 @@
2096
2916
 
2097
2917
  <fo:list-item id="{@id}">
2098
2918
  <fo:list-item-label end-indent="label-end()">
2099
- <fo:block>
2919
+ <fo:block> <!-- debug: border="0.5pt solid green" -->
2100
2920
  <fo:inline>
2101
- <xsl:if test="@list_type = 'ul'">
2102
- <xsl:attribute name="font-size">15pt</xsl:attribute>
2921
+ <!-- <xsl:if test="@list_type = 'ul'">
2922
+ <xsl:attribute name="font-size">15pt</xsl:attribute> -->
2923
+ <xsl:if test="@font-size">
2924
+ <xsl:attribute name="font-size"><xsl:value-of select="@font-size"/></xsl:attribute>
2103
2925
  <!-- <xsl:attribute name="baseline-shift">-10%</xsl:attribute> -->
2104
2926
  </xsl:if>
2105
2927
  <xsl:value-of select="@label"/>
@@ -2129,7 +2951,7 @@
2129
2951
  </fo:block>
2130
2952
  </fo:list-item-label>
2131
2953
  <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts">
2132
- <fo:block margin-bottom="0pt">
2954
+ <fo:block margin-bottom="0pt"> <!-- debug: border="0.5pt solid red" -->
2133
2955
  <xsl:if test="@list_type = 'ol'">
2134
2956
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2135
2957
  </xsl:if>
@@ -2147,6 +2969,10 @@
2147
2969
  </fo:block-container>
2148
2970
  </fo:block-container>
2149
2971
 
2972
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'li']) and not(../ancestor::bipm:ul | ../ancestor::bipm:ol) and not (../following-sibling::*[1][local-name() = 'ul' or local-name() = 'ol'])">
2973
+ <fo:block/>
2974
+ </xsl:if>
2975
+
2150
2976
  </xsl:template>
2151
2977
 
2152
2978
  <xsl:template match="bipm:ul2/bipm:note | bipm:ol2/bipm:note" priority="2">
@@ -2219,7 +3045,8 @@
2219
3045
  <xsl:if test=".//bipm:fn">
2220
3046
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
2221
3047
  </xsl:if>
2222
- <xsl:call-template name="processBibitem"/>
3048
+ <xsl:call-template name="processBibitem"/>
3049
+ <!-- <xsl:apply-templates /> -->
2223
3050
  </fo:block>
2224
3051
  </xsl:template>
2225
3052
 
@@ -2271,13 +3098,22 @@
2271
3098
  <fo:list-item-label end-indent="label-end()">
2272
3099
  <fo:block>
2273
3100
  <fo:inline>
2274
- <xsl:number format="1."/>
3101
+ <!-- <xsl:number format="1."/> -->
3102
+ <xsl:choose>
3103
+ <xsl:when test="bipm:docidentifier[@type='metanorma']">
3104
+ <xsl:value-of select="bipm:docidentifier[@type='metanorma']"/>
3105
+ </xsl:when>
3106
+ <xsl:otherwise>
3107
+ <xsl:number format="[1]"/>
3108
+ </xsl:otherwise>
3109
+ </xsl:choose>
2275
3110
  </fo:inline>
2276
3111
  </fo:block>
2277
3112
  </fo:list-item-label>
2278
3113
  <fo:list-item-body start-indent="body-start()">
2279
3114
  <fo:block>
2280
3115
  <xsl:call-template name="processBibitem"/>
3116
+ <!-- <xsl:apply-templates /> -->
2281
3117
  </fo:block>
2282
3118
  </fo:list-item-body>
2283
3119
  </fo:list-item>
@@ -2293,6 +3129,9 @@
2293
3129
  </fo:inline>
2294
3130
  </xsl:template>
2295
3131
 
3132
+ <xsl:template match="bipm:references/bipm:bibitem/bipm:docidentifier[@type='metanorma' and ../bipm:formattedref]"/>
3133
+
3134
+
2296
3135
  <xsl:template match="bipm:pagebreak">
2297
3136
  <fo:block break-after="page"/>
2298
3137
  <!-- <fo:block>&#xA0;</fo:block>
@@ -2316,21 +3155,40 @@
2316
3155
  <xsl:template match="bipm:xref" priority="2">
2317
3156
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
2318
3157
  <xsl:choose>
2319
- <xsl:when test="@pagenumber='true'"><!-- ToC in Appendix -->
2320
- <fo:inline font-weight="bold"><fo:page-number-citation ref-id="{@target}"/></fo:inline>
3158
+ <xsl:when test="@pagenumber='true'"><!-- ToC in Appendix, and page in references like this: « Le BIPM et la Convention du Mètre » (page 5). -->
3159
+ <fo:inline> <!-- font-weight="bold" -->
3160
+ <!-- DEBUG -->
3161
+ <xsl:if test="@id">
3162
+ <!-- <xsl:value-of select="concat('[', @id,']')"/> -->
3163
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3164
+ </xsl:if>
3165
+ <fo:page-number-citation ref-id="{@target}"/>
3166
+ <!-- <xsl:if test="@to">&#x2013;<fo:page-number-citation ref-id="{@to}"/></xsl:if> -->
3167
+ </fo:inline>
2321
3168
  </xsl:when>
2322
3169
  <xsl:when test="starts-with(normalize-space(following-sibling::node()[1]), ')')">
2323
3170
  <!-- add , see p. N -->
2324
3171
  <!-- add , voir p. N -->
2325
- <xsl:apply-templates/>
2326
- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language"/>
2327
- <xsl:text>, </xsl:text>
2328
- <xsl:choose>
2329
- <xsl:when test="$curr_lang = 'fr'">voir</xsl:when>
2330
- <xsl:otherwise>see</xsl:otherwise>
2331
- </xsl:choose>
2332
- <xsl:text> p. </xsl:text>
2333
- <fo:page-number-citation ref-id="{@target}"/>
3172
+ <xsl:apply-templates/>
3173
+
3174
+ <xsl:variable name="nopage" select="normalize-space(@nopage)"/>
3175
+
3176
+ <xsl:if test="$nopage != 'true'">
3177
+ <xsl:text>, </xsl:text>
3178
+ <xsl:variable name="nosee" select="normalize-space(@nosee)"/>
3179
+ <xsl:if test="$nosee != 'true'">
3180
+ <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
3181
+ <fo:inline>
3182
+ <xsl:if test="ancestor::bipm:note_side">
3183
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3184
+ </xsl:if>
3185
+ <xsl:value-of select="ancestor::bipm:bipm-standard/bipm:localized-strings/bipm:localized-string[@key='see' and @language=$curr_lang]"/>
3186
+ </fo:inline>
3187
+ <xsl:text> </xsl:text>
3188
+ </xsl:if>
3189
+ <xsl:text>p. </xsl:text>
3190
+ <fo:page-number-citation ref-id="{@target}"/>
3191
+ </xsl:if>
2334
3192
  </xsl:when>
2335
3193
  <xsl:otherwise>
2336
3194
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -2339,12 +3197,27 @@
2339
3197
  </fo:basic-link>
2340
3198
  </xsl:template>
2341
3199
 
3200
+ <xsl:template match="bipm:eref[.//bipm:locality[@type = 'anchor']]" priority="2">
3201
+ <xsl:variable name="target" select=".//bipm:locality[@type = 'anchor']/bipm:referenceFrom"/>
3202
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}">
3203
+ <!-- <xsl:apply-templates select="node()[not(local-name() = 'localityStack')]"/> -->
3204
+ <xsl:if test="xalan:nodeset($ids)//id = $target">
3205
+ <fo:page-number-citation ref-id="{$target}"/>
3206
+ </xsl:if>
3207
+ </fo:basic-link>
3208
+ </xsl:template>
3209
+
2342
3210
  <xsl:template match="bipm:note[not(ancestor::bipm:preface)]/bipm:name" priority="2" mode="presentation">
2343
3211
  <xsl:choose>
2344
3212
  <xsl:when test="not(../preceding-sibling::bipm:note) and not((../following-sibling::bipm:note))">
2345
- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language"/>
3213
+ <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
2346
3214
  <xsl:choose>
2347
- <xsl:when test="$curr_lang = 'fr'">Remarque: </xsl:when>
3215
+ <xsl:when test="$curr_lang = 'fr'">
3216
+ <xsl:choose>
3217
+ <xsl:when test="ancestor::bipm:li">Remarque: </xsl:when>
3218
+ <xsl:otherwise>Note: </xsl:otherwise>
3219
+ </xsl:choose>
3220
+ </xsl:when>
2348
3221
  <xsl:otherwise>Note: </xsl:otherwise>
2349
3222
  </xsl:choose>
2350
3223
  </xsl:when>
@@ -2366,12 +3239,59 @@
2366
3239
 
2367
3240
  </xsl:template>
2368
3241
 
3242
+ <xsl:template match="*[local-name() = 'sup_fn']">
3243
+ <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
3244
+ <xsl:apply-templates/>
3245
+ </fo:inline>
3246
+ </xsl:template>
3247
+
3248
+ <!-- DEBUG -->
3249
+ <!-- <xsl:template match="mathml:math" priority="10"/> -->
3250
+
3251
+ <!-- for chemical expressions, when prefix superscripted -->
3252
+ <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1 and mathml:mtext and (mathml:mtext/text() = '' or not(mathml:mtext/text()))]/mathml:mtext" mode="mathml" priority="2">
3253
+ <mathml:mspace height="1ex"/>
3254
+ </xsl:template>
3255
+ <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1 and mathml:mtext and (mathml:mtext/text() = ' ' or mathml:mtext/text() = ' ')]/mathml:mtext" mode="mathml" priority="2">
3256
+ <mathml:mspace width="1ex" height="1ex"/>
3257
+ </xsl:template>
3258
+
3259
+ <!-- set height for sup -->
3260
+ <!-- <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1 and mathml:mtext and (mathml:mtext/text() != '' and mathml:mtext/text() != ' ' and mathml:mtext/text() != '&#xa0;')]/mathml:mtext" mode="mtext"> -->
3261
+ <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1]/*" mode="mathml" priority="2">
3262
+ <xsl:copy>
3263
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3264
+ </xsl:copy>
3265
+ <!-- <xsl:copy-of select="."/> -->
3266
+ <mathml:mspace height="1.47ex"/>
3267
+ </xsl:template>
3268
+
3269
+ <!-- set script minimal font-size -->
3270
+ <xsl:template match="mathml:math" mode="mathml" priority="2">
3271
+ <xsl:copy>
3272
+ <xsl:apply-templates select="@*" mode="mathml"/>
3273
+ <mathml:mstyle scriptminsize="6pt">
3274
+ <xsl:apply-templates select="node()" mode="mathml"/>
3275
+ </mathml:mstyle>
3276
+ </xsl:copy>
3277
+ </xsl:template>
3278
+
3279
+ <!-- issue 'over bar above equation with sub' fixing -->
3280
+ <xsl:template match="mathml:msub/mathml:mrow[1][mathml:mover and count(following-sibling::*) = 1 and following-sibling::mathml:mrow]" mode="mathml" priority="2">
3281
+ <mathml:mstyle>
3282
+ <xsl:copy-of select="."/>
3283
+ </mathml:mstyle>
3284
+ </xsl:template>
3285
+
2369
3286
  <xsl:template name="insertHeaderFooter">
2370
- <!-- <xsl:variable name="header-title">Le BIPM et la Convention du Mètre</xsl:variable> -->
3287
+ <xsl:param name="header-title"/>
2371
3288
  <fo:static-content flow-name="header-odd">
2372
3289
  <fo:block-container font-family="Arial" font-size="8pt" padding-top="12.5mm">
2373
- <fo:block text-align="right">
2374
- <fo:retrieve-marker retrieve-class-name="header-title" retrieve-boundary="page-sequence" retrieve-position="first-starting-within-page"/>
3290
+ <fo:block text-align="right">
3291
+ <xsl:copy-of select="$header-title"/>
3292
+ <!-- <fo:retrieve-marker retrieve-class-name="header-title"
3293
+ retrieve-boundary="page-sequence"
3294
+ retrieve-position="first-starting-within-page"/> -->
2375
3295
  <xsl:text>  </xsl:text>
2376
3296
  <fo:inline font-size="13pt" baseline-shift="-15%">•</fo:inline>
2377
3297
  <xsl:text>  </xsl:text>
@@ -2388,8 +3308,11 @@
2388
3308
  <fo:inline font-weight="bold"><fo:page-number/></fo:inline>
2389
3309
  <xsl:text>  </xsl:text>
2390
3310
  <fo:inline font-size="13pt" baseline-shift="-15%">•</fo:inline>
2391
- <xsl:text>  </xsl:text>
2392
- <fo:retrieve-marker retrieve-class-name="header-title" retrieve-boundary="page-sequence" retrieve-position="first-starting-within-page"/>
3311
+ <xsl:text>  </xsl:text>
3312
+ <xsl:copy-of select="$header-title"/>
3313
+ <!-- <fo:retrieve-marker retrieve-class-name="header-title"
3314
+ retrieve-boundary="page-sequence"
3315
+ retrieve-position="first-starting-within-page"/> -->
2393
3316
  </fo:block>
2394
3317
  <fo:block-container font-size="1pt" border-top="0.5pt solid black" width="86.6mm">
2395
3318
  <fo:block> </fo:block>
@@ -2398,7 +3321,7 @@
2398
3321
  </fo:static-content>
2399
3322
  </xsl:template>
2400
3323
 
2401
- <xsl:template name="insertHeaderFooterAppendix">
3324
+ <!-- <xsl:template name="insertHeaderFooterAppendix">
2402
3325
  <fo:static-content flow-name="header-appendix">
2403
3326
  <fo:block-container font-size="11pt" padding-top="12.7mm">
2404
3327
 
@@ -2435,7 +3358,7 @@
2435
3358
  <fo:block text-align="center" padding-bottom="12.7mm"><fo:page-number/>/<fo:page-number-citation ref-id="theLastPage"/></fo:block>
2436
3359
  </fo:block-container>
2437
3360
  </fo:static-content>
2438
- </xsl:template>
3361
+ </xsl:template> -->
2439
3362
 
2440
3363
  <xsl:template name="printRevisionDate">
2441
3364
  <xsl:param name="date"/>
@@ -2501,7 +3424,7 @@
2501
3424
  </fo:static-content>
2502
3425
  </xsl:template>
2503
3426
 
2504
- <xsl:template name="insertIndexPages">
3427
+ <!-- <xsl:template name="insertIndexPages">
2505
3428
  <fo:page-sequence master-reference="index" force-page-count="no-force">
2506
3429
  <xsl:call-template name="insertHeaderFooter"/>
2507
3430
  <fo:flow flow-name="xsl-region-body">
@@ -2518,14 +3441,223 @@
2518
3441
  <fo:block>atmosphère normale, 52</fo:block>
2519
3442
  <fo:block>atome gramme, 104</fo:block>
2520
3443
  <fo:block>atome de césium, niveaux hyperfins, 15, 17, 18, 56, 58, 83, 85, 92, 94, 97, 98, 102</fo:block>
2521
- <xsl:if test="position() != last()"><fo:block> </fo:block></xsl:if>
3444
+ <xsl:if test="position() != last()"><fo:block>&#xA0;</fo:block></xsl:if>
2522
3445
  </xsl:for-each>
2523
3446
 
2524
3447
  </fo:flow>
2525
3448
  </fo:page-sequence>
2526
3449
  </xsl:template>
3450
+ -->
3451
+
3452
+
3453
+ <!-- =================== -->
3454
+ <!-- Index processing -->
3455
+ <!-- =================== -->
3456
+
3457
+ <xsl:template match="@*|node()" mode="index_add_id">
3458
+ <xsl:copy>
3459
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
3460
+ </xsl:copy>
3461
+ </xsl:template>
3462
+
3463
+ <xsl:template match="bipm:xref" mode="index_add_id">
3464
+ <xsl:variable name="id">
3465
+ <xsl:call-template name="generateIndexXrefId"/>
3466
+ </xsl:variable>
3467
+ <xsl:copy> <!-- add id to xref -->
3468
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
3469
+ <xsl:attribute name="id">
3470
+ <xsl:value-of select="$id"/>
3471
+ </xsl:attribute>
3472
+ <xsl:apply-templates mode="index_add_id"/>
3473
+ </xsl:copy>
3474
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
3475
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
3476
+ <xsl:if test="@to">
3477
+ <xsl:value-of select="$dash"/>
3478
+ <xsl:copy>
3479
+ <xsl:copy-of select="@*"/>
3480
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
3481
+ <xsl:attribute name="id">
3482
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
3483
+ </xsl:attribute>
3484
+ <xsl:apply-templates mode="index_add_id"/>
3485
+ </xsl:copy>
3486
+ </xsl:if>
3487
+ </xsl:template>
3488
+
3489
+ <xsl:template match="@*|node()" mode="index_update">
3490
+ <xsl:copy>
3491
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
3492
+ </xsl:copy>
3493
+ </xsl:template>
3494
+
3495
+ <xsl:template match="bipm:clause[@type = 'index']//bipm:li" mode="index_update">
3496
+ <xsl:copy>
3497
+ <xsl:apply-templates select="@*" mode="index_update"/>
3498
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
3499
+ </xsl:copy>
3500
+ </xsl:template>
3501
+
3502
+ <xsl:template match="bipm:clause[@type = 'index']//bipm:li/node()" mode="process_li_element" priority="2">
3503
+ <xsl:param name="element"/>
3504
+ <xsl:param name="remove" select="'false'"/>
3505
+ <!-- <node></node> -->
3506
+ <xsl:choose>
3507
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
3508
+ <!-- skip text (i.e. remove it) and process next element -->
3509
+ <!-- [removed_<xsl:value-of select="."/>] -->
3510
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3511
+ </xsl:when>
3512
+ <xsl:when test="self::text()">
3513
+ <xsl:value-of select="."/>
3514
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3515
+ </xsl:when>
3516
+ <xsl:when test="self::* and local-name(.) = 'xref'">
3517
+ <xsl:variable name="id" select="@id"/>
3518
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
3519
+ <xsl:variable name="id_next" select="following-sibling::bipm:xref[1]/@id"/>
3520
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
3521
+
3522
+ <xsl:variable name="id_prev" select="preceding-sibling::bipm:xref[1]/@id"/>
3523
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
3524
+
3525
+ <xsl:choose>
3526
+ <!-- 2nd pass -->
3527
+ <!-- if page is equal to page for next and page is not the end of range -->
3528
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
3529
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
3530
+ <!-- [removed_xref] -->
3531
+
3532
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
3533
+ <xsl:with-param name="remove">true</xsl:with-param>
3534
+ </xsl:apply-templates>
3535
+ </xsl:when>
3536
+
3537
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
3538
+ <!-- remove xref -->
3539
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
3540
+ <xsl:with-param name="remove">true</xsl:with-param>
3541
+ </xsl:apply-templates>
3542
+ </xsl:when>
3543
+
3544
+ <xsl:otherwise>
3545
+ <xsl:copy-of select="."/>
3546
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3547
+ </xsl:otherwise>
3548
+ </xsl:choose>
3549
+ </xsl:when>
3550
+ <xsl:when test="self::* and local-name(.) = 'ul'">
3551
+ <!-- ul -->
3552
+ <xsl:apply-templates select="." mode="index_update"/>
3553
+ </xsl:when>
3554
+ <xsl:otherwise>
3555
+ <xsl:copy-of select="."/>
3556
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3557
+ </xsl:otherwise>
3558
+ </xsl:choose>
3559
+ </xsl:template>
3560
+
3561
+
3562
+ <xsl:template name="generateIndexXrefId">
3563
+ <xsl:variable name="level" select="count(ancestor::bipm:ul)"/>
3564
+ <!-- <xsl:variable name="parent_ul_id" select="generate-id(ancestor::bipm:ul[1])"/>
3565
+ <xsl:variable name="item_number" select="count(ancestor::bipm:li[ancestor::bipm:ul[generate-id() = $parent_ul_id]])"/> -->
3566
+ <xsl:variable name="docid">
3567
+ <xsl:call-template name="getDocumentId"/>
3568
+ </xsl:variable>
3569
+ <xsl:variable name="item_number">
3570
+ <xsl:number count="bipm:li[ancestor::bipm:clause[@type = 'index']]" level="any"/>
3571
+ </xsl:variable>
3572
+ <xsl:variable name="xref_number"><xsl:number count="bipm:xref"/></xsl:variable>
3573
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
3574
+ </xsl:template>
3575
+
3576
+ <xsl:template match="bipm:clause[@type = 'index']"/>
3577
+ <xsl:template match="bipm:clause[@type = 'index']" mode="index">
3578
+
3579
+ <fo:page-sequence master-reference="index" force-page-count="no-force">
3580
+ <xsl:variable name="header-title">
3581
+ <xsl:choose>
3582
+ <xsl:when test="./bipm:title[1]/*[local-name() = 'tab']">
3583
+ <xsl:apply-templates select="./bipm:title[1]/*[local-name() = 'tab'][1]/following-sibling::node()" mode="header"/>
3584
+ </xsl:when>
3585
+ <xsl:otherwise>
3586
+ <xsl:apply-templates select="./bipm:title[1]" mode="header"/>
3587
+ </xsl:otherwise>
3588
+ </xsl:choose>
3589
+ </xsl:variable>
3590
+ <xsl:call-template name="insertHeaderFooter">
3591
+ <xsl:with-param name="header-title" select="$header-title"/>
3592
+ </xsl:call-template>
3593
+
3594
+ <fo:flow flow-name="xsl-region-body">
3595
+ <fo:block id="{@id}">
3596
+ <xsl:apply-templates/>
3597
+
3598
+ <!-- TEST <xsl:variable name="alphabet" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
3599
+ <xsl:for-each select="(document('')//node())[position() &lt; 26]">
3600
+ <xsl:variable name="letter" select="substring($alphabet, position(), 1)"/>
3601
+ <xsl:if test="position() &lt;= 3">
3602
+ <fo:block font-size="10pt" font-weight="bold" margin-bottom="3pt" keep-with-next="always"><xsl:value-of select="$letter"/>, DEBUG</fo:block>
3603
+
3604
+ <fo:block>accélération due à la pesanteur (gn), 33</fo:block>
3605
+ <fo:block>activité d’un radionucléide, 26, 27</fo:block>
3606
+ <fo:block>ampère (A), 13, 16, 18, 20, 28, 44, 49, 51, 52, 54, 55, 71, 81, 83-86, 89, 91-94, 97, 99, 100, 101, 103-104</fo:block>
3607
+ <fo:block>angle, 25, 26, 33, 37 38, 40, 48, 55, 65</fo:block>
3608
+ <fo:block>atmosphère normale, 52</fo:block>
3609
+ <fo:block>atome gramme, 104</fo:block>
3610
+ <fo:block>atome de césium, niveaux hyperfins, 15, 17, 18, 56, 58, 83, 85, 92, 94, 97, 98, 102</fo:block>
3611
+ <xsl:if test="position() != last()"><fo:block>&#xA0;</fo:block></xsl:if>
3612
+ </xsl:if>
3613
+ </xsl:for-each> -->
3614
+ </fo:block>
3615
+ </fo:flow>
3616
+ </fo:page-sequence>
3617
+ </xsl:template>
3618
+
3619
+ <xsl:template match="bipm:clause[@type = 'index']/bipm:title" priority="4">
3620
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt" margin-left="-18mm" span="all">
3621
+ <!-- Index -->
3622
+ <xsl:apply-templates/>
3623
+ </fo:block>
3624
+ </xsl:template>
3625
+
3626
+ <xsl:template match="bipm:clause[@type = 'index']/bipm:clause" priority="4">
3627
+ <xsl:apply-templates/>
3628
+ <fo:block>
3629
+ <xsl:if test="following-sibling::bipm:clause">
3630
+ <fo:block> </fo:block>
3631
+ </xsl:if>
3632
+ </fo:block>
3633
+ </xsl:template>
3634
+
3635
+ <xsl:template match="bipm:clause[@type = 'index']/bipm:clause/bipm:title" priority="4">
3636
+ <!-- Letter A, B, C, ... -->
3637
+ <fo:block font-size="10pt" font-weight="bold" margin-bottom="3pt" keep-with-next="always">
3638
+ <xsl:apply-templates/>
3639
+ </fo:block>
3640
+ </xsl:template>
3641
+
3642
+ <xsl:template match="bipm:clause[@type = 'index']//bipm:ul" priority="4">
3643
+ <xsl:apply-templates/>
3644
+ </xsl:template>
3645
+
3646
+ <xsl:template match="bipm:clause[@type = 'index']//bipm:li" priority="4">
3647
+ <xsl:variable name="level" select="count(ancestor::bipm:ul)"/>
3648
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
3649
+ <xsl:apply-templates/>
3650
+ </fo:block>
3651
+ </xsl:template>
3652
+
3653
+ <xsl:template match="bipm:bookmark">
3654
+ <fo:inline id="{@id}"/>
3655
+ </xsl:template>
3656
+
3657
+ <!-- =================== -->
3658
+ <!-- End of Index processing -->
3659
+ <!-- =================== -->
2527
3660
 
2528
-
2529
3661
  <xsl:variable name="Image-Logo-BIPM">
2530
3662
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAaIAAADRCAYAAACOyra0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2dpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGOTdGMTE3NDA3MjA2ODExODIyQUJFNEQ3OTI1MkI2OSIgeG1wTU06RG9jdW1lbnRJ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iMwjhLm1K62gC6Dl65TeBE4f33rXl4NmZF26mqtQD6FnXxKja06PdbdBb4ODuMdqUOaLqzA3q5nkaqiicu5HST1hexa7nxaMxtbW1zBsT0H3fopkjw0AmbNLfT9BkMhnWAsYHC25FlWlyerZHUlqWR0lZpSWjLoXcva19Upvm1hnQ5pvJZLx0vbSMnKLWd9KyOtx9+LQD9ZmHY4skT6eWSa/SK6e8im+c9iTP+X5GbvtHOYVtmQyGGNKSLUwMizs4tbzr3q75XTMjgyZjeEEPGblFra/fTe8qlkhZFHe6t7FPatfK9hGSN/lVzo/G0D09M69t8uOcDpCBiohV1NW97XWosoBbhGMiwsDAwMDAeCXgZAUMDAwMDExEGBgYGBiYiDAwMDAwMN4J/i/AACGmCZ5CpEpCAAAAAElFTkSuQmCC</xsl:text>
2531
3663
  </xsl:variable>
@@ -2858,32 +3990,61 @@
2858
3990
  </xsl:if>
2859
3991
  </xsl:template>
2860
3992
 
2861
- <xsl:template match="node()" mode="change_id">
3993
+ <!-- <xsl:template match="node()" mode="change_id">
2862
3994
  <xsl:param name="lang"/>
3995
+ <xsl:param name="ignoreReferenceFrom"/>
2863
3996
  <xsl:copy>
2864
3997
  <xsl:apply-templates select="@*|node()" mode="change_id">
2865
3998
  <xsl:with-param name="lang" select="$lang"/>
3999
+ <xsl:with-param name="ignoreReferenceFrom" select="$ignoreReferenceFrom"/>
4000
+ </xsl:apply-templates>
4001
+ </xsl:copy>
4002
+ </xsl:template>
4003
+
4004
+ <xsl:template match="bipm:locality[@type='anchor']/bipm:referenceFrom " mode="change_id">
4005
+ <xsl:param name="lang"/>
4006
+ <xsl:param name="ignoreReferenceFrom"/>
4007
+ <xsl:copy>
4008
+ <xsl:apply-templates select="@*" mode="change_id">
4009
+ <xsl:with-param name="lang" select="$lang"/>
4010
+ <xsl:with-param name="ignoreReferenceFrom" select="$ignoreReferenceFrom"/>
2866
4011
  </xsl:apply-templates>
4012
+ <xsl:choose>
4013
+ <xsl:when test="$ignoreReferenceFrom = 'true'"><xsl:value-of select="."/></xsl:when>
4014
+ <xsl:otherwise><xsl:value-of select="."/>_<xsl:value-of select="$lang"/><xsl:if test="$doctype = 'guide'">_<xsl:number count="bipm:bipm-standard" level="any"/></xsl:if></xsl:otherwise>
4015
+ </xsl:choose>
2867
4016
  </xsl:copy>
2868
4017
  </xsl:template>
2869
4018
 
2870
4019
  <xsl:template match="@*" mode="change_id">
2871
4020
  <xsl:param name="lang"/>
4021
+ <xsl:param name="ignoreReferenceFrom"/>
2872
4022
  <xsl:choose>
2873
- <xsl:when test="local-name() = 'id' or local-name() = 'bibitemid' or (local-name() = 'target' and local-name(..) = 'xref')">
4023
+ <xsl:when test="$ignoreReferenceFrom = 'true' and local-name() = 'id' and xalan:nodeset($ids)//referenceFrom = .">
2874
4024
  <xsl:attribute name="{local-name()}">
2875
- <xsl:value-of select="."/>_<xsl:value-of select="$lang"/>
4025
+ <xsl:value-of select="."/>
4026
+ </xsl:attribute>
4027
+ </xsl:when>
4028
+ <xsl:when test="local-name() = 'id' or
4029
+ local-name() = 'bibitemid' or
4030
+ (local-name() = 'target' and local-name(..) = 'xref')">
4031
+ <xsl:attribute name="{local-name()}">
4032
+ <xsl:value-of select="."/>_<xsl:value-of select="$lang"/><xsl:if test="$doctype = 'guide'">_<xsl:number count="bipm:bipm-standard" level="any"/></xsl:if>
2876
4033
  </xsl:attribute>
2877
4034
  </xsl:when>
2878
- <xsl:otherwise>
4035
+ <xsl:otherwise>
4036
+ no change
2879
4037
  <xsl:copy>
2880
4038
  <xsl:apply-templates select="@*" mode="change_id">
2881
4039
  <xsl:with-param name="lang" select="$lang"/>
4040
+ <xsl:with-param name="ignoreReferenceFrom" select="$ignoreReferenceFrom"/>
2882
4041
  </xsl:apply-templates>
2883
4042
  </xsl:copy>
2884
4043
  </xsl:otherwise>
2885
4044
  </xsl:choose>
2886
- </xsl:template>
4045
+ </xsl:template> -->
4046
+
4047
+
2887
4048
 
2888
4049
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
2889
4050
 
@@ -2940,13 +4101,30 @@
2940
4101
  <title-part lang="en">
2941
4102
 
2942
4103
 
4104
+
4105
+ <xsl:text>Part #</xsl:text>
4106
+
2943
4107
  </title-part>
2944
4108
  <title-part lang="fr">
2945
4109
 
2946
4110
 
4111
+
4112
+ <xsl:text>Partie #</xsl:text>
4113
+
2947
4114
  </title-part>
2948
4115
  <title-part lang="zh">第 # 部分:</title-part>
2949
4116
 
4117
+ <title-subpart lang="en">
4118
+
4119
+ <xsl:text>Sub-part #</xsl:text>
4120
+
4121
+ </title-subpart>
4122
+ <title-subpart lang="fr">
4123
+
4124
+ <xsl:text>Partie de sub #</xsl:text>
4125
+
4126
+ </title-subpart>
4127
+
2950
4128
  <title-modified lang="en">modified</title-modified>
2951
4129
  <title-modified lang="fr">modifiée</title-modified>
2952
4130
 
@@ -3031,11 +4209,14 @@
3031
4209
  </xsl:choose>
3032
4210
  </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="'&#8232;'"/><xsl:attribute-set name="root-style">
3033
4211
 
3034
- <xsl:attribute name="font-family">Times New Roman, STIX Two Math, HanSans</xsl:attribute>
4212
+ <xsl:attribute name="font-family">Times New Roman, STIX Two Math, Source Han Sans</xsl:attribute>
3035
4213
  <xsl:attribute name="font-size">10.5pt</xsl:attribute>
3036
4214
 
3037
4215
  </xsl:attribute-set><xsl:attribute-set name="link-style">
3038
4216
 
4217
+ <xsl:attribute name="color">blue</xsl:attribute>
4218
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4219
+
3039
4220
 
3040
4221
 
3041
4222
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
@@ -3155,7 +4336,7 @@
3155
4336
 
3156
4337
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3157
4338
  <xsl:attribute name="text-align">left</xsl:attribute>
3158
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
4339
+ <xsl:attribute name="margin-top">24pt</xsl:attribute>
3159
4340
  <xsl:attribute name="margin-left">25mm</xsl:attribute>
3160
4341
  <xsl:attribute name="text-indent">-25mm</xsl:attribute>
3161
4342
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -3231,6 +4412,9 @@
3231
4412
 
3232
4413
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
3233
4414
 
4415
+
4416
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
4417
+
3234
4418
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
3235
4419
 
3236
4420
 
@@ -3255,6 +4439,13 @@
3255
4439
  </xsl:attribute-set><xsl:attribute-set name="term-style">
3256
4440
 
3257
4441
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
4442
+
4443
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4444
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4445
+ <xsl:attribute name="text-align">left</xsl:attribute>
4446
+ <xsl:attribute name="margin-left">19mm</xsl:attribute>
4447
+ <xsl:attribute name="text-indent">-19mm</xsl:attribute>
4448
+
3258
4449
 
3259
4450
 
3260
4451
 
@@ -3367,9 +4558,9 @@
3367
4558
 
3368
4559
 
3369
4560
 
3370
-
3371
- <fo:block> </fo:block>
3372
-
4561
+ <!-- <xsl:if test="$namespace = 'bipm'">
4562
+ <fo:block>&#xA0;</fo:block>
4563
+ </xsl:if> -->
3373
4564
 
3374
4565
  <!-- $namespace = 'iso' or -->
3375
4566
 
@@ -3403,10 +4594,12 @@
3403
4594
 
3404
4595
 
3405
4596
  <xsl:variable name="colwidths">
3406
- <xsl:call-template name="calculate-column-widths">
3407
- <xsl:with-param name="cols-count" select="$cols-count"/>
3408
- <xsl:with-param name="table" select="$simple-table"/>
3409
- </xsl:call-template>
4597
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
4598
+ <xsl:call-template name="calculate-column-widths">
4599
+ <xsl:with-param name="cols-count" select="$cols-count"/>
4600
+ <xsl:with-param name="table" select="$simple-table"/>
4601
+ </xsl:call-template>
4602
+ </xsl:if>
3410
4603
  </xsl:variable>
3411
4604
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3412
4605
 
@@ -3457,7 +4650,12 @@
3457
4650
 
3458
4651
  <xsl:variable name="table_attributes">
3459
4652
  <attribute name="table-layout">fixed</attribute>
3460
- <attribute name="width">100%</attribute>
4653
+ <attribute name="width">
4654
+ <xsl:choose>
4655
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
4656
+ <xsl:otherwise>100%</xsl:otherwise>
4657
+ </xsl:choose>
4658
+ </attribute>
3461
4659
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3462
4660
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3463
4661
 
@@ -3493,16 +4691,25 @@
3493
4691
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3494
4692
  </xsl:if>
3495
4693
 
3496
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3497
- <xsl:choose>
3498
- <xsl:when test=". = 1 or . = 0">
3499
- <fo:table-column column-width="proportional-column-width(2)"/>
3500
- </xsl:when>
3501
- <xsl:otherwise>
3502
- <fo:table-column column-width="proportional-column-width({.})"/>
3503
- </xsl:otherwise>
3504
- </xsl:choose>
3505
- </xsl:for-each>
4694
+ <xsl:choose>
4695
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
4696
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
4697
+ <fo:table-column column-width="{@width}"/>
4698
+ </xsl:for-each>
4699
+ </xsl:when>
4700
+ <xsl:otherwise>
4701
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
4702
+ <xsl:choose>
4703
+ <xsl:when test=". = 1 or . = 0">
4704
+ <fo:table-column column-width="proportional-column-width(2)"/>
4705
+ </xsl:when>
4706
+ <xsl:otherwise>
4707
+ <fo:table-column column-width="proportional-column-width({.})"/>
4708
+ </xsl:otherwise>
4709
+ </xsl:choose>
4710
+ </xsl:for-each>
4711
+ </xsl:otherwise>
4712
+ </xsl:choose>
3506
4713
 
3507
4714
  <xsl:choose>
3508
4715
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -3515,10 +4722,12 @@
3515
4722
 
3516
4723
  </fo:table>
3517
4724
 
4725
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3518
4726
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3519
4727
  <xsl:call-template name="insertTableFooterInSeparateTable">
3520
4728
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
3521
4729
  <xsl:with-param name="colwidths" select="$colwidths"/>
4730
+ <xsl:with-param name="colgroup" select="$colgroup"/>
3522
4731
  </xsl:call-template>
3523
4732
  </xsl:for-each>
3524
4733
 
@@ -3551,6 +4760,11 @@
3551
4760
  <xsl:if test="normalize-space() != ''">
3552
4761
  <fo:block xsl:use-attribute-sets="table-name-style">
3553
4762
 
4763
+
4764
+ <xsl:if test="not(*[local-name()='tab'])"> <!-- table without number -->
4765
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
4766
+ </xsl:if>
4767
+
3554
4768
  <xsl:apply-templates/>
3555
4769
  </fo:block>
3556
4770
  </xsl:if>
@@ -3773,12 +4987,22 @@
3773
4987
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3774
4988
  <xsl:param name="table_attributes"/>
3775
4989
  <xsl:param name="colwidths"/>
4990
+ <xsl:param name="colgroup"/>
3776
4991
 
3777
4992
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3778
4993
 
3779
4994
  <xsl:if test="$isNoteOrFnExist = 'true'">
3780
4995
 
3781
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
4996
+ <xsl:variable name="cols-count">
4997
+ <xsl:choose>
4998
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
4999
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
5000
+ </xsl:when>
5001
+ <xsl:otherwise>
5002
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
5003
+ </xsl:otherwise>
5004
+ </xsl:choose>
5005
+ </xsl:variable>
3782
5006
 
3783
5007
  <fo:table keep-with-previous="always">
3784
5008
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3796,16 +5020,25 @@
3796
5020
  </xsl:choose>
3797
5021
  </xsl:for-each>
3798
5022
 
3799
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3800
- <xsl:choose>
3801
- <xsl:when test=". = 1 or . = 0">
3802
- <fo:table-column column-width="proportional-column-width(2)"/>
3803
- </xsl:when>
3804
- <xsl:otherwise>
3805
- <fo:table-column column-width="proportional-column-width({.})"/>
3806
- </xsl:otherwise>
3807
- </xsl:choose>
3808
- </xsl:for-each>
5023
+ <xsl:choose>
5024
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
5025
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
5026
+ <fo:table-column column-width="{@width}"/>
5027
+ </xsl:for-each>
5028
+ </xsl:when>
5029
+ <xsl:otherwise>
5030
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
5031
+ <xsl:choose>
5032
+ <xsl:when test=". = 1 or . = 0">
5033
+ <fo:table-column column-width="proportional-column-width(2)"/>
5034
+ </xsl:when>
5035
+ <xsl:otherwise>
5036
+ <fo:table-column column-width="proportional-column-width({.})"/>
5037
+ </xsl:otherwise>
5038
+ </xsl:choose>
5039
+ </xsl:for-each>
5040
+ </xsl:otherwise>
5041
+ </xsl:choose>
3809
5042
 
3810
5043
  <fo:table-body>
3811
5044
  <fo:table-row>
@@ -3918,6 +5151,14 @@
3918
5151
 
3919
5152
 
3920
5153
 
5154
+
5155
+ <xsl:if test="count(*) = 1 and local-name(*[1]) = 'th'">
5156
+ <xsl:attribute name="keep-with-next.within-page">always</xsl:attribute>
5157
+ </xsl:if>
5158
+ <xsl:if test="not(ancestor::*[local-name()='note_side'])">
5159
+ <xsl:attribute name="min-height">5mm</xsl:attribute>
5160
+ </xsl:if>
5161
+
3921
5162
  <!-- <xsl:if test="$namespace = 'bipm'">
3922
5163
  <xsl:attribute name="height">8mm</xsl:attribute>
3923
5164
  </xsl:if> -->
@@ -3947,7 +5188,7 @@
3947
5188
 
3948
5189
  <xsl:attribute name="font-weight">normal</xsl:attribute>
3949
5190
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
3950
- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute>
5191
+ <!-- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute> -->
3951
5192
  <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
3952
5193
  <xsl:attribute name="height">8mm</xsl:attribute>
3953
5194
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -4023,7 +5264,12 @@
4023
5264
  </xsl:attribute>
4024
5265
  </xsl:if>
4025
5266
  <xsl:call-template name="display-align"/>
4026
- <fo:block>
5267
+ <fo:block>
5268
+
5269
+ <xsl:if test="not(.//bipm:image)">
5270
+ <xsl:attribute name="line-stacking-strategy">font-height</xsl:attribute>
5271
+ </xsl:if>
5272
+
4027
5273
  <xsl:apply-templates/>
4028
5274
  </fo:block>
4029
5275
  </fo:table-cell>
@@ -4270,7 +5516,16 @@
4270
5516
  <xsl:apply-templates/>
4271
5517
  </fo:inline>
4272
5518
  </xsl:template><xsl:template match="*[local-name()='dl']">
4273
- <fo:block-container margin-left="0mm">
5519
+ <fo:block-container>
5520
+
5521
+
5522
+ <xsl:if test="not(ancestor::*[local-name() = 'li'])">
5523
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
5524
+ </xsl:if>
5525
+ <xsl:if test="ancestor::*[local-name() = 'li']">
5526
+ <xsl:attribute name="margin-left">6.5mm</xsl:attribute><!-- 8 mm -->
5527
+ </xsl:if>
5528
+
4274
5529
  <xsl:if test="parent::*[local-name() = 'note']">
4275
5530
  <xsl:attribute name="margin-left">
4276
5531
  <xsl:choose>
@@ -4280,8 +5535,13 @@
4280
5535
  </xsl:attribute>
4281
5536
 
4282
5537
  </xsl:if>
4283
- <fo:block-container margin-left="0mm">
4284
-
5538
+ <fo:block-container>
5539
+
5540
+
5541
+ <!-- <xsl:if test="not(ancestor::*[local-name() = 'li'])"> -->
5542
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
5543
+ <!-- </xsl:if> -->
5544
+
4285
5545
  <xsl:variable name="parent" select="local-name(..)"/>
4286
5546
 
4287
5547
  <xsl:variable name="key_iso">
@@ -4295,9 +5555,12 @@
4295
5555
  <fo:block margin-bottom="12pt" text-align="left">
4296
5556
 
4297
5557
  <xsl:variable name="title-where">
4298
- <xsl:call-template name="getTitle">
4299
- <xsl:with-param name="name" select="'title-where'"/>
4300
- </xsl:call-template>
5558
+
5559
+
5560
+ <xsl:call-template name="getTitle">
5561
+ <xsl:with-param name="name" select="'title-where'"/>
5562
+ </xsl:call-template>
5563
+
4301
5564
  </xsl:variable>
4302
5565
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
4303
5566
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -4313,9 +5576,12 @@
4313
5576
 
4314
5577
 
4315
5578
  <xsl:variable name="title-where">
4316
- <xsl:call-template name="getTitle">
4317
- <xsl:with-param name="name" select="'title-where'"/>
4318
- </xsl:call-template>
5579
+
5580
+
5581
+ <xsl:call-template name="getTitle">
5582
+ <xsl:with-param name="name" select="'title-where'"/>
5583
+ </xsl:call-template>
5584
+
4319
5585
  </xsl:variable>
4320
5586
  <xsl:value-of select="$title-where"/>
4321
5587
  </fo:block>
@@ -4326,9 +5592,12 @@
4326
5592
 
4327
5593
 
4328
5594
  <xsl:variable name="title-key">
4329
- <xsl:call-template name="getTitle">
4330
- <xsl:with-param name="name" select="'title-key'"/>
4331
- </xsl:call-template>
5595
+
5596
+
5597
+ <xsl:call-template name="getTitle">
5598
+ <xsl:with-param name="name" select="'title-key'"/>
5599
+ </xsl:call-template>
5600
+
4332
5601
  </xsl:variable>
4333
5602
  <xsl:value-of select="$title-key"/>
4334
5603
  </fo:block>
@@ -4454,12 +5723,32 @@
4454
5723
  </xsl:otherwise>
4455
5724
  </xsl:choose>
4456
5725
  </xsl:template><xsl:template name="getMaxLength_dt">
4457
- <xsl:for-each select="*[local-name()='dt']">
4458
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
4459
- <xsl:if test="position() = 1">
4460
- <xsl:value-of select="string-length(normalize-space(.))"/>
4461
- </xsl:if>
4462
- </xsl:for-each>
5726
+ <xsl:variable name="lengths">
5727
+ <xsl:for-each select="*[local-name()='dt']">
5728
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
5729
+ <xsl:variable name="attributes">
5730
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
5731
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
5732
+ </xsl:variable>
5733
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
5734
+ </xsl:for-each>
5735
+ </xsl:variable>
5736
+ <xsl:variable name="maxLength">
5737
+ <!-- <xsl:for-each select="*[local-name()='dt']">
5738
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
5739
+ <xsl:if test="position() = 1">
5740
+ <xsl:value-of select="string-length(normalize-space(.))"/>
5741
+ </xsl:if>
5742
+ </xsl:for-each> -->
5743
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
5744
+ <xsl:sort select="." data-type="number" order="descending"/>
5745
+ <xsl:if test="position() = 1">
5746
+ <xsl:value-of select="."/>
5747
+ </xsl:if>
5748
+ </xsl:for-each>
5749
+ </xsl:variable>
5750
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
5751
+ <xsl:value-of select="$maxLength"/>
4463
5752
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
4464
5753
  <xsl:param name="key_iso"/>
4465
5754
 
@@ -4574,6 +5863,7 @@
4574
5863
  </fo:inline>
4575
5864
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
4576
5865
  <fo:inline font-weight="bold">
5866
+
4577
5867
  <xsl:apply-templates/>
4578
5868
  </fo:inline>
4579
5869
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -4613,6 +5903,10 @@
4613
5903
  </xsl:if>
4614
5904
  <xsl:apply-templates/>
4615
5905
  </fo:inline>
5906
+ </xsl:template><xsl:template match="*[local-name()='underline']">
5907
+ <fo:inline text-decoration="underline">
5908
+ <xsl:apply-templates/>
5909
+ </fo:inline>
4616
5910
  </xsl:template><xsl:template match="*[local-name()='del']">
4617
5911
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
4618
5912
  <xsl:apply-templates/>
@@ -4902,7 +6196,18 @@
4902
6196
  <xsl:with-param name="previousRow" select="$newRow"/>
4903
6197
  </xsl:apply-templates>
4904
6198
  </xsl:template><xsl:template name="getLang">
4905
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6199
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6200
+ <xsl:variable name="language">
6201
+ <xsl:choose>
6202
+ <xsl:when test="$language_current != ''">
6203
+ <xsl:value-of select="$language_current"/>
6204
+ </xsl:when>
6205
+ <xsl:otherwise>
6206
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6207
+ </xsl:otherwise>
6208
+ </xsl:choose>
6209
+ </xsl:variable>
6210
+
4906
6211
  <xsl:choose>
4907
6212
  <xsl:when test="$language = 'English'">en</xsl:when>
4908
6213
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -4937,6 +6242,11 @@
4937
6242
  <xsl:value-of select="substring($str, 2)"/>
4938
6243
  </xsl:template><xsl:template match="mathml:math">
4939
6244
  <fo:inline font-family="STIX Two Math"> <!-- -->
6245
+
6246
+ <xsl:if test="ancestor::*[local-name()='table']">
6247
+ <xsl:attribute name="font-size">95%</xsl:attribute> <!-- base font in table is 10pt -->
6248
+ </xsl:if>
6249
+
4940
6250
  <xsl:variable name="mathml">
4941
6251
  <xsl:apply-templates select="." mode="mathml"/>
4942
6252
  </xsl:variable>
@@ -4966,6 +6276,7 @@
4966
6276
  </xsl:choose>
4967
6277
  </xsl:variable>
4968
6278
  <fo:inline xsl:use-attribute-sets="link-style">
6279
+
4969
6280
  <xsl:choose>
4970
6281
  <xsl:when test="$target = ''">
4971
6282
  <xsl:apply-templates/>
@@ -5019,10 +6330,14 @@
5019
6330
  </fo:inline>
5020
6331
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
5021
6332
  <xsl:variable name="title-modified">
5022
- <xsl:call-template name="getTitle">
5023
- <xsl:with-param name="name" select="'title-modified'"/>
5024
- </xsl:call-template>
6333
+
6334
+
6335
+ <xsl:call-template name="getTitle">
6336
+ <xsl:with-param name="name" select="'title-modified'"/>
6337
+ </xsl:call-template>
6338
+
5025
6339
  </xsl:variable>
6340
+
5026
6341
  <xsl:choose>
5027
6342
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
5028
6343
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -5151,6 +6466,8 @@
5151
6466
  </xsl:when>
5152
6467
  <xsl:otherwise>
5153
6468
 
6469
+ <xsl:text>:</xsl:text>
6470
+
5154
6471
 
5155
6472
  </xsl:otherwise>
5156
6473
  </xsl:choose>
@@ -5182,7 +6499,12 @@
5182
6499
  </fo:inline>
5183
6500
  </xsl:if>
5184
6501
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
5185
- <fo:block-container id="{@id}">
6502
+ <fo:block-container id="{@id}">
6503
+
6504
+ <xsl:if test="*[local-name() = 'name']">
6505
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
6506
+ </xsl:if>
6507
+
5186
6508
  <fo:block>
5187
6509
  <xsl:apply-templates/>
5188
6510
  </fo:block>
@@ -5233,7 +6555,7 @@
5233
6555
  <xsl:apply-templates mode="bookmarks"/>
5234
6556
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
5235
6557
  <xsl:apply-templates select="."/>
5236
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
6558
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
5237
6559
  <xsl:apply-templates mode="bookmarks"/>
5238
6560
  </xsl:template><xsl:template name="addBookmarks">
5239
6561
  <xsl:param name="contents"/>
@@ -5249,6 +6571,8 @@
5249
6571
  <xsl:variable name="bookmark-title_">
5250
6572
  <xsl:call-template name="getLangVersion">
5251
6573
  <xsl:with-param name="lang" select="@lang"/>
6574
+ <xsl:with-param name="doctype" select="@doctype"/>
6575
+ <xsl:with-param name="title" select="@title-part"/>
5252
6576
  </xsl:call-template>
5253
6577
  </xsl:variable>
5254
6578
  <xsl:choose>
@@ -5266,13 +6590,34 @@
5266
6590
  </xsl:choose>
5267
6591
  </fo:bookmark-title>
5268
6592
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
6593
+
6594
+ <xsl:call-template name="insertFigureBookmarks">
6595
+ <xsl:with-param name="contents" select="contents"/>
6596
+ </xsl:call-template>
6597
+
6598
+ <xsl:call-template name="insertTableBookmarks">
6599
+ <xsl:with-param name="contents" select="contents"/>
6600
+ <xsl:with-param name="lang" select="@lang"/>
6601
+ </xsl:call-template>
6602
+
5269
6603
  </fo:bookmark>
5270
6604
 
5271
6605
  </xsl:for-each>
5272
6606
  </xsl:when>
5273
6607
  <xsl:otherwise>
5274
6608
  <xsl:for-each select="xalan:nodeset($contents)/doc">
6609
+
5275
6610
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
6611
+
6612
+ <xsl:call-template name="insertFigureBookmarks">
6613
+ <xsl:with-param name="contents" select="contents"/>
6614
+ </xsl:call-template>
6615
+
6616
+ <xsl:call-template name="insertTableBookmarks">
6617
+ <xsl:with-param name="contents" select="contents"/>
6618
+ <xsl:with-param name="lang" select="@lang"/>
6619
+ </xsl:call-template>
6620
+
5276
6621
  </xsl:for-each>
5277
6622
  </xsl:otherwise>
5278
6623
  </xsl:choose>
@@ -5291,16 +6636,66 @@
5291
6636
 
5292
6637
  </fo:bookmark-tree>
5293
6638
  </xsl:if>
6639
+ </xsl:template><xsl:template name="insertFigureBookmarks">
6640
+ <xsl:param name="contents"/>
6641
+ <xsl:if test="xalan:nodeset($contents)/figure">
6642
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
6643
+ <fo:bookmark-title>Figures</fo:bookmark-title>
6644
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
6645
+ <fo:bookmark internal-destination="{@id}">
6646
+ <fo:bookmark-title>
6647
+ <xsl:value-of select="normalize-space(title)"/>
6648
+ </fo:bookmark-title>
6649
+ </fo:bookmark>
6650
+ </xsl:for-each>
6651
+ </fo:bookmark>
6652
+ </xsl:if>
6653
+ </xsl:template><xsl:template name="insertTableBookmarks">
6654
+ <xsl:param name="contents"/>
6655
+ <xsl:param name="lang"/>
6656
+ <xsl:if test="xalan:nodeset($contents)/table">
6657
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
6658
+ <fo:bookmark-title>
6659
+ <xsl:choose>
6660
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
6661
+ <xsl:otherwise>Tables</xsl:otherwise>
6662
+ </xsl:choose>
6663
+ </fo:bookmark-title>
6664
+ <xsl:for-each select="xalan:nodeset($contents)/table">
6665
+ <fo:bookmark internal-destination="{@id}">
6666
+ <fo:bookmark-title>
6667
+ <xsl:value-of select="normalize-space(title)"/>
6668
+ </fo:bookmark-title>
6669
+ </fo:bookmark>
6670
+ </xsl:for-each>
6671
+ </fo:bookmark>
6672
+ </xsl:if>
5294
6673
  </xsl:template><xsl:template name="getLangVersion">
5295
6674
  <xsl:param name="lang"/>
6675
+ <xsl:param name="doctype" select="''"/>
6676
+ <xsl:param name="title" select="''"/>
5296
6677
  <xsl:choose>
5297
6678
  <xsl:when test="$lang = 'en'">
5298
6679
 
5299
- English version
6680
+
6681
+ <xsl:choose>
6682
+ <xsl:when test="$doctype = 'guide'">
6683
+ <xsl:value-of select="$title"/>
6684
+ </xsl:when>
6685
+ <xsl:otherwise>English version</xsl:otherwise>
6686
+ </xsl:choose>
6687
+
5300
6688
  </xsl:when>
5301
6689
  <xsl:when test="$lang = 'fr'">
5302
6690
 
5303
- Version française
6691
+
6692
+ <xsl:choose>
6693
+ <xsl:when test="$doctype = 'guide'">
6694
+ <xsl:value-of select="$title"/>
6695
+ </xsl:when>
6696
+ <xsl:otherwise>Version française</xsl:otherwise>
6697
+ </xsl:choose>
6698
+
5304
6699
  </xsl:when>
5305
6700
  <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
5306
6701
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
@@ -5756,9 +7151,14 @@
5756
7151
 
5757
7152
  <fo:inline>
5758
7153
 
5759
- <xsl:call-template name="getTitle">
5760
- <xsl:with-param name="name" select="'title-source'"/>
5761
- </xsl:call-template>
7154
+
7155
+
7156
+
7157
+ <xsl:call-template name="getTitle">
7158
+ <xsl:with-param name="name" select="'title-source'"/>
7159
+ </xsl:call-template>
7160
+
7161
+
5762
7162
  <xsl:text>: </xsl:text>
5763
7163
  </fo:inline>
5764
7164
 
@@ -5783,7 +7183,8 @@
5783
7183
  <fo:block-container margin-left="0mm">
5784
7184
 
5785
7185
  <fo:block xsl:use-attribute-sets="quote-style">
5786
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
7186
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
7187
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5787
7188
  </fo:block>
5788
7189
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5789
7190
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5910,9 +7311,12 @@
5910
7311
  </fo:block>
5911
7312
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5912
7313
  <xsl:variable name="title-deprecated">
5913
- <xsl:call-template name="getTitle">
5914
- <xsl:with-param name="name" select="'title-deprecated'"/>
5915
- </xsl:call-template>
7314
+
7315
+
7316
+ <xsl:call-template name="getTitle">
7317
+ <xsl:with-param name="name" select="'title-deprecated'"/>
7318
+ </xsl:call-template>
7319
+
5916
7320
  </xsl:variable>
5917
7321
  <fo:block xsl:use-attribute-sets="deprecates-style">
5918
7322
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5963,7 +7367,7 @@
5963
7367
  <fo:block id="{@id}">
5964
7368
  <xsl:apply-templates/>
5965
7369
  </fo:block>
5966
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
7370
+ </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']">
5967
7371
 
5968
7372
  <fo:block id="{@id}">
5969
7373
  <xsl:apply-templates/>
@@ -6022,7 +7426,8 @@
6022
7426
  <fo:table-column column-width="107mm"/>
6023
7427
  <fo:table-column column-width="15mm"/>
6024
7428
  <fo:table-body>
6025
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
7429
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
7430
+
6026
7431
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
6027
7432
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
6028
7433
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -6040,6 +7445,38 @@
6040
7445
  <fo:block><xsl:apply-templates/></fo:block>
6041
7446
  </fo:table-cell>
6042
7447
  </xsl:template><xsl:template name="processBibitem">
7448
+
7449
+
7450
+ <!-- start BIPM bibtem processing -->
7451
+ <xsl:choose>
7452
+ <xsl:when test="*[local-name() = 'formattedref']">
7453
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
7454
+ </xsl:when>
7455
+ <xsl:otherwise>
7456
+ <xsl:variable name="docidentifier" select="*[local-name() = 'docidentifier'][not(@type = 'URN' or @type = 'metanorma' or @type = 'BIPM' or @type = 'ISBN' or @type = 'ISSN')]"/>
7457
+
7458
+ <xsl:value-of select="$docidentifier"/>
7459
+ <xsl:if test="$docidentifier != '' and *[local-name() = 'title']">, </xsl:if>
7460
+
7461
+ <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language"/>
7462
+
7463
+ <xsl:choose>
7464
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $curr_lang]">
7465
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $curr_lang]"/>
7466
+ </xsl:when>
7467
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
7468
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
7469
+ </xsl:when>
7470
+ <xsl:otherwise>
7471
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
7472
+ </xsl:otherwise>
7473
+ </xsl:choose>
7474
+
7475
+ </xsl:otherwise>
7476
+ </xsl:choose>
7477
+
7478
+ <!-- end BIPM bibitem processing-->
7479
+
6043
7480
 
6044
7481
 
6045
7482
 
@@ -6098,6 +7535,8 @@
6098
7535
  <xsl:value-of select="translate(.,'. ','')"/>
6099
7536
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
6100
7537
  <xsl:value-of select="substring(.,1,1)"/>
7538
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
7539
+ <fo:inline><xsl:apply-templates/></fo:inline>
6101
7540
  </xsl:template><xsl:template name="convertDate">
6102
7541
  <xsl:param name="date"/>
6103
7542
  <xsl:param name="format" select="'short'"/>
@@ -6279,13 +7718,22 @@
6279
7718
  </xsl:template><xsl:template name="split">
6280
7719
  <xsl:param name="pText" select="."/>
6281
7720
  <xsl:param name="sep" select="','"/>
7721
+ <xsl:param name="normalize-space" select="'true'"/>
6282
7722
  <xsl:if test="string-length($pText) &gt;0">
6283
7723
  <item>
6284
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
7724
+ <xsl:choose>
7725
+ <xsl:when test="$normalize-space = 'true'">
7726
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
7727
+ </xsl:when>
7728
+ <xsl:otherwise>
7729
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
7730
+ </xsl:otherwise>
7731
+ </xsl:choose>
6285
7732
  </item>
6286
7733
  <xsl:call-template name="split">
6287
7734
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
6288
7735
  <xsl:with-param name="sep" select="$sep"/>
7736
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
6289
7737
  </xsl:call-template>
6290
7738
  </xsl:if>
6291
7739
  </xsl:template><xsl:template name="getDocumentId">
@@ -6351,4 +7799,28 @@
6351
7799
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
6352
7800
  </xsl:call-template>
6353
7801
  </xsl:if>
7802
+ </xsl:template><xsl:template name="repeat">
7803
+ <xsl:param name="char" select="'*'"/>
7804
+ <xsl:param name="count"/>
7805
+ <xsl:if test="$count &gt; 0">
7806
+ <xsl:value-of select="$char"/>
7807
+ <xsl:call-template name="repeat">
7808
+ <xsl:with-param name="char" select="$char"/>
7809
+ <xsl:with-param name="count" select="$count - 1"/>
7810
+ </xsl:call-template>
7811
+ </xsl:if>
7812
+ </xsl:template><xsl:template name="getLocalizedString">
7813
+ <xsl:param name="key"/>
7814
+
7815
+ <xsl:variable name="curr_lang">
7816
+ <xsl:call-template name="getLang"/>
7817
+ </xsl:variable>
7818
+
7819
+ <xsl:choose>
7820
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
7821
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7822
+ </xsl:when>
7823
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
7824
+ </xsl:choose>
7825
+
6354
7826
  </xsl:template></xsl:stylesheet>