metanorma-iho 0.7.9 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -235,96 +235,7 @@
235
235
 
236
236
  <fo:block break-after="page"/>
237
237
 
238
- <!-- Table of Contents -->
239
- <fo:block role="TOC">
240
- <fo:block font-weight="bold" margin-bottom="7.5pt" role="H1" font-size="12pt" margin-top="4pt">
241
- <fo:block-container width="18.3mm" border-bottom="1.25pt solid black">
242
- <fo:block line-height="75%">
243
- <xsl:call-template name="getLocalizedString">
244
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
245
- </xsl:call-template>
246
- </fo:block>
247
- </fo:block-container>
248
- </fo:block>
249
- <xsl:if test="$debug = 'true'">
250
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
251
- DEBUG
252
- contents=<xsl:copy-of select="$contents"/>
253
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
254
- </xsl:if>
255
-
256
- <fo:block line-height="115%">
257
-
258
- <xsl:for-each select="$contents//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
259
- <fo:block role="TOCI">
260
- <!-- <xsl:if test="@level = 1">
261
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
262
- </xsl:if> -->
263
-
264
- <fo:list-block>
265
-
266
- <xsl:attribute name="provisional-distance-between-starts">
267
- <xsl:choose>
268
- <xsl:when test="@level &gt;= 1 and @root = 'preface'">0mm</xsl:when>
269
- <xsl:when test="@level &gt;= 1 and @root = 'annex' and not(@type = 'annex')">13mm</xsl:when>
270
- <xsl:when test="@level &gt;= 1 and not(@type = 'annex')">
271
- <xsl:choose>
272
- <xsl:when test="$toc_level = 3">12.9mm</xsl:when>
273
- <xsl:when test="$toc_level &gt; 3">15mm</xsl:when>
274
- <xsl:otherwise>10mm</xsl:otherwise>
275
- </xsl:choose>
276
- </xsl:when>
277
- <xsl:otherwise>0mm</xsl:otherwise>
278
- </xsl:choose>
279
- </xsl:attribute>
280
- <fo:list-item>
281
- <fo:list-item-label end-indent="label-end()">
282
- <fo:block>
283
- <xsl:if test="@section != '' and not(@type = 'annex')"> <!-- output below -->
284
- <xsl:value-of select="@section"/>
285
- </xsl:if>
286
- </fo:block>
287
- </fo:list-item-label>
288
- <fo:list-item-body start-indent="body-start()">
289
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
290
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
291
- <xsl:apply-templates select="title"/>
292
- <fo:inline keep-together.within-line="always">
293
- <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
294
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
295
- </fo:inline>
296
- </fo:basic-link>
297
- </fo:block>
298
- </fo:list-item-body>
299
- </fo:list-item>
300
- </fo:list-block>
301
- </fo:block>
302
-
303
- </xsl:for-each>
304
-
305
- <!-- List of Tables -->
306
- <xsl:if test="$contents//tables/table">
307
- <xsl:call-template name="insertListOf_Title">
308
- <xsl:with-param name="title" select="$title-list-tables"/>
309
- </xsl:call-template>
310
- <xsl:for-each select="$contents//tables/table">
311
- <xsl:call-template name="insertListOf_Item"/>
312
- </xsl:for-each>
313
- </xsl:if>
314
-
315
- <!-- List of Figures -->
316
- <xsl:if test="$contents//figures/figure">
317
- <xsl:call-template name="insertListOf_Title">
318
- <xsl:with-param name="title" select="$title-list-figures"/>
319
- </xsl:call-template>
320
- <xsl:for-each select="$contents//figures/figure">
321
- <xsl:call-template name="insertListOf_Item"/>
322
- </xsl:for-each>
323
- </xsl:if>
324
- </fo:block>
325
- </fo:block>
326
-
327
- <!-- Foreword, Introduction -->
238
+ <!-- Contents, Foreword, Introduction -->
328
239
  <xsl:call-template name="processPrefaceSectionsDefault"/>
329
240
 
330
241
  </fo:flow>
@@ -434,6 +345,101 @@
434
345
  </fo:block>
435
346
  </xsl:template>
436
347
 
348
+ <xsl:template match="iho:preface/iho:clause[@type = 'toc']" priority="4">
349
+ <!-- Table of Contents -->
350
+ <fo:block role="TOC">
351
+
352
+ <xsl:apply-templates/>
353
+
354
+ <xsl:if test="$debug = 'true'">
355
+ <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
356
+ DEBUG
357
+ contents=<xsl:copy-of select="$contents"/>
358
+ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
359
+ </xsl:if>
360
+
361
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
362
+
363
+ <fo:block line-height="115%">
364
+
365
+ <xsl:for-each select="$contents//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
366
+ <fo:block role="TOCI">
367
+ <fo:list-block>
368
+ <xsl:attribute name="provisional-distance-between-starts">
369
+ <xsl:choose>
370
+ <xsl:when test="@level &gt;= 1 and @root = 'preface'">0mm</xsl:when>
371
+ <xsl:when test="@level &gt;= 1 and @root = 'annex' and not(@type = 'annex')">13mm</xsl:when>
372
+ <xsl:when test="@level &gt;= 1 and not(@type = 'annex')">
373
+ <xsl:choose>
374
+ <xsl:when test="$toc_level = 3">12.9mm</xsl:when>
375
+ <xsl:when test="$toc_level &gt; 3">15mm</xsl:when>
376
+ <xsl:otherwise>10mm</xsl:otherwise>
377
+ </xsl:choose>
378
+ </xsl:when>
379
+ <xsl:otherwise>0mm</xsl:otherwise>
380
+ </xsl:choose>
381
+ </xsl:attribute>
382
+ <fo:list-item>
383
+ <fo:list-item-label end-indent="label-end()">
384
+ <fo:block>
385
+ <xsl:if test="@section != '' and not(@type = 'annex')"> <!-- output below -->
386
+ <xsl:value-of select="@section"/>
387
+ </xsl:if>
388
+ </fo:block>
389
+ </fo:list-item-label>
390
+ <fo:list-item-body start-indent="body-start()">
391
+ <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
392
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
393
+ <xsl:apply-templates select="title"/>
394
+ <fo:inline keep-together.within-line="always">
395
+ <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
396
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
397
+ </fo:inline>
398
+ </fo:basic-link>
399
+ </fo:block>
400
+ </fo:list-item-body>
401
+ </fo:list-item>
402
+ </fo:list-block>
403
+ </fo:block>
404
+ </xsl:for-each>
405
+
406
+ <!-- List of Tables -->
407
+ <xsl:if test="$contents//tables/table">
408
+ <xsl:call-template name="insertListOf_Title">
409
+ <xsl:with-param name="title" select="$title-list-tables"/>
410
+ </xsl:call-template>
411
+ <xsl:for-each select="$contents//tables/table">
412
+ <xsl:call-template name="insertListOf_Item"/>
413
+ </xsl:for-each>
414
+ </xsl:if>
415
+
416
+ <!-- List of Figures -->
417
+ <xsl:if test="$contents//figures/figure">
418
+ <xsl:call-template name="insertListOf_Title">
419
+ <xsl:with-param name="title" select="$title-list-figures"/>
420
+ </xsl:call-template>
421
+ <xsl:for-each select="$contents//figures/figure">
422
+ <xsl:call-template name="insertListOf_Item"/>
423
+ </xsl:for-each>
424
+ </xsl:if>
425
+ </fo:block>
426
+ </xsl:if>
427
+ </fo:block>
428
+ </xsl:template>
429
+
430
+ <xsl:template match="iho:preface/iho:clause[@type = 'toc']/iho:title" priority="3">
431
+ <fo:block font-weight="bold" margin-bottom="7.5pt" role="H1" font-size="12pt" margin-top="4pt">
432
+ <fo:block-container width="18.3mm" border-bottom="1.25pt solid black">
433
+ <fo:block line-height="75%">
434
+ <!-- <xsl:call-template name="getLocalizedString">
435
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
436
+ </xsl:call-template> -->
437
+ <xsl:apply-templates/>
438
+ </fo:block>
439
+ </fo:block-container>
440
+ </fo:block>
441
+ </xsl:template>
442
+
437
443
  <!-- ============================= -->
438
444
  <!-- CONTENTS -->
439
445
  <!-- ============================= -->
@@ -456,6 +462,7 @@
456
462
 
457
463
  <xsl:variable name="skip">
458
464
  <xsl:choose>
465
+ <xsl:when test="@type = 'toc'">true</xsl:when>
459
466
  <xsl:when test="ancestor-or-self::iho:bibitem">true</xsl:when>
460
467
  <xsl:when test="ancestor-or-self::iho:term">true</xsl:when>
461
468
  <xsl:otherwise>false</xsl:otherwise>
@@ -1237,6 +1244,10 @@
1237
1244
 
1238
1245
  </xsl:attribute-set>
1239
1246
 
1247
+ <xsl:template name="refine_link-style">
1248
+
1249
+ </xsl:template> <!-- refine_link-style -->
1250
+
1240
1251
  <xsl:attribute-set name="sourcecode-container-style">
1241
1252
 
1242
1253
  </xsl:attribute-set>
@@ -1253,6 +1264,10 @@
1253
1264
 
1254
1265
  </xsl:attribute-set>
1255
1266
 
1267
+ <xsl:template name="refine_sourcecode-style">
1268
+
1269
+ </xsl:template> <!-- refine_sourcecode-style -->
1270
+
1256
1271
  <xsl:attribute-set name="pre-style">
1257
1272
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1258
1273
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1341,6 +1356,10 @@
1341
1356
 
1342
1357
  </xsl:attribute-set> <!-- example-style -->
1343
1358
 
1359
+ <xsl:template name="refine_example-style">
1360
+
1361
+ </xsl:template> <!-- refine_example-style -->
1362
+
1344
1363
  <xsl:attribute-set name="example-body-style">
1345
1364
 
1346
1365
  </xsl:attribute-set> <!-- example-body-style -->
@@ -1360,6 +1379,10 @@
1360
1379
 
1361
1380
  </xsl:attribute-set> <!-- example-p-style -->
1362
1381
 
1382
+ <xsl:template name="refine_example-p-style">
1383
+
1384
+ </xsl:template> <!-- refine_example-p-style -->
1385
+
1363
1386
  <xsl:attribute-set name="termexample-name-style">
1364
1387
 
1365
1388
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1391,6 +1414,12 @@
1391
1414
 
1392
1415
  </xsl:attribute-set> <!-- table-container-style -->
1393
1416
 
1417
+ <xsl:template name="refine_table-container-style">
1418
+ <xsl:param name="margin-side"/>
1419
+
1420
+ <!-- end table block-container attributes -->
1421
+ </xsl:template> <!-- refine_table-container-style -->
1422
+
1394
1423
  <xsl:attribute-set name="table-style">
1395
1424
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1396
1425
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
@@ -1399,6 +1428,13 @@
1399
1428
 
1400
1429
  </xsl:attribute-set><!-- table-style -->
1401
1430
 
1431
+ <xsl:template name="refine_table-style">
1432
+ <xsl:param name="margin-side"/>
1433
+
1434
+ <xsl:call-template name="setBordersTableArray"/>
1435
+
1436
+ </xsl:template> <!-- refine_table-style -->
1437
+
1402
1438
  <xsl:attribute-set name="table-name-style">
1403
1439
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1404
1440
 
@@ -1409,6 +1445,11 @@
1409
1445
 
1410
1446
  </xsl:attribute-set> <!-- table-name-style -->
1411
1447
 
1448
+ <xsl:template name="refine_table-name-style">
1449
+ <xsl:param name="continued"/>
1450
+
1451
+ </xsl:template> <!-- refine_table-name-style -->
1452
+
1412
1453
  <xsl:attribute-set name="table-row-style">
1413
1454
  <xsl:attribute name="min-height">4mm</xsl:attribute>
1414
1455
 
@@ -1423,14 +1464,30 @@
1423
1464
 
1424
1465
  </xsl:attribute-set>
1425
1466
 
1467
+ <xsl:template name="refine_table-header-row-style">
1468
+
1469
+ <xsl:call-template name="setBordersTableArray"/>
1470
+
1471
+ </xsl:template> <!-- refine_table-header-row-style -->
1472
+
1426
1473
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
1427
1474
 
1428
1475
  </xsl:attribute-set>
1429
1476
 
1477
+ <xsl:template name="refine_table-footer-row-style">
1478
+
1479
+ </xsl:template> <!-- refine_table-footer-row-style -->
1480
+
1430
1481
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
1431
1482
 
1432
1483
  </xsl:attribute-set>
1433
1484
 
1485
+ <xsl:template name="refine_table-body-row-style">
1486
+
1487
+ <xsl:call-template name="setBordersTableArray"/>
1488
+
1489
+ </xsl:template> <!-- refine_table-body-row-style -->
1490
+
1434
1491
  <xsl:attribute-set name="table-header-cell-style">
1435
1492
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1436
1493
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1445,6 +1502,18 @@
1445
1502
 
1446
1503
  </xsl:attribute-set> <!-- table-header-cell-style -->
1447
1504
 
1505
+ <xsl:template name="refine_table-header-cell-style">
1506
+
1507
+ <xsl:call-template name="setBordersTableArray"/>
1508
+
1509
+ <xsl:if test="$lang = 'ar'">
1510
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1511
+ </xsl:if>
1512
+
1513
+ <xsl:call-template name="setTableCellAttributes"/>
1514
+
1515
+ </xsl:template> <!-- refine_table-header-cell-style -->
1516
+
1448
1517
  <xsl:attribute-set name="table-cell-style">
1449
1518
  <xsl:attribute name="display-align">center</xsl:attribute>
1450
1519
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1458,6 +1527,18 @@
1458
1527
 
1459
1528
  </xsl:attribute-set> <!-- table-cell-style -->
1460
1529
 
1530
+ <xsl:template name="refine_table-cell-style">
1531
+
1532
+ <xsl:if test="$lang = 'ar'">
1533
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1534
+ </xsl:if>
1535
+
1536
+ <!-- bsi -->
1537
+
1538
+ <xsl:call-template name="setBordersTableArray"/>
1539
+
1540
+ </xsl:template> <!-- refine_table-cell-style -->
1541
+
1461
1542
  <xsl:attribute-set name="table-footer-cell-style">
1462
1543
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1463
1544
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1468,6 +1549,10 @@
1468
1549
 
1469
1550
  </xsl:attribute-set> <!-- table-footer-cell-style -->
1470
1551
 
1552
+ <xsl:template name="refine_table-footer-cell-style">
1553
+
1554
+ </xsl:template> <!-- refine_table-footer-cell-style -->
1555
+
1471
1556
  <xsl:attribute-set name="table-note-style">
1472
1557
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1473
1558
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1478,6 +1563,10 @@
1478
1563
 
1479
1564
  </xsl:attribute-set><!-- table-note-style -->
1480
1565
 
1566
+ <xsl:template name="refine_table-note-style">
1567
+
1568
+ </xsl:template> <!-- refine_table-note-style -->
1569
+
1481
1570
  <xsl:attribute-set name="table-fn-style">
1482
1571
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1483
1572
 
@@ -1533,6 +1622,10 @@
1533
1622
 
1534
1623
  </xsl:attribute-set>
1535
1624
 
1625
+ <xsl:template name="refine_dt-cell-style">
1626
+
1627
+ </xsl:template> <!-- refine_dt-cell-style -->
1628
+
1536
1629
  <xsl:attribute-set name="dt-block-style">
1537
1630
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
1538
1631
 
@@ -1540,6 +1633,10 @@
1540
1633
 
1541
1634
  </xsl:attribute-set>
1542
1635
 
1636
+ <xsl:template name="refine_dt-block-style">
1637
+
1638
+ </xsl:template> <!-- refine_dt-block-style -->
1639
+
1543
1640
  <xsl:attribute-set name="dl-name-style">
1544
1641
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1545
1642
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1553,6 +1650,10 @@
1553
1650
 
1554
1651
  </xsl:attribute-set>
1555
1652
 
1653
+ <xsl:template name="refine_dd-cell-style">
1654
+
1655
+ </xsl:template> <!-- refine_dd-cell-style -->
1656
+
1556
1657
  <!-- ========================== -->
1557
1658
  <!-- END Definition's list styles -->
1558
1659
  <!-- ========================== -->
@@ -1566,7 +1667,6 @@
1566
1667
  </xsl:attribute-set>
1567
1668
 
1568
1669
  <xsl:attribute-set name="xref-style">
1569
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1570
1670
 
1571
1671
  <xsl:attribute name="color">blue</xsl:attribute>
1572
1672
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1577,6 +1677,12 @@
1577
1677
 
1578
1678
  </xsl:attribute-set>
1579
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
+
1580
1686
  <xsl:attribute-set name="note-style">
1581
1687
 
1582
1688
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -1586,6 +1692,10 @@
1586
1692
 
1587
1693
  </xsl:attribute-set>
1588
1694
 
1695
+ <xsl:template name="refine_note-style">
1696
+
1697
+ </xsl:template>
1698
+
1589
1699
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
1590
1700
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
1591
1701
 
@@ -1596,6 +1706,10 @@
1596
1706
 
1597
1707
  </xsl:attribute-set>
1598
1708
 
1709
+ <xsl:template name="refine_note-name-style">
1710
+
1711
+ </xsl:template> <!-- refine_note-name-style -->
1712
+
1599
1713
  <xsl:attribute-set name="table-note-name-style">
1600
1714
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
1601
1715
 
@@ -1603,6 +1717,10 @@
1603
1717
 
1604
1718
  </xsl:attribute-set>
1605
1719
 
1720
+ <xsl:template name="refine_table-note-name-style">
1721
+
1722
+ </xsl:template> <!-- refine_table-note-name-style -->
1723
+
1606
1724
  <xsl:attribute-set name="note-p-style">
1607
1725
 
1608
1726
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -1619,10 +1737,18 @@
1619
1737
 
1620
1738
  </xsl:attribute-set>
1621
1739
 
1740
+ <xsl:template name="refine_termnote-style">
1741
+
1742
+ </xsl:template> <!-- refine_termnote-style -->
1743
+
1622
1744
  <xsl:attribute-set name="termnote-name-style">
1623
1745
 
1624
1746
  </xsl:attribute-set>
1625
1747
 
1748
+ <xsl:template name="refine_termnote-name-style">
1749
+
1750
+ </xsl:template>
1751
+
1626
1752
  <xsl:attribute-set name="termnote-p-style">
1627
1753
 
1628
1754
  </xsl:attribute-set>
@@ -1637,6 +1763,10 @@
1637
1763
 
1638
1764
  </xsl:attribute-set>
1639
1765
 
1766
+ <xsl:template name="refine_quote-style">
1767
+
1768
+ </xsl:template>
1769
+
1640
1770
  <xsl:attribute-set name="quote-source-style">
1641
1771
  <xsl:attribute name="text-align">right</xsl:attribute>
1642
1772
 
@@ -1648,6 +1778,10 @@
1648
1778
 
1649
1779
  </xsl:attribute-set>
1650
1780
 
1781
+ <xsl:template name="refine_termsource-style">
1782
+
1783
+ </xsl:template> <!-- refine_termsource-style -->
1784
+
1651
1785
  <xsl:attribute-set name="termsource-text-style">
1652
1786
 
1653
1787
  </xsl:attribute-set>
@@ -1692,6 +1826,10 @@
1692
1826
 
1693
1827
  </xsl:attribute-set>
1694
1828
 
1829
+ <xsl:template name="refine_figure-name-style">
1830
+
1831
+ </xsl:template> <!-- refine_figure-name-style -->
1832
+
1695
1833
  <xsl:attribute-set name="figure-source-style">
1696
1834
 
1697
1835
  </xsl:attribute-set>
@@ -1708,6 +1846,10 @@
1708
1846
 
1709
1847
  </xsl:attribute-set> <!-- formula-stem-block-style -->
1710
1848
 
1849
+ <xsl:template name="refine_formula-stem-block-style">
1850
+
1851
+ </xsl:template> <!-- refine_formula-stem-block-style -->
1852
+
1711
1853
  <xsl:attribute-set name="formula-stem-number-style">
1712
1854
  <xsl:attribute name="text-align">right</xsl:attribute>
1713
1855
 
@@ -1719,6 +1861,10 @@
1719
1861
 
1720
1862
  </xsl:attribute-set>
1721
1863
 
1864
+ <xsl:template name="refine_image-style">
1865
+
1866
+ </xsl:template>
1867
+
1722
1868
  <xsl:attribute-set name="figure-pseudocode-p-style">
1723
1869
 
1724
1870
  </xsl:attribute-set>
@@ -1811,12 +1957,20 @@
1811
1957
 
1812
1958
  </xsl:attribute-set>
1813
1959
 
1960
+ <xsl:template name="refine_mathml-style">
1961
+
1962
+ </xsl:template>
1963
+
1814
1964
  <xsl:attribute-set name="list-style">
1815
1965
 
1816
1966
  <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
1817
1967
 
1818
1968
  </xsl:attribute-set> <!-- list-style -->
1819
1969
 
1970
+ <xsl:template name="refine_list-style">
1971
+
1972
+ </xsl:template> <!-- refine_list-style -->
1973
+
1820
1974
  <xsl:attribute-set name="list-name-style">
1821
1975
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1822
1976
 
@@ -1830,16 +1984,28 @@
1830
1984
 
1831
1985
  </xsl:attribute-set>
1832
1986
 
1987
+ <xsl:template name="refine_list-item-style">
1988
+
1989
+ </xsl:template> <!-- refine_list-item-style -->
1990
+
1833
1991
  <xsl:attribute-set name="list-item-label-style">
1834
1992
 
1835
1993
  <xsl:attribute name="line-height">115%</xsl:attribute>
1836
1994
 
1837
1995
  </xsl:attribute-set>
1838
1996
 
1997
+ <xsl:template name="refine_list-item-label-style">
1998
+
1999
+ </xsl:template> <!-- refine_list-item-label-style -->
2000
+
1839
2001
  <xsl:attribute-set name="list-item-body-style">
1840
2002
 
1841
2003
  </xsl:attribute-set>
1842
2004
 
2005
+ <xsl:template name="refine_list-item-body-style">
2006
+
2007
+ </xsl:template> <!-- refine_list-item-body-style -->
2008
+
1843
2009
  <xsl:attribute-set name="toc-style">
1844
2010
  <xsl:attribute name="line-height">135%</xsl:attribute>
1845
2011
  </xsl:attribute-set>
@@ -1850,6 +2016,10 @@
1850
2016
 
1851
2017
  </xsl:attribute-set>
1852
2018
 
2019
+ <xsl:template name="refine_fn-reference-style">
2020
+
2021
+ </xsl:template> <!-- refine_fn-reference-style -->
2022
+
1853
2023
  <xsl:attribute-set name="fn-style">
1854
2024
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1855
2025
  </xsl:attribute-set>
@@ -1873,6 +2043,10 @@
1873
2043
 
1874
2044
  </xsl:attribute-set>
1875
2045
 
2046
+ <xsl:template name="refine_fn-body-style">
2047
+
2048
+ </xsl:template> <!-- refine_fn-body-style -->
2049
+
1876
2050
  <xsl:attribute-set name="fn-body-num-style">
1877
2051
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1878
2052
 
@@ -1882,6 +2056,10 @@
1882
2056
 
1883
2057
  </xsl:attribute-set> <!-- fn-body-num-style -->
1884
2058
 
2059
+ <xsl:template name="refine_fn-body-num-style">
2060
+
2061
+ </xsl:template> <!-- refine_fn-body-num-style -->
2062
+
1885
2063
  <!-- admonition -->
1886
2064
  <xsl:attribute-set name="admonition-style">
1887
2065
 
@@ -2536,7 +2714,9 @@
2536
2714
 
2537
2715
  <fo:block-container xsl:use-attribute-sets="table-container-style">
2538
2716
 
2539
- <!-- end table block-container attributes -->
2717
+ <xsl:call-template name="refine_table-container-style">
2718
+ <xsl:with-param name="margin-side" select="$margin-side"/>
2719
+ </xsl:call-template>
2540
2720
 
2541
2721
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2542
2722
 
@@ -2557,7 +2737,9 @@
2557
2737
 
2558
2738
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2559
2739
 
2560
- <xsl:call-template name="setBordersTableArray"/>
2740
+ <xsl:call-template name="refine_table-style">
2741
+ <xsl:with-param name="margin-side" select="$margin-side"/>
2742
+ </xsl:call-template>
2561
2743
 
2562
2744
  </xsl:element>
2563
2745
  </xsl:variable>
@@ -2623,7 +2805,7 @@
2623
2805
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2624
2806
  </xsl:when>
2625
2807
  <xsl:otherwise>
2626
- <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 -->
2808
+ <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 -->
2627
2809
  </xsl:otherwise>
2628
2810
  </xsl:choose>
2629
2811
 
@@ -2713,6 +2895,10 @@
2713
2895
 
2714
2896
  <fo:block xsl:use-attribute-sets="table-name-style">
2715
2897
 
2898
+ <xsl:call-template name="refine_table-name-style">
2899
+ <xsl:with-param name="continued" select="$continued"/>
2900
+ </xsl:call-template>
2901
+
2716
2902
  <xsl:choose>
2717
2903
  <xsl:when test="$continued = 'true'">
2718
2904
 
@@ -3095,6 +3281,8 @@
3095
3281
  <fo:table-row>
3096
3282
  <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">
3097
3283
 
3284
+ <xsl:call-template name="refine_table-header-title-style"/>
3285
+
3098
3286
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3099
3287
  <xsl:with-param name="continued">true</xsl:with-param>
3100
3288
  </xsl:apply-templates>
@@ -3107,6 +3295,10 @@
3107
3295
  </fo:table-row>
3108
3296
  </xsl:template> <!-- table-header-title -->
3109
3297
 
3298
+ <xsl:template name="refine_table-header-title-style">
3299
+
3300
+ </xsl:template> <!-- refine_table-header-title-style -->
3301
+
3110
3302
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3111
3303
  <fo:table-body>
3112
3304
  <xsl:apply-templates/>
@@ -3131,7 +3323,7 @@
3131
3323
  <xsl:param name="colwidths"/>
3132
3324
  <xsl:param name="colgroup"/>
3133
3325
 
3134
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3326
+ <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']"/>
3135
3327
 
3136
3328
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3137
3329
 
@@ -3191,6 +3383,8 @@
3191
3383
  <fo:table-row>
3192
3384
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3193
3385
 
3386
+ <xsl:call-template name="refine_table-footer-cell-style"/>
3387
+
3194
3388
  <xsl:call-template name="setBordersTableArray"/>
3195
3389
 
3196
3390
  <!-- fn will be processed inside 'note' processing -->
@@ -3199,6 +3393,7 @@
3199
3393
 
3200
3394
  <!-- except gb and bsi -->
3201
3395
 
3396
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3202
3397
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3203
3398
  <xsl:apply-templates select="../*[local-name()='note']"/>
3204
3399
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -3330,7 +3525,7 @@
3330
3525
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3331
3526
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3332
3527
 
3333
- <xsl:call-template name="setBordersTableArray"/>
3528
+ <xsl:call-template name="refine_table-header-row-style"/>
3334
3529
 
3335
3530
  <xsl:call-template name="setTableRowAttributes"/>
3336
3531
 
@@ -3364,6 +3559,8 @@
3364
3559
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3365
3560
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3366
3561
 
3562
+ <xsl:call-template name="refine_table-footer-row-style"/>
3563
+
3367
3564
  <xsl:call-template name="setTableRowAttributes"/>
3368
3565
  <xsl:apply-templates/>
3369
3566
  </fo:table-row>
@@ -3377,9 +3574,10 @@
3377
3574
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3378
3575
  </xsl:if>
3379
3576
 
3380
- <xsl:call-template name="setBordersTableArray"/>
3577
+ <xsl:call-template name="refine_table-body-row-style"/>
3381
3578
 
3382
3579
  <xsl:call-template name="setTableRowAttributes"/>
3580
+
3383
3581
  <xsl:apply-templates/>
3384
3582
  </fo:table-row>
3385
3583
  </xsl:template>
@@ -3398,13 +3596,7 @@
3398
3596
  <xsl:with-param name="default">center</xsl:with-param>
3399
3597
  </xsl:call-template>
3400
3598
 
3401
- <xsl:call-template name="setBordersTableArray"/>
3402
-
3403
- <xsl:if test="$lang = 'ar'">
3404
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3405
- </xsl:if>
3406
-
3407
- <xsl:call-template name="setTableCellAttributes"/>
3599
+ <xsl:call-template name="refine_table-header-cell-style"/>
3408
3600
 
3409
3601
  <fo:block>
3410
3602
  <xsl:apply-templates/>
@@ -3446,13 +3638,7 @@
3446
3638
  <xsl:with-param name="default">left</xsl:with-param>
3447
3639
  </xsl:call-template>
3448
3640
 
3449
- <xsl:if test="$lang = 'ar'">
3450
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3451
- </xsl:if>
3452
-
3453
- <!-- bsi -->
3454
-
3455
- <xsl:call-template name="setBordersTableArray"/>
3641
+ <xsl:call-template name="refine_table-cell-style"/>
3456
3642
 
3457
3643
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3458
3644
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -3483,9 +3669,13 @@
3483
3669
 
3484
3670
  <fo:block xsl:use-attribute-sets="table-note-style">
3485
3671
 
3672
+ <xsl:call-template name="refine_table-note-style"/>
3673
+
3486
3674
  <!-- Table's note name (NOTE, for example) -->
3487
3675
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
3488
3676
 
3677
+ <xsl:call-template name="refine_table-note-name-style"/>
3678
+
3489
3679
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3490
3680
 
3491
3681
  </fo:inline>
@@ -3513,6 +3703,14 @@
3513
3703
  <!-- list of footnotes to calculate actual footnotes number -->
3514
3704
  <xsl:variable name="p_fn_">
3515
3705
  <xsl:call-template name="get_fn_list"/>
3706
+ <!-- <xsl:choose>
3707
+ <xsl:when test="$namespace = 'jis'">
3708
+ <xsl:call-template name="get_fn_list_for_element"/>
3709
+ </xsl:when>
3710
+ <xsl:otherwise>
3711
+ <xsl:call-template name="get_fn_list"/>
3712
+ </xsl:otherwise>
3713
+ </xsl:choose> -->
3516
3714
  </xsl:variable>
3517
3715
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3518
3716
 
@@ -3537,7 +3735,14 @@
3537
3735
 
3538
3736
  </xsl:variable>
3539
3737
 
3540
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3738
+ <xsl:variable name="ref_id">
3739
+ <xsl:choose>
3740
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
3741
+ <xsl:otherwise>
3742
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3743
+ </xsl:otherwise>
3744
+ </xsl:choose>
3745
+ </xsl:variable>
3541
3746
  <xsl:variable name="footnote_inline">
3542
3747
  <fo:inline>
3543
3748
 
@@ -3563,7 +3768,7 @@
3563
3768
  <xsl:call-template name="insert_basic_link">
3564
3769
  <xsl:with-param name="element">
3565
3770
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3566
- <xsl:value-of select="$current_fn_number_text"/>
3771
+ <xsl:copy-of select="$current_fn_number_text"/>
3567
3772
  </fo:basic-link>
3568
3773
  </xsl:with-param>
3569
3774
  </xsl:call-template>
@@ -3583,8 +3788,12 @@
3583
3788
 
3584
3789
  <fo:block xsl:use-attribute-sets="fn-body-style">
3585
3790
 
3791
+ <xsl:call-template name="refine_fn-body-style"/>
3792
+
3586
3793
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3587
3794
 
3795
+ <xsl:call-template name="refine_fn-body-num-style"/>
3796
+
3588
3797
  <xsl:value-of select="$current_fn_number_text"/>
3589
3798
  </fo:inline>
3590
3799
  <xsl:apply-templates/>
@@ -3636,6 +3845,28 @@
3636
3845
  </xsl:choose>
3637
3846
  </xsl:template>
3638
3847
 
3848
+ <xsl:template name="get_fn_list_for_element">
3849
+ <xsl:choose>
3850
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
3851
+ <fn gen_id="{generate-id(.)}">
3852
+ <xsl:copy-of select="@*"/>
3853
+ <xsl:copy-of select="node()"/>
3854
+ </fn>
3855
+ </xsl:when>
3856
+ <xsl:otherwise>
3857
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
3858
+ <xsl:variable name="element_id" select="@id"/>
3859
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3860
+ <!-- copy unique fn -->
3861
+ <fn gen_id="{generate-id(.)}">
3862
+ <xsl:copy-of select="@*"/>
3863
+ <xsl:copy-of select="node()"/>
3864
+ </fn>
3865
+ </xsl:for-each>
3866
+ </xsl:for-each>
3867
+ </xsl:otherwise>
3868
+ </xsl:choose>
3869
+ </xsl:template>
3639
3870
  <!-- ============================ -->
3640
3871
  <!-- table's footnotes rendering -->
3641
3872
  <!-- ============================ -->
@@ -3810,6 +4041,8 @@
3810
4041
  <xsl:template match="*[local-name()='fn']">
3811
4042
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
3812
4043
 
4044
+ <xsl:call-template name="refine_fn-reference-style"/>
4045
+
3813
4046
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3814
4047
 
3815
4048
  <xsl:value-of select="@reference"/>
@@ -3909,6 +4142,8 @@
3909
4142
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3910
4143
  <fo:block margin-bottom="12pt" text-align="left">
3911
4144
 
4145
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4146
+
3912
4147
  <!-- <xsl:variable name="title-where">
3913
4148
  <xsl:call-template name="getLocalizedString">
3914
4149
  <xsl:with-param name="key">where</xsl:with-param>
@@ -3922,6 +4157,8 @@
3922
4157
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
3923
4158
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3924
4159
 
4160
+ <xsl:call-template name="refine_figure_key_style"/>
4161
+
3925
4162
  <xsl:variable name="title-key">
3926
4163
  <xsl:call-template name="getLocalizedString">
3927
4164
  <xsl:with-param name="key">key</xsl:with-param>
@@ -3936,7 +4173,7 @@
3936
4173
  <xsl:if test="$onlyOneComponent = 'false'">
3937
4174
  <fo:block>
3938
4175
 
3939
- <!-- <xsl:attribute name="margin-left">7mm</xsl:attribute> -->
4176
+ <xsl:call-template name="refine_multicomponent_style"/>
3940
4177
 
3941
4178
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3942
4179
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -3944,7 +4181,7 @@
3944
4181
 
3945
4182
  <fo:block>
3946
4183
 
3947
- <!-- <xsl:attribute name="margin-left">-3.5mm</xsl:attribute> -->
4184
+ <xsl:call-template name="refine_multicomponent_block_style"/>
3948
4185
 
3949
4186
  <xsl:apply-templates select="*[local-name() = 'name']">
3950
4187
  <xsl:with-param name="process">true</xsl:with-param>
@@ -4105,6 +4342,28 @@
4105
4342
 
4106
4343
  </xsl:template> <!-- END: dl -->
4107
4344
 
4345
+ <xsl:template name="refine_dl_formula_where_style">
4346
+
4347
+ </xsl:template> <!-- refine_dl_formula_where_style -->
4348
+
4349
+ <xsl:template name="refine_figure_key_style">
4350
+
4351
+ </xsl:template> <!-- refine_figure_key_style -->
4352
+
4353
+ <xsl:template name="refine_multicomponent_style">
4354
+ <xsl:variable name="parent" select="local-name(..)"/>
4355
+
4356
+ <!-- <xsl:attribute name="margin-left">7mm</xsl:attribute> -->
4357
+
4358
+ </xsl:template> <!-- refine_multicomponent_style -->
4359
+
4360
+ <xsl:template name="refine_multicomponent_block_style">
4361
+ <xsl:variable name="parent" select="local-name(..)"/>
4362
+
4363
+ <!-- <xsl:attribute name="margin-left">-3.5mm</xsl:attribute> -->
4364
+
4365
+ </xsl:template> <!-- refine_multicomponent_block_style -->
4366
+
4108
4367
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4109
4368
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4110
4369
 
@@ -4324,6 +4583,8 @@
4324
4583
 
4325
4584
  </xsl:if>
4326
4585
 
4586
+ <xsl:call-template name="refine_dt-cell-style"/>
4587
+
4327
4588
  <fo:block xsl:use-attribute-sets="dt-block-style">
4328
4589
  <xsl:copy-of select="@id"/>
4329
4590
 
@@ -4331,6 +4592,8 @@
4331
4592
  <xsl:attribute name="margin-top">0</xsl:attribute>
4332
4593
  </xsl:if>
4333
4594
 
4595
+ <xsl:call-template name="refine_dt-block-style"/>
4596
+
4334
4597
  <xsl:apply-templates>
4335
4598
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4336
4599
  </xsl:apply-templates>
@@ -4350,6 +4613,8 @@
4350
4613
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4351
4614
  </xsl:if>
4352
4615
 
4616
+ <xsl:call-template name="refine_dd-cell-style"/>
4617
+
4353
4618
  <fo:block>
4354
4619
 
4355
4620
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -4500,12 +4765,18 @@
4500
4765
  <xsl:param name="split_keep-within-line"/>
4501
4766
  <fo:inline font-weight="bold">
4502
4767
 
4768
+ <xsl:call-template name="refine_strong_style"/>
4769
+
4503
4770
  <xsl:apply-templates>
4504
4771
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4505
4772
  </xsl:apply-templates>
4506
4773
  </fo:inline>
4507
4774
  </xsl:template>
4508
4775
 
4776
+ <xsl:template name="refine_strong_style">
4777
+
4778
+ </xsl:template>
4779
+
4509
4780
  <xsl:template match="*[local-name()='padding']">
4510
4781
  <fo:inline padding-right="{@value}"> </fo:inline>
4511
4782
  </xsl:template>
@@ -5044,7 +5315,10 @@
5044
5315
  </xsl:choose>
5045
5316
  </xsl:variable>
5046
5317
 
5047
- <xsl:value-of select="$text9"/>
5318
+ <!-- replace sequence #x200B and space TO space -->
5319
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5320
+
5321
+ <xsl:value-of select="$text10"/>
5048
5322
  </xsl:template>
5049
5323
 
5050
5324
  <xsl:template name="add-zero-spaces-link-java">
@@ -5719,6 +5993,11 @@
5719
5993
 
5720
5994
  <fo:inline xsl:use-attribute-sets="mathml-style">
5721
5995
 
5996
+ <!-- DEBUG -->
5997
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
5998
+
5999
+ <xsl:call-template name="refine_mathml-style"/>
6000
+
5722
6001
  <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 -->
5723
6002
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5724
6003
  </xsl:if>
@@ -5823,6 +6102,8 @@
5823
6102
 
5824
6103
  <fo:instream-foreign-object fox:alt-text="Math">
5825
6104
 
6105
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6106
+
5826
6107
  <!-- put MathML in Actual Text -->
5827
6108
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
5828
6109
  <xsl:attribute name="fox:actual-text">
@@ -5843,6 +6124,10 @@
5843
6124
  </fo:instream-foreign-object>
5844
6125
  </xsl:template>
5845
6126
 
6127
+ <xsl:template name="refine_mathml_insteam_object_style">
6128
+
6129
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
6130
+
5846
6131
  <xsl:template match="mathml:*" mode="mathml_actual_text">
5847
6132
  <!-- <xsl:text>a+b</xsl:text> -->
5848
6133
  <xsl:text>&lt;</xsl:text>
@@ -5987,6 +6272,8 @@
5987
6272
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5988
6273
  <fo:inline xsl:use-attribute-sets="mathml-style">
5989
6274
 
6275
+ <xsl:call-template name="refine_mathml-style"/>
6276
+
5990
6277
  <xsl:choose>
5991
6278
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5992
6279
  <xsl:otherwise>
@@ -6031,6 +6318,8 @@
6031
6318
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6032
6319
  </xsl:if>
6033
6320
 
6321
+ <xsl:call-template name="refine_link-style"/>
6322
+
6034
6323
  <xsl:choose>
6035
6324
  <xsl:when test="$target_text = ''">
6036
6325
  <xsl:apply-templates/>
@@ -6118,6 +6407,9 @@
6118
6407
  <xsl:call-template name="insert_basic_link">
6119
6408
  <xsl:with-param name="element">
6120
6409
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6410
+ <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'])">
6411
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6412
+ </xsl:if>
6121
6413
  <xsl:if test="parent::*[local-name() = 'add']">
6122
6414
  <xsl:call-template name="append_add-style"/>
6123
6415
  </xsl:if>
@@ -6179,6 +6471,8 @@
6179
6471
  <fo:table-cell display-align="center">
6180
6472
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6181
6473
 
6474
+ <xsl:call-template name="refine_formula-stem-block-style"/>
6475
+
6182
6476
  <xsl:apply-templates/>
6183
6477
  </fo:block>
6184
6478
  </fo:table-cell>
@@ -6220,12 +6514,18 @@
6220
6514
 
6221
6515
  <xsl:call-template name="setBlockSpanAll"/>
6222
6516
 
6517
+ <xsl:call-template name="refine_note-style"/>
6518
+
6223
6519
  <fo:block-container margin-left="0mm" margin-right="0mm">
6224
6520
 
6225
6521
  <fo:block>
6226
6522
 
6523
+ <xsl:call-template name="refine_note_block_style"/>
6524
+
6227
6525
  <fo:inline xsl:use-attribute-sets="note-name-style">
6228
6526
 
6527
+ <xsl:call-template name="refine_note-name-style"/>
6528
+
6229
6529
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6230
6530
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6231
6531
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6251,6 +6551,10 @@
6251
6551
 
6252
6552
  </xsl:template>
6253
6553
 
6554
+ <xsl:template name="refine_note_block_style">
6555
+
6556
+ </xsl:template>
6557
+
6254
6558
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6255
6559
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6256
6560
  <xsl:choose>
@@ -6272,12 +6576,16 @@
6272
6576
 
6273
6577
  <xsl:call-template name="setBlockSpanAll"/>
6274
6578
 
6579
+ <xsl:call-template name="refine_termnote-style"/>
6580
+
6275
6581
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6276
6582
 
6277
6583
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6278
6584
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6279
6585
  </xsl:if>
6280
6586
 
6587
+ <xsl:call-template name="refine_termnote-name-style"/>
6588
+
6281
6589
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6282
6590
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6283
6591
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6449,6 +6757,8 @@
6449
6757
  <xsl:otherwise>
6450
6758
  <fo:block xsl:use-attribute-sets="image-style">
6451
6759
 
6760
+ <xsl:call-template name="refine_image-style"/>
6761
+
6452
6762
  <xsl:variable name="src">
6453
6763
  <xsl:call-template name="image_src"/>
6454
6764
  </xsl:variable>
@@ -7298,6 +7608,8 @@
7298
7608
  <xsl:if test="normalize-space() != ''">
7299
7609
  <fo:block xsl:use-attribute-sets="figure-name-style">
7300
7610
 
7611
+ <xsl:call-template name="refine_figure-name-style"/>
7612
+
7301
7613
  <xsl:apply-templates/>
7302
7614
  </fo:block>
7303
7615
  </xsl:if>
@@ -7562,6 +7874,8 @@
7562
7874
  </xsl:attribute>
7563
7875
  </xsl:for-each>
7564
7876
 
7877
+ <xsl:call-template name="refine_sourcecode-style"/>
7878
+
7565
7879
  <!-- remove margin between rows in the table with sourcecode line numbers -->
7566
7880
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7567
7881
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -8266,6 +8580,8 @@
8266
8580
 
8267
8581
  <xsl:call-template name="setBlockSpanAll"/>
8268
8582
 
8583
+ <xsl:call-template name="refine_example-style"/>
8584
+
8269
8585
  <xsl:variable name="fo_element">
8270
8586
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8271
8587
  inline
@@ -8393,6 +8709,8 @@
8393
8709
  </xsl:if>
8394
8710
  <fo:block xsl:use-attribute-sets="example-p-style">
8395
8711
 
8712
+ <xsl:call-template name="refine_example-p-style"/>
8713
+
8396
8714
  <xsl:apply-templates/>
8397
8715
  </fo:block>
8398
8716
  </fo:block-container>
@@ -8409,6 +8727,7 @@
8409
8727
  </xsl:otherwise>
8410
8728
  </xsl:choose>
8411
8729
  </xsl:template> <!-- example/p -->
8730
+
8412
8731
  <!-- ====== -->
8413
8732
  <!-- ====== -->
8414
8733
 
@@ -8420,6 +8739,8 @@
8420
8739
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
8421
8740
  <fo:block xsl:use-attribute-sets="termsource-style">
8422
8741
 
8742
+ <xsl:call-template name="refine_termsource-style"/>
8743
+
8423
8744
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
8424
8745
  <xsl:variable name="termsource_text">
8425
8746
  <xsl:apply-templates/>
@@ -8535,6 +8856,8 @@
8535
8856
  <fo:block-container margin-left="0mm">
8536
8857
  <fo:block-container xsl:use-attribute-sets="quote-style">
8537
8858
 
8859
+ <xsl:call-template name="refine_quote-style"/>
8860
+
8538
8861
  <fo:block-container margin-left="0mm" margin-right="0mm">
8539
8862
  <fo:block role="BlockQuote">
8540
8863
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -8609,8 +8932,7 @@
8609
8932
 
8610
8933
  </xsl:if>
8611
8934
 
8612
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8613
- <xsl:variable name="text" select="normalize-space()"/>
8935
+ <xsl:call-template name="refine_eref-style"/>
8614
8936
 
8615
8937
  <xsl:call-template name="insert_basic_link">
8616
8938
  <xsl:with-param name="element">
@@ -8620,8 +8942,7 @@
8620
8942
  </xsl:if>
8621
8943
  <xsl:if test="@type = 'inline'">
8622
8944
 
8623
- <xsl:attribute name="color">blue</xsl:attribute>
8624
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8945
+ <xsl:call-template name="refine_basic_link_style"/>
8625
8946
 
8626
8947
  </xsl:if>
8627
8948
 
@@ -8655,6 +8976,14 @@
8655
8976
  </xsl:otherwise>
8656
8977
  </xsl:choose>
8657
8978
  </xsl:template>
8979
+
8980
+ <xsl:template name="refine_basic_link_style">
8981
+
8982
+ <xsl:attribute name="color">blue</xsl:attribute>
8983
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
8984
+
8985
+ </xsl:template> <!-- refine_basic_link_style -->
8986
+
8658
8987
  <!-- ====== -->
8659
8988
  <!-- END eref -->
8660
8989
  <!-- ====== -->
@@ -8798,11 +9127,17 @@
8798
9127
  <fo:block>
8799
9128
  <xsl:call-template name="setId"/>
8800
9129
 
9130
+ <xsl:call-template name="sections_element_style"/>
9131
+
8801
9132
  <xsl:apply-templates/>
8802
9133
  </fo:block>
8803
9134
 
8804
9135
  </xsl:template>
8805
9136
 
9137
+ <xsl:template name="sections_element_style">
9138
+
9139
+ </xsl:template> <!-- sections_element_style -->
9140
+
8806
9141
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
8807
9142
  <fo:block break-after="page"/>
8808
9143
  <fo:block>
@@ -8817,10 +9152,16 @@
8817
9152
 
8818
9153
  <xsl:call-template name="setBlockSpanAll"/>
8819
9154
 
9155
+ <xsl:call-template name="refine_clause_style"/>
9156
+
8820
9157
  <xsl:apply-templates/>
8821
9158
  </fo:block>
8822
9159
  </xsl:template>
8823
9160
 
9161
+ <xsl:template name="refine_clause_style">
9162
+
9163
+ </xsl:template> <!-- refine_clause_style -->
9164
+
8824
9165
  <xsl:template match="*[local-name() = 'definitions']">
8825
9166
  <fo:block id="{@id}">
8826
9167
  <xsl:apply-templates/>
@@ -8833,10 +9174,16 @@
8833
9174
 
8834
9175
  <xsl:call-template name="setBlockSpanAll"/>
8835
9176
 
9177
+ <xsl:call-template name="refine_annex_style"/>
9178
+
8836
9179
  </fo:block>
8837
9180
  <xsl:apply-templates/>
8838
9181
  </xsl:template>
8839
9182
 
9183
+ <xsl:template name="refine_annex_style">
9184
+
9185
+ </xsl:template>
9186
+
8840
9187
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
8841
9188
  <!-- comment 2019-11-29 -->
8842
9189
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -9004,6 +9351,8 @@
9004
9351
  </xsl:choose>
9005
9352
  </xsl:attribute>
9006
9353
 
9354
+ <xsl:call-template name="refine_list_container_style"/>
9355
+
9007
9356
  <fo:block-container margin-left="0mm">
9008
9357
  <fo:block>
9009
9358
  <xsl:apply-templates select="." mode="list"/>
@@ -9021,6 +9370,10 @@
9021
9370
  </xsl:choose>
9022
9371
  </xsl:template>
9023
9372
 
9373
+ <xsl:template name="refine_list_container_style">
9374
+
9375
+ </xsl:template> <!-- refine_list_container_style -->
9376
+
9024
9377
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
9025
9378
 
9026
9379
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -9031,7 +9384,7 @@
9031
9384
 
9032
9385
  <xsl:variable name="provisional_distance_between_starts_">
9033
9386
  <attributes xsl:use-attribute-sets="list-style">
9034
-
9387
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
9035
9388
  </attributes>
9036
9389
  </xsl:variable>
9037
9390
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -9067,6 +9420,8 @@
9067
9420
  <addon><xsl:value-of select="$addon"/></addon> -->
9068
9421
  </xsl:if>
9069
9422
 
9423
+ <xsl:call-template name="refine_list-style"/>
9424
+
9070
9425
  <xsl:if test="*[local-name() = 'name']">
9071
9426
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9072
9427
  </xsl:if>
@@ -9079,6 +9434,10 @@
9079
9434
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9080
9435
  </xsl:template>
9081
9436
 
9437
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
9438
+
9439
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
9440
+
9082
9441
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9083
9442
  <xsl:param name="process">false</xsl:param>
9084
9443
  <xsl:if test="$process = 'true'">
@@ -9092,20 +9451,27 @@
9092
9451
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9093
9452
  <xsl:copy-of select="@id"/>
9094
9453
 
9454
+ <xsl:call-template name="refine_list-item-style"/>
9455
+
9095
9456
  <fo:list-item-label end-indent="label-end()">
9096
9457
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9097
9458
 
9459
+ <xsl:call-template name="refine_list-item-label-style"/>
9460
+
9098
9461
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9099
9462
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9100
9463
  <xsl:call-template name="append_add-style"/>
9101
9464
  </xsl:if>
9102
9465
 
9103
9466
  <xsl:call-template name="getListItemFormat"/>
9467
+
9104
9468
  </fo:block>
9105
9469
  </fo:list-item-label>
9106
9470
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9107
9471
  <fo:block>
9108
9472
 
9473
+ <xsl:call-template name="refine_list-item-body-style"/>
9474
+
9109
9475
  <xsl:apply-templates/>
9110
9476
 
9111
9477
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -9423,6 +9789,7 @@
9423
9789
 
9424
9790
  <fo:block id="{@id}">
9425
9791
  <xsl:apply-templates/>
9792
+
9426
9793
  </fo:block>
9427
9794
  </xsl:template>
9428
9795
 
@@ -9440,6 +9807,7 @@
9440
9807
 
9441
9808
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
9442
9809
  <xsl:apply-templates/>
9810
+
9443
9811
  </fo:block>
9444
9812
 
9445
9813
  </xsl:template> <!-- references -->
@@ -10023,6 +10391,9 @@
10023
10391
  </xsl:copy>
10024
10392
  </xsl:template>
10025
10393
 
10394
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
10395
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
10396
+
10026
10397
  <xsl:template name="add_id">
10027
10398
  <xsl:if test="not(@id)">
10028
10399
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10307,6 +10678,14 @@
10307
10678
  <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">
10308
10679
  <xsl:variable name="p_fn_">
10309
10680
  <xsl:call-template name="get_fn_list"/>
10681
+ <!-- <xsl:choose>
10682
+ <xsl:when test="$namespace = 'jis'">
10683
+ <xsl:call-template name="get_fn_list_for_element"/>
10684
+ </xsl:when>
10685
+ <xsl:otherwise>
10686
+ <xsl:call-template name="get_fn_list"/>
10687
+ </xsl:otherwise>
10688
+ </xsl:choose> -->
10310
10689
  </xsl:variable>
10311
10690
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10312
10691
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10321,8 +10700,14 @@
10321
10700
  <xsl:attribute name="current_fn_number">
10322
10701
  <xsl:value-of select="$current_fn_number"/>
10323
10702
  </xsl:attribute>
10703
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10324
10704
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10325
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10705
+
10706
+ <xsl:value-of select="$skip_footnote_body_"/>
10707
+
10708
+ </xsl:attribute>
10709
+ <xsl:attribute name="ref_id">
10710
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10326
10711
  </xsl:attribute>
10327
10712
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10328
10713
  </xsl:copy>