metanorma-iho 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,42 +6,45 @@
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
9
- <xsl:variable name="title-en"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']/node()"/></xsl:variable>
10
- <xsl:variable name="title-main_"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'main']/node()"/></xsl:variable>
11
- <xsl:variable name="title-main"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-main']/node()"/></xsl:variable>
12
- <xsl:variable name="title-appendix"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-appendix']/node()"/></xsl:variable>
13
- <xsl:variable name="title-annex"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-annex']/node()"/></xsl:variable>
14
- <xsl:variable name="title-part"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-part']/node()"/></xsl:variable>
15
- <xsl:variable name="title-supplement"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-supplement']/node()"/></xsl:variable>
16
- <xsl:variable name="title_header">
17
- <xsl:copy-of select="$title-main_"/>
18
- <xsl:if test="normalize-space($title-main_) = ''"><xsl:copy-of select="$title-en"/></xsl:if>
19
- </xsl:variable>
20
-
21
- <xsl:variable name="docidentifier_parent" select="normalize-space(/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO-parent-document'])"/>
22
- <xsl:variable name="docidentifier">
23
- <xsl:value-of select="$docidentifier_parent"/>
24
- <xsl:if test="$docidentifier_parent = ''"><xsl:value-of select="/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO']"/></xsl:if>
25
- </xsl:variable>
26
- <xsl:variable name="copyrightText" select="concat('© International Hydrographic Association ', /mn:metanorma/mn:bibdata/mn:copyright/mn:from ,' – All rights reserved')"/>
27
- <xsl:variable name="edition">
28
- <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:edition[normalize-space(@language) = '']"/>
29
- </xsl:variable>
30
- <xsl:variable name="month_year">
31
- <xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:date[@type = 'published']"/>
32
- </xsl:variable>
33
-
34
9
  <!-- Example:
35
10
  <item level="1" id="Foreword" display="true">Foreword</item>
36
11
  <item id="term-script" display="false">3.2</item>
37
12
  -->
38
13
  <xsl:variable name="contents_">
39
- <mnx:contents>
40
- <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
41
- <xsl:call-template name="processMainSectionsDefault_Contents"/>
14
+ <xsl:variable name="bundle" select="count(//mn:metanorma) &gt; 1"/>
15
+ <xsl:for-each select="//mn:metanorma">
16
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
17
+ <xsl:variable name="docidentifier"><xsl:value-of select="mn:bibdata/mn:docidentifier[@type = 'IHO']"/></xsl:variable>
18
+ <xsl:variable name="docnumber_">
19
+ <xsl:choose>
20
+ <xsl:when test="ancestor::*[local-name() = 'doc-container'] and (preceding::mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO'] = $docidentifier or following::mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO'] = $docidentifier)">
21
+ <xsl:variable name="doc_container_id" select="ancestor::*[local-name() = 'doc-container']/@id"/>
22
+ <xsl:value-of select="ancestor::*[local-name() = 'metanorma-collection']//*[local-name() = 'entry'][@target = $doc_container_id]/*[local-name() = 'identifier']"/>
23
+ </xsl:when>
24
+ <xsl:otherwise>
25
+ <xsl:value-of select="$docidentifier"/>
26
+ <xsl:if test="normalize-space($docidentifier) = ''">
27
+ <xsl:value-of select="mn:bibdata/mn:docidentifier[1]"/>
28
+ </xsl:if>
29
+ </xsl:otherwise>
30
+ </xsl:choose>
31
+ </xsl:variable>
32
+ <xsl:variable name="docnumber" select="normalize-space($docnumber_)"/>
33
+ <xsl:variable name="current_document">
34
+ <xsl:copy-of select="."/>
35
+ </xsl:variable>
42
36
 
43
- <xsl:call-template name="processTablesFigures_Contents"/>
44
- </mnx:contents>
37
+ <xsl:for-each select="xalan:nodeset($current_document)"> <!-- <xsl:for-each select="."> -->
38
+ <mnx:doc num="{$num}" firstpage_id="firstpage_id_{$num}" title-part="{$docnumber}" bundle="{$bundle}"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
39
+ <mnx:contents>
40
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
41
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
42
+
43
+ <xsl:call-template name="processTablesFigures_Contents"/>
44
+ </mnx:contents>
45
+ </mnx:doc>
46
+ </xsl:for-each>
47
+ </xsl:for-each>
45
48
  </xsl:variable>
46
49
  <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
47
50
 
@@ -94,6 +97,13 @@
94
97
  <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
95
98
  <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
96
99
  </fo:simple-page-master>
100
+ <fo:simple-page-master master-name="blankpage-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
101
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
102
+ <fo:region-before region-name="header-blank" extent="{$marginTop}mm"/>
103
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
104
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
105
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
106
+ </fo:simple-page-master>
97
107
  <!-- Preface pages -->
98
108
  <fo:page-sequence-master master-name="preface">
99
109
  <fo:repeatable-page-master-alternatives>
@@ -105,7 +115,7 @@
105
115
  </fo:page-sequence-master>
106
116
  <fo:page-sequence-master master-name="preface-landscape">
107
117
  <fo:repeatable-page-master-alternatives>
108
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
118
+ <fo:conditional-page-master-reference master-reference="blankpage-landscape" blank-or-not-blank="blank"/>
109
119
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-landscape"/>
110
120
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-landscape"/>
111
121
  </fo:repeatable-page-master-alternatives>
@@ -127,7 +137,7 @@
127
137
  </fo:page-sequence-master>
128
138
  <fo:page-sequence-master master-name="document-landscape">
129
139
  <fo:repeatable-page-master-alternatives>
130
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
140
+ <fo:conditional-page-master-reference master-reference="blankpage-landscape" blank-or-not-blank="blank"/>
131
141
  <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-landscape"/>
132
142
  <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-landscape"/>
133
143
  </fo:repeatable-page-master-alternatives>
@@ -165,154 +175,213 @@
165
175
  </redirect:write>
166
176
  </xsl:if>
167
177
 
168
- <xsl:for-each select="xalan:nodeset($updated_xml)/*">
169
-
170
- <xsl:call-template name="cover-page"/>
171
-
172
- <xsl:choose>
173
- <xsl:when test="/mn:metanorma/mn:boilerplate/*[not(self::mn:feedback-statement)]">
174
- <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
175
- <xsl:call-template name="insertHeaderFooter">
176
- <xsl:with-param name="font-weight">normal</xsl:with-param>
177
- </xsl:call-template>
178
- <fo:flow flow-name="xsl-region-body">
179
- <fo:block-container margin-left="-1.5mm" margin-right="-1mm">
180
- <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black">
181
- <fo:block-container margin-top="6.5mm" margin-left="7.5mm" margin-right="8.5mm" margin-bottom="7.5mm">
182
- <fo:block-container margin="0">
183
- <fo:block text-align="justify">
184
- <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/*[not(self::mn:feedback-statement)]"/>
185
- </fo:block>
186
- </fo:block-container>
187
- </fo:block-container>
188
- </fo:block-container>
189
- </fo:block-container>
190
- </fo:flow>
191
- </fo:page-sequence>
192
- </xsl:when>
193
- <xsl:otherwise>
194
- <!-- https://github.com/metanorma/metanorma-iho/issues/293:
195
- If the publication has no copyright boxed note (normally on page ii of the publication), page ii should be "Page intentionally left blank". -->
196
- <fo:page-sequence master-reference="blankpage" format="i" force-page-count="no-force">
197
- <xsl:call-template name="insertHeaderFooterBlank"/>
198
- <fo:flow flow-name="xsl-region-body">
199
- <fo:block/>
200
- </fo:flow>
201
- </fo:page-sequence>
202
- </xsl:otherwise>
203
- </xsl:choose>
178
+ <!-- <xsl:for-each select="xalan:nodeset($updated_xml)/*"> -->
179
+ <xsl:for-each select="xalan:nodeset($updated_xml)//mn:metanorma">
180
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
204
181
 
205
- <xsl:variable name="updated_xml_with_pages">
206
- <xsl:call-template name="processPrefaceAndMainSectionsIHO_items"/>
182
+ <xsl:variable name="current_document">
183
+ <xsl:copy-of select="."/>
207
184
  </xsl:variable>
208
185
 
209
- <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
186
+ <xsl:for-each select="xalan:nodeset($current_document)">
210
187
 
211
- <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
188
+ <xsl:variable name="title-en"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']/node()"/></xsl:variable>
189
+ <xsl:variable name="title-main_"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'main']/node()"/></xsl:variable>
212
190
 
213
- <!-- Preface Pages -->
214
- <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
191
+ <xsl:variable name="title_header">
192
+ <xsl:copy-of select="$title-main_"/>
193
+ <xsl:if test="normalize-space($title-main_) = ''"><xsl:copy-of select="$title-en"/></xsl:if>
194
+ </xsl:variable>
215
195
 
216
- <xsl:attribute name="master-reference">
217
- <xsl:text>preface</xsl:text>
218
- <xsl:call-template name="getPageSequenceOrientation"/>
219
- </xsl:attribute>
196
+ <xsl:variable name="docidentifier_parent" select="normalize-space(/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO-parent-document'])"/>
197
+ <xsl:variable name="docidentifier">
198
+ <xsl:value-of select="$docidentifier_parent"/>
199
+ <xsl:if test="$docidentifier_parent = ''"><xsl:value-of select="/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'IHO']"/></xsl:if>
200
+ </xsl:variable>
220
201
 
221
- <xsl:call-template name="insertFootnoteSeparatorCommon"/>
222
- <xsl:call-template name="insertHeaderFooter">
223
- <xsl:with-param name="font-weight">normal</xsl:with-param>
224
- </xsl:call-template>
225
- <fo:flow flow-name="xsl-region-body">
202
+ <xsl:variable name="copyrightText" select="concat('© International Hydrographic Association ', /mn:metanorma/mn:bibdata/mn:copyright/mn:from ,' – All rights reserved')"/>
203
+ <xsl:variable name="edition"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:edition[normalize-space(@language) = '']"/></xsl:variable>
204
+ <xsl:variable name="month_year"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:date[@type = 'published']"/></xsl:variable>
205
+
206
+ <xsl:call-template name="cover-page">
207
+ <xsl:with-param name="num" select="$num"/>
208
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
209
+ <xsl:with-param name="edition" select="$edition"/>
210
+ <xsl:with-param name="month_year" select="$month_year"/>
211
+ </xsl:call-template>
226
212
 
227
- <!-- <xsl:if test="position() = 1">
213
+ <xsl:choose>
214
+ <xsl:when test="/mn:metanorma/mn:boilerplate/*[not(self::mn:feedback-statement)]">
215
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
216
+ <xsl:call-template name="insertHeaderFooter">
217
+ <xsl:with-param name="title_header" select="$title_header"/>
218
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
219
+ <xsl:with-param name="edition" select="$edition"/>
220
+ <xsl:with-param name="month_year" select="$month_year"/>
221
+ <xsl:with-param name="font-weight">normal</xsl:with-param>
222
+ </xsl:call-template>
223
+ <fo:flow flow-name="xsl-region-body">
228
224
  <fo:block-container margin-left="-1.5mm" margin-right="-1mm">
229
- <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black" >
225
+ <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black">
230
226
  <fo:block-container margin-top="6.5mm" margin-left="7.5mm" margin-right="8.5mm" margin-bottom="7.5mm">
231
227
  <fo:block-container margin="0">
232
228
  <fo:block text-align="justify">
233
- <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/*[local-name() != 'feedback-statement']"/>
229
+ <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/*[not(self::mn:feedback-statement)]"/>
234
230
  </fo:block>
235
231
  </fo:block-container>
236
232
  </fo:block-container>
237
233
  </fo:block-container>
238
234
  </fo:block-container>
239
- <fo:block break-after="page"/>
240
- </xsl:if> -->
235
+ </fo:flow>
236
+ </fo:page-sequence>
237
+ </xsl:when>
238
+ <xsl:otherwise>
239
+ <!-- https://github.com/metanorma/metanorma-iho/issues/293:
240
+ If the publication has no copyright boxed note (normally on page ii of the publication), page ii should be "Page intentionally left blank". -->
241
+ <fo:page-sequence master-reference="blankpage" format="i" force-page-count="no-force">
242
+ <xsl:call-template name="insertHeaderFooterBlank">
243
+ <xsl:with-param name="title_header" select="$title_header"/>
244
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
245
+ <xsl:with-param name="edition" select="$edition"/>
246
+ <xsl:with-param name="month_year" select="$month_year"/>
247
+ </xsl:call-template>
248
+ <fo:flow flow-name="xsl-region-body">
249
+ <fo:block/>
250
+ </fo:flow>
251
+ </fo:page-sequence>
252
+ </xsl:otherwise>
253
+ </xsl:choose>
241
254
 
242
- <!-- Contents, Document History, ... except Foreword and Introduction -->
243
- <!-- <xsl:call-template name="processPrefaceSectionsDefault"/> -->
244
- <xsl:apply-templates select="*[not(self::mn:foreword) and not(self::mn:introduction)]"/>
255
+ <xsl:variable name="updated_xml_with_pages">
256
+ <xsl:call-template name="processPrefaceAndMainSectionsIHO_items"/>
257
+ </xsl:variable>
245
258
 
246
- </fo:flow>
247
- </fo:page-sequence>
248
- <!-- End Preface Pages -->
249
- <!-- =========================== -->
250
- <!-- =========================== -->
251
- </xsl:for-each>
259
+ <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
252
260
 
253
- <xsl:for-each select=".//mn:page_sequence[mn:foreword or mn:introduction][parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
261
+ <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
254
262
 
255
- <!-- Preface Pages -->
256
- <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
263
+ <!-- Preface Pages -->
264
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
257
265
 
258
- <xsl:attribute name="master-reference">
259
- <xsl:text>preface</xsl:text>
260
- <xsl:call-template name="getPageSequenceOrientation"/>
261
- </xsl:attribute>
266
+ <xsl:attribute name="master-reference">
267
+ <xsl:text>preface</xsl:text>
268
+ <xsl:call-template name="getPageSequenceOrientation"/>
269
+ </xsl:attribute>
262
270
 
263
- <xsl:call-template name="insertFootnoteSeparatorCommon"/>
264
- <xsl:call-template name="insertHeaderFooter">
265
- <xsl:with-param name="font-weight">normal</xsl:with-param>
266
- </xsl:call-template>
267
- <fo:flow flow-name="xsl-region-body">
271
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
272
+ <xsl:call-template name="insertHeaderFooter">
273
+ <xsl:with-param name="title_header" select="$title_header"/>
274
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
275
+ <xsl:with-param name="edition" select="$edition"/>
276
+ <xsl:with-param name="month_year" select="$month_year"/>
277
+ <xsl:with-param name="font-weight">normal</xsl:with-param>
278
+ <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
279
+ </xsl:call-template>
280
+ <fo:flow flow-name="xsl-region-body">
281
+
282
+ <!-- <xsl:if test="position() = 1">
283
+ <fo:block-container margin-left="-1.5mm" margin-right="-1mm">
284
+ <fo:block-container margin-left="0mm" margin-right="0mm" border="0.5pt solid black" >
285
+ <fo:block-container margin-top="6.5mm" margin-left="7.5mm" margin-right="8.5mm" margin-bottom="7.5mm">
286
+ <fo:block-container margin="0">
287
+ <fo:block text-align="justify">
288
+ <xsl:apply-templates select="/mn:metanorma/mn:boilerplate/*[local-name() != 'feedback-statement']"/>
289
+ </fo:block>
290
+ </fo:block-container>
291
+ </fo:block-container>
292
+ </fo:block-container>
293
+ </fo:block-container>
294
+ <fo:block break-after="page"/>
295
+ </xsl:if> -->
268
296
 
269
- <!-- Foreword, Introduction -->
270
- <xsl:apply-templates select="*[self::mn:foreword or self::mn:introduction]"/>
297
+ <!-- Contents, Document History, ... except Foreword and Introduction -->
298
+ <!-- <xsl:call-template name="processPrefaceSectionsDefault"/> -->
299
+ <xsl:apply-templates select="*[not(self::mn:foreword) and not(self::mn:introduction)]">
300
+ <xsl:with-param name="num" select="$num"/>
301
+ </xsl:apply-templates>
271
302
 
272
- </fo:flow>
273
- </fo:page-sequence>
274
- <!-- End Preface Pages -->
275
- <!-- =========================== -->
276
- <!-- =========================== -->
277
- </xsl:for-each>
303
+ </fo:flow>
304
+ </fo:page-sequence>
305
+ <!-- End Preface Pages -->
306
+ <!-- =========================== -->
307
+ <!-- =========================== -->
308
+ </xsl:for-each>
278
309
 
279
- <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
310
+ <xsl:for-each select=".//mn:page_sequence[mn:foreword or mn:introduction][parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
280
311
 
281
- <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
312
+ <!-- Preface Pages -->
313
+ <fo:page-sequence master-reference="preface" format="i" force-page-count="end-on-even">
282
314
 
283
- <xsl:attribute name="master-reference">
284
- <xsl:text>document</xsl:text>
285
- <xsl:call-template name="getPageSequenceOrientation"/>
286
- </xsl:attribute>
315
+ <xsl:attribute name="master-reference">
316
+ <xsl:text>preface</xsl:text>
317
+ <xsl:call-template name="getPageSequenceOrientation"/>
318
+ </xsl:attribute>
287
319
 
288
- <xsl:if test="position() = 1">
289
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
290
- </xsl:if>
320
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
321
+ <xsl:call-template name="insertHeaderFooter">
322
+ <xsl:with-param name="title_header" select="$title_header"/>
323
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
324
+ <xsl:with-param name="edition" select="$edition"/>
325
+ <xsl:with-param name="month_year" select="$month_year"/>
326
+ <xsl:with-param name="font-weight">normal</xsl:with-param>
327
+ <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
328
+ </xsl:call-template>
329
+ <fo:flow flow-name="xsl-region-body">
291
330
 
292
- <xsl:call-template name="insertFootnoteSeparatorCommon"/>
293
- <xsl:call-template name="insertHeaderFooter"/>
294
- <fo:flow flow-name="xsl-region-body">
295
- <fo:block-container>
331
+ <!-- Foreword, Introduction -->
332
+ <xsl:apply-templates select="*[self::mn:foreword or self::mn:introduction]"/>
296
333
 
297
- <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-en"/></fo:block> -->
334
+ </fo:flow>
335
+ </fo:page-sequence>
336
+ <!-- End Preface Pages -->
337
+ <!-- =========================== -->
338
+ <!-- =========================== -->
339
+ </xsl:for-each>
298
340
 
299
- <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" /> -->
300
- <!-- Normative references -->
301
- <!-- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" /> -->
302
- <!-- Terms and definitions -->
303
- <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']" />
304
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']" />
305
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]" /> -->
341
+ <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
306
342
 
307
- <!-- <xsl:call-template name="processMainSectionsDefault"/> -->
343
+ <fo:page-sequence master-reference="document" format="1" force-page-count="end-on-even">
308
344
 
309
- <xsl:apply-templates/>
345
+ <xsl:attribute name="master-reference">
346
+ <xsl:text>document</xsl:text>
347
+ <xsl:call-template name="getPageSequenceOrientation"/>
348
+ </xsl:attribute>
310
349
 
311
- <xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
312
- </fo:block-container>
313
- </fo:flow>
314
- </fo:page-sequence>
315
- <!-- </xsl:if> -->
350
+ <xsl:if test="position() = 1">
351
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
352
+ </xsl:if>
353
+
354
+ <xsl:call-template name="insertFootnoteSeparatorCommon"/>
355
+ <xsl:call-template name="insertHeaderFooter">
356
+ <xsl:with-param name="title_header" select="$title_header"/>
357
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
358
+ <xsl:with-param name="edition" select="$edition"/>
359
+ <xsl:with-param name="month_year" select="$month_year"/>
360
+ <xsl:with-param name="orientation"><xsl:call-template name="getPageSequenceOrientation"/></xsl:with-param>
361
+ </xsl:call-template>
362
+ <fo:flow flow-name="xsl-region-body">
363
+ <fo:block-container>
364
+
365
+ <!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1"><xsl:value-of select="$title-en"/></fo:block> -->
366
+
367
+ <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" /> -->
368
+ <!-- Normative references -->
369
+ <!-- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" /> -->
370
+ <!-- Terms and definitions -->
371
+ <!-- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']" />
372
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']" />
373
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]" /> -->
374
+
375
+ <!-- <xsl:call-template name="processMainSectionsDefault"/> -->
376
+
377
+ <xsl:apply-templates/>
378
+
379
+ <xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
380
+ </fo:block-container>
381
+ </fo:flow>
382
+ </fo:page-sequence>
383
+ <!-- </xsl:if> -->
384
+ </xsl:for-each>
316
385
  </xsl:for-each>
317
386
  </xsl:for-each>
318
387
 
@@ -362,11 +431,31 @@
362
431
  </xsl:template>
363
432
 
364
433
  <xsl:template name="cover-page">
434
+ <xsl:param name="num"/>
435
+ <xsl:param name="docidentifier"/>
436
+ <xsl:param name="edition"/>
437
+ <xsl:param name="month_year"/>
438
+
439
+ <xsl:variable name="title-en"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@language = 'en']/node()"/></xsl:variable>
440
+ <xsl:variable name="title-main_"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'main']/node()"/></xsl:variable>
441
+ <xsl:variable name="title-main"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-main']/node()"/></xsl:variable>
442
+ <xsl:variable name="title-appendix"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-appendix']/node()"/></xsl:variable>
443
+ <xsl:variable name="title-annex"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-annex']/node()"/></xsl:variable>
444
+ <xsl:variable name="title-part"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-part']/node()"/></xsl:variable>
445
+ <xsl:variable name="title-supplement"><xsl:apply-templates select="/mn:metanorma/mn:bibdata/mn:title[@type = 'title-supplement']/node()"/></xsl:variable>
446
+
365
447
  <!-- =========================== -->
366
448
  <!-- Cover Page -->
367
449
  <fo:page-sequence master-reference="cover-page">
368
450
  <fo:flow flow-name="xsl-region-body">
369
451
 
452
+ <fo:block-container absolute-position="fixed" top="1mm">
453
+ <xsl:if test="$num = 1">
454
+ <xsl:attribute name="id">firstpage_id_0</xsl:attribute>
455
+ </xsl:if>
456
+ <fo:block id="firstpage_id_{$num}"> </fo:block>
457
+ </fo:block-container>
458
+
370
459
  <xsl:variable name="isCoverPageImage" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and 1 = 1)"/>
371
460
 
372
461
  <xsl:variable name="document_scheme" select="normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'document-scheme']/mn:value)"/>
@@ -377,7 +466,7 @@
377
466
  </xsl:when>
378
467
  <xsl:otherwise>
379
468
 
380
- <fo:block-container position="absolute" left="14.25mm" top="12mm" id="__internal_layout__coverpage_{generate-id()}">
469
+ <fo:block-container position="absolute" left="14.25mm" top="12mm" id="__internal_layout__coverpage_{$num}_{generate-id()}">
381
470
  <fo:table table-layout="fixed" width="181.1mm">
382
471
  <fo:table-column column-width="26mm"/>
383
472
  <fo:table-column column-width="19.4mm"/>
@@ -588,6 +677,7 @@
588
677
  </xsl:template>
589
678
 
590
679
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="4">
680
+ <xsl:param name="num"/>
591
681
  <!-- Table of Contents -->
592
682
  <fo:block>
593
683
 
@@ -603,7 +693,7 @@
603
693
 
604
694
  <fo:block role="TOC" xsl:use-attribute-sets="toc-style">
605
695
 
606
- <xsl:for-each select="$contents//mnx:item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
696
+ <xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
607
697
  <fo:block role="TOCI">
608
698
  <fo:list-block xsl:use-attribute-sets="toc-item-block-style">
609
699
 
@@ -611,7 +701,7 @@
611
701
 
612
702
  <fo:list-item>
613
703
  <fo:list-item-label end-indent="label-end()">
614
- <fo:block id="__internal_layout__toc_sectionnum_{generate-id()}">
704
+ <fo:block id="__internal_layout__toc_sectionnum_{$num}_{generate-id()}">
615
705
  <xsl:if test="@section != '' and not(@type = 'annex')"> <!-- output below -->
616
706
  <xsl:value-of select="@section"/>
617
707
  </xsl:if>
@@ -767,7 +857,7 @@
767
857
  <fo:inline><xsl:copy-of select="@id"/><xsl:apply-templates/></fo:inline>
768
858
  </xsl:template>
769
859
 
770
- <xsl:template match="/mn:metanorma/mn:bibdata/mn:edition">
860
+ <xsl:template match="mn:metanorma/mn:bibdata/mn:edition">
771
861
  <xsl:call-template name="capitalize">
772
862
  <xsl:with-param name="str">
773
863
  <xsl:call-template name="getLocalizedString">
@@ -779,7 +869,7 @@
779
869
  <xsl:apply-templates/>
780
870
  </xsl:template>
781
871
 
782
- <xsl:template match="/mn:metanorma/mn:bibdata/mn:date[@type = 'published']">
872
+ <xsl:template match="mn:metanorma/mn:bibdata/mn:date[@type = 'published']">
783
873
  <xsl:call-template name="convertDate">
784
874
  <xsl:with-param name="date" select="."/>
785
875
  <xsl:with-param name="format" select="'short'"/>
@@ -804,15 +894,21 @@
804
894
  <!-- title -->
805
895
  <!-- ====== -->
806
896
 
807
- <xsl:template match="mn:annex/mn:fmt-title">
808
- <fo:block font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always" role="H1">
897
+ <xsl:template match="mn:annex/mn:fmt-title" name="annex_title">
898
+ <fo:block xsl:use-attribute-sets="annex-title-style">
899
+
900
+ <xsl:call-template name="refine_annex-title-style"/>
901
+
809
902
  <xsl:apply-templates/>
810
903
  <xsl:apply-templates select="following-sibling::*[1][mn:variant-title][@type = 'sub']" mode="subtitle"/>
811
904
  </fo:block>
812
905
  </xsl:template>
813
906
 
814
907
  <xsl:template match="mn:bibliography/mn:references[not(@normative='true')]/mn:fmt-title">
815
- <fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always" role="H1">
908
+ <fo:block xsl:use-attribute-sets="references-non-normative-title-style">
909
+
910
+ <xsl:call-template name="refine_references-non-normative-title-style"/>
911
+
816
912
  <xsl:apply-templates/>
817
913
  </fo:block>
818
914
  </xsl:template>
@@ -959,10 +1055,16 @@
959
1055
  <xsl:attribute name="space-after">0pt</xsl:attribute>
960
1056
  </xsl:if>
961
1057
 
1058
+ <xsl:if test="ancestor::mn:li and ancestor::mn:table">
1059
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
1060
+ </xsl:if>
1061
+
962
1062
  <xsl:if test=".//mn:fn">
963
1063
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
964
1064
  </xsl:if>
965
1065
 
1066
+ <xsl:copy-of select="@id"/>
1067
+
966
1068
  <xsl:apply-templates>
967
1069
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
968
1070
  </xsl:apply-templates>
@@ -1016,7 +1118,12 @@
1016
1118
  <xsl:template match="mn:index"/>
1017
1119
 
1018
1120
  <xsl:template name="insertHeaderFooter">
1121
+ <xsl:param name="title_header"/>
1122
+ <xsl:param name="docidentifier"/>
1123
+ <xsl:param name="edition"/>
1124
+ <xsl:param name="month_year"/>
1019
1125
  <xsl:param name="font-weight" select="'bold'"/>
1126
+ <xsl:param name="orientation"/>
1020
1127
  <fo:static-content flow-name="header-odd" role="artifact">
1021
1128
  <fo:block-container height="100%" font-size="8pt">
1022
1129
  <fo:block padding-top="12.5mm">
@@ -1053,10 +1160,19 @@
1053
1160
  </fo:block>
1054
1161
  </fo:block-container>
1055
1162
  </fo:static-content>
1056
- <xsl:call-template name="insertHeaderBlank"/>
1057
- <xsl:call-template name="insertFooter"/>
1163
+ <xsl:call-template name="insertHeaderBlank">
1164
+ <xsl:with-param name="title_header" select="$title_header"/>
1165
+ <xsl:with-param name="orientation" select="$orientation"/>
1166
+ </xsl:call-template>
1167
+ <xsl:call-template name="insertFooter">
1168
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
1169
+ <xsl:with-param name="edition" select="$edition"/>
1170
+ <xsl:with-param name="month_year" select="$month_year"/>
1171
+ </xsl:call-template>
1058
1172
  </xsl:template>
1059
1173
  <xsl:template name="insertHeaderBlank">
1174
+ <xsl:param name="title_header"/>
1175
+ <xsl:param name="orientation"/>
1060
1176
  <fo:static-content flow-name="header-blank" role="artifact">
1061
1177
  <fo:block-container height="100%" font-size="8pt">
1062
1178
  <fo:block padding-top="12.5mm">
@@ -1075,11 +1191,18 @@
1075
1191
  </fo:block>
1076
1192
  </fo:block-container>
1077
1193
  <fo:block-container position="absolute" left="40.5mm" top="130mm" height="4mm" width="79mm" border="0.75pt solid black" text-align="center" display-align="center" line-height="100%">
1194
+ <xsl:if test="$orientation = '-landscape'">
1195
+ <xsl:attribute name="left">84mm</xsl:attribute>
1196
+ <xsl:attribute name="top">87mm</xsl:attribute>
1197
+ </xsl:if>
1078
1198
  <fo:block>Page intentionally left blank</fo:block>
1079
1199
  </fo:block-container>
1080
1200
  </fo:static-content>
1081
1201
  </xsl:template>
1082
1202
  <xsl:template name="insertFooter">
1203
+ <xsl:param name="docidentifier"/>
1204
+ <xsl:param name="edition"/>
1205
+ <xsl:param name="month_year"/>
1083
1206
  <fo:static-content flow-name="footer" role="artifact">
1084
1207
  <fo:block-container height="100%" display-align="after">
1085
1208
  <fo:block padding-bottom="12.5mm" font-size="8pt" text-align-last="justify">
@@ -1097,8 +1220,18 @@
1097
1220
  </fo:static-content>
1098
1221
  </xsl:template>
1099
1222
  <xsl:template name="insertHeaderFooterBlank">
1100
- <xsl:call-template name="insertHeaderBlank"/>
1101
- <xsl:call-template name="insertFooter"/>
1223
+ <xsl:param name="title_header"/>
1224
+ <xsl:param name="docidentifier"/>
1225
+ <xsl:param name="edition"/>
1226
+ <xsl:param name="month_year"/>
1227
+ <xsl:call-template name="insertHeaderBlank">
1228
+ <xsl:with-param name="title_header" select="$title_header"/>
1229
+ </xsl:call-template>
1230
+ <xsl:call-template name="insertFooter">
1231
+ <xsl:with-param name="docidentifier" select="$docidentifier"/>
1232
+ <xsl:with-param name="edition" select="$edition"/>
1233
+ <xsl:with-param name="month_year" select="$month_year"/>
1234
+ </xsl:call-template>
1102
1235
  </xsl:template>
1103
1236
 
1104
1237
  <xsl:variable name="Image-IHO-SVG">
@@ -2763,10 +2896,16 @@
2763
2896
  <xsl:attribute-set name="license-statement-style">
2764
2897
  </xsl:attribute-set> <!-- license-statement-style -->
2765
2898
 
2899
+ <xsl:template name="refine_license-statement-style">
2900
+ </xsl:template>
2901
+
2766
2902
  <xsl:attribute-set name="license-statement-title-style">
2767
2903
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2768
2904
  </xsl:attribute-set> <!-- license-statement-title-style -->
2769
2905
 
2906
+ <xsl:template name="refine_license-statement-title-style">
2907
+ </xsl:template>
2908
+
2770
2909
  <xsl:attribute-set name="license-statement-p-style">
2771
2910
  </xsl:attribute-set> <!-- license-statement-p-style -->
2772
2911
 
@@ -2777,23 +2916,47 @@
2777
2916
  <xsl:attribute-set name="legal-statement-style">
2778
2917
  </xsl:attribute-set> <!-- legal-statement-style -->
2779
2918
 
2919
+ <xsl:template name="refine_legal-statement-style">
2920
+ </xsl:template>
2921
+
2780
2922
  <xsl:attribute-set name="legal-statement-title-style">
2781
2923
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2782
2924
  </xsl:attribute-set> <!-- legal-statement-title-style -->
2783
2925
 
2926
+ <xsl:template name="refine_legal-statement-title-style">
2927
+ </xsl:template>
2928
+
2784
2929
  <xsl:attribute-set name="legal-statement-p-style">
2785
2930
  </xsl:attribute-set> <!-- legal-statement-p-style -->
2786
2931
 
2932
+ <xsl:template name="refine_legal-statement-p-style">
2933
+ <xsl:if test="@align">
2934
+ <xsl:attribute name="text-align">
2935
+ <xsl:value-of select="@align"/>
2936
+ </xsl:attribute>
2937
+ </xsl:if>
2938
+ </xsl:template>
2939
+
2787
2940
  <xsl:attribute-set name="feedback-statement-style">
2788
2941
  </xsl:attribute-set> <!-- feedback-statement-style -->
2789
2942
 
2943
+ <xsl:template name="refine_feedback-statement-style">
2944
+ </xsl:template>
2945
+
2790
2946
  <xsl:attribute-set name="feedback-statement-title-style">
2791
2947
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2792
2948
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
2793
2949
 
2950
+ <xsl:template name="refine_feedback-statement-title-style">
2951
+
2952
+ </xsl:template>
2953
+
2794
2954
  <xsl:attribute-set name="feedback-statement-p-style">
2795
2955
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
2796
2956
 
2957
+ <xsl:template name="refine_feedback-statement-p-style">
2958
+ </xsl:template>
2959
+
2797
2960
  <!-- End boilerplate sections styles -->
2798
2961
 
2799
2962
  <!-- ================================= -->
@@ -2819,6 +2982,7 @@
2819
2982
 
2820
2983
  <xsl:template match="mn:license-statement">
2821
2984
  <fo:block xsl:use-attribute-sets="license-statement-style">
2985
+ <xsl:call-template name="refine_license-statement-style"/>
2822
2986
  <xsl:apply-templates/>
2823
2987
  </fo:block>
2824
2988
  </xsl:template> <!-- license-statement -->
@@ -2836,6 +3000,7 @@
2836
3000
  <xsl:template match="mn:legal-statement">
2837
3001
  <xsl:param name="isLegacy">false</xsl:param>
2838
3002
  <fo:block xsl:use-attribute-sets="legal-statement-style">
3003
+ <xsl:call-template name="refine_legal-statement-style"/>
2839
3004
  <xsl:apply-templates/>
2840
3005
  </fo:block>
2841
3006
  </xsl:template> <!-- legal-statement -->
@@ -3005,6 +3170,27 @@
3005
3170
  <xsl:attribute-set name="sourcecode-container-style">
3006
3171
  </xsl:attribute-set>
3007
3172
 
3173
+ <xsl:template name="refine_sourcecode-container-style">
3174
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3175
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3176
+ </xsl:if>
3177
+
3178
+ <xsl:if test="ancestor::mn:example">
3179
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3180
+ </xsl:if>
3181
+
3182
+ <xsl:copy-of select="@id"/>
3183
+
3184
+ <xsl:if test="parent::mn:note">
3185
+ <xsl:attribute name="margin-left">
3186
+ <xsl:choose>
3187
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
3188
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3189
+ </xsl:choose>
3190
+ </xsl:attribute>
3191
+ </xsl:if>
3192
+ </xsl:template>
3193
+
3008
3194
  <xsl:attribute-set name="sourcecode-style">
3009
3195
  <xsl:attribute name="white-space">pre</xsl:attribute>
3010
3196
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -3026,6 +3212,9 @@
3026
3212
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3027
3213
  </xsl:attribute-set> <!-- sourcecode-name-style -->
3028
3214
 
3215
+ <xsl:template name="refine_sourcecode-name-style">
3216
+ </xsl:template>
3217
+
3029
3218
  <xsl:template name="add-zero-spaces-equal">
3030
3219
  <xsl:param name="text" select="."/>
3031
3220
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -3113,24 +3302,8 @@
3113
3302
  <xsl:otherwise>
3114
3303
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
3115
3304
 
3116
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
3117
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3118
- </xsl:if>
3305
+ <xsl:call-template name="refine_sourcecode-container-style"/>
3119
3306
 
3120
- <xsl:if test="ancestor::mn:example">
3121
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
3122
- </xsl:if>
3123
-
3124
- <xsl:copy-of select="@id"/>
3125
-
3126
- <xsl:if test="parent::mn:note">
3127
- <xsl:attribute name="margin-left">
3128
- <xsl:choose>
3129
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
3130
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3131
- </xsl:choose>
3132
- </xsl:attribute>
3133
- </xsl:if>
3134
3307
  <fo:block-container margin-left="0mm" role="SKIP">
3135
3308
 
3136
3309
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -3457,6 +3630,7 @@
3457
3630
  <xsl:template match="mn:sourcecode/mn:fmt-name">
3458
3631
  <xsl:if test="normalize-space() != ''">
3459
3632
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3633
+ <xsl:call-template name="refine_sourcecode-name-style"/>
3460
3634
  <xsl:apply-templates/>
3461
3635
  </fo:block>
3462
3636
  </xsl:if>
@@ -3505,12 +3679,31 @@
3505
3679
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3506
3680
  <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
3507
3681
  <xsl:attribute name="line-height">113%</xsl:attribute>
3508
- </xsl:attribute-set>
3682
+ </xsl:attribute-set> <!-- pre-style -->
3683
+
3684
+ <xsl:template name="refine_pre-style">
3685
+ </xsl:template>
3509
3686
 
3510
3687
  <xsl:attribute-set name="tt-style">
3511
3688
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
3512
3689
  </xsl:attribute-set>
3513
3690
 
3691
+ <xsl:template name="refine_tt-style">
3692
+ <xsl:variable name="_font-size">9.5 <!-- inherit -->
3693
+ </xsl:variable>
3694
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3695
+ <xsl:if test="$font-size != ''">
3696
+ <xsl:attribute name="font-size">
3697
+ <xsl:choose>
3698
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3699
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3700
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3701
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3702
+ </xsl:choose>
3703
+ </xsl:attribute>
3704
+ </xsl:if>
3705
+ </xsl:template>
3706
+
3514
3707
  <xsl:variable name="color-added-text">
3515
3708
  <xsl:text>rgb(0, 255, 0)</xsl:text>
3516
3709
  </xsl:variable>
@@ -3523,9 +3716,14 @@
3523
3716
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
3524
3717
  </xsl:attribute-set>
3525
3718
 
3719
+ <xsl:template name="refine_add-style">
3720
+ </xsl:template>
3721
+
3526
3722
  <xsl:variable name="add-style">
3527
- <add-style xsl:use-attribute-sets="add-style"/>
3528
- </xsl:variable>
3723
+ <add-style xsl:use-attribute-sets="add-style">
3724
+ <xsl:call-template name="refine_add-style"/>
3725
+ </add-style>
3726
+ </xsl:variable>
3529
3727
  <xsl:template name="append_add-style">
3530
3728
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
3531
3729
  </xsl:template>
@@ -3538,24 +3736,77 @@
3538
3736
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3539
3737
  </xsl:attribute-set>
3540
3738
 
3739
+ <xsl:template name="refine_del-style">
3740
+ </xsl:template>
3741
+
3742
+ <xsl:attribute-set name="strong-style">
3743
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3744
+ </xsl:attribute-set>
3745
+
3746
+ <xsl:template name="refine_strong_style">
3747
+ <xsl:if test="ancestor::*['preferred']">
3748
+ <xsl:attribute name="role">SKIP</xsl:attribute>
3749
+ </xsl:if>
3750
+ </xsl:template> <!-- refine_strong_style -->
3751
+
3752
+ <xsl:attribute-set name="em-style">
3753
+ <xsl:attribute name="font-style">italic</xsl:attribute>
3754
+ </xsl:attribute-set>
3755
+
3756
+ <xsl:template name="refine_em_style">
3757
+ </xsl:template> <!-- refine_em_style -->
3758
+
3759
+ <xsl:attribute-set name="sup-style">
3760
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3761
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3762
+ </xsl:attribute-set>
3763
+
3764
+ <xsl:template name="refine_sup-style">
3765
+ </xsl:template>
3766
+
3767
+ <xsl:attribute-set name="sub-style">
3768
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3769
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
3770
+ </xsl:attribute-set>
3771
+
3772
+ <xsl:template name="refine_sub-style">
3773
+ </xsl:template>
3774
+
3775
+ <xsl:attribute-set name="underline-style">
3776
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3777
+ </xsl:attribute-set>
3778
+
3779
+ <xsl:template name="refine_underline-style">
3780
+ </xsl:template>
3781
+
3782
+ <xsl:attribute-set name="hi-style">
3783
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
3784
+ </xsl:attribute-set>
3785
+
3786
+ <xsl:template name="refine_hi-style">
3787
+ </xsl:template>
3788
+
3789
+ <xsl:attribute-set name="strike-style">
3790
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
3791
+ </xsl:attribute-set>
3792
+
3793
+ <xsl:template name="refine_strike-style">
3794
+ </xsl:template>
3795
+
3541
3796
  <xsl:template match="mn:br">
3542
3797
  <xsl:value-of select="$linebreak"/>
3543
3798
  </xsl:template>
3544
3799
 
3545
- <xsl:template match="mn:em">
3546
- <fo:inline font-style="italic">
3547
- <xsl:call-template name="refine_italic_style"/>
3800
+ <xsl:template match="mn:em">
3801
+ <fo:inline xsl:use-attribute-sets="em-style">
3802
+ <xsl:call-template name="refine_em_style"/>
3548
3803
  <xsl:apply-templates/>
3549
3804
  </fo:inline>
3550
3805
  </xsl:template>
3551
3806
 
3552
- <xsl:template name="refine_italic_style">
3553
- </xsl:template>
3554
-
3555
3807
  <xsl:template match="mn:strong | *[local-name()='b']">
3556
3808
  <xsl:param name="split_keep-within-line"/>
3557
- <fo:inline font-weight="bold">
3558
-
3809
+ <fo:inline xsl:use-attribute-sets="strong-style">
3559
3810
  <xsl:call-template name="refine_strong_style"/>
3560
3811
 
3561
3812
  <xsl:apply-templates>
@@ -3564,44 +3815,27 @@
3564
3815
  </fo:inline>
3565
3816
  </xsl:template>
3566
3817
 
3567
- <xsl:template name="refine_strong_style">
3568
- <xsl:if test="ancestor::*['preferred']">
3569
- <xsl:attribute name="role">SKIP</xsl:attribute>
3570
- </xsl:if>
3571
- </xsl:template>
3572
-
3573
3818
  <xsl:template match="*[local-name()='padding']">
3574
3819
  <fo:inline padding-right="{@value}"> </fo:inline>
3575
3820
  </xsl:template>
3576
3821
 
3577
3822
  <xsl:template match="mn:sup">
3578
- <fo:inline font-size="80%" vertical-align="super">
3823
+ <fo:inline xsl:use-attribute-sets="sup-style">
3824
+ <xsl:call-template name="refine_sup-style"/>
3579
3825
  <xsl:apply-templates/>
3580
3826
  </fo:inline>
3581
3827
  </xsl:template>
3582
3828
 
3583
3829
  <xsl:template match="mn:sub">
3584
- <fo:inline font-size="80%" vertical-align="sub">
3830
+ <fo:inline xsl:use-attribute-sets="sub-style">
3831
+ <xsl:call-template name="refine_sub-style"/>
3585
3832
  <xsl:apply-templates/>
3586
3833
  </fo:inline>
3587
3834
  </xsl:template>
3588
3835
 
3589
3836
  <xsl:template match="mn:tt">
3590
3837
  <fo:inline xsl:use-attribute-sets="tt-style">
3591
-
3592
- <xsl:variable name="_font-size">9.5 <!-- inherit -->
3593
- </xsl:variable>
3594
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3595
- <xsl:if test="$font-size != ''">
3596
- <xsl:attribute name="font-size">
3597
- <xsl:choose>
3598
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
3599
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
3600
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3601
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3602
- </xsl:choose>
3603
- </xsl:attribute>
3604
- </xsl:if>
3838
+ <xsl:call-template name="refine_tt-style"/>
3605
3839
  <xsl:apply-templates/>
3606
3840
  </fo:inline>
3607
3841
  </xsl:template> <!-- tt -->
@@ -3620,7 +3854,8 @@
3620
3854
  </xsl:template>
3621
3855
 
3622
3856
  <xsl:template match="mn:underline">
3623
- <fo:inline text-decoration="underline">
3857
+ <fo:inline xsl:use-attribute-sets="underline-style">
3858
+ <xsl:call-template name="refine_underline-style"/>
3624
3859
  <xsl:apply-templates/>
3625
3860
  </fo:inline>
3626
3861
  </xsl:template>
@@ -3778,6 +4013,7 @@
3778
4013
 
3779
4014
  <xsl:template match="mn:del">
3780
4015
  <fo:inline xsl:use-attribute-sets="del-style">
4016
+ <xsl:call-template name="refine_del-style"/>
3781
4017
  <xsl:apply-templates/>
3782
4018
  </fo:inline>
3783
4019
  </xsl:template>
@@ -3787,7 +4023,8 @@
3787
4023
 
3788
4024
  <!-- highlight text -->
3789
4025
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
3790
- <fo:inline background-color="yellow">
4026
+ <fo:inline xsl:use-attribute-sets="hi-style">
4027
+ <xsl:call-template name="refine_hi-style"/>
3791
4028
  <xsl:apply-templates/>
3792
4029
  </fo:inline>
3793
4030
  </xsl:template>
@@ -3873,7 +4110,8 @@
3873
4110
  </xsl:template>
3874
4111
 
3875
4112
  <xsl:template match="mn:strike">
3876
- <fo:inline text-decoration="line-through">
4113
+ <fo:inline xsl:use-attribute-sets="strike-style">
4114
+ <xsl:call-template name="refine_strike-style"/>
3877
4115
  <xsl:apply-templates/>
3878
4116
  </fo:inline>
3879
4117
  </xsl:template>
@@ -3953,6 +4191,7 @@
3953
4191
 
3954
4192
  <xsl:template match="mn:pre" name="pre">
3955
4193
  <fo:block xsl:use-attribute-sets="pre-style">
4194
+ <xsl:call-template name="refine_pre-style"/>
3956
4195
  <xsl:copy-of select="@id"/>
3957
4196
  <xsl:choose>
3958
4197
 
@@ -3983,24 +4222,42 @@
3983
4222
  <xsl:attribute-set name="permission-style">
3984
4223
  </xsl:attribute-set>
3985
4224
 
4225
+ <xsl:template name="refine_permission-style">
4226
+ </xsl:template>
4227
+
3986
4228
  <xsl:attribute-set name="permission-name-style">
3987
4229
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3988
4230
  </xsl:attribute-set>
3989
4231
 
4232
+ <xsl:template name="refine_permission-name-style">
4233
+ </xsl:template>
4234
+
3990
4235
  <xsl:attribute-set name="permission-label-style">
3991
4236
  </xsl:attribute-set>
3992
4237
 
4238
+ <xsl:template name="refine_permission-label-style">
4239
+ </xsl:template>
4240
+
3993
4241
  <xsl:attribute-set name="requirement-style">
3994
4242
  </xsl:attribute-set>
3995
4243
 
4244
+ <xsl:template name="refine_requirement-style">
4245
+ </xsl:template>
4246
+
3996
4247
  <xsl:attribute-set name="requirement-name-style">
3997
4248
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3998
4249
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3999
4250
  </xsl:attribute-set>
4000
4251
 
4252
+ <xsl:template name="refine_requirement-name-style">
4253
+ </xsl:template>
4254
+
4001
4255
  <xsl:attribute-set name="requirement-label-style">
4002
4256
  </xsl:attribute-set>
4003
4257
 
4258
+ <xsl:template name="refine_requirement-label-style">
4259
+ </xsl:template>
4260
+
4004
4261
  <xsl:attribute-set name="subject-style">
4005
4262
  </xsl:attribute-set>
4006
4263
 
@@ -4029,19 +4286,29 @@
4029
4286
  <xsl:attribute name="border">1pt solid black</xsl:attribute>
4030
4287
  </xsl:attribute-set>
4031
4288
 
4289
+ <xsl:template name="refine_recommendation-style">
4290
+ </xsl:template>
4291
+
4032
4292
  <xsl:attribute-set name="recommendation-name-style">
4033
4293
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4034
4294
  </xsl:attribute-set>
4035
4295
 
4296
+ <xsl:template name="refine_recommendation-name-style">
4297
+ </xsl:template>
4298
+
4036
4299
  <xsl:attribute-set name="recommendation-label-style">
4037
4300
  </xsl:attribute-set>
4038
4301
 
4302
+ <xsl:template name="refine_recommendation-label-style">
4303
+ </xsl:template>
4304
+
4039
4305
  <!-- ========== -->
4040
4306
  <!-- permission -->
4041
4307
  <!-- ========== -->
4042
4308
  <xsl:template match="mn:permission">
4043
4309
  <xsl:call-template name="setNamedDestination"/>
4044
4310
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4311
+ <xsl:call-template name="refine_permission-style"/>
4045
4312
  <xsl:apply-templates select="mn:fmt-name"/>
4046
4313
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4047
4314
  </fo:block>
@@ -4050,6 +4317,7 @@
4050
4317
  <xsl:template match="mn:permission/mn:fmt-name">
4051
4318
  <xsl:if test="normalize-space() != ''">
4052
4319
  <fo:inline xsl:use-attribute-sets="permission-name-style">
4320
+ <xsl:call-template name="refine_permission-name-style"/>
4053
4321
  <xsl:apply-templates/><xsl:text>:</xsl:text>
4054
4322
  </fo:inline>
4055
4323
 
@@ -4058,6 +4326,7 @@
4058
4326
 
4059
4327
  <xsl:template match="mn:permission/mn:label">
4060
4328
  <fo:block xsl:use-attribute-sets="permission-label-style">
4329
+ <xsl:call-template name="refine_permission-label-style"/>
4061
4330
  <xsl:apply-templates/>
4062
4331
  </fo:block>
4063
4332
  </xsl:template>
@@ -4070,6 +4339,7 @@
4070
4339
  <xsl:template match="mn:requirement">
4071
4340
  <xsl:call-template name="setNamedDestination"/>
4072
4341
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4342
+ <xsl:call-template name="refine_requirement-style"/>
4073
4343
  <xsl:apply-templates select="mn:fmt-name"/>
4074
4344
  <xsl:apply-templates select="mn:label"/>
4075
4345
  <xsl:apply-templates select="@obligation"/>
@@ -4081,6 +4351,7 @@
4081
4351
  <xsl:template match="mn:requirement/mn:fmt-name">
4082
4352
  <xsl:if test="normalize-space() != ''">
4083
4353
  <fo:inline xsl:use-attribute-sets="requirement-name-style">
4354
+ <xsl:call-template name="refine_requirement-name-style"/>
4084
4355
  <xsl:apply-templates/><xsl:text>:</xsl:text>
4085
4356
  </fo:inline>
4086
4357
 
@@ -4089,6 +4360,7 @@
4089
4360
 
4090
4361
  <xsl:template match="mn:requirement/mn:label">
4091
4362
  <fo:block xsl:use-attribute-sets="requirement-label-style">
4363
+ <xsl:call-template name="refine_requirement-label-style"/>
4092
4364
  <xsl:apply-templates/>
4093
4365
  </fo:block>
4094
4366
  </xsl:template>
@@ -4114,6 +4386,7 @@
4114
4386
  <xsl:template match="mn:recommendation">
4115
4387
  <xsl:call-template name="setNamedDestination"/>
4116
4388
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4389
+ <xsl:call-template name="refine_recommendation-style"/>
4117
4390
  <xsl:apply-templates select="mn:fmt-name"/>
4118
4391
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4119
4392
  </fo:block>
@@ -4122,6 +4395,7 @@
4122
4395
  <xsl:template match="mn:recommendation/mn:fmt-name">
4123
4396
  <xsl:if test="normalize-space() != ''">
4124
4397
  <fo:inline xsl:use-attribute-sets="recommendation-name-style">
4398
+ <xsl:call-template name="refine_recommendation-name-style"/>
4125
4399
  <xsl:apply-templates/><xsl:text>:</xsl:text>
4126
4400
  </fo:inline>
4127
4401
 
@@ -4130,6 +4404,7 @@
4130
4404
 
4131
4405
  <xsl:template match="mn:recommendation/mn:label">
4132
4406
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4407
+ <xsl:call-template name="refine_recommendation-label-style"/>
4133
4408
  <xsl:apply-templates/>
4134
4409
  </fo:block>
4135
4410
  </xsl:template>
@@ -4311,36 +4586,66 @@
4311
4586
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
4312
4587
  </xsl:attribute-set> <!-- term-style -->
4313
4588
 
4589
+ <xsl:template name="refine_term-style">
4590
+ </xsl:template>
4591
+
4314
4592
  <xsl:attribute-set name="term-name-style">
4315
4593
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4316
4594
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4317
4595
  </xsl:attribute-set> <!-- term-name-style -->
4318
4596
 
4319
- <xsl:attribute-set name="preferred-block-style">
4597
+ <xsl:template name="refine_term-name-style">
4598
+ </xsl:template>
4599
+
4600
+ <xsl:attribute-set name="preferred-block-style">
4320
4601
  <xsl:attribute name="line-height">1.1</xsl:attribute>
4321
4602
  </xsl:attribute-set> <!-- preferred-block-style -->
4322
4603
 
4604
+ <xsl:template name="refine_preferred-block-style">
4605
+ </xsl:template>
4606
+
4323
4607
  <xsl:attribute-set name="preferred-term-style">
4324
4608
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4325
4609
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4326
4610
  </xsl:attribute-set> <!-- preferred-term-style -->
4327
4611
 
4612
+ <xsl:template name="refine_preferred-term-style">
4613
+ <xsl:if test="mn:strong">
4614
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
4615
+ </xsl:if>
4616
+ </xsl:template>
4617
+
4328
4618
  <xsl:attribute-set name="domain-style">
4329
4619
  </xsl:attribute-set> <!-- domain-style -->
4330
4620
 
4621
+ <xsl:template name="refine_domain-style">
4622
+ </xsl:template>
4623
+
4331
4624
  <xsl:attribute-set name="admitted-style">
4332
4625
  </xsl:attribute-set> <!-- admitted-style -->
4333
4626
 
4627
+ <xsl:template name="refine_admitted-style">
4628
+ </xsl:template>
4629
+
4334
4630
  <xsl:attribute-set name="deprecates-style">
4335
4631
  </xsl:attribute-set> <!-- deprecates-style -->
4336
4632
 
4633
+ <xsl:template name="refine_deprecates-style">
4634
+ </xsl:template>
4635
+
4337
4636
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
4338
4637
  </xsl:attribute-set>
4339
4638
 
4639
+ <xsl:template name="refine_related-block-style">
4640
+ </xsl:template>
4641
+
4340
4642
  <xsl:attribute-set name="definition-style">
4341
4643
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4342
4644
  </xsl:attribute-set> <!-- definition-style -->
4343
4645
 
4646
+ <xsl:template name="refine_definition-style">
4647
+ </xsl:template>
4648
+
4344
4649
  <xsl:attribute-set name="termsource-style">
4345
4650
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4346
4651
  </xsl:attribute-set> <!-- termsource-style -->
@@ -4351,11 +4656,17 @@
4351
4656
  <xsl:attribute-set name="termsource-text-style">
4352
4657
  </xsl:attribute-set> <!-- termsource-text-style -->
4353
4658
 
4659
+ <xsl:template name="refine_termsource-text-style">
4660
+ </xsl:template>
4661
+
4354
4662
  <xsl:attribute-set name="origin-style">
4355
4663
  <xsl:attribute name="color">blue</xsl:attribute>
4356
4664
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
4357
4665
  </xsl:attribute-set> <!-- origin-style -->
4358
4666
 
4667
+ <xsl:template name="refine_origin-style">
4668
+ </xsl:template>
4669
+
4359
4670
  <!-- ====== -->
4360
4671
  <!-- term -->
4361
4672
  <!-- ====== -->
@@ -4371,9 +4682,8 @@
4371
4682
  <xsl:template match="mn:term">
4372
4683
  <xsl:call-template name="setNamedDestination"/>
4373
4684
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
4685
+ <xsl:call-template name="refine_term-style"/>
4374
4686
 
4375
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
4376
- </xsl:if>
4377
4687
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
4378
4688
  </fo:block>
4379
4689
  </xsl:template>
@@ -4449,6 +4759,7 @@
4449
4759
  <!-- text SOURCE: -->
4450
4760
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
4451
4761
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
4762
+ <xsl:call-template name="refine_termsource-text-style"/>
4452
4763
  <xsl:value-of select="."/>
4453
4764
  </fo:inline>
4454
4765
  </xsl:template>
@@ -4461,6 +4772,7 @@
4461
4772
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4462
4773
  </xsl:if>
4463
4774
  <fo:inline xsl:use-attribute-sets="origin-style">
4775
+ <xsl:call-template name="refine_origin-style"/>
4464
4776
  <xsl:apply-templates/>
4465
4777
  </fo:inline>
4466
4778
  </fo:basic-link>
@@ -4510,9 +4822,12 @@
4510
4822
  </xsl:variable>
4511
4823
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
4512
4824
 
4825
+ <xsl:call-template name="refine_preferred-block-style"/>
4826
+
4513
4827
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
4514
4828
 
4515
4829
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
4830
+ <xsl:call-template name="refine_term-name-style"/>
4516
4831
 
4517
4832
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
4518
4833
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -4523,7 +4838,7 @@
4523
4838
  </xsl:if>
4524
4839
 
4525
4840
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
4526
- <xsl:call-template name="setStyle_preferred"/>
4841
+ <xsl:call-template name="refine_preferred-term-style"/>
4527
4842
 
4528
4843
  <xsl:apply-templates/>
4529
4844
  </fo:block>
@@ -4544,22 +4859,18 @@
4544
4859
 
4545
4860
  <xsl:template match="mn:fmt-admitted">
4546
4861
  <fo:block xsl:use-attribute-sets="admitted-style">
4862
+ <xsl:call-template name="refine_admitted-style"/>
4547
4863
  <xsl:apply-templates/>
4548
4864
  </fo:block>
4549
4865
  </xsl:template>
4550
4866
 
4551
4867
  <xsl:template match="mn:fmt-deprecates">
4552
4868
  <fo:block xsl:use-attribute-sets="deprecates-style">
4869
+ <xsl:call-template name="refine_deprecates-style"/>
4553
4870
  <xsl:apply-templates/>
4554
4871
  </fo:block>
4555
4872
  </xsl:template>
4556
4873
 
4557
- <xsl:template name="setStyle_preferred">
4558
- <xsl:if test="mn:strong">
4559
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4560
- </xsl:if>
4561
- </xsl:template>
4562
-
4563
4874
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
4564
4875
  <!-- in metanorma xml preferred terms delimited by semicolons -->
4565
4876
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -4569,6 +4880,7 @@
4569
4880
 
4570
4881
  <xsl:template match="mn:fmt-related">
4571
4882
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
4883
+ <xsl:call-template name="refine_related-block-style"/>
4572
4884
  <xsl:apply-templates/>
4573
4885
  </fo:block>
4574
4886
  </xsl:template>
@@ -4583,6 +4895,7 @@
4583
4895
  <!-- ========== -->
4584
4896
  <xsl:template match="mn:fmt-definition">
4585
4897
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
4898
+ <xsl:call-template name="refine_definition-style"/>
4586
4899
  <xsl:apply-templates/>
4587
4900
  </fo:block>
4588
4901
  </xsl:template>
@@ -4635,6 +4948,9 @@
4635
4948
  <xsl:attribute-set name="example-body-style">
4636
4949
  </xsl:attribute-set> <!-- example-body-style -->
4637
4950
 
4951
+ <xsl:template name="refine_example-body-style">
4952
+ </xsl:template>
4953
+
4638
4954
  <xsl:attribute-set name="example-name-style">
4639
4955
  <!-- <xsl:attribute name="keep-with-next">always</xsl:attribute>
4640
4956
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -4685,6 +5001,8 @@
4685
5001
  <xsl:when test="contains($element, 'block')">
4686
5002
  <fo:block xsl:use-attribute-sets="example-p-style">
4687
5003
 
5004
+ <xsl:call-template name="refine_example-p-style"/>
5005
+
4688
5006
  <xsl:apply-templates/>
4689
5007
  </fo:block>
4690
5008
  </xsl:when>
@@ -4736,6 +5054,7 @@
4736
5054
  </fo:block>
4737
5055
 
4738
5056
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5057
+ <xsl:call-template name="refine_example-body-style"/>
4739
5058
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4740
5059
  <xsl:variable name="example_body">
4741
5060
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -4798,6 +5117,7 @@
4798
5117
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
4799
5118
  <!-- display further elements in blocks -->
4800
5119
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
5120
+ <xsl:call-template name="refine_example-body-style"/>
4801
5121
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4802
5122
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
4803
5123
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -4902,6 +5222,9 @@
4902
5222
 
4903
5223
  <xsl:template name="refine_table-container-style">
4904
5224
  <xsl:param name="margin-side"/>
5225
+ <xsl:if test="contains(translate(@style, ' ', ''), 'border:none')">
5226
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
5227
+ </xsl:if>
4905
5228
  <!-- end table block-container attributes -->
4906
5229
  </xsl:template> <!-- refine_table-container-style -->
4907
5230
 
@@ -5002,6 +5325,9 @@
5002
5325
  <xsl:if test="$lang = 'ar'">
5003
5326
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
5004
5327
  </xsl:if>
5328
+ <xsl:if test="contains(translate(ancestor::mn:table/@style, ' ', ''), 'border:none')">
5329
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
5330
+ </xsl:if>
5005
5331
 
5006
5332
  <xsl:call-template name="setBordersTableArray"/>
5007
5333
 
@@ -5040,6 +5366,9 @@
5040
5366
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
5041
5367
  </xsl:attribute-set> <!-- table-fn-number-style -->
5042
5368
 
5369
+ <xsl:template name="refine_table-fn-number-style">
5370
+ </xsl:template>
5371
+
5043
5372
  <xsl:attribute-set name="table-fmt-fn-label-style">
5044
5373
  <xsl:attribute name="font-size">80%</xsl:attribute>
5045
5374
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -5048,30 +5377,12 @@
5048
5377
  <xsl:template name="refine_table-fmt-fn-label-style">
5049
5378
  </xsl:template>
5050
5379
 
5051
- <xsl:attribute-set name="fn-container-body-style">
5052
- <xsl:attribute name="text-indent">0</xsl:attribute>
5053
- <xsl:attribute name="start-indent">0</xsl:attribute>
5054
- </xsl:attribute-set>
5055
-
5056
5380
  <xsl:attribute-set name="table-fn-body-style">
5057
5381
  </xsl:attribute-set>
5058
5382
 
5059
- <xsl:attribute-set name="figure-fn-number-style">
5060
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
5061
- </xsl:attribute-set> <!-- figure-fn-number-style -->
5062
-
5063
- <xsl:attribute-set name="figure-fmt-fn-label-style">
5064
- <xsl:attribute name="font-size">80%</xsl:attribute>
5065
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5066
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
5067
-
5068
- <xsl:template name="refine_figure-fmt-fn-label-style">
5383
+ <xsl:template name="refine_table-fn-body-style">
5069
5384
  </xsl:template>
5070
5385
 
5071
- <xsl:attribute-set name="figure-fn-body-style">
5072
- <xsl:attribute name="text-align">justify</xsl:attribute>
5073
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
5074
- </xsl:attribute-set>
5075
5386
  <!-- ========================== -->
5076
5387
  <!-- END Table styles -->
5077
5388
  <!-- ========================== -->
@@ -6349,6 +6660,7 @@
6349
6660
  </xsl:apply-templates>
6350
6661
 
6351
6662
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
6663
+ <xsl:call-template name="refine_table-fn-body-style"/>
6352
6664
  <!-- <xsl:copy-of select="./node()"/> -->
6353
6665
  <xsl:apply-templates/>
6354
6666
  </fo:inline>
@@ -6367,6 +6679,7 @@
6367
6679
  <xsl:param name="process">false</xsl:param>
6368
6680
  <xsl:if test="$process = 'true'">
6369
6681
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
6682
+ <xsl:call-template name="refine_table-fn-number-style"/>
6370
6683
 
6371
6684
  <!-- tab is padding-right -->
6372
6685
  <xsl:apply-templates select=".//mn:tab">
@@ -7238,9 +7551,18 @@
7238
7551
  <xsl:attribute-set name="dl-block-style">
7239
7552
  </xsl:attribute-set>
7240
7553
 
7554
+ <xsl:template name="refine_dl-block-style">
7555
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
7556
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
7557
+ </xsl:if>
7558
+ </xsl:template>
7559
+
7241
7560
  <xsl:attribute-set name="dt-row-style">
7242
7561
  </xsl:attribute-set>
7243
7562
 
7563
+ <xsl:template name="refine_dt-row-style">
7564
+ </xsl:template>
7565
+
7244
7566
  <xsl:attribute-set name="dt-cell-style">
7245
7567
  </xsl:attribute-set>
7246
7568
 
@@ -7261,6 +7583,9 @@
7261
7583
  <xsl:attribute name="font-weight">normal</xsl:attribute>
7262
7584
  </xsl:attribute-set> <!-- dl-name-style -->
7263
7585
 
7586
+ <xsl:template name="refine_dl-name-style">
7587
+ </xsl:template>
7588
+
7264
7589
  <xsl:attribute-set name="dd-cell-style">
7265
7590
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
7266
7591
  </xsl:attribute-set>
@@ -7299,9 +7624,7 @@
7299
7624
  <!-- <dl><xsl:copy-of select="."/></dl> -->
7300
7625
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
7301
7626
 
7302
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
7303
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
7304
- </xsl:if>
7627
+ <xsl:call-template name="refine_dl-block-style"/>
7305
7628
 
7306
7629
  <xsl:call-template name="setBlockSpanAll"/>
7307
7630
  <xsl:if test="not(ancestor::mn:quote)">
@@ -7600,6 +7923,8 @@
7600
7923
  <xsl:if test="$process = 'true'">
7601
7924
  <fo:block xsl:use-attribute-sets="dl-name-style">
7602
7925
 
7926
+ <xsl:call-template name="refine_dl-name-style"/>
7927
+
7603
7928
  <xsl:apply-templates/>
7604
7929
  </fo:block>
7605
7930
  </xsl:if>
@@ -7788,6 +8113,8 @@
7788
8113
  <xsl:param name="split_keep-within-line"/>
7789
8114
 
7790
8115
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
8116
+ <xsl:call-template name="refine_dt-row-style"/>
8117
+
7791
8118
  <xsl:call-template name="insert_dt_cell">
7792
8119
  <xsl:with-param name="key_iso" select="$key_iso"/>
7793
8120
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7997,15 +8324,22 @@
7997
8324
  <xsl:attribute-set name="appendix-style">
7998
8325
  </xsl:attribute-set>
7999
8326
 
8327
+ <xsl:template name="refine_appendix-style">
8328
+ </xsl:template>
8329
+
8000
8330
  <xsl:attribute-set name="appendix-example-style">
8001
8331
  </xsl:attribute-set>
8002
8332
 
8333
+ <xsl:template name="refine_appendix-example-style">
8334
+ </xsl:template>
8335
+
8003
8336
  <!-- ======================== -->
8004
8337
  <!-- Appendix processing -->
8005
8338
  <!-- ======================== -->
8006
8339
  <xsl:template match="mn:appendix">
8007
8340
  <xsl:call-template name="setNamedDestination"/>
8008
8341
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
8342
+ <xsl:call-template name="refine_appendix-style"/>
8009
8343
  <xsl:apply-templates select="mn:fmt-title"/>
8010
8344
  </fo:block>
8011
8345
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -8024,6 +8358,7 @@
8024
8358
  <xsl:template match="mn:appendix//mn:example" priority="2">
8025
8359
  <xsl:call-template name="setNamedDestination"/>
8026
8360
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
8361
+ <xsl:call-template name="refine_appendix-example-style"/>
8027
8362
  <xsl:apply-templates select="mn:fmt-name"/>
8028
8363
  </fo:block>
8029
8364
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -8032,7 +8367,16 @@
8032
8367
  <xsl:attribute-set name="xref-style">
8033
8368
  <xsl:attribute name="color">blue</xsl:attribute>
8034
8369
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
8035
- </xsl:attribute-set>
8370
+ </xsl:attribute-set> <!-- xref-style -->
8371
+
8372
+ <xsl:template name="refine_xref-style">
8373
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
8374
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8375
+ </xsl:if>
8376
+ <xsl:if test="parent::mn:add">
8377
+ <xsl:call-template name="append_add-style"/>
8378
+ </xsl:if>
8379
+ </xsl:template> <!-- refine_xref-style -->
8036
8380
 
8037
8381
  <xsl:template match="mn:fmt-xref">
8038
8382
  <xsl:call-template name="insert_basic_link">
@@ -8041,12 +8385,8 @@
8041
8385
  <xsl:call-template name="getAltText"/>
8042
8386
  </xsl:variable>
8043
8387
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8044
- <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
8045
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8046
- </xsl:if>
8047
- <xsl:if test="parent::mn:add">
8048
- <xsl:call-template name="append_add-style"/>
8049
- </xsl:if>
8388
+ <xsl:call-template name="refine_xref-style"/>
8389
+
8050
8390
  <xsl:apply-templates/>
8051
8391
  </fo:basic-link>
8052
8392
  </xsl:with-param>
@@ -8159,10 +8499,10 @@
8159
8499
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
8160
8500
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8161
8501
  <xsl:attribute name="text-align">justify</xsl:attribute>
8162
- </xsl:attribute-set>
8502
+ </xsl:attribute-set> <!-- note-style -->
8163
8503
 
8164
8504
  <xsl:template name="refine_note-style">
8165
- </xsl:template>
8505
+ </xsl:template> <!-- refine_note-style -->
8166
8506
 
8167
8507
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
8168
8508
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
@@ -8170,7 +8510,7 @@
8170
8510
  <xsl:attribute-set name="note-name-style">
8171
8511
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
8172
8512
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
8173
- </xsl:attribute-set>
8513
+ </xsl:attribute-set> <!-- note-name-style -->
8174
8514
 
8175
8515
  <xsl:template name="refine_note-name-style">
8176
8516
  </xsl:template> <!-- refine_note-name-style -->
@@ -8186,20 +8526,23 @@
8186
8526
  <xsl:attribute-set name="note-p-style">
8187
8527
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
8188
8528
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
8189
- </xsl:attribute-set>
8529
+ </xsl:attribute-set> <!-- note-p-style -->
8530
+
8531
+ <xsl:template name="refine_note-p-style">
8532
+ </xsl:template>
8190
8533
 
8191
8534
  <xsl:attribute-set name="termnote-style">
8192
8535
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8193
8536
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
8194
8537
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
8195
8538
  <xsl:attribute name="text-align">justify</xsl:attribute>
8196
- </xsl:attribute-set>
8539
+ </xsl:attribute-set> <!-- termnote-style -->
8197
8540
 
8198
8541
  <xsl:template name="refine_termnote-style">
8199
8542
  </xsl:template> <!-- refine_termnote-style -->
8200
8543
 
8201
8544
  <xsl:attribute-set name="termnote-name-style">
8202
- </xsl:attribute-set>
8545
+ </xsl:attribute-set> <!-- termnote-name-style -->
8203
8546
 
8204
8547
  <xsl:template name="refine_termnote-name-style">
8205
8548
  </xsl:template>
@@ -8207,6 +8550,9 @@
8207
8550
  <xsl:attribute-set name="termnote-p-style">
8208
8551
  </xsl:attribute-set>
8209
8552
 
8553
+ <xsl:template name="refine_termnote-p-style">
8554
+ </xsl:template>
8555
+
8210
8556
  <!-- ====== -->
8211
8557
  <!-- note -->
8212
8558
  <!-- termnote -->
@@ -8267,11 +8613,13 @@
8267
8613
  <xsl:choose>
8268
8614
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
8269
8615
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
8616
+ <xsl:call-template name="refine_note-p-style"/>
8270
8617
  <xsl:apply-templates/>
8271
8618
  </fo:inline>
8272
8619
  </xsl:when>
8273
8620
  <xsl:otherwise>
8274
8621
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
8622
+ <xsl:call-template name="refine_note-p-style"/>
8275
8623
  <xsl:apply-templates/>
8276
8624
  </fo:block>
8277
8625
  </xsl:otherwise>
@@ -8363,11 +8711,13 @@
8363
8711
  <xsl:choose>
8364
8712
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
8365
8713
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
8714
+ <xsl:call-template name="refine_termnote-p-style"/>
8366
8715
  <xsl:apply-templates/>
8367
8716
  </fo:inline>
8368
8717
  </xsl:when>
8369
8718
  <xsl:otherwise>
8370
8719
  <fo:block xsl:use-attribute-sets="termnote-p-style">
8720
+ <xsl:call-template name="refine_termnote-p-style"/>
8371
8721
  <xsl:apply-templates/>
8372
8722
  </fo:block>
8373
8723
  </xsl:otherwise>
@@ -8383,7 +8733,7 @@
8383
8733
  <xsl:attribute name="font-family">Calibri</xsl:attribute>
8384
8734
  <xsl:attribute name="margin-left">4.5mm</xsl:attribute>
8385
8735
  <xsl:attribute name="margin-right">9mm</xsl:attribute>
8386
- </xsl:attribute-set>
8736
+ </xsl:attribute-set> <!-- quote-style -->
8387
8737
 
8388
8738
  <xsl:template name="refine_quote-style">
8389
8739
  </xsl:template>
@@ -8392,6 +8742,9 @@
8392
8742
  <xsl:attribute name="text-align">right</xsl:attribute>
8393
8743
  </xsl:attribute-set>
8394
8744
 
8745
+ <xsl:template name="refine_quote-source-style">
8746
+ </xsl:template>
8747
+
8395
8748
  <!-- ====== -->
8396
8749
  <!-- quote -->
8397
8750
  <!-- source -->
@@ -8420,6 +8773,7 @@
8420
8773
  </fo:block-container>
8421
8774
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
8422
8775
  <fo:block xsl:use-attribute-sets="quote-source-style">
8776
+ <xsl:call-template name="refine_quote-source-style"/>
8423
8777
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
8424
8778
  <xsl:apply-templates select="mn:author"/>
8425
8779
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -8482,6 +8836,9 @@
8482
8836
  <xsl:attribute-set name="figure-style">
8483
8837
  </xsl:attribute-set>
8484
8838
 
8839
+ <xsl:template name="refine_figure-style">
8840
+ </xsl:template>
8841
+
8485
8842
  <xsl:attribute-set name="figure-name-style">
8486
8843
  <xsl:attribute name="role">Caption</xsl:attribute>
8487
8844
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -8490,7 +8847,7 @@
8490
8847
  <xsl:attribute name="margin-top">2pt</xsl:attribute>
8491
8848
  <xsl:attribute name="space-after">6pt</xsl:attribute>
8492
8849
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
8493
- </xsl:attribute-set>
8850
+ </xsl:attribute-set> <!-- figure-name-style -->
8494
8851
 
8495
8852
  <xsl:template name="refine_figure-name-style">
8496
8853
  </xsl:template> <!-- refine_figure-name-style -->
@@ -8498,7 +8855,7 @@
8498
8855
  <xsl:attribute-set name="image-style">
8499
8856
  <xsl:attribute name="role">SKIP</xsl:attribute>
8500
8857
  <xsl:attribute name="text-align">center</xsl:attribute>
8501
- </xsl:attribute-set>
8858
+ </xsl:attribute-set> <!-- image-style -->
8502
8859
 
8503
8860
  <xsl:template name="refine_image-style">
8504
8861
  </xsl:template>
@@ -8508,14 +8865,51 @@
8508
8865
  <xsl:attribute name="content-height">100%</xsl:attribute>
8509
8866
  <xsl:attribute name="scaling">uniform</xsl:attribute>
8510
8867
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
8511
- </xsl:attribute-set>
8868
+ </xsl:attribute-set> <!-- image-graphic-style -->
8869
+
8870
+ <xsl:template name="refine_image-graphic-style">
8871
+ </xsl:template>
8512
8872
 
8513
8873
  <xsl:attribute-set name="figure-source-style">
8514
8874
  </xsl:attribute-set>
8515
8875
 
8876
+ <xsl:template name="refine_figure-source-style">
8877
+ </xsl:template>
8878
+
8516
8879
  <xsl:attribute-set name="figure-pseudocode-p-style">
8517
8880
  </xsl:attribute-set>
8518
8881
 
8882
+ <xsl:template name="refine_figure-pseudocode-p-style">
8883
+ </xsl:template>
8884
+
8885
+ <xsl:attribute-set name="figure-fn-number-style">
8886
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
8887
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
8888
+
8889
+ <xsl:template name="refine_figure-fn-number-style">
8890
+ </xsl:template>
8891
+
8892
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
8893
+ <xsl:attribute name="font-size">80%</xsl:attribute>
8894
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
8895
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
8896
+
8897
+ <xsl:template name="refine_figure-fmt-fn-label-style">
8898
+ </xsl:template>
8899
+
8900
+ <xsl:attribute-set name="figure-fn-body-style">
8901
+ <xsl:attribute name="text-align">justify</xsl:attribute>
8902
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
8903
+ </xsl:attribute-set>
8904
+
8905
+ <xsl:template name="refine_figure-fn-body-style">
8906
+ <xsl:variable name="key_iso">
8907
+ </xsl:variable>
8908
+ <xsl:if test="normalize-space($key_iso) = 'true'">
8909
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
8910
+ </xsl:if>
8911
+ </xsl:template>
8912
+
8519
8913
  <!-- ============================ -->
8520
8914
  <!-- figure's footnotes rendering -->
8521
8915
  <!-- ============================ -->
@@ -8628,9 +9022,8 @@
8628
9022
  </fo:table-cell>
8629
9023
  <fo:table-cell>
8630
9024
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
8631
- <xsl:if test="normalize-space($key_iso) = 'true'">
8632
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
8633
- </xsl:if>
9025
+ <xsl:call-template name="refine_figure-fn-body-style"/>
9026
+
8634
9027
  <!-- <xsl:copy-of select="./node()"/> -->
8635
9028
  <xsl:apply-templates/>
8636
9029
  </fo:block>
@@ -8648,6 +9041,7 @@
8648
9041
  <xsl:param name="process">false</xsl:param>
8649
9042
  <xsl:if test="$process = 'true'">
8650
9043
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
9044
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8651
9045
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
8652
9046
 
8653
9047
  <!-- tab is padding-right -->
@@ -8685,6 +9079,7 @@
8685
9079
  <xsl:attribute name="font-size">10pt</xsl:attribute>
8686
9080
  </xsl:if>
8687
9081
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
9082
+ <xsl:call-template name="refine_figure-fn-number-style"/>
8688
9083
  <!-- <xsl:value-of select="@reference"/> -->
8689
9084
  <xsl:apply-templates/>
8690
9085
  </fo:inline>
@@ -8730,6 +9125,8 @@
8730
9125
 
8731
9126
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8732
9127
 
9128
+ <xsl:call-template name="refine_figure-style"/>
9129
+
8733
9130
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
8734
9131
  <xsl:call-template name="setIDforNamedDestination"/>
8735
9132
  </xsl:for-each>
@@ -8773,6 +9170,7 @@
8773
9170
 
8774
9171
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
8775
9172
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
9173
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
8776
9174
  <xsl:apply-templates/>
8777
9175
  </fo:block>
8778
9176
  </xsl:template>
@@ -8902,6 +9300,8 @@
8902
9300
  </xsl:variable>
8903
9301
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
8904
9302
 
9303
+ <xsl:call-template name="refine_image-graphic-style"/>
9304
+
8905
9305
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
8906
9306
  <xsl:variable name="scale">
8907
9307
  <xsl:call-template name="getImageScale">
@@ -9601,6 +10001,9 @@
9601
10001
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9602
10002
  </xsl:attribute-set> <!-- formula-style -->
9603
10003
 
10004
+ <xsl:template name="refine_formula-style">
10005
+ </xsl:template>
10006
+
9604
10007
  <xsl:attribute-set name="formula-stem-block-style">
9605
10008
  <xsl:attribute name="text-align">center</xsl:attribute>
9606
10009
  </xsl:attribute-set> <!-- formula-stem-block-style -->
@@ -9669,6 +10072,8 @@
9669
10072
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
9670
10073
  <fo:block xsl:use-attribute-sets="formula-style">
9671
10074
 
10075
+ <xsl:call-template name="refine_formula-style"/>
10076
+
9672
10077
  <fo:table table-layout="fixed" width="100%">
9673
10078
  <fo:table-column column-width="95%"/>
9674
10079
  <fo:table-column column-width="5%"/>
@@ -10088,11 +10493,17 @@
10088
10493
  <xsl:attribute name="font-weight">normal</xsl:attribute>
10089
10494
  </xsl:attribute-set> <!-- list-name-style -->
10090
10495
 
10496
+ <xsl:template name="refine_list-name-style">
10497
+ </xsl:template>
10498
+
10091
10499
  <xsl:attribute-set name="list-item-style">
10092
10500
  <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
10093
10501
  </xsl:attribute-set>
10094
10502
 
10095
10503
  <xsl:template name="refine_list-item-style">
10504
+ <xsl:if test="ancestor::mn:table">
10505
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10506
+ </xsl:if>
10096
10507
  </xsl:template> <!-- refine_list-item-style -->
10097
10508
 
10098
10509
  <xsl:attribute-set name="list-item-label-style">
@@ -10389,6 +10800,7 @@
10389
10800
  <xsl:param name="process">false</xsl:param>
10390
10801
  <xsl:if test="$process = 'true'">
10391
10802
  <fo:block xsl:use-attribute-sets="list-name-style">
10803
+ <xsl:call-template name="refine_list-name-style"/>
10392
10804
  <xsl:apply-templates/>
10393
10805
  </fo:block>
10394
10806
  </xsl:if>
@@ -10449,24 +10861,45 @@
10449
10861
  <!-- END Lists processing -->
10450
10862
  <!-- ===================================== -->
10451
10863
 
10864
+ <xsl:attribute-set name="footnote-separator-leader-style">
10865
+ </xsl:attribute-set>
10866
+
10867
+ <xsl:template name="refine_footnote-separator-leader-style">
10868
+ </xsl:template>
10869
+
10870
+ <xsl:attribute-set name="fn-container-body-style">
10871
+ <xsl:attribute name="text-indent">0</xsl:attribute>
10872
+ <xsl:attribute name="start-indent">0</xsl:attribute>
10873
+ </xsl:attribute-set>
10874
+
10875
+ <xsl:template name="refine_fn-container-body-style">
10876
+ </xsl:template>
10877
+
10452
10878
  <xsl:attribute-set name="fn-reference-style">
10453
10879
  <xsl:attribute name="font-size">80%</xsl:attribute>
10454
10880
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
10455
-
10456
- </xsl:attribute-set>
10881
+ </xsl:attribute-set> <!-- fn-reference-style -->
10457
10882
 
10458
10883
  <xsl:template name="refine_fn-reference-style">
10884
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10885
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
10459
10886
  </xsl:template> <!-- refine_fn-reference-style -->
10460
10887
 
10461
10888
  <xsl:attribute-set name="fn-style">
10462
10889
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
10463
10890
  </xsl:attribute-set>
10464
10891
 
10892
+ <xsl:template name="refine_fn-style">
10893
+ </xsl:template>
10894
+
10465
10895
  <xsl:attribute-set name="fn-num-style">
10466
10896
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
10467
10897
  <xsl:attribute name="font-size">70%</xsl:attribute>
10468
10898
  <xsl:attribute name="vertical-align">super</xsl:attribute>
10469
- </xsl:attribute-set>
10899
+ </xsl:attribute-set> <!-- fn-num-style -->
10900
+
10901
+ <xsl:template name="refine_fn-num-style">
10902
+ </xsl:template>
10470
10903
 
10471
10904
  <xsl:attribute-set name="fn-body-style">
10472
10905
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -10475,7 +10908,7 @@
10475
10908
  <xsl:attribute name="start-indent">0</xsl:attribute>
10476
10909
  <xsl:attribute name="font-size">10pt</xsl:attribute>
10477
10910
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10478
- </xsl:attribute-set>
10911
+ </xsl:attribute-set> <!-- fn-body-style" -->
10479
10912
 
10480
10913
  <xsl:template name="refine_fn-body-style">
10481
10914
  </xsl:template> <!-- refine_fn-body-style -->
@@ -10540,10 +10973,12 @@
10540
10973
  <xsl:choose>
10541
10974
  <xsl:when test="ancestor::mn:bibitem">
10542
10975
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
10976
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
10543
10977
  </fn_styles>
10544
10978
  </xsl:when>
10545
10979
  <xsl:otherwise>
10546
10980
  <fn_styles xsl:use-attribute-sets="fn-num-style">
10981
+ <xsl:call-template name="refine_fn-num-style"/>
10547
10982
  </fn_styles>
10548
10983
  </xsl:otherwise>
10549
10984
  </xsl:choose>
@@ -10553,9 +10988,12 @@
10553
10988
  <xsl:copy-of select="."/>
10554
10989
  </xsl:for-each>
10555
10990
 
10556
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
10991
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
10992
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
10557
10993
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
10558
- </xsl:if>
10994
+ </xsl:if> -->
10995
+
10996
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
10559
10997
 
10560
10998
  <xsl:call-template name="insert_basic_link">
10561
10999
  <xsl:with-param name="element">
@@ -10578,10 +11016,12 @@
10578
11016
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
10579
11017
 
10580
11018
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
11019
+ <xsl:call-template name="refine_fn-style"/>
10581
11020
  <xsl:copy-of select="$footnote_inline"/>
10582
11021
  <fo:footnote-body role="Note">
10583
11022
 
10584
11023
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
11024
+ <xsl:call-template name="refine_fn-container-body-style"/>
10585
11025
 
10586
11026
  <xsl:variable name="fn_block">
10587
11027
  <xsl:call-template name="refine_fn-body-style"/>
@@ -10683,6 +11123,9 @@
10683
11123
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10684
11124
  </xsl:attribute-set> <!-- admonition-style -->
10685
11125
 
11126
+ <xsl:template name="refine_admonition-style">
11127
+ </xsl:template>
11128
+
10686
11129
  <xsl:attribute-set name="admonition-container-style">
10687
11130
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
10688
11131
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -10690,6 +11133,9 @@
10690
11133
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
10691
11134
  </xsl:attribute-set> <!-- admonition-container-style -->
10692
11135
 
11136
+ <xsl:template name="refine_admonition-container-style">
11137
+ </xsl:template>
11138
+
10693
11139
  <xsl:attribute-set name="admonition-name-style">
10694
11140
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
10695
11141
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -10699,9 +11145,16 @@
10699
11145
  <xsl:attribute name="text-align">center</xsl:attribute>
10700
11146
  </xsl:attribute-set> <!-- admonition-name-style -->
10701
11147
 
11148
+ <xsl:template name="refine_admonition-name-style">
11149
+ </xsl:template>
11150
+
10702
11151
  <xsl:attribute-set name="admonition-p-style">
10703
11152
  <xsl:attribute name="font-style">italic</xsl:attribute>
10704
11153
  </xsl:attribute-set> <!-- admonition-p-style -->
11154
+
11155
+ <xsl:template name="refine_admonition-p-style">
11156
+ </xsl:template>
11157
+
10705
11158
  <!-- end admonition -->
10706
11159
 
10707
11160
  <!-- ================ -->
@@ -10711,12 +11164,18 @@
10711
11164
  <xsl:call-template name="setNamedDestination"/>
10712
11165
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
10713
11166
 
11167
+ <xsl:call-template name="refine_admonition-style"/>
11168
+
10714
11169
  <xsl:call-template name="setBlockSpanAll"/>
10715
11170
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
11171
+
11172
+ <xsl:call-template name="refine_admonition-container-style"/>
10716
11173
  <fo:block xsl:use-attribute-sets="admonition-name-style">
11174
+ <xsl:call-template name="refine_admonition-name-style"/>
10717
11175
  <xsl:call-template name="displayAdmonitionName"/>
10718
11176
  </fo:block>
10719
11177
  <fo:block xsl:use-attribute-sets="admonition-p-style">
11178
+ <xsl:call-template name="refine_admonition-p-style"/>
10720
11179
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10721
11180
  </fo:block>
10722
11181
 
@@ -10777,10 +11236,27 @@
10777
11236
  <!-- END Admonition -->
10778
11237
  <!-- ================ -->
10779
11238
 
11239
+ <xsl:attribute-set name="references-non-normative-title-style">
11240
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
11241
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
11242
+ <xsl:attribute name="text-align">center</xsl:attribute>
11243
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
11244
+ <xsl:attribute name="margin-bottom">36pt</xsl:attribute>
11245
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
11246
+ <xsl:attribute name="role">H1</xsl:attribute>
11247
+ </xsl:attribute-set>
11248
+
11249
+ <xsl:template name="refine_references-non-normative-title-style">
11250
+
11251
+ </xsl:template>
11252
+
10780
11253
  <!-- bibitem in Normative References (references/@normative="true") -->
10781
11254
  <xsl:attribute-set name="bibitem-normative-style">
10782
11255
  </xsl:attribute-set> <!-- bibitem-normative-style -->
10783
11256
 
11257
+ <xsl:template name="refine_bibitem-normative-style">
11258
+ </xsl:template>
11259
+
10784
11260
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
10785
11261
  <xsl:attribute-set name="bibitem-normative-list-style">
10786
11262
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -10789,9 +11265,28 @@
10789
11265
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
10790
11266
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
10791
11267
 
11268
+ <xsl:template name="refine_bibitem-normative-list-style">
11269
+ <xsl:variable name="docidentifier">
11270
+ <xsl:apply-templates select="mn:biblio-tag">
11271
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
11272
+ </xsl:apply-templates>
11273
+ </xsl:variable>
11274
+ <xsl:attribute name="provisional-distance-between-starts">
11275
+ <xsl:choose>
11276
+ <xsl:when test="string-length($docidentifier) = 0">0mm</xsl:when>
11277
+ <xsl:when test="string-length($docidentifier) &gt; 19">46.5mm</xsl:when>
11278
+ <xsl:when test="string-length($docidentifier) &gt; 10">37mm</xsl:when>
11279
+ <xsl:otherwise>24.5mm</xsl:otherwise>
11280
+ </xsl:choose>
11281
+ </xsl:attribute>
11282
+ </xsl:template>
11283
+
10792
11284
  <xsl:attribute-set name="bibitem-non-normative-style">
10793
11285
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
10794
11286
 
11287
+ <xsl:template name="refine_bibitem-non-normative-style">
11288
+ </xsl:template>
11289
+
10795
11290
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
10796
11291
  <xsl:attribute-set name="bibitem-non-normative-list-style">
10797
11292
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -10799,17 +11294,29 @@
10799
11294
  <xsl:attribute name="line-height">115%</xsl:attribute>
10800
11295
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
10801
11296
 
11297
+ <xsl:template name="refine_bibitem-non-normative-list-style">
11298
+ </xsl:template>
11299
+
10802
11300
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
10803
11301
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10804
11302
  </xsl:attribute-set>
10805
11303
 
11304
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
11305
+ </xsl:template>
11306
+
10806
11307
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
10807
11308
  <xsl:attribute-set name="bibitem-normative-list-body-style">
10808
11309
  </xsl:attribute-set>
10809
11310
 
11311
+ <xsl:template name="refine_bibitem-normative-list-body-style">
11312
+ </xsl:template>
11313
+
10810
11314
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
10811
11315
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
10812
11316
 
11317
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
11318
+ </xsl:template>
11319
+
10813
11320
  <!-- footnote reference number for bibitem, in the text -->
10814
11321
  <xsl:attribute-set name="bibitem-note-fn-style">
10815
11322
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -10818,6 +11325,9 @@
10818
11325
  <xsl:attribute name="baseline-shift">30%</xsl:attribute>
10819
11326
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
10820
11327
 
11328
+ <xsl:template name="refine_bibitem-note-fn-style">
11329
+ </xsl:template>
11330
+
10821
11331
  <!-- footnote number on the page bottom -->
10822
11332
  <xsl:attribute-set name="bibitem-note-fn-number-style">
10823
11333
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -10836,6 +11346,9 @@
10836
11346
  <xsl:attribute-set name="references-non-normative-style">
10837
11347
  </xsl:attribute-set> <!-- references-non-normative-style -->
10838
11348
 
11349
+ <xsl:template name="refine_references-non-normative-style">
11350
+ </xsl:template>
11351
+
10839
11352
  <!-- ======================= -->
10840
11353
  <!-- Bibliography rendering -->
10841
11354
  <!-- ======================= -->
@@ -10876,6 +11389,7 @@
10876
11389
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
10877
11390
 
10878
11391
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
11392
+ <xsl:call-template name="refine_references-non-normative-style"/>
10879
11393
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
10880
11394
  </fo:block>
10881
11395
  </xsl:template> <!-- references -->
@@ -10890,19 +11404,13 @@
10890
11404
  <xsl:call-template name="setNamedDestination"/>
10891
11405
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-normative-list-style">
10892
11406
 
11407
+ <xsl:call-template name="refine_bibitem-normative-list-style"/>
11408
+
10893
11409
  <xsl:variable name="docidentifier">
10894
11410
  <xsl:apply-templates select="mn:biblio-tag">
10895
11411
  <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10896
11412
  </xsl:apply-templates>
10897
11413
  </xsl:variable>
10898
- <xsl:attribute name="provisional-distance-between-starts">
10899
- <xsl:choose>
10900
- <xsl:when test="string-length($docidentifier) = 0">0mm</xsl:when>
10901
- <xsl:when test="string-length($docidentifier) &gt; 19">46.5mm</xsl:when>
10902
- <xsl:when test="string-length($docidentifier) &gt; 10">37mm</xsl:when>
10903
- <xsl:otherwise>24.5mm</xsl:otherwise>
10904
- </xsl:choose>
10905
- </xsl:attribute>
10906
11414
 
10907
11415
  <fo:list-item>
10908
11416
  <fo:list-item-label end-indent="label-end()">
@@ -10914,6 +11422,7 @@
10914
11422
  </fo:list-item-label>
10915
11423
  <fo:list-item-body start-indent="body-start()">
10916
11424
  <fo:block xsl:use-attribute-sets="bibitem-normative-list-body-style">
11425
+ <xsl:call-template name="refine_bibitem-normative-list-body-style"/>
10917
11426
  <xsl:call-template name="processBibitem">
10918
11427
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10919
11428
  </xsl:call-template>
@@ -10925,18 +11434,23 @@
10925
11434
  </xsl:template> <!-- bibitem -->
10926
11435
 
10927
11436
  <!-- Bibliography (non-normative references) -->
10928
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
11437
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
10929
11438
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
10930
11439
  <xsl:call-template name="bibitem"/>
10931
11440
 
10932
11441
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
10933
11442
 
11443
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
11444
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
11445
+
10934
11446
  <xsl:template name="insertListItem_Bibitem">
10935
11447
  <xsl:choose>
10936
11448
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
10937
11449
  <xsl:otherwise>
10938
11450
  <xsl:call-template name="setNamedDestination"/>
10939
11451
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
11452
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
11453
+
10940
11454
  <fo:list-item-label end-indent="label-end()">
10941
11455
  <fo:block role="SKIP">
10942
11456
  <fo:inline role="SKIP">
@@ -10947,16 +11461,18 @@
10947
11461
  </fo:block>
10948
11462
  </fo:list-item-label>
10949
11463
  <fo:list-item-body start-indent="body-start()">
10950
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
11464
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
11465
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
10951
11466
  <xsl:call-template name="processBibitem">
10952
11467
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10953
11468
  </xsl:call-template>
10954
11469
  </fo:block>
11470
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10955
11471
  </fo:list-item-body>
10956
11472
  </fo:list-item>
10957
11473
  </xsl:otherwise>
10958
11474
  </xsl:choose>
10959
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
11475
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
10960
11476
  <xsl:with-param name="skip">false</xsl:with-param>
10961
11477
  </xsl:apply-templates>
10962
11478
  </xsl:template>
@@ -10972,25 +11488,16 @@
10972
11488
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
10973
11489
  </xsl:apply-templates>
10974
11490
  <xsl:apply-templates select="mn:formattedref"/>
11491
+ <xsl:call-template name="processBibitemFollowingNotes"/>
10975
11492
  <!-- end bibitem processing -->
10976
-
10977
- <xsl:call-template name="processBibliographyNote"/>
10978
11493
  </xsl:template> <!-- processBibitem (bibitem) -->
10979
11494
 
10980
- <xsl:template name="processBibliographyNote">
10981
- <xsl:if test="self::mn:note">
10982
- <xsl:variable name="note_node">
10983
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
10984
- <xsl:copy> <!-- skip @id -->
10985
- <xsl:copy-of select="node()"/>
10986
- </xsl:copy>
10987
- </xsl:element>
10988
- </xsl:variable>
10989
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
10990
- <xsl:call-template name="note"/>
10991
- </xsl:for-each> -->
11495
+ <xsl:template name="processBibitemFollowingNotes">
11496
+ <!-- current context is bibitem element -->
11497
+ <xsl:variable name="bibitem_id" select="@id"/>
11498
+ <xsl:for-each select="following-sibling::mn:note[preceding-sibling::mn:bibitem[1][@id = $bibitem_id] and preceding-sibling::*[1][self::mn:note or self::mn:bibitem]]">
10992
11499
  <xsl:call-template name="note"/>
10993
- </xsl:if>
11500
+ </xsl:for-each>
10994
11501
  </xsl:template>
10995
11502
 
10996
11503
  <xsl:template match="mn:title" mode="title">
@@ -11190,11 +11697,17 @@
11190
11697
  <!-- Index section styles -->
11191
11698
  <xsl:attribute-set name="indexsect-title-style">
11192
11699
  <xsl:attribute name="role">H1</xsl:attribute>
11193
- </xsl:attribute-set>
11700
+ </xsl:attribute-set> <!-- indexsect-title-style -->
11701
+
11702
+ <xsl:template name="refine_indexsect-title-style">
11703
+ </xsl:template>
11194
11704
 
11195
11705
  <xsl:attribute-set name="indexsect-clause-title-style">
11196
11706
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11197
- </xsl:attribute-set>
11707
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
11708
+
11709
+ <xsl:template name="refine_indexsect-clause-title-style">
11710
+ </xsl:template>
11198
11711
  <!-- End Index section styles -->
11199
11712
 
11200
11713
  <!-- =================== -->
@@ -11388,6 +11901,7 @@
11388
11901
 
11389
11902
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
11390
11903
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
11904
+ <xsl:call-template name="refine_indexsect-title-style"/>
11391
11905
  <!-- Index -->
11392
11906
  <xsl:apply-templates/>
11393
11907
  </fo:block>
@@ -11396,6 +11910,7 @@
11396
11910
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
11397
11911
  <!-- Letter A, B, C, ... -->
11398
11912
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
11913
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
11399
11914
  <xsl:apply-templates/>
11400
11915
  </fo:block>
11401
11916
  </xsl:template>
@@ -11618,9 +12133,15 @@
11618
12133
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
11619
12134
  </xsl:attribute-set> <!-- END: toc-leader-style -->
11620
12135
 
12136
+ <xsl:template name="refine_toc-leader-style">
12137
+ </xsl:template>
12138
+
11621
12139
  <xsl:attribute-set name="toc-pagenumber-style">
11622
12140
  </xsl:attribute-set>
11623
12141
 
12142
+ <xsl:template name="refine_toc-pagenumber-style">
12143
+ </xsl:template>
12144
+
11624
12145
  <!-- List of Figures, Tables -->
11625
12146
  <xsl:attribute-set name="toc-listof-title-style">
11626
12147
  <xsl:attribute name="role">TOCI</xsl:attribute>
@@ -11635,6 +12156,9 @@
11635
12156
  <xsl:attribute-set name="toc-listof-item-block-style">
11636
12157
  </xsl:attribute-set>
11637
12158
 
12159
+ <xsl:template name="refine_toc-listof-item-block-style">
12160
+ </xsl:template>
12161
+
11638
12162
  <xsl:attribute-set name="toc-listof-item-style">
11639
12163
  <xsl:attribute name="role">TOCI</xsl:attribute>
11640
12164
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
@@ -11642,6 +12166,9 @@
11642
12166
  <xsl:attribute name="text-indent">-12mm</xsl:attribute>
11643
12167
  </xsl:attribute-set>
11644
12168
 
12169
+ <xsl:template name="refine_toc-listof-item-style">
12170
+ </xsl:template>
12171
+
11645
12172
  <xsl:template name="processPrefaceSectionsDefault_Contents">
11646
12173
  <xsl:variable name="nodes_preface_">
11647
12174
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -12754,23 +13281,55 @@
12754
13281
  <!-- Ruby text (CJK languages) rendering -->
12755
13282
  <!-- ===================================== -->
12756
13283
  <!-- ===================================== -->
13284
+
13285
+ <xsl:attribute-set name="ruby-style">
13286
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
13287
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
13288
+ </xsl:attribute-set>
13289
+
13290
+ <xsl:template name="refine_ruby-style">
13291
+ <xsl:if test="not(ancestor::mn:ruby)">
13292
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
13293
+ </xsl:if>
13294
+ <xsl:variable name="rt_text" select="mn:rt"/>
13295
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
13296
+ <!-- Example: width="2em" -->
13297
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
13298
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
13299
+ <xsl:variable name="text_width">
13300
+ <xsl:choose>
13301
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
13302
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
13303
+ </xsl:choose>
13304
+ </xsl:variable>
13305
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
13306
+ </xsl:template> <!-- refine_ruby-style -->
13307
+
13308
+ <xsl:attribute-set name="rb-style">
13309
+ <xsl:attribute name="line-height">1em</xsl:attribute>
13310
+ <xsl:attribute name="text-align">center</xsl:attribute>
13311
+ </xsl:attribute-set>
13312
+
13313
+ <xsl:template name="refine_rb-style">
13314
+ </xsl:template>
13315
+
13316
+ <xsl:attribute-set name="rt-style">
13317
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
13318
+ <xsl:attribute name="text-align">center</xsl:attribute>
13319
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
13320
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
13321
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
13322
+ </xsl:attribute-set>
13323
+
13324
+ <xsl:template name="refine_rt-style">
13325
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
13326
+ <xsl:attribute name="space-before">0em</xsl:attribute>
13327
+ </xsl:if>
13328
+ </xsl:template>
13329
+
12757
13330
  <xsl:template match="mn:ruby">
12758
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
12759
- <xsl:if test="not(ancestor::mn:ruby)">
12760
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
12761
- </xsl:if>
12762
- <xsl:variable name="rt_text" select="mn:rt"/>
12763
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
12764
- <!-- Example: width="2em" -->
12765
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
12766
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
12767
- <xsl:variable name="text_width">
12768
- <xsl:choose>
12769
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
12770
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
12771
- </xsl:choose>
12772
- </xsl:variable>
12773
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
13331
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
13332
+ <xsl:call-template name="refine_ruby-style"/>
12774
13333
 
12775
13334
  <xsl:choose>
12776
13335
  <xsl:when test="ancestor::mn:ruby">
@@ -12788,17 +13347,14 @@
12788
13347
  </xsl:template>
12789
13348
 
12790
13349
  <xsl:template match="mn:rb">
12791
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
13350
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
12792
13351
  </xsl:template>
12793
13352
 
12794
13353
  <xsl:template match="mn:rt">
12795
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
12796
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
12797
- <xsl:attribute name="space-before">0em</xsl:attribute>
12798
- </xsl:if>
13354
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
13355
+ <xsl:call-template name="refine_rt-style"/>
12799
13356
  <xsl:apply-templates/>
12800
13357
  </fo:block>
12801
-
12802
13358
  </xsl:template>
12803
13359
 
12804
13360
  <!-- ===================================== -->
@@ -12807,6 +13363,24 @@
12807
13363
  <!-- ===================================== -->
12808
13364
  <!-- ===================================== -->
12809
13365
 
13366
+ <xsl:attribute-set name="annex-title-style">
13367
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
13368
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
13369
+ <xsl:attribute name="text-align">center</xsl:attribute>
13370
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
13371
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
13372
+ <xsl:attribute name="role">H1</xsl:attribute>
13373
+ </xsl:attribute-set>
13374
+
13375
+ <xsl:template name="refine_annex-title-style">
13376
+ </xsl:template>
13377
+
13378
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
13379
+ </xsl:attribute-set>
13380
+
13381
+ <xsl:template name="refine_p-zzSTDTitle1-style">
13382
+ </xsl:template>
13383
+
12810
13384
  <xsl:template name="processPrefaceSectionsDefault">
12811
13385
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
12812
13386
  <xsl:sort select="@displayorder" data-type="number"/>