metanorma-iho 0.7.9 → 0.7.11

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>
@@ -2579,7 +2761,7 @@
2579
2761
  </xsl:attribute>
2580
2762
  </xsl:for-each>
2581
2763
 
2582
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2764
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2583
2765
  <xsl:if test="$isNoteOrFnExist = 'true'">
2584
2766
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2585
2767
  </xsl:if>
@@ -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() = 'example') 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()='example'] 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,8 +3393,10 @@
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']"/>
3399
+ <xsl:apply-templates select="../*[local-name()='example']"/>
3204
3400
  <xsl:apply-templates select="../*[local-name()='source']"/>
3205
3401
 
3206
3402
  <xsl:variable name="isDisplayRowSeparator">
@@ -3209,7 +3405,7 @@
3209
3405
 
3210
3406
  <!-- horizontal row separator -->
3211
3407
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
3212
- <xsl:if test="../*[local-name()='note'] and normalize-space($table_fn_block) != ''">
3408
+ <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3213
3409
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3214
3410
 
3215
3411
  <xsl:call-template name="setBordersTableArray"/>
@@ -3330,7 +3526,7 @@
3330
3526
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3331
3527
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3332
3528
 
3333
- <xsl:call-template name="setBordersTableArray"/>
3529
+ <xsl:call-template name="refine_table-header-row-style"/>
3334
3530
 
3335
3531
  <xsl:call-template name="setTableRowAttributes"/>
3336
3532
 
@@ -3364,6 +3560,8 @@
3364
3560
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3365
3561
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3366
3562
 
3563
+ <xsl:call-template name="refine_table-footer-row-style"/>
3564
+
3367
3565
  <xsl:call-template name="setTableRowAttributes"/>
3368
3566
  <xsl:apply-templates/>
3369
3567
  </fo:table-row>
@@ -3377,9 +3575,10 @@
3377
3575
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3378
3576
  </xsl:if>
3379
3577
 
3380
- <xsl:call-template name="setBordersTableArray"/>
3578
+ <xsl:call-template name="refine_table-body-row-style"/>
3381
3579
 
3382
3580
  <xsl:call-template name="setTableRowAttributes"/>
3581
+
3383
3582
  <xsl:apply-templates/>
3384
3583
  </fo:table-row>
3385
3584
  </xsl:template>
@@ -3398,13 +3597,7 @@
3398
3597
  <xsl:with-param name="default">center</xsl:with-param>
3399
3598
  </xsl:call-template>
3400
3599
 
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"/>
3600
+ <xsl:call-template name="refine_table-header-cell-style"/>
3408
3601
 
3409
3602
  <fo:block>
3410
3603
  <xsl:apply-templates/>
@@ -3446,13 +3639,7 @@
3446
3639
  <xsl:with-param name="default">left</xsl:with-param>
3447
3640
  </xsl:call-template>
3448
3641
 
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"/>
3642
+ <xsl:call-template name="refine_table-cell-style"/>
3456
3643
 
3457
3644
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3458
3645
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -3479,13 +3666,17 @@
3479
3666
  </fo:table-cell>
3480
3667
  </xsl:template> <!-- td -->
3481
3668
 
3482
- <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
3669
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
3483
3670
 
3484
3671
  <fo:block xsl:use-attribute-sets="table-note-style">
3485
3672
 
3486
- <!-- Table's note name (NOTE, for example) -->
3673
+ <xsl:call-template name="refine_table-note-style"/>
3674
+
3675
+ <!-- Table's note/example name (NOTE, for example) -->
3487
3676
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
3488
3677
 
3678
+ <xsl:call-template name="refine_table-note-name-style"/>
3679
+
3489
3680
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3490
3681
 
3491
3682
  </fo:inline>
@@ -3495,7 +3686,7 @@
3495
3686
 
3496
3687
  </xsl:template> <!-- table/note -->
3497
3688
 
