metanorma-un 0.10.8 → 0.10.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -182,119 +182,10 @@
182
182
  </fo:flow>
183
183
  </fo:page-sequence>
184
184
 
185
- <fo:page-sequence master-reference="document-preface-master" force-page-count="even" line-height="115%">
186
- <xsl:call-template name="insertHeaderPreface"/>
187
- <fo:flow flow-name="xsl-region-body" text-align="justify">
188
- <xsl:variable name="title-toc">
189
- <xsl:call-template name="getTitle">
190
- <xsl:with-param name="name" select="'title-toc'"/>
191
- </xsl:call-template>
192
- </xsl:variable>
193
- <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
194
- <xsl:variable name="title-page">
195
- <xsl:call-template name="getLocalizedString">
196
- <xsl:with-param name="key">locality.page</xsl:with-param>
197
- <xsl:with-param name="lang" select="$lang"/>
198
- </xsl:call-template>
199
- </xsl:variable>
200
- <fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-page"/></fo:block>
201
- <fo:block role="TOC">
202
- <xsl:for-each select="$contents//item[not (@type = 'annex' or @parent = 'annex') and @display = 'true']">
203
-
204
- <fo:block role="TOCI">
205
-
206
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
207
- <xsl:if test="@level = 2 and @section != ''">
208
- <xsl:attribute name="margin-left">20mm</xsl:attribute>
209
- </xsl:if>
210
- <xsl:if test="@level &gt;= 3 and @section != ''">
211
- <xsl:attribute name="margin-left"><xsl:value-of select="(@level - 2) * 28"/>mm</xsl:attribute>
212
- </xsl:if>
213
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
214
- <xsl:if test="@section != ''">
215
- <fo:inline>
216
- <xsl:attribute name="padding-right">
217
- <xsl:choose>
218
- <xsl:when test="@level = 1">4mm</xsl:when>
219
- <xsl:when test="@level = 2">5mm</xsl:when>
220
- <xsl:otherwise>4mm</xsl:otherwise>
221
- </xsl:choose>
222
- </xsl:attribute>
223
- <xsl:value-of select="@section"/>
224
- </fo:inline>
225
- </xsl:if>
226
-
227
- <xsl:apply-templates select="title"/>
228
- <xsl:text> </xsl:text>
229
-
230
- <fo:inline keep-together.within-line="always">
231
- <fo:leader leader-pattern="dots"/>
232
- <fo:page-number-citation ref-id="{@id}"/>
233
- </fo:inline>
234
- </fo:basic-link>
235
- </fo:block>
236
- </fo:block>
237
-
238
- </xsl:for-each>
239
-
240
- <xsl:if test="$contents//item[@type = 'annex' and @display = 'true']">
241
- <fo:block text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-next="always">ANNEXES</fo:block>
242
- <xsl:for-each select="$contents//item[@type = 'annex' and @display = 'true']">
243
- <fo:block role="TOCI">
244
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
245
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
246
- <xsl:if test="@section = ''">
247
- <xsl:attribute name="fox:alt-text">Annex</xsl:attribute>
248
- </xsl:if>
249
- <xsl:if test="@section != ''">
250
- <fo:inline padding-right="3mm">
251
- <xsl:choose>
252
- <xsl:when test="contains(@section, 'Annex')">
253
- <xsl:value-of select="substring-after(@section, 'Annex')"/>
254
- <xsl:text>: </xsl:text>
255
- </xsl:when>
256
- <xsl:otherwise>
257
- <xsl:value-of select="@section"/>
258
- </xsl:otherwise>
259
- </xsl:choose>
260
- </fo:inline>
261
- </xsl:if>
262
-
263
- <xsl:apply-templates/>
264
-
265
- <fo:inline keep-together.within-line="always">
266
- <fo:leader leader-pattern="dots"/>
267
- <fo:page-number-citation ref-id="{@id}"/>
268
- </fo:inline>
269
- </fo:basic-link>
270
- </fo:block>
271
- </fo:block>
272
- </xsl:for-each>
273
- </xsl:if>
274
-
275
- <!-- List of Tables -->
276
- <xsl:if test="$contents//tables/table">
277
- <xsl:call-template name="insertListOf_Title">
278
- <xsl:with-param name="title" select="$title-list-tables"/>
279
- </xsl:call-template>
280
- <xsl:for-each select="$contents//tables/table">
281
- <xsl:call-template name="insertListOf_Item"/>
282
- </xsl:for-each>
283
- </xsl:if>
284
-
285
- <!-- List of Figures -->
286
- <xsl:if test="$contents//figures/figure">
287
- <xsl:call-template name="insertListOf_Title">
288
- <xsl:with-param name="title" select="$title-list-figures"/>
289
- </xsl:call-template>
290
- <xsl:for-each select="$contents//figures/figure">
291
- <xsl:call-template name="insertListOf_Item"/>
292
- </xsl:for-each>
293
- </xsl:if>
294
-
295
- </fo:block>
296
- </fo:flow>
297
- </fo:page-sequence>
185
+ <!-- Table of contents -->
186
+ <xsl:apply-templates select="/*/un:preface/un:clause[@type = 'toc']">
187
+ <xsl:with-param name="process">true</xsl:with-param>
188
+ </xsl:apply-templates>
298
189
 
299
190
  <!-- End Preface Pages -->
300
191
 
@@ -374,6 +265,140 @@
374
265
  </fo:block>
375
266
  </xsl:template>
376
267
 
268
+ <xsl:template match="un:preface/un:clause[@type = 'toc']" priority="4">
269
+ <xsl:param name="process">false</xsl:param>
270
+ <xsl:if test="$process = 'true'">
271
+ <fo:page-sequence master-reference="document-preface-master" force-page-count="even" line-height="115%">
272
+ <xsl:call-template name="insertHeaderPreface"/>
273
+ <fo:flow flow-name="xsl-region-body" text-align="justify">
274
+
275
+ <xsl:apply-templates/>
276
+
277
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
278
+
279
+ <fo:block role="TOC">
280
+ <xsl:for-each select="$contents//item[not (@type = 'annex' or @parent = 'annex') and @display = 'true']">
281
+
282
+ <fo:block role="TOCI">
283
+
284
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
285
+ <xsl:if test="@level = 2 and @section != ''">
286
+ <xsl:attribute name="margin-left">20mm</xsl:attribute>
287
+ </xsl:if>
288
+ <xsl:if test="@level &gt;= 3 and @section != ''">
289
+ <xsl:attribute name="margin-left"><xsl:value-of select="(@level - 2) * 28"/>mm</xsl:attribute>
290
+ </xsl:if>
291
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
292
+ <xsl:if test="@section != ''">
293
+ <fo:inline>
294
+ <xsl:attribute name="padding-right">
295
+ <xsl:choose>
296
+ <xsl:when test="@level = 1">4mm</xsl:when>
297
+ <xsl:when test="@level = 2">5mm</xsl:when>
298
+ <xsl:otherwise>4mm</xsl:otherwise>
299
+ </xsl:choose>
300
+ </xsl:attribute>
301
+ <xsl:value-of select="@section"/>
302
+ </fo:inline>
303
+ </xsl:if>
304
+
305
+ <xsl:apply-templates select="title"/>
306
+ <xsl:text> </xsl:text>
307
+
308
+ <fo:inline keep-together.within-line="always">
309
+ <fo:leader leader-pattern="dots"/>
310
+ <fo:page-number-citation ref-id="{@id}"/>
311
+ </fo:inline>
312
+ </fo:basic-link>
313
+ </fo:block>
314
+ </fo:block>
315
+
316
+ </xsl:for-each>
317
+
318
+ <xsl:if test="$contents//item[@type = 'annex' and @display = 'true']">
319
+ <fo:block text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-next="always">ANNEXES</fo:block>
320
+ <xsl:for-each select="$contents//item[@type = 'annex' and @display = 'true']">
321
+ <fo:block role="TOCI">
322
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
323
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}">
324
+ <xsl:if test="@section = ''">
325
+ <xsl:attribute name="fox:alt-text">Annex</xsl:attribute>
326
+ </xsl:if>
327
+ <xsl:if test="@section != ''">
328
+ <fo:inline padding-right="3mm">
329
+ <xsl:choose>
330
+ <xsl:when test="contains(@section, 'Annex')">
331
+ <xsl:value-of select="substring-after(@section, 'Annex')"/>
332
+ <xsl:text>: </xsl:text>
333
+ </xsl:when>
334
+ <xsl:otherwise>
335
+ <xsl:value-of select="@section"/>
336
+ </xsl:otherwise>
337
+ </xsl:choose>
338
+ </fo:inline>
339
+ </xsl:if>
340
+
341
+ <xsl:apply-templates/>
342
+
343
+ <fo:inline keep-together.within-line="always">
344
+ <fo:leader leader-pattern="dots"/>
345
+ <fo:page-number-citation ref-id="{@id}"/>
346
+ </fo:inline>
347
+ </fo:basic-link>
348
+ </fo:block>
349
+ </fo:block>
350
+ </xsl:for-each>
351
+ </xsl:if>
352
+
353
+ <!-- List of Tables -->
354
+ <xsl:if test="$contents//tables/table">
355
+ <xsl:call-template name="insertListOf_Title">
356
+ <xsl:with-param name="title" select="$title-list-tables"/>
357
+ </xsl:call-template>
358
+ <xsl:for-each select="$contents//tables/table">
359
+ <xsl:call-template name="insertListOf_Item"/>
360
+ </xsl:for-each>
361
+ </xsl:if>
362
+
363
+ <!-- List of Figures -->
364
+ <xsl:if test="$contents//figures/figure">
365
+ <xsl:call-template name="insertListOf_Title">
366
+ <xsl:with-param name="title" select="$title-list-figures"/>
367
+ </xsl:call-template>
368
+ <xsl:for-each select="$contents//figures/figure">
369
+ <xsl:call-template name="insertListOf_Item"/>
370
+ </xsl:for-each>
371
+ </xsl:if>
372
+
373
+ </fo:block>
374
+ </xsl:if>
375
+ <fo:block/> <!-- prevent empty toc -->
376
+ </fo:flow>
377
+ </fo:page-sequence>
378
+
379
+ </xsl:if>
380
+ </xsl:template>
381
+
382
+ <xsl:template match="un:preface/un:clause[@type = 'toc']/un:title" priority="4">
383
+ <!-- <xsl:variable name="title-toc">
384
+ <xsl:call-template name="getTitle">
385
+ <xsl:with-param name="name" select="'title-toc'"/>
386
+ </xsl:call-template>
387
+ </xsl:variable> -->
388
+ <fo:block font-size="14pt" margin-top="4pt" margin-bottom="8pt" role="H1">
389
+ <!-- <xsl:value-of select="$title-toc"/> -->
390
+ <xsl:apply-templates/>
391
+ </fo:block>
392
+
393
+ <xsl:variable name="title-page">
394
+ <xsl:call-template name="getLocalizedString">
395
+ <xsl:with-param name="key">locality.page</xsl:with-param>
396
+ <xsl:with-param name="lang" select="$lang"/>
397
+ </xsl:call-template>
398
+ </xsl:variable>
399
+ <fo:block font-size="9pt" text-align="right" font-style="italic" margin-bottom="6pt"><xsl:value-of select="$title-page"/></fo:block>
400
+ </xsl:template>
401
+
377
402
  <!-- ============================= -->
378
403
  <!-- CONTENTS -->
379
404
  <!-- ============================= -->
@@ -401,6 +426,7 @@
401
426
 
402
427
  <xsl:variable name="skip">
403
428
  <xsl:choose>
429
+ <xsl:when test="@type = 'toc'">true</xsl:when>
404
430
  <xsl:when test="ancestor-or-self::un:bibitem">true</xsl:when>
405
431
  <xsl:when test="ancestor-or-self::un:term">true</xsl:when>
406
432
  <xsl:when test="@inline-header='true'">true</xsl:when>
@@ -1212,6 +1238,10 @@
1212
1238
 
1213
1239
  </xsl:attribute-set>
1214
1240
 
1241
+ <xsl:template name="refine_link-style">
1242
+
1243
+ </xsl:template> <!-- refine_link-style -->
1244
+
1215
1245
  <xsl:attribute-set name="sourcecode-container-style">
1216
1246
 
1217
1247
  </xsl:attribute-set>
@@ -1227,6 +1257,10 @@
1227
1257
 
1228
1258
  </xsl:attribute-set>
1229
1259
 
1260
+ <xsl:template name="refine_sourcecode-style">
1261
+
1262
+ </xsl:template> <!-- refine_sourcecode-style -->
1263
+
1230
1264
  <xsl:attribute-set name="pre-style">
1231
1265
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1232
1266
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1304,6 +1338,10 @@
1304
1338
 
1305
1339
  </xsl:attribute-set> <!-- example-style -->
1306
1340
 
1341
+ <xsl:template name="refine_example-style">
1342
+
1343
+ </xsl:template> <!-- refine_example-style -->
1344
+
1307
1345
  <xsl:attribute-set name="example-body-style">
1308
1346
 
1309
1347
  </xsl:attribute-set> <!-- example-body-style -->
@@ -1326,6 +1364,15 @@
1326
1364
 
1327
1365
  </xsl:attribute-set> <!-- example-p-style -->
1328
1366
 
1367
+ <xsl:template name="refine_example-p-style">
1368
+
1369
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
1370
+ <xsl:if test="$num = 1">
1371
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
1372
+ </xsl:if>
1373
+
1374
+ </xsl:template> <!-- refine_example-p-style -->
1375
+
1329
1376
  <xsl:attribute-set name="termexample-name-style">
1330
1377
 
1331
1378
  </xsl:attribute-set> <!-- termexample-name-style -->
@@ -1351,12 +1398,42 @@
1351
1398
 
1352
1399
  </xsl:attribute-set> <!-- table-container-style -->
1353
1400
 
1401
+ <xsl:template name="refine_table-container-style">
1402
+ <xsl:param name="margin-side"/>
1403
+
1404
+ <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
1405
+ <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
1406
+
1407
+ <xsl:if test="not(ancestor::*[local-name()='sections'])">
1408
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1409
+ </xsl:if>
1410
+
1411
+ <!-- end table block-container attributes -->
1412
+ </xsl:template> <!-- refine_table-container-style -->
1413
+
1354
1414
  <xsl:attribute-set name="table-style">
1355
1415
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1356
1416
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
1357
1417
 
1358
1418
  </xsl:attribute-set><!-- table-style -->
1359
1419
 
1420
+ <xsl:template name="refine_table-style">
1421
+ <xsl:param name="margin-side"/>
1422
+
1423
+ <xsl:if test="$margin-side != 0">
1424
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
1425
+ <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
1426
+ </xsl:if>
1427
+
1428
+ <xsl:call-template name="setBordersTableArray"/>
1429
+
1430
+ <xsl:if test="ancestor::*[local-name()='sections']">
1431
+ <xsl:attribute name="border-top">1.5pt solid black</xsl:attribute>
1432
+ <xsl:attribute name="border-bottom">1.5pt solid black</xsl:attribute>
1433
+ </xsl:if>
1434
+
1435
+ </xsl:template> <!-- refine_table-style -->
1436
+
1360
1437
  <xsl:attribute-set name="table-name-style">
1361
1438
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1362
1439
 
@@ -1369,6 +1446,11 @@
1369
1446
 
1370
1447
  </xsl:attribute-set> <!-- table-name-style -->
1371
1448
 
1449
+ <xsl:template name="refine_table-name-style">
1450
+ <xsl:param name="continued"/>
1451
+
1452
+ </xsl:template> <!-- refine_table-name-style -->
1453
+
1372
1454
  <xsl:attribute-set name="table-row-style">
1373
1455
  <xsl:attribute name="min-height">4mm</xsl:attribute>
1374
1456
 
@@ -1379,14 +1461,30 @@
1379
1461
 
1380
1462
  </xsl:attribute-set>
1381
1463
 
1464
+ <xsl:template name="refine_table-header-row-style">
1465
+
1466
+ <xsl:call-template name="setBordersTableArray"/>
1467
+
1468
+ </xsl:template> <!-- refine_table-header-row-style -->
1469
+
1382
1470
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
1383
1471
 
1384
1472
  </xsl:attribute-set>
1385
1473
 
1474
+ <xsl:template name="refine_table-footer-row-style">
1475
+
1476
+ </xsl:template> <!-- refine_table-footer-row-style -->
1477
+
1386
1478
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
1387
1479
 
1388
1480
  </xsl:attribute-set>
1389
1481
 
1482
+ <xsl:template name="refine_table-body-row-style">
1483
+
1484
+ <xsl:call-template name="setBordersTableArray"/>
1485
+
1486
+ </xsl:template> <!-- refine_table-body-row-style -->
1487
+
1390
1488
  <xsl:attribute-set name="table-header-cell-style">
1391
1489
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1392
1490
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1398,6 +1496,33 @@
1398
1496
 
1399
1497
  </xsl:attribute-set> <!-- table-header-cell-style -->
1400
1498
 
1499
+ <xsl:template name="refine_table-header-cell-style">
1500
+
1501
+ <xsl:call-template name="setBordersTableArray"/>
1502
+
1503
+ <xsl:if test="ancestor::*[local-name()='sections']">
1504
+ <xsl:attribute name="border">solid black 0pt</xsl:attribute>
1505
+ <xsl:attribute name="display-align">before</xsl:attribute>
1506
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1507
+ </xsl:if>
1508
+ <xsl:if test="ancestor::*[local-name()='annex']">
1509
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1510
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1511
+ <xsl:attribute name="background-color">rgb(218, 218, 218)</xsl:attribute>
1512
+ <xsl:if test="starts-with(text(), '1') or starts-with(text(), '2') or starts-with(text(), '3') or starts-with(text(), '4') or starts-with(text(), '5') or starts-with(text(), '6') or starts-with(text(), '7') or starts-with(text(), '8') or starts-with(text(), '9')">
1513
+ <xsl:attribute name="color">rgb(46, 116, 182)</xsl:attribute>
1514
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1515
+ </xsl:if>
1516
+ </xsl:if>
1517
+
1518
+ <xsl:if test="$lang = 'ar'">
1519
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1520
+ </xsl:if>
1521
+
1522
+ <xsl:call-template name="setTableCellAttributes"/>
1523
+
1524
+ </xsl:template> <!-- refine_table-header-cell-style -->
1525
+
1401
1526
  <xsl:attribute-set name="table-cell-style">
1402
1527
  <xsl:attribute name="display-align">center</xsl:attribute>
1403
1528
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1408,6 +1533,23 @@
1408
1533
 
1409
1534
  </xsl:attribute-set> <!-- table-cell-style -->
1410
1535
 
1536
+ <xsl:template name="refine_table-cell-style">
1537
+
1538
+ <xsl:if test="$lang = 'ar'">
1539
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1540
+ </xsl:if>
1541
+
1542
+ <!-- bsi -->
1543
+
1544
+ <xsl:call-template name="setBordersTableArray"/>
1545
+
1546
+ <xsl:if test="ancestor::*[local-name()='sections']">
1547
+ <xsl:attribute name="border">solid black 0pt</xsl:attribute>
1548
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1549
+ </xsl:if>
1550
+
1551
+ </xsl:template> <!-- refine_table-cell-style -->
1552
+
1411
1553
  <xsl:attribute-set name="table-footer-cell-style">
1412
1554
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1413
1555
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1416,12 +1558,20 @@
1416
1558
 
1417
1559
  </xsl:attribute-set> <!-- table-footer-cell-style -->
1418
1560
 
1561
+ <xsl:template name="refine_table-footer-cell-style">
1562
+
1563
+ </xsl:template> <!-- refine_table-footer-cell-style -->
1564
+
1419
1565
  <xsl:attribute-set name="table-note-style">
1420
1566
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1421
1567
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1422
1568
 
1423
1569
  </xsl:attribute-set><!-- table-note-style -->
1424
1570
 
1571
+ <xsl:template name="refine_table-note-style">
1572
+
1573
+ </xsl:template> <!-- refine_table-note-style -->
1574
+
1425
1575
  <xsl:attribute-set name="table-fn-style">
1426
1576
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1427
1577
 
@@ -1477,11 +1627,19 @@
1477
1627
 
1478
1628
  </xsl:attribute-set>
1479
1629
 
1630
+ <xsl:template name="refine_dt-cell-style">
1631
+
1632
+ </xsl:template> <!-- refine_dt-cell-style -->
1633
+
1480
1634
  <xsl:attribute-set name="dt-block-style">
1481
1635
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
1482
1636
 
1483
1637
  </xsl:attribute-set>
1484
1638
 
1639
+ <xsl:template name="refine_dt-block-style">
1640
+
1641
+ </xsl:template> <!-- refine_dt-block-style -->
1642
+
1485
1643
  <xsl:attribute-set name="dl-name-style">
1486
1644
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1487
1645
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1495,6 +1653,10 @@
1495
1653
 
1496
1654
  </xsl:attribute-set>
1497
1655
 
1656
+ <xsl:template name="refine_dd-cell-style">
1657
+
1658
+ </xsl:template> <!-- refine_dd-cell-style -->
1659
+
1498
1660
  <!-- ========================== -->
1499
1661
  <!-- END Definition's list styles -->
1500
1662
  <!-- ========================== -->
@@ -1508,7 +1670,6 @@
1508
1670
  </xsl:attribute-set>
1509
1671
 
1510
1672
  <xsl:attribute-set name="xref-style">
1511
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1512
1673
 
1513
1674
  </xsl:attribute-set>
1514
1675
 
@@ -1516,6 +1677,12 @@
1516
1677
 
1517
1678
  </xsl:attribute-set>
1518
1679
 
1680
+ <xsl:template name="refine_eref-style">
1681
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
1682
+ <xsl:variable name="text" select="normalize-space()"/>
1683
+
1684
+ </xsl:template> <!-- refine_eref-style -->
1685
+
1519
1686
  <xsl:attribute-set name="note-style">
1520
1687
 
1521
1688
  <xsl:attribute name="margin-top">3pt</xsl:attribute>
@@ -1524,6 +1691,14 @@
1524
1691
 
1525
1692
  </xsl:attribute-set>
1526
1693
 
1694
+ <xsl:template name="refine_note-style">
1695
+
1696
+ <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'">
1697
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1698
+ </xsl:if>
1699
+
1700
+ </xsl:template>
1701
+
1527
1702
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
1528
1703
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
1529
1704
 
@@ -1531,11 +1706,23 @@
1531
1706
 
1532
1707
  </xsl:attribute-set>
1533
1708
 
1709
+ <xsl:template name="refine_note-name-style">
1710
+
1711
+ </xsl:template> <!-- refine_note-name-style -->
1712
+
1534
1713
  <xsl:attribute-set name="table-note-name-style">
1535
1714
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
1536
1715
 
1537
1716
  </xsl:attribute-set>
1538
1717
 
1718
+ <xsl:template name="refine_table-note-name-style">
1719
+
1720
+ <xsl:if test="@type = 'source' or @type = 'abbreviation'">
1721
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
1722
+ </xsl:if>
1723
+
1724
+ </xsl:template> <!-- refine_table-note-name-style -->
1725
+
1539
1726
  <xsl:attribute-set name="note-p-style">
1540
1727
 
1541
1728
  <xsl:attribute name="margin-top">3pt</xsl:attribute>
@@ -1552,10 +1739,18 @@
1552
1739
 
1553
1740
  </xsl:attribute-set>
1554
1741
 
1742
+ <xsl:template name="refine_termnote-style">
1743
+
1744
+ </xsl:template> <!-- refine_termnote-style -->
1745
+
1555
1746
  <xsl:attribute-set name="termnote-name-style">
1556
1747
 
1557
1748
  </xsl:attribute-set>
1558
1749
 
1750
+ <xsl:template name="refine_termnote-name-style">
1751
+
1752
+ </xsl:template>
1753
+
1559
1754
  <xsl:attribute-set name="termnote-p-style">
1560
1755
 
1561
1756
  </xsl:attribute-set>
@@ -1566,6 +1761,10 @@
1566
1761
 
1567
1762
  </xsl:attribute-set>
1568
1763
 
1764
+ <xsl:template name="refine_quote-style">
1765
+
1766
+ </xsl:template>
1767
+
1569
1768
  <xsl:attribute-set name="quote-source-style">
1570
1769
  <xsl:attribute name="text-align">right</xsl:attribute>
1571
1770
 
@@ -1575,6 +1774,10 @@
1575
1774
 
1576
1775
  </xsl:attribute-set>
1577
1776
 
1777
+ <xsl:template name="refine_termsource-style">
1778
+
1779
+ </xsl:template> <!-- refine_termsource-style -->
1780
+
1578
1781
  <xsl:attribute-set name="termsource-text-style">
1579
1782
 
1580
1783
  </xsl:attribute-set>
@@ -1613,6 +1816,10 @@
1613
1816
 
1614
1817
  </xsl:attribute-set>
1615
1818
 
1819
+ <xsl:template name="refine_figure-name-style">
1820
+
1821
+ </xsl:template> <!-- refine_figure-name-style -->
1822
+
1616
1823
  <xsl:attribute-set name="figure-source-style">
1617
1824
 
1618
1825
  </xsl:attribute-set>
@@ -1629,6 +1836,15 @@
1629
1836
 
1630
1837
  </xsl:attribute-set> <!-- formula-stem-block-style -->
1631
1838
 
1839
+ <xsl:template name="refine_formula-stem-block-style">
1840
+
1841
+ <xsl:if test="ancestor::*[local-name() ='annex']">
1842
+ <xsl:attribute name="text-align">left</xsl:attribute>
1843
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
1844
+ </xsl:if>
1845
+
1846
+ </xsl:template> <!-- refine_formula-stem-block-style -->
1847
+
1632
1848
  <xsl:attribute-set name="formula-stem-number-style">
1633
1849
  <xsl:attribute name="text-align">right</xsl:attribute>
1634
1850
 
@@ -1643,6 +1859,15 @@
1643
1859
 
1644
1860
  </xsl:attribute-set>
1645
1861
 
1862
+ <xsl:template name="refine_image-style">
1863
+
1864
+ <xsl:if test="ancestor::un:admonition">
1865
+ <xsl:attribute name="margin-top">-12mm</xsl:attribute>
1866
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1867
+ </xsl:if>
1868
+
1869
+ </xsl:template>
1870
+
1646
1871
  <xsl:attribute-set name="figure-pseudocode-p-style">
1647
1872
 
1648
1873
  </xsl:attribute-set>
@@ -1729,6 +1954,10 @@
1729
1954
 
1730
1955
  </xsl:attribute-set>
1731
1956
 
1957
+ <xsl:template name="refine_mathml-style">
1958
+
1959
+ </xsl:template>
1960
+
1732
1961
  <xsl:attribute-set name="list-style">
1733
1962
 
1734
1963
  <xsl:attribute name="provisional-distance-between-starts">3.5mm</xsl:attribute>
@@ -1737,6 +1966,10 @@
1737
1966
 
1738
1967
  </xsl:attribute-set> <!-- list-style -->
1739
1968
 
1969
+ <xsl:template name="refine_list-style">
1970
+
1971
+ </xsl:template> <!-- refine_list-style -->
1972
+
1740
1973
  <xsl:attribute-set name="list-name-style">
1741
1974
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1742
1975
 
@@ -1748,14 +1981,26 @@
1748
1981
 
1749
1982
  </xsl:attribute-set>
1750
1983
 
1984
+ <xsl:template name="refine_list-item-style">
1985
+
1986
+ </xsl:template> <!-- refine_list-item-style -->
1987
+
1751
1988
  <xsl:attribute-set name="list-item-label-style">
1752
1989
 
1753
1990
  </xsl:attribute-set>
1754
1991
 
1992
+ <xsl:template name="refine_list-item-label-style">
1993
+
1994
+ </xsl:template> <!-- refine_list-item-label-style -->
1995
+
1755
1996
  <xsl:attribute-set name="list-item-body-style">
1756
1997
 
1757
1998
  </xsl:attribute-set>
1758
1999
 
2000
+ <xsl:template name="refine_list-item-body-style">
2001
+
2002
+ </xsl:template> <!-- refine_list-item-body-style -->
2003
+
1759
2004
  <xsl:attribute-set name="toc-style">
1760
2005
  <xsl:attribute name="line-height">135%</xsl:attribute>
1761
2006
  </xsl:attribute-set>
@@ -1766,6 +2011,10 @@
1766
2011
 
1767
2012
  </xsl:attribute-set>
1768
2013
 
2014
+ <xsl:template name="refine_fn-reference-style">
2015
+
2016
+ </xsl:template> <!-- refine_fn-reference-style -->
2017
+
1769
2018
  <xsl:attribute-set name="fn-style">
1770
2019
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1771
2020
  </xsl:attribute-set>
@@ -1789,6 +2038,10 @@
1789
2038
 
1790
2039
  </xsl:attribute-set>
1791
2040
 
2041
+ <xsl:template name="refine_fn-body-style">
2042
+
2043
+ </xsl:template> <!-- refine_fn-body-style -->
2044
+
1792
2045
  <xsl:attribute-set name="fn-body-num-style">
1793
2046
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1794
2047
 
@@ -1798,6 +2051,10 @@
1798
2051
 
1799
2052
  </xsl:attribute-set> <!-- fn-body-num-style -->
1800
2053
 
2054
+ <xsl:template name="refine_fn-body-num-style">
2055
+
2056
+ </xsl:template> <!-- refine_fn-body-num-style -->
2057
+
1801
2058
  <!-- admonition -->
1802
2059
  <xsl:attribute-set name="admonition-style">
1803
2060
 
@@ -2453,14 +2710,9 @@
2453
2710
 
2454
2711
  <fo:block-container xsl:use-attribute-sets="table-container-style">
2455
2712
 
2456
- <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
2457
- <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute>
2458
-
2459
- <xsl:if test="not(ancestor::*[local-name()='sections'])">
2460
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2461
- </xsl:if>
2462
-
2463
- <!-- end table block-container attributes -->
2713
+ <xsl:call-template name="refine_table-container-style">
2714
+ <xsl:with-param name="margin-side" select="$margin-side"/>
2715
+ </xsl:call-template>
2464
2716
 
2465
2717
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2466
2718
 
@@ -2487,17 +2739,9 @@
2487
2739
 
2488
2740
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2489
2741
 
2490
- <xsl:if test="$margin-side != 0">
2491
- <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2492
- <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2493
- </xsl:if>
2494
-
2495
- <xsl:call-template name="setBordersTableArray"/>
2496
-
2497
- <xsl:if test="ancestor::*[local-name()='sections']">
2498
- <xsl:attribute name="border-top">1.5pt solid black</xsl:attribute>
2499
- <xsl:attribute name="border-bottom">1.5pt solid black</xsl:attribute>
2500
- </xsl:if>
2742
+ <xsl:call-template name="refine_table-style">
2743
+ <xsl:with-param name="margin-side" select="$margin-side"/>
2744
+ </xsl:call-template>
2501
2745
 
2502
2746
  </xsl:element>
2503
2747
  </xsl:variable>
@@ -2563,7 +2807,7 @@
2563
2807
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2564
2808
  </xsl:when>
2565
2809
  <xsl:otherwise>
2566
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2810
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2567
2811
  </xsl:otherwise>
2568
2812
  </xsl:choose>
2569
2813
 
@@ -2650,6 +2894,10 @@
2650
2894
 
2651
2895
  <fo:block xsl:use-attribute-sets="table-name-style">
2652
2896
 
2897
+ <xsl:call-template name="refine_table-name-style">
2898
+ <xsl:with-param name="continued" select="$continued"/>
2899
+ </xsl:call-template>
2900
+
2653
2901
  <xsl:choose>
2654
2902
  <xsl:when test="$continued = 'true'">
2655
2903
 
@@ -3032,6 +3280,8 @@
3032
3280
  <fo:table-row>
3033
3281
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3034
3282
 
3283
+ <xsl:call-template name="refine_table-header-title-style"/>
3284
+
3035
3285
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3036
3286
  <xsl:with-param name="continued">true</xsl:with-param>
3037
3287
  </xsl:apply-templates>
@@ -3044,6 +3294,10 @@
3044
3294
  </fo:table-row>
3045
3295
  </xsl:template> <!-- table-header-title -->
3046
3296
 
3297
+ <xsl:template name="refine_table-header-title-style">
3298
+
3299
+ </xsl:template> <!-- refine_table-header-title-style -->
3300
+
3047
3301
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3048
3302
  <fo:table-body>
3049
3303
  <xsl:apply-templates/>
@@ -3068,7 +3322,7 @@
3068
3322
  <xsl:param name="colwidths"/>
3069
3323
  <xsl:param name="colgroup"/>
3070
3324
 
3071
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3325
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3072
3326
 
3073
3327
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3074
3328
 
@@ -3128,6 +3382,8 @@
3128
3382
  <fo:table-row>
3129
3383
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3130
3384
 
3385
+ <xsl:call-template name="refine_table-footer-cell-style"/>
3386
+
3131
3387
  <xsl:call-template name="setBordersTableArray"/>
3132
3388
 
3133
3389
  <!-- fn will be processed inside 'note' processing -->
@@ -3136,6 +3392,7 @@
3136
3392
 
3137
3393
  <!-- except gb and bsi -->
3138
3394
 
3395
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3139
3396
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3140
3397
  <xsl:apply-templates select="../*[local-name()='note']"/>
3141
3398
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -3267,7 +3524,7 @@
3267
3524
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3268
3525
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3269
3526
 
3270
- <xsl:call-template name="setBordersTableArray"/>
3527
+ <xsl:call-template name="refine_table-header-row-style"/>
3271
3528
 
3272
3529
  <xsl:call-template name="setTableRowAttributes"/>
3273
3530
 
@@ -3301,6 +3558,8 @@
3301
3558
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3302
3559
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3303
3560
 
3561
+ <xsl:call-template name="refine_table-footer-row-style"/>
3562
+
3304
3563
  <xsl:call-template name="setTableRowAttributes"/>
3305
3564
  <xsl:apply-templates/>
3306
3565
  </fo:table-row>
@@ -3314,9 +3573,10 @@
3314
3573
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3315
3574
  </xsl:if>
3316
3575
 
3317
- <xsl:call-template name="setBordersTableArray"/>
3576
+ <xsl:call-template name="refine_table-body-row-style"/>
3318
3577
 
3319
3578
  <xsl:call-template name="setTableRowAttributes"/>
3579
+
3320
3580
  <xsl:apply-templates/>
3321
3581
  </fo:table-row>
3322
3582
  </xsl:template>
@@ -3335,28 +3595,7 @@
3335
3595
  <xsl:with-param name="default">center</xsl:with-param>
3336
3596
  </xsl:call-template>
3337
3597
 
3338
- <xsl:call-template name="setBordersTableArray"/>
3339
-
3340
- <xsl:if test="ancestor::*[local-name()='sections']">
3341
- <xsl:attribute name="border">solid black 0pt</xsl:attribute>
3342
- <xsl:attribute name="display-align">before</xsl:attribute>
3343
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
3344
- </xsl:if>
3345
- <xsl:if test="ancestor::*[local-name()='annex']">
3346
- <xsl:attribute name="font-weight">normal</xsl:attribute>
3347
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
3348
- <xsl:attribute name="background-color">rgb(218, 218, 218)</xsl:attribute>
3349
- <xsl:if test="starts-with(text(), '1') or starts-with(text(), '2') or starts-with(text(), '3') or starts-with(text(), '4') or starts-with(text(), '5') or starts-with(text(), '6') or starts-with(text(), '7') or starts-with(text(), '8') or starts-with(text(), '9')">
3350
- <xsl:attribute name="color">rgb(46, 116, 182)</xsl:attribute>
3351
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3352
- </xsl:if>
3353
- </xsl:if>
3354
-
3355
- <xsl:if test="$lang = 'ar'">
3356
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3357
- </xsl:if>
3358
-
3359
- <xsl:call-template name="setTableCellAttributes"/>
3598
+ <xsl:call-template name="refine_table-header-cell-style"/>
3360
3599
 
3361
3600
  <fo:block>
3362
3601
  <xsl:apply-templates/>
@@ -3398,18 +3637,7 @@
3398
3637
  <xsl:with-param name="default">left</xsl:with-param>
3399
3638
  </xsl:call-template>
3400
3639
 
3401
- <xsl:if test="$lang = 'ar'">
3402
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3403
- </xsl:if>
3404
-
3405
- <!-- bsi -->
3406
-
3407
- <xsl:call-template name="setBordersTableArray"/>
3408
-
3409
- <xsl:if test="ancestor::*[local-name()='sections']">
3410
- <xsl:attribute name="border">solid black 0pt</xsl:attribute>
3411
- <xsl:attribute name="padding-top">1mm</xsl:attribute>
3412
- </xsl:if>
3640
+ <xsl:call-template name="refine_table-cell-style"/>
3413
3641
 
3414
3642
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3415
3643
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -3440,12 +3668,12 @@
3440
3668
 
3441
3669
  <fo:block xsl:use-attribute-sets="table-note-style">
3442
3670
 
3671
+ <xsl:call-template name="refine_table-note-style"/>
3672
+
3443
3673
  <!-- Table's note name (NOTE, for example) -->
3444
3674
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
3445
3675
 
3446
- <xsl:if test="@type = 'source' or @type = 'abbreviation'">
3447
- <xsl:attribute name="font-size">9pt</xsl:attribute>
3448
- </xsl:if>
3676
+ <xsl:call-template name="refine_table-note-name-style"/>
3449
3677
 
3450
3678
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3451
3679
 
@@ -3474,6 +3702,14 @@
3474
3702
  <!-- list of footnotes to calculate actual footnotes number -->
3475
3703
  <xsl:variable name="p_fn_">
3476
3704
  <xsl:call-template name="get_fn_list"/>
3705
+ <!-- <xsl:choose>
3706
+ <xsl:when test="$namespace = 'jis'">
3707
+ <xsl:call-template name="get_fn_list_for_element"/>
3708
+ </xsl:when>
3709
+ <xsl:otherwise>
3710
+ <xsl:call-template name="get_fn_list"/>
3711
+ </xsl:otherwise>
3712
+ </xsl:choose> -->
3477
3713
  </xsl:variable>
3478
3714
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3479
3715
 
@@ -3498,7 +3734,14 @@
3498
3734
 
3499
3735
  </xsl:variable>
3500
3736
 
3501
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3737
+ <xsl:variable name="ref_id">
3738
+ <xsl:choose>
3739
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
3740
+ <xsl:otherwise>
3741
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3742
+ </xsl:otherwise>
3743
+ </xsl:choose>
3744
+ </xsl:variable>
3502
3745
  <xsl:variable name="footnote_inline">
3503
3746
  <fo:inline>
3504
3747
 
@@ -3524,7 +3767,7 @@
3524
3767
  <xsl:call-template name="insert_basic_link">
3525
3768
  <xsl:with-param name="element">
3526
3769
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3527
- <xsl:value-of select="$current_fn_number_text"/>
3770
+ <xsl:copy-of select="$current_fn_number_text"/>
3528
3771
  </fo:basic-link>
3529
3772
  </xsl:with-param>
3530
3773
  </xsl:call-template>
@@ -3544,8 +3787,12 @@
3544
3787
 
3545
3788
  <fo:block xsl:use-attribute-sets="fn-body-style">
3546
3789
 
3790
+ <xsl:call-template name="refine_fn-body-style"/>
3791
+
3547
3792
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3548
3793
 
3794
+ <xsl:call-template name="refine_fn-body-num-style"/>
3795
+
3549
3796
  <xsl:value-of select="$current_fn_number_text"/>
3550
3797
  </fo:inline>
3551
3798
  <xsl:apply-templates/>
@@ -3597,6 +3844,28 @@
3597
3844
  </xsl:choose>
3598
3845
  </xsl:template>
3599
3846
 
3847
+ <xsl:template name="get_fn_list_for_element">
3848
+ <xsl:choose>
3849
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
3850
+ <fn gen_id="{generate-id(.)}">
3851
+ <xsl:copy-of select="@*"/>
3852
+ <xsl:copy-of select="node()"/>
3853
+ </fn>
3854
+ </xsl:when>
3855
+ <xsl:otherwise>
3856
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
3857
+ <xsl:variable name="element_id" select="@id"/>
3858
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3859
+ <!-- copy unique fn -->
3860
+ <fn gen_id="{generate-id(.)}">
3861
+ <xsl:copy-of select="@*"/>
3862
+ <xsl:copy-of select="node()"/>
3863
+ </fn>
3864
+ </xsl:for-each>
3865
+ </xsl:for-each>
3866
+ </xsl:otherwise>
3867
+ </xsl:choose>
3868
+ </xsl:template>
3600
3869
  <!-- ============================ -->
3601
3870
  <!-- table's footnotes rendering -->
3602
3871
  <!-- ============================ -->
@@ -3771,6 +4040,8 @@
3771
4040
  <xsl:template match="*[local-name()='fn']">
3772
4041
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
3773
4042
 
4043
+ <xsl:call-template name="refine_fn-reference-style"/>
4044
+
3774
4045
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3775
4046
 
3776
4047
  <xsl:value-of select="@reference"/>
@@ -3870,6 +4141,8 @@
3870
4141
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3871
4142
  <fo:block margin-bottom="12pt" text-align="left">
3872
4143
 
4144
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4145
+
3873
4146
  <!-- <xsl:variable name="title-where">
3874
4147
  <xsl:call-template name="getLocalizedString">
3875
4148
  <xsl:with-param name="key">where</xsl:with-param>
@@ -3883,6 +4156,8 @@
3883
4156
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
3884
4157
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3885
4158
 
4159
+ <xsl:call-template name="refine_figure_key_style"/>
4160
+
3886
4161
  <xsl:variable name="title-key">
3887
4162
  <xsl:call-template name="getLocalizedString">
3888
4163
  <xsl:with-param name="key">key</xsl:with-param>
@@ -3897,12 +4172,16 @@
3897
4172
  <xsl:if test="$onlyOneComponent = 'false'">
3898
4173
  <fo:block>
3899
4174
 
4175
+ <xsl:call-template name="refine_multicomponent_style"/>
4176
+
3900
4177
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3901
4178
  <xsl:attribute name="margin-top">0</xsl:attribute>
3902
4179
  </xsl:if>
3903
4180
 
3904
4181
  <fo:block>
3905
4182
 
4183
+ <xsl:call-template name="refine_multicomponent_block_style"/>
4184
+
3906
4185
  <xsl:apply-templates select="*[local-name() = 'name']">
3907
4186
  <xsl:with-param name="process">true</xsl:with-param>
3908
4187
  </xsl:apply-templates>
@@ -4060,6 +4339,24 @@
4060
4339
 
4061
4340
  </xsl:template> <!-- END: dl -->
4062
4341
 
4342
+ <xsl:template name="refine_dl_formula_where_style">
4343
+
4344
+ </xsl:template> <!-- refine_dl_formula_where_style -->
4345
+
4346
+ <xsl:template name="refine_figure_key_style">
4347
+
4348
+ </xsl:template> <!-- refine_figure_key_style -->
4349
+
4350
+ <xsl:template name="refine_multicomponent_style">
4351
+ <xsl:variable name="parent" select="local-name(..)"/>
4352
+
4353
+ </xsl:template> <!-- refine_multicomponent_style -->
4354
+
4355
+ <xsl:template name="refine_multicomponent_block_style">
4356
+ <xsl:variable name="parent" select="local-name(..)"/>
4357
+
4358
+ </xsl:template> <!-- refine_multicomponent_block_style -->
4359
+
4063
4360
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4064
4361
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4065
4362
 
@@ -4279,6 +4576,8 @@
4279
4576
 
4280
4577
  </xsl:if>
4281
4578
 
4579
+ <xsl:call-template name="refine_dt-cell-style"/>
4580
+
4282
4581
  <fo:block xsl:use-attribute-sets="dt-block-style">
4283
4582
  <xsl:copy-of select="@id"/>
4284
4583
 
@@ -4286,6 +4585,8 @@
4286
4585
  <xsl:attribute name="margin-top">0</xsl:attribute>
4287
4586
  </xsl:if>
4288
4587
 
4588
+ <xsl:call-template name="refine_dt-block-style"/>
4589
+
4289
4590
  <xsl:apply-templates>
4290
4591
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4291
4592
  </xsl:apply-templates>
@@ -4305,6 +4606,8 @@
4305
4606
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4306
4607
  </xsl:if>
4307
4608
 
4609
+ <xsl:call-template name="refine_dd-cell-style"/>
4610
+
4308
4611
  <fo:block>
4309
4612
 
4310
4613
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -4455,12 +4758,18 @@
4455
4758
  <xsl:param name="split_keep-within-line"/>
4456
4759
  <fo:inline font-weight="bold">
4457
4760
 
4761
+ <xsl:call-template name="refine_strong_style"/>
4762
+
4458
4763
  <xsl:apply-templates>
4459
4764
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4460
4765
  </xsl:apply-templates>
4461
4766
  </fo:inline>
4462
4767
  </xsl:template>
4463
4768
 
4769
+ <xsl:template name="refine_strong_style">
4770
+
4771
+ </xsl:template>
4772
+
4464
4773
  <xsl:template match="*[local-name()='padding']">
4465
4774
  <fo:inline padding-right="{@value}"> </fo:inline>
4466
4775
  </xsl:template>
@@ -4927,7 +5236,10 @@
4927
5236
  </xsl:choose>
4928
5237
  </xsl:variable>
4929
5238
 
4930
- <xsl:value-of select="$text9"/>
5239
+ <!-- replace sequence #x200B and space TO space -->
5240
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5241
+
5242
+ <xsl:value-of select="$text10"/>
4931
5243
  </xsl:template>
4932
5244
 
4933
5245
  <xsl:template name="add-zero-spaces-link-java">
@@ -5602,6 +5914,11 @@
5602
5914
 
5603
5915
  <fo:inline xsl:use-attribute-sets="mathml-style">
5604
5916
 
5917
+ <!-- DEBUG -->
5918
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
5919
+
5920
+ <xsl:call-template name="refine_mathml-style"/>
5921
+
5605
5922
  <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
5606
5923
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5607
5924
  </xsl:if>
@@ -5706,6 +6023,8 @@
5706
6023
 
5707
6024
  <fo:instream-foreign-object fox:alt-text="Math">
5708
6025
 
6026
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6027
+
5709
6028
  <!-- put MathML in Actual Text -->
5710
6029
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
5711
6030
  <xsl:attribute name="fox:actual-text">
@@ -5726,6 +6045,10 @@
5726
6045
  </fo:instream-foreign-object>
5727
6046
  </xsl:template>
5728
6047
 
6048
+ <xsl:template name="refine_mathml_insteam_object_style">
6049
+
6050
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
6051
+
5729
6052
  <xsl:template match="mathml:*" mode="mathml_actual_text">
5730
6053
  <!-- <xsl:text>a+b</xsl:text> -->
5731
6054
  <xsl:text>&lt;</xsl:text>
@@ -5870,6 +6193,8 @@
5870
6193
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5871
6194
  <fo:inline xsl:use-attribute-sets="mathml-style">
5872
6195
 
6196
+ <xsl:call-template name="refine_mathml-style"/>
6197
+
5873
6198
  <xsl:choose>
5874
6199
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5875
6200
  <xsl:otherwise>
@@ -5914,6 +6239,8 @@
5914
6239
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5915
6240
  </xsl:if>
5916
6241
 
6242
+ <xsl:call-template name="refine_link-style"/>
6243
+
5917
6244
  <xsl:choose>
5918
6245
  <xsl:when test="$target_text = ''">
5919
6246
  <xsl:apply-templates/>
@@ -6001,6 +6328,9 @@
6001
6328
  <xsl:call-template name="insert_basic_link">
6002
6329
  <xsl:with-param name="element">
6003
6330
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6331
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
6332
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6333
+ </xsl:if>
6004
6334
  <xsl:if test="parent::*[local-name() = 'add']">
6005
6335
  <xsl:call-template name="append_add-style"/>
6006
6336
  </xsl:if>
@@ -6062,10 +6392,7 @@
6062
6392
  <fo:table-cell display-align="center">
6063
6393
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6064
6394
 
6065
- <xsl:if test="ancestor::*[local-name() ='annex']">
6066
- <xsl:attribute name="text-align">left</xsl:attribute>
6067
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
6068
- </xsl:if>
6395
+ <xsl:call-template name="refine_formula-stem-block-style"/>
6069
6396
 
6070
6397
  <xsl:apply-templates/>
6071
6398
  </fo:block>
@@ -6108,25 +6435,18 @@
6108
6435
 
6109
6436
  <xsl:call-template name="setBlockSpanAll"/>
6110
6437
 
6111
- <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'">
6112
- <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
6113
- </xsl:if>
6438
+ <xsl:call-template name="refine_note-style"/>
6114
6439
 
6115
6440
  <fo:block-container margin-left="0mm" margin-right="0mm">
6116
6441
 
6117
6442
  <fo:block>
6118
6443
 
6119
- <xsl:attribute name="font-size">10pt</xsl:attribute>
6120
- <xsl:attribute name="text-indent">0</xsl:attribute>
6121
- <xsl:attribute name="padding-top">1.5mm</xsl:attribute>
6122
- <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'">
6123
- <xsl:attribute name="font-size">9pt</xsl:attribute>
6124
- <xsl:attribute name="text-align">justify</xsl:attribute>
6125
- <xsl:attribute name="padding-top">0mm</xsl:attribute>
6126
- </xsl:if>
6444
+ <xsl:call-template name="refine_note_block_style"/>
6127
6445
 
6128
6446
  <fo:inline xsl:use-attribute-sets="note-name-style">
6129
6447
 
6448
+ <xsl:call-template name="refine_note-name-style"/>
6449
+
6130
6450
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6131
6451
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6132
6452
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6152,6 +6472,19 @@
6152
6472
 
6153
6473
  </xsl:template>
6154
6474
 
6475
+ <xsl:template name="refine_note_block_style">
6476
+
6477
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
6478
+ <xsl:attribute name="text-indent">0</xsl:attribute>
6479
+ <xsl:attribute name="padding-top">1.5mm</xsl:attribute>
6480
+ <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'">
6481
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
6482
+ <xsl:attribute name="text-align">justify</xsl:attribute>
6483
+ <xsl:attribute name="padding-top">0mm</xsl:attribute>
6484
+ </xsl:if>
6485
+
6486
+ </xsl:template>
6487
+
6155
6488
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6156
6489
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6157
6490
  <xsl:choose>
@@ -6173,12 +6506,16 @@
6173
6506
 
6174
6507
  <xsl:call-template name="setBlockSpanAll"/>
6175
6508
 
6509
+ <xsl:call-template name="refine_termnote-style"/>
6510
+
6176
6511
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6177
6512
 
6178
6513
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6179
6514
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6180
6515
  </xsl:if>
6181
6516
 
6517
+ <xsl:call-template name="refine_termnote-name-style"/>
6518
+
6182
6519
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6183
6520
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6184
6521
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6352,10 +6689,7 @@
6352
6689
  <xsl:otherwise>
6353
6690
  <fo:block xsl:use-attribute-sets="image-style">
6354
6691
 
6355
- <xsl:if test="ancestor::un:admonition">
6356
- <xsl:attribute name="margin-top">-12mm</xsl:attribute>
6357
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
6358
- </xsl:if>
6692
+ <xsl:call-template name="refine_image-style"/>
6359
6693
 
6360
6694
  <xsl:variable name="src">
6361
6695
  <xsl:call-template name="image_src"/>
@@ -7206,6 +7540,8 @@
7206
7540
  <xsl:if test="normalize-space() != ''">
7207
7541
  <fo:block xsl:use-attribute-sets="figure-name-style">
7208
7542
 
7543
+ <xsl:call-template name="refine_figure-name-style"/>
7544
+
7209
7545
  <xsl:apply-templates/>
7210
7546
  </fo:block>
7211
7547
  </xsl:if>
@@ -7470,6 +7806,8 @@
7470
7806
  </xsl:attribute>
7471
7807
  </xsl:for-each>
7472
7808
 
7809
+ <xsl:call-template name="refine_sourcecode-style"/>
7810
+
7473
7811
  <!-- remove margin between rows in the table with sourcecode line numbers -->
7474
7812
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7475
7813
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -8174,6 +8512,8 @@
8174
8512
 
8175
8513
  <xsl:call-template name="setBlockSpanAll"/>
8176
8514
 
8515
+ <xsl:call-template name="refine_example-style"/>
8516
+
8177
8517
  <xsl:variable name="fo_element">
8178
8518
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8179
8519
  block
@@ -8301,9 +8641,7 @@
8301
8641
  </xsl:if>
8302
8642
  <fo:block xsl:use-attribute-sets="example-p-style">
8303
8643
 
8304
- <xsl:if test="$num = 1">
8305
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
8306
- </xsl:if>
8644
+ <xsl:call-template name="refine_example-p-style"/>
8307
8645
 
8308
8646
  <xsl:apply-templates/>
8309
8647
  </fo:block>
@@ -8321,6 +8659,7 @@
8321
8659
  </xsl:otherwise>
8322
8660
  </xsl:choose>
8323
8661
  </xsl:template> <!-- example/p -->
8662
+
8324
8663
  <!-- ====== -->
8325
8664
  <!-- ====== -->
8326
8665
 
@@ -8332,6 +8671,8 @@
8332
8671
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
8333
8672
  <fo:block xsl:use-attribute-sets="termsource-style">
8334
8673
 
8674
+ <xsl:call-template name="refine_termsource-style"/>
8675
+
8335
8676
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
8336
8677
  <xsl:variable name="termsource_text">
8337
8678
  <xsl:apply-templates/>
@@ -8447,6 +8788,8 @@
8447
8788
  <fo:block-container margin-left="0mm">
8448
8789
  <fo:block-container xsl:use-attribute-sets="quote-style">
8449
8790
 
8791
+ <xsl:call-template name="refine_quote-style"/>
8792
+
8450
8793
  <fo:block-container margin-left="0mm" margin-right="0mm">
8451
8794
  <fo:block role="BlockQuote">
8452
8795
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -8521,8 +8864,7 @@
8521
8864
 
8522
8865
  </xsl:if>
8523
8866
 
8524
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8525
- <xsl:variable name="text" select="normalize-space()"/>
8867
+ <xsl:call-template name="refine_eref-style"/>
8526
8868
 
8527
8869
  <xsl:call-template name="insert_basic_link">
8528
8870
  <xsl:with-param name="element">
@@ -8532,6 +8874,8 @@
8532
8874
  </xsl:if>
8533
8875
  <xsl:if test="@type = 'inline'">
8534
8876
 
8877
+ <xsl:call-template name="refine_basic_link_style"/>
8878
+
8535
8879
  </xsl:if>
8536
8880
 
8537
8881
  <xsl:choose>
@@ -8564,6 +8908,11 @@
8564
8908
  </xsl:otherwise>
8565
8909
  </xsl:choose>
8566
8910
  </xsl:template>
8911
+
8912
+ <xsl:template name="refine_basic_link_style">
8913
+
8914
+ </xsl:template> <!-- refine_basic_link_style -->
8915
+
8567
8916
  <!-- ====== -->
8568
8917
  <!-- END eref -->
8569
8918
  <!-- ====== -->
@@ -8708,16 +9057,22 @@
8708
9057
  <fo:block>
8709
9058
  <xsl:call-template name="setId"/>
8710
9059
 
8711
- <xsl:variable name="num"><xsl:number/></xsl:variable>
8712
- <xsl:if test="$num = 1">
8713
- <xsl:attribute name="margin-top">3pt</xsl:attribute>
8714
- </xsl:if>
9060
+ <xsl:call-template name="sections_element_style"/>
8715
9061
 
8716
9062
  <xsl:apply-templates/>
8717
9063
  </fo:block>
8718
9064
 
8719
9065
  </xsl:template>
8720
9066
 
9067
+ <xsl:template name="sections_element_style">
9068
+
9069
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
9070
+ <xsl:if test="$num = 1">
9071
+ <xsl:attribute name="margin-top">3pt</xsl:attribute>
9072
+ </xsl:if>
9073
+
9074
+ </xsl:template> <!-- sections_element_style -->
9075
+
8721
9076
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
8722
9077
  <fo:block break-after="page"/>
8723
9078
  <fo:block>
@@ -8732,10 +9087,16 @@
8732
9087
 
8733
9088
  <xsl:call-template name="setBlockSpanAll"/>
8734
9089
 
9090
+ <xsl:call-template name="refine_clause_style"/>
9091
+
8735
9092
  <xsl:apply-templates/>
8736
9093
  </fo:block>
8737
9094
  </xsl:template>
8738
9095
 
9096
+ <xsl:template name="refine_clause_style">
9097
+
9098
+ </xsl:template> <!-- refine_clause_style -->
9099
+
8739
9100
  <xsl:template match="*[local-name() = 'definitions']">
8740
9101
  <fo:block id="{@id}">
8741
9102
  <xsl:apply-templates/>
@@ -8748,15 +9109,21 @@
8748
9109
 
8749
9110
  <xsl:call-template name="setBlockSpanAll"/>
8750
9111
 
8751
- <xsl:variable name="num"><xsl:number/></xsl:variable>
8752
- <xsl:if test="$num = 1">
8753
- <xsl:attribute name="margin-top">3pt</xsl:attribute>
8754
- </xsl:if>
9112
+ <xsl:call-template name="refine_annex_style"/>
8755
9113
 
8756
9114
  </fo:block>
8757
9115
  <xsl:apply-templates/>
8758
9116
  </xsl:template>
8759
9117
 
9118
+ <xsl:template name="refine_annex_style">
9119
+
9120
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
9121
+ <xsl:if test="$num = 1">
9122
+ <xsl:attribute name="margin-top">3pt</xsl:attribute>
9123
+ </xsl:if>
9124
+
9125
+ </xsl:template>
9126
+
8760
9127
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
8761
9128
  <!-- comment 2019-11-29 -->
8762
9129
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -8921,6 +9288,8 @@
8921
9288
  </xsl:choose>
8922
9289
  </xsl:attribute>
8923
9290
 
9291
+ <xsl:call-template name="refine_list_container_style"/>
9292
+
8924
9293
  <fo:block-container margin-left="0mm">
8925
9294
  <fo:block>
8926
9295
  <xsl:apply-templates select="." mode="list"/>
@@ -8938,6 +9307,10 @@
8938
9307
  </xsl:choose>
8939
9308
  </xsl:template>
8940
9309
 
9310
+ <xsl:template name="refine_list_container_style">
9311
+
9312
+ </xsl:template> <!-- refine_list_container_style -->
9313
+
8941
9314
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8942
9315
 
8943
9316
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -8948,11 +9321,7 @@
8948
9321
 
8949
9322
  <xsl:variable name="provisional_distance_between_starts_">
8950
9323
  <attributes xsl:use-attribute-sets="list-style">
8951
-
8952
- <xsl:if test="local-name() = 'ol'">
8953
- <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
8954
- </xsl:if>
8955
-
9324
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
8956
9325
  </attributes>
8957
9326
  </xsl:variable>
8958
9327
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -8988,6 +9357,8 @@
8988
9357
  <addon><xsl:value-of select="$addon"/></addon> -->
8989
9358
  </xsl:if>
8990
9359
 
9360
+ <xsl:call-template name="refine_list-style"/>
9361
+
8991
9362
  <xsl:if test="*[local-name() = 'name']">
8992
9363
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
8993
9364
  </xsl:if>
@@ -9000,6 +9371,14 @@
9000
9371
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9001
9372
  </xsl:template>
9002
9373
 
9374
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
9375
+
9376
+ <xsl:if test="local-name() = 'ol'">
9377
+ <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
9378
+ </xsl:if>
9379
+
9380
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
9381
+
9003
9382
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9004
9383
  <xsl:param name="process">false</xsl:param>
9005
9384
  <xsl:if test="$process = 'true'">
@@ -9013,20 +9392,27 @@
9013
9392
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9014
9393
  <xsl:copy-of select="@id"/>
9015
9394
 
9395
+ <xsl:call-template name="refine_list-item-style"/>
9396
+
9016
9397
  <fo:list-item-label end-indent="label-end()">
9017
9398
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9018
9399
 
9400
+ <xsl:call-template name="refine_list-item-label-style"/>
9401
+
9019
9402
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9020
9403
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9021
9404
  <xsl:call-template name="append_add-style"/>
9022
9405
  </xsl:if>
9023
9406
 
9024
9407
  <xsl:call-template name="getListItemFormat"/>
9408
+
9025
9409
  </fo:block>
9026
9410
  </fo:list-item-label>
9027
9411
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9028
9412
  <fo:block>
9029
9413
 
9414
+ <xsl:call-template name="refine_list-item-body-style"/>
9415
+
9030
9416
  <xsl:apply-templates/>
9031
9417
 
9032
9418
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -9344,6 +9730,7 @@
9344
9730
 
9345
9731
  <fo:block id="{@id}">
9346
9732
  <xsl:apply-templates/>
9733
+
9347
9734
  </fo:block>
9348
9735
  </xsl:template>
9349
9736
 
@@ -9361,6 +9748,7 @@
9361
9748
 
9362
9749
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
9363
9750
  <xsl:apply-templates/>
9751
+
9364
9752
  </fo:block>
9365
9753
 
9366
9754
  </xsl:template> <!-- references -->
@@ -9925,6 +10313,9 @@
9925
10313
  </xsl:copy>
9926
10314
  </xsl:template>
9927
10315
 
10316
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
10317
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
10318
+
9928
10319
  <xsl:template name="add_id">
9929
10320
  <xsl:if test="not(@id)">
9930
10321
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10209,6 +10600,14 @@
10209
10600
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
10210
10601
  <xsl:variable name="p_fn_">
10211
10602
  <xsl:call-template name="get_fn_list"/>
10603
+ <!-- <xsl:choose>
10604
+ <xsl:when test="$namespace = 'jis'">
10605
+ <xsl:call-template name="get_fn_list_for_element"/>
10606
+ </xsl:when>
10607
+ <xsl:otherwise>
10608
+ <xsl:call-template name="get_fn_list"/>
10609
+ </xsl:otherwise>
10610
+ </xsl:choose> -->
10212
10611
  </xsl:variable>
10213
10612
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10214
10613
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10223,8 +10622,14 @@
10223
10622
  <xsl:attribute name="current_fn_number">
10224
10623
  <xsl:value-of select="$current_fn_number"/>
10225
10624
  </xsl:attribute>
10625
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10226
10626
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10227
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10627
+
10628
+ <xsl:value-of select="$skip_footnote_body_"/>
10629
+
10630
+ </xsl:attribute>
10631
+ <xsl:attribute name="ref_id">
10632
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10228
10633
  </xsl:attribute>
10229
10634
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10230
10635
  </xsl:copy>