3498
- <xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
3689
+ <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name()='example']/*[local-name()='p']" priority="2">
3499
3690
  <xsl:apply-templates/>
3500
3691
  </xsl:template>
3501
3692
 
@@ -3513,6 +3704,14 @@
3513
3704
  <!-- list of footnotes to calculate actual footnotes number -->
3514
3705
  <xsl:variable name="p_fn_">
3515
3706
  <xsl:call-template name="get_fn_list"/>
3707
+ <!-- <xsl:choose>
3708
+ <xsl:when test="$namespace = 'jis'">
3709
+ <xsl:call-template name="get_fn_list_for_element"/>
3710
+ </xsl:when>
3711
+ <xsl:otherwise>
3712
+ <xsl:call-template name="get_fn_list"/>
3713
+ </xsl:otherwise>
3714
+ </xsl:choose> -->
3516
3715
  </xsl:variable>
3517
3716
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3518
3717
 
@@ -3537,7 +3736,14 @@
3537
3736
 
3538
3737
  </xsl:variable>
3539
3738
 
3540
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3739
+ <xsl:variable name="ref_id">
3740
+ <xsl:choose>
3741
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
3742
+ <xsl:otherwise>
3743
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3744
+ </xsl:otherwise>
3745
+ </xsl:choose>
3746
+ </xsl:variable>
3541
3747
  <xsl:variable name="footnote_inline">
3542
3748
  <fo:inline>
3543
3749
 
@@ -3563,7 +3769,7 @@
3563
3769
  <xsl:call-template name="insert_basic_link">
3564
3770
  <xsl:with-param name="element">
3565
3771
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3566
- <xsl:value-of select="$current_fn_number_text"/>
3772
+ <xsl:copy-of select="$current_fn_number_text"/>
3567
3773
  </fo:basic-link>
3568
3774
  </xsl:with-param>
3569
3775
  </xsl:call-template>
@@ -3583,8 +3789,12 @@
3583
3789
 
3584
3790
  <fo:block xsl:use-attribute-sets="fn-body-style">
3585
3791
 
3792
+ <xsl:call-template name="refine_fn-body-style"/>
3793
+
3586
3794
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3587
3795
 
3796
+ <xsl:call-template name="refine_fn-body-num-style"/>
3797
+
3588
3798
  <xsl:value-of select="$current_fn_number_text"/>
3589
3799
  </fo:inline>
3590
3800
  <xsl:apply-templates/>
@@ -3636,6 +3846,28 @@
3636
3846
  </xsl:choose>
3637
3847
  </xsl:template>
3638
3848
 
3849
+ <xsl:template name="get_fn_list_for_element">
3850
+ <xsl:choose>
3851
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
3852
+ <fn gen_id="{generate-id(.)}">
3853
+ <xsl:copy-of select="@*"/>
3854
+ <xsl:copy-of select="node()"/>
3855
+ </fn>
3856
+ </xsl:when>
3857
+ <xsl:otherwise>
3858
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
3859
+ <xsl:variable name="element_id" select="@id"/>
3860
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3861
+ <!-- copy unique fn -->
3862
+ <fn gen_id="{generate-id(.)}">
3863
+ <xsl:copy-of select="@*"/>
3864
+ <xsl:copy-of select="node()"/>
3865
+ </fn>
3866
+ </xsl:for-each>
3867
+ </xsl:for-each>
3868
+ </xsl:otherwise>
3869
+ </xsl:choose>
3870
+ </xsl:template>
3639
3871
  <!-- ============================ -->
3640
3872
  <!-- table's footnotes rendering -->
3641
3873
  <!-- ============================ -->
@@ -3810,6 +4042,8 @@
3810
4042
  <xsl:template match="*[local-name()='fn']">
3811
4043
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
3812
4044
 
4045
+ <xsl:call-template name="refine_fn-reference-style"/>
4046
+
3813
4047
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3814
4048
 
3815
4049
  <xsl:value-of select="@reference"/>
@@ -3909,6 +4143,8 @@
3909
4143
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3910
4144
  <fo:block margin-bottom="12pt" text-align="left">
3911
4145
 
4146
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4147
+
3912
4148
  <!-- <xsl:variable name="title-where">
3913
4149
  <xsl:call-template name="getLocalizedString">
3914
4150
  <xsl:with-param name="key">where</xsl:with-param>
@@ -3922,6 +4158,8 @@
3922
4158
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
3923
4159
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3924
4160
 
4161
+ <xsl:call-template name="refine_figure_key_style"/>
4162
+
3925
4163
  <xsl:variable name="title-key">
3926
4164
  <xsl:call-template name="getLocalizedString">
3927
4165
  <xsl:with-param name="key">key</xsl:with-param>
@@ -3936,7 +4174,7 @@
3936
4174
  <xsl:if test="$onlyOneComponent = 'false'">
3937
4175
  <fo:block>
3938
4176
 
3939
- <!-- <xsl:attribute name="margin-left">7mm</xsl:attribute> -->
4177
+ <xsl:call-template name="refine_multicomponent_style"/>
3940
4178
 
3941
4179
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3942
4180
  <xsl:attribute name="margin-top">0</xsl:attribute>
@@ -3944,7 +4182,7 @@
3944
4182
 
3945
4183
  <fo:block>
3946
4184
 
3947
- <!-- <xsl:attribute name="margin-left">-3.5mm</xsl:attribute> -->
4185
+ <xsl:call-template name="refine_multicomponent_block_style"/>
3948
4186
 
3949
4187
  <xsl:apply-templates select="*[local-name() = 'name']">
3950
4188
  <xsl:with-param name="process">true</xsl:with-param>
@@ -4105,6 +4343,28 @@
4105
4343
 
4106
4344
  </xsl:template> <!-- END: dl -->
4107
4345
 
4346
+ <xsl:template name="refine_dl_formula_where_style">
4347
+
4348
+ </xsl:template> <!-- refine_dl_formula_where_style -->
4349
+
4350
+ <xsl:template name="refine_figure_key_style">
4351
+
4352
+ </xsl:template> <!-- refine_figure_key_style -->
4353
+
4354
+ <xsl:template name="refine_multicomponent_style">
4355
+ <xsl:variable name="parent" select="local-name(..)"/>
4356
+
4357
+ <!-- <xsl:attribute name="margin-left">7mm</xsl:attribute> -->
4358
+
4359
+ </xsl:template> <!-- refine_multicomponent_style -->
4360
+
4361
+ <xsl:template name="refine_multicomponent_block_style">
4362
+ <xsl:variable name="parent" select="local-name(..)"/>
4363
+
4364
+ <!-- <xsl:attribute name="margin-left">-3.5mm</xsl:attribute> -->
4365
+
4366
+ </xsl:template> <!-- refine_multicomponent_block_style -->
4367
+
4108
4368
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4109
4369
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4110
4370
 
@@ -4324,6 +4584,8 @@
4324
4584
 
4325
4585
  </xsl:if>
4326
4586
 
4587
+ <xsl:call-template name="refine_dt-cell-style"/>
4588
+
4327
4589
  <fo:block xsl:use-attribute-sets="dt-block-style">
4328
4590
  <xsl:copy-of select="@id"/>
4329
4591
 
@@ -4331,6 +4593,8 @@
4331
4593
  <xsl:attribute name="margin-top">0</xsl:attribute>
4332
4594
  </xsl:if>
4333
4595
 
4596
+ <xsl:call-template name="refine_dt-block-style"/>
4597
+
4334
4598
  <xsl:apply-templates>
4335
4599
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4336
4600
  </xsl:apply-templates>
@@ -4350,6 +4614,8 @@
4350
4614
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4351
4615
  </xsl:if>
4352
4616
 
4617
+ <xsl:call-template name="refine_dd-cell-style"/>
4618
+
4353
4619
  <fo:block>
4354
4620
 
4355
4621
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -4500,12 +4766,18 @@
4500
4766
  <xsl:param name="split_keep-within-line"/>
4501
4767
  <fo:inline font-weight="bold">
4502
4768
 
4769
+ <xsl:call-template name="refine_strong_style"/>
4770
+
4503
4771
  <xsl:apply-templates>
4504
4772
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4505
4773
  </xsl:apply-templates>
4506
4774
  </fo:inline>
4507
4775
  </xsl:template>
4508
4776
 
4777
+ <xsl:template name="refine_strong_style">
4778
+
4779
+ </xsl:template>
4780
+
4509
4781
  <xsl:template match="*[local-name()='padding']">
4510
4782
  <fo:inline padding-right="{@value}"> </fo:inline>
4511
4783
  </xsl:template>
@@ -5044,7 +5316,10 @@
5044
5316
  </xsl:choose>
5045
5317
  </xsl:variable>
5046
5318
 
5047
- <xsl:value-of select="$text9"/>
5319
+ <!-- replace sequence #x200B and space TO space -->
5320
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5321
+
5322
+ <xsl:value-of select="$text10"/>
5048
5323
  </xsl:template>
5049
5324
 
5050
5325
  <xsl:template name="add-zero-spaces-link-java">
@@ -5719,6 +5994,11 @@
5719
5994
 
5720
5995
  <fo:inline xsl:use-attribute-sets="mathml-style">
5721
5996
 
5997
+ <!-- DEBUG -->
5998
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
5999
+
6000
+ <xsl:call-template name="refine_mathml-style"/>
6001
+
5722
6002
  <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
6003
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5724
6004
  </xsl:if>
@@ -5823,6 +6103,8 @@
5823
6103
 
5824
6104
  <fo:instream-foreign-object fox:alt-text="Math">
5825
6105
 
6106
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6107
+
5826
6108
  <!-- put MathML in Actual Text -->
5827
6109
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
5828
6110
  <xsl:attribute name="fox:actual-text">
@@ -5843,6 +6125,10 @@
5843
6125
  </fo:instream-foreign-object>
5844
6126
  </xsl:template>
5845
6127
 
6128
+ <xsl:template name="refine_mathml_insteam_object_style">
6129
+
6130
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
6131
+
5846
6132
  <xsl:template match="mathml:*" mode="mathml_actual_text">
5847
6133
  <!-- <xsl:text>a+b</xsl:text> -->
5848
6134
  <xsl:text>&lt;</xsl:text>
@@ -5987,6 +6273,8 @@
5987
6273
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5988
6274
  <fo:inline xsl:use-attribute-sets="mathml-style">
5989
6275
 
6276
+ <xsl:call-template name="refine_mathml-style"/>
6277
+
5990
6278
  <xsl:choose>
5991
6279
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5992
6280
  <xsl:otherwise>
@@ -6031,6 +6319,8 @@
6031
6319
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6032
6320
  </xsl:if>
6033
6321
 
6322
+ <xsl:call-template name="refine_link-style"/>
6323
+
6034
6324
  <xsl:choose>
6035
6325
  <xsl:when test="$target_text = ''">
6036
6326
  <xsl:apply-templates/>
@@ -6118,6 +6408,9 @@
6118
6408
  <xsl:call-template name="insert_basic_link">
6119
6409
  <xsl:with-param name="element">
6120
6410
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6411
+ <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'])">
6412
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6413
+ </xsl:if>
6121
6414
  <xsl:if test="parent::*[local-name() = 'add']">
6122
6415
  <xsl:call-template name="append_add-style"/>
6123
6416
  </xsl:if>
@@ -6179,6 +6472,8 @@
6179
6472
  <fo:table-cell display-align="center">
6180
6473
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6181
6474
 
6475
+ <xsl:call-template name="refine_formula-stem-block-style"/>
6476
+
6182
6477
  <xsl:apply-templates/>
6183
6478
  </fo:block>
6184
6479
  </fo:table-cell>
@@ -6220,12 +6515,18 @@
6220
6515
 
6221
6516
  <xsl:call-template name="setBlockSpanAll"/>
6222
6517
 
6518
+ <xsl:call-template name="refine_note-style"/>
6519
+
6223
6520
  <fo:block-container margin-left="0mm" margin-right="0mm">
6224
6521
 
6225
6522
  <fo:block>
6226
6523
 
6524
+ <xsl:call-template name="refine_note_block_style"/>
6525
+
6227
6526
  <fo:inline xsl:use-attribute-sets="note-name-style">
6228
6527
 
6528
+ <xsl:call-template name="refine_note-name-style"/>
6529
+
6229
6530
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6230
6531
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6231
6532
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6251,6 +6552,10 @@
6251
6552
 
6252
6553
  </xsl:template>
6253
6554
 
6555
+ <xsl:template name="refine_note_block_style">
6556
+
6557
+ </xsl:template>
6558
+
6254
6559
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6255
6560
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6256
6561
  <xsl:choose>
@@ -6272,12 +6577,16 @@
6272
6577
 
6273
6578
  <xsl:call-template name="setBlockSpanAll"/>
6274
6579
 
6580
+ <xsl:call-template name="refine_termnote-style"/>
6581
+
6275
6582
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6276
6583
 
6277
6584
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6278
6585
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6279
6586
  </xsl:if>
6280
6587
 
6588
+ <xsl:call-template name="refine_termnote-name-style"/>
6589
+
6281
6590
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6282
6591
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6283
6592
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6449,6 +6758,8 @@
6449
6758
  <xsl:otherwise>
6450
6759
  <fo:block xsl:use-attribute-sets="image-style">
6451
6760
 
6761
+ <xsl:call-template name="refine_image-style"/>
6762
+
6452
6763
  <xsl:variable name="src">
6453
6764
  <xsl:call-template name="image_src"/>
6454
6765
  </xsl:variable>
@@ -7298,6 +7609,8 @@
7298
7609
  <xsl:if test="normalize-space() != ''">
7299
7610
  <fo:block xsl:use-attribute-sets="figure-name-style">
7300
7611
 
7612
+ <xsl:call-template name="refine_figure-name-style"/>
7613
+
7301
7614
  <xsl:apply-templates/>
7302
7615
  </fo:block>
7303
7616
  </xsl:if>
@@ -7562,6 +7875,8 @@
7562
7875
  </xsl:attribute>
7563
7876
  </xsl:for-each>
7564
7877
 
7878
+ <xsl:call-template name="refine_sourcecode-style"/>
7879
+
7565
7880
  <!-- remove margin between rows in the table with sourcecode line numbers -->
7566
7881
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
7567
7882
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
@@ -8266,6 +8581,8 @@
8266
8581
 
8267
8582
  <xsl:call-template name="setBlockSpanAll"/>
8268
8583
 
8584
+ <xsl:call-template name="refine_example-style"/>
8585
+
8269
8586
  <xsl:variable name="fo_element">
8270
8587
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
8271
8588
  inline
@@ -8376,6 +8693,12 @@
8376
8693
 
8377
8694
  </xsl:template>
8378
8695
 
8696
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
8697
+ <fo:inline xsl:use-attribute-sets="example-name-style">
8698
+ <xsl:apply-templates/>
8699
+ </fo:inline>
8700
+ </xsl:template>
8701
+
8379
8702
  <xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
8380
8703
  <xsl:param name="fo_element">block</xsl:param>
8381
8704
 
@@ -8393,6 +8716,8 @@
8393
8716
  </xsl:if>
8394
8717
  <fo:block xsl:use-attribute-sets="example-p-style">
8395
8718
 
8719
+ <xsl:call-template name="refine_example-p-style"/>
8720
+
8396
8721
  <xsl:apply-templates/>
8397
8722
  </fo:block>
8398
8723
  </fo:block-container>
@@ -8409,6 +8734,7 @@
8409
8734
  </xsl:otherwise>
8410
8735
  </xsl:choose>
8411
8736
  </xsl:template> <!-- example/p -->
8737
+
8412
8738
  <!-- ====== -->
8413
8739
  <!-- ====== -->
8414
8740
 
@@ -8420,6 +8746,8 @@
8420
8746
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
8421
8747
  <fo:block xsl:use-attribute-sets="termsource-style">
8422
8748
 
8749
+ <xsl:call-template name="refine_termsource-style"/>
8750
+
8423
8751
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
8424
8752
  <xsl:variable name="termsource_text">
8425
8753
  <xsl:apply-templates/>
@@ -8535,6 +8863,8 @@
8535
8863
  <fo:block-container margin-left="0mm">
8536
8864
  <fo:block-container xsl:use-attribute-sets="quote-style">
8537
8865
 
8866
+ <xsl:call-template name="refine_quote-style"/>
8867
+
8538
8868
  <fo:block-container margin-left="0mm" margin-right="0mm">
8539
8869
  <fo:block role="BlockQuote">
8540
8870
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -8609,8 +8939,7 @@
8609
8939
 
8610
8940
  </xsl:if>
8611
8941
 
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()"/>
8942
+ <xsl:call-template name="refine_eref-style"/>
8614
8943
 
8615
8944
  <xsl:call-template name="insert_basic_link">
8616
8945
  <xsl:with-param name="element">
@@ -8620,8 +8949,7 @@
8620
8949
  </xsl:if>
8621
8950
  <xsl:if test="@type = 'inline'">
8622
8951
 
8623
- <xsl:attribute name="color">blue</xsl:attribute>
8624
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8952
+ <xsl:call-template name="refine_basic_link_style"/>
8625
8953
 
8626
8954
  </xsl:if>
8627
8955
 
@@ -8655,6 +8983,14 @@
8655
8983
  </xsl:otherwise>
8656
8984
  </xsl:choose>
8657
8985
  </xsl:template>
8986
+
8987
+ <xsl:template name="refine_basic_link_style">
8988
+
8989
+ <xsl:attribute name="color">blue</xsl:attribute>
8990
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
8991
+
8992
+ </xsl:template> <!-- refine_basic_link_style -->
8993
+
8658
8994
  <!-- ====== -->
8659
8995
  <!-- END eref -->
8660
8996
  <!-- ====== -->
@@ -8798,11 +9134,17 @@
8798
9134
  <fo:block>
8799
9135
  <xsl:call-template name="setId"/>
8800
9136
 
9137
+ <xsl:call-template name="sections_element_style"/>
9138
+
8801
9139
  <xsl:apply-templates/>
8802
9140
  </fo:block>
8803
9141
 
8804
9142
  </xsl:template>
8805
9143
 
9144
+ <xsl:template name="sections_element_style">
9145
+
9146
+ </xsl:template> <!-- sections_element_style -->
9147
+
8806
9148
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
8807
9149
  <fo:block break-after="page"/>
8808
9150
  <fo:block>
@@ -8817,10 +9159,16 @@
8817
9159
 
8818
9160
  <xsl:call-template name="setBlockSpanAll"/>
8819
9161
 
9162
+ <xsl:call-template name="refine_clause_style"/>
9163
+
8820
9164
  <xsl:apply-templates/>
8821
9165
  </fo:block>
8822
9166
  </xsl:template>
8823
9167
 
9168
+ <xsl:template name="refine_clause_style">
9169
+
9170
+ </xsl:template> <!-- refine_clause_style -->
9171
+
8824
9172
  <xsl:template match="*[local-name() = 'definitions']">
8825
9173
  <fo:block id="{@id}">
8826
9174
  <xsl:apply-templates/>
@@ -8833,10 +9181,16 @@
8833
9181
 
8834
9182
  <xsl:call-template name="setBlockSpanAll"/>
8835
9183
 
9184
+ <xsl:call-template name="refine_annex_style"/>
9185
+
8836
9186
  </fo:block>
8837
9187
  <xsl:apply-templates/>
8838
9188
  </xsl:template>
8839
9189
 
9190
+ <xsl:template name="refine_annex_style">
9191
+
9192
+ </xsl:template>
9193
+
8840
9194
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
8841
9195
  <!-- comment 2019-11-29 -->
8842
9196
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -8916,6 +9270,9 @@
8916
9270
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
8917
9271
  </xsl:choose>
8918
9272
  </xsl:when>
9273
+ <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
9274
+ <xsl:value-of select="@label"/>
9275
+ </xsl:when>
8919
9276
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
8920
9277
 
8921
9278
  <!-- Example: for BSI <?list-start 2?> -->
@@ -8973,10 +9330,10 @@
8973
9330
  <xsl:when test="$type = 'arabic'">
8974
9331
  1)
8975
9332
  </xsl:when>
8976
- <xsl:when test="$type = 'alphabet'">
9333
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
8977
9334
  a)
8978
9335
  </xsl:when>
8979
- <xsl:when test="$type = 'alphabet_upper'">
9336
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
8980
9337
  A.
8981
9338
  </xsl:when>
8982
9339
  <xsl:when test="$type = 'roman'">
@@ -9004,6 +9361,8 @@
9004
9361
  </xsl:choose>
9005
9362
  </xsl:attribute>
9006
9363
 
9364
+ <xsl:call-template name="refine_list_container_style"/>
9365
+
9007
9366
  <fo:block-container margin-left="0mm">
9008
9367
  <fo:block>
9009
9368
  <xsl:apply-templates select="." mode="list"/>
@@ -9021,6 +9380,10 @@
9021
9380
  </xsl:choose>
9022
9381
  </xsl:template>
9023
9382
 
9383
+ <xsl:template name="refine_list_container_style">
9384
+
9385
+ </xsl:template> <!-- refine_list_container_style -->
9386
+
9024
9387
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
9025
9388
 
9026
9389
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -9031,7 +9394,7 @@
9031
9394
 
9032
9395
  <xsl:variable name="provisional_distance_between_starts_">
9033
9396
  <attributes xsl:use-attribute-sets="list-style">
9034
-
9397
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
9035
9398
  </attributes>
9036
9399
  </xsl:variable>
9037
9400
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -9067,6 +9430,8 @@
9067
9430
  <addon><xsl:value-of select="$addon"/></addon> -->
9068
9431
  </xsl:if>
9069
9432
 
9433
+ <xsl:call-template name="refine_list-style"/>
9434
+
9070
9435
  <xsl:if test="*[local-name() = 'name']">
9071
9436
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9072
9437
  </xsl:if>
@@ -9079,6 +9444,10 @@
9079
9444
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9080
9445
  </xsl:template>
9081
9446
 
9447
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
9448
+
9449
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
9450
+
9082
9451
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9083
9452
  <xsl:param name="process">false</xsl:param>
9084
9453
  <xsl:if test="$process = 'true'">
@@ -9092,20 +9461,27 @@
9092
9461
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9093
9462
  <xsl:copy-of select="@id"/>
9094
9463
 
9464
+ <xsl:call-template name="refine_list-item-style"/>
9465
+
9095
9466
  <fo:list-item-label end-indent="label-end()">
9096
9467
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9097
9468
 
9469
+ <xsl:call-template name="refine_list-item-label-style"/>
9470
+
9098
9471
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9099
9472
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9100
9473
  <xsl:call-template name="append_add-style"/>
9101
9474
  </xsl:if>
9102
9475
 
9103
9476
  <xsl:call-template name="getListItemFormat"/>
9477
+
9104
9478
  </fo:block>
9105
9479
  </fo:list-item-label>
9106
9480
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9107
9481
  <fo:block>
9108
9482
 
9483
+ <xsl:call-template name="refine_list-item-body-style"/>
9484
+
9109
9485
  <xsl:apply-templates/>
9110
9486
 
9111
9487
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -9423,6 +9799,7 @@
9423
9799
 
9424
9800
  <fo:block id="{@id}">
9425
9801
  <xsl:apply-templates/>
9802
+
9426
9803
  </fo:block>
9427
9804
  </xsl:template>
9428
9805
 
@@ -9440,6 +9817,7 @@
9440
9817
 
9441
9818
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
9442
9819
  <xsl:apply-templates/>
9820
+
9443
9821
  </fo:block>
9444
9822
 
9445
9823
  </xsl:template> <!-- references -->
@@ -10023,6 +10401,9 @@
10023
10401
  </xsl:copy>
10024
10402
  </xsl:template>
10025
10403
 
10404
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
10405
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
10406
+
10026
10407
  <xsl:template name="add_id">
10027
10408
  <xsl:if test="not(@id)">
10028
10409
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10307,6 +10688,14 @@
10307
10688
  <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
10689
  <xsl:variable name="p_fn_">
10309
10690
  <xsl:call-template name="get_fn_list"/>
10691
+ <!-- <xsl:choose>
10692
+ <xsl:when test="$namespace = 'jis'">
10693
+ <xsl:call-template name="get_fn_list_for_element"/>
10694
+ </xsl:when>
10695
+ <xsl:otherwise>
10696
+ <xsl:call-template name="get_fn_list"/>
10697
+ </xsl:otherwise>
10698
+ </xsl:choose> -->
10310
10699
  </xsl:variable>
10311
10700
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10312
10701
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10321,8 +10710,14 @@
10321
10710
  <xsl:attribute name="current_fn_number">
10322
10711
  <xsl:value-of select="$current_fn_number"/>
10323
10712
  </xsl:attribute>
10713
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10324
10714
  <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))"/>
10715
+
10716
+ <xsl:value-of select="$skip_footnote_body_"/>
10717
+
10718
+ </xsl:attribute>
10719
+ <xsl:attribute name="ref_id">
10720
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10326
10721
  </xsl:attribute>
10327
10722
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10328
10723
  </xsl:copy>