metanorma-iec 1.3.9 → 1.3.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1353,7 +1353,7 @@
1353
1353
  </fo:block-container>
1354
1354
  <fo:block-container margin-left="8.5mm">
1355
1355
  <fo:block-container margin-left="0mm">
1356
- <fo:block font-size="12pt" font-weight="bold" color="{$color_blue}" margin-bottom="16pt">
1356
+ <fo:block font-size="12pt" font-weight="bold" color="{$color_blue}" margin-bottom="16pt" role="H1">
1357
1357
  <!-- Example:
1358
1358
  Electromagnetic compatibility (EMC) –
1359
1359
  Part 4-5: Testing and measurement techniques – Surge immunity test
@@ -1379,7 +1379,7 @@
1379
1379
  <xsl:value-of select="$title-part"/>
1380
1380
  </xsl:if>
1381
1381
  </fo:block>
1382
- <fo:block font-size="12pt" font-weight="bold">
1382
+ <fo:block font-size="12pt" font-weight="bold" role="H1">
1383
1383
  <!-- Example: Compatibilité électromagnétique (CEM) –
1384
1384
  Partie 4-5: Techniques d'essai et de mesure – Essai d'immunité aux ondes de
1385
1385
  choc -->
@@ -1423,111 +1423,112 @@
1423
1423
  <xsl:template name="insertTOCpages">
1424
1424
  <xsl:param name="contents"/>
1425
1425
  <fo:block-container>
1426
- <fo:block font-size="12pt" text-align="center" margin-bottom="22pt">
1427
- <xsl:variable name="title-toc">
1428
- <xsl:call-template name="getTitle">
1429
- <xsl:with-param name="name" select="'title-toc'"/>
1426
+ <fo:block role="TOC">
1427
+ <fo:block font-size="12pt" text-align="center" margin-bottom="22pt" role="H1">
1428
+ <xsl:variable name="title-toc">
1429
+ <xsl:call-template name="getTitle">
1430
+ <xsl:with-param name="name" select="'title-toc'"/>
1431
+ </xsl:call-template>
1432
+ </xsl:variable>
1433
+ <xsl:call-template name="addLetterSpacing">
1434
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
1430
1435
  </xsl:call-template>
1431
- </xsl:variable>
1432
- <xsl:call-template name="addLetterSpacing">
1433
- <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
1434
- </xsl:call-template>
1435
- </fo:block>
1436
-
1437
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [@display = 'true']
1438
- [@level &lt;= 3]
1439
- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1440
- <fo:block text-align-last="justify">
1441
- <xsl:if test="@level = 1">
1442
- <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
1443
- </xsl:if>
1444
- <xsl:if test="@level = 2">
1445
- <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1446
- </xsl:if>
1447
- <xsl:if test="@level = 3">
1448
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1449
- </xsl:if>
1450
- <!-- <xsl:if test="@level &gt;= 2 and @section != ''">
1451
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
1452
- </xsl:if> -->
1453
-
1454
- <!-- <xsl:choose>
1455
- <xsl:when test="@section != '' and not(@display-section = 'false')"> -->
1456
- <fo:list-block>
1457
- <xsl:attribute name="margin-left">
1458
- <xsl:choose>
1459
- <xsl:when test="@level = 2">8mm</xsl:when>
1460
- <xsl:when test="@level = 3">23mm</xsl:when>
1461
- <xsl:otherwise>0mm</xsl:otherwise>
1462
- </xsl:choose>
1463
- </xsl:attribute>
1464
- <xsl:attribute name="provisional-distance-between-starts">
1465
- <xsl:choose>
1466
- <xsl:when test="@section = ''">0mm</xsl:when>
1467
- <xsl:when test="@level = 1">8mm</xsl:when>
1468
- <xsl:when test="@level = 2">15mm</xsl:when>
1469
- <xsl:when test="@level = 3">19mm</xsl:when>
1470
- <xsl:otherwise>0mm</xsl:otherwise>
1471
- </xsl:choose>
1472
- </xsl:attribute>
1473
- <fo:list-item>
1474
- <fo:list-item-label end-indent="label-end()">
1475
- <fo:block>
1476
- <xsl:value-of select="@section"/>
1477
- </fo:block>
1478
- </fo:list-item-label>
1479
- <fo:list-item-body start-indent="body-start()">
1480
- <fo:block text-align-last="justify">
1481
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1482
- <xsl:variable name="title">
1483
- <xsl:apply-templates select="title"/>
1484
- </xsl:variable>
1485
- <xsl:call-template name="addLetterSpacing">
1486
- <xsl:with-param name="text" select="$title"/>
1487
- </xsl:call-template>
1488
- <xsl:text> </xsl:text>
1489
- <fo:inline keep-together.within-line="always">
1490
- <fo:leader leader-pattern="dots"/>
1491
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1492
- </fo:inline>
1493
- </fo:basic-link>
1494
- </fo:block>
1495
- </fo:list-item-body>
1496
- </fo:list-item>
1497
- </fo:list-block>
1498
1436
  </fo:block>
1499
- </xsl:for-each>
1500
-
1501
- <xsl:if test="//iec:figure[@id and iec:name]">
1502
- <fo:block margin-bottom="5pt"> </fo:block>
1503
- <xsl:for-each select="//iec:figure[@id and iec:name]">
1504
- <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm">
1505
- <fo:basic-link internal-destination="{@id}" fox:alt-text="Figure {@id}">
1506
- <xsl:apply-templates select="iec:name" mode="contents"/>
1507
- <fo:inline keep-together.within-line="always">
1508
- <fo:leader leader-pattern="dots"/>
1509
- <fo:page-number-citation ref-id="{@id}"/>
1510
- </fo:inline>
1511
- </fo:basic-link>
1512
- </fo:block>
1513
- </xsl:for-each>
1514
- </xsl:if>
1515
-
1516
- <xsl:if test="//iec:table[@id and iec:name]">
1517
- <fo:block margin-bottom="5pt"> </fo:block>
1518
- <xsl:for-each select="//iec:table[@id and iec:name]">
1519
- <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm">
1520
- <fo:basic-link internal-destination="{@id}" fox:alt-text="Table {@id}">
1521
- <xsl:apply-templates select="iec:name" mode="contents"/>
1522
- <fo:inline keep-together.within-line="always">
1523
- <fo:leader leader-pattern="dots"/>
1524
- <fo:page-number-citation ref-id="{@id}"/>
1525
- </fo:inline>
1526
- </fo:basic-link>
1437
+
1438
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [@display = 'true']
1439
+ [@level &lt;= 3]
1440
+ [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1441
+ <fo:block text-align-last="justify" role="TOCI">
1442
+ <xsl:if test="@level = 1">
1443
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
1444
+ </xsl:if>
1445
+ <xsl:if test="@level = 2">
1446
+ <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1447
+ </xsl:if>
1448
+ <xsl:if test="@level = 3">
1449
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1450
+ </xsl:if>
1451
+ <!-- <xsl:if test="@level &gt;= 2 and @section != ''">
1452
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
1453
+ </xsl:if> -->
1454
+
1455
+ <!-- <xsl:choose>
1456
+ <xsl:when test="@section != '' and not(@display-section = 'false')"> -->
1457
+ <fo:list-block>
1458
+ <xsl:attribute name="margin-left">
1459
+ <xsl:choose>
1460
+ <xsl:when test="@level = 2">8mm</xsl:when>
1461
+ <xsl:when test="@level = 3">23mm</xsl:when>
1462
+ <xsl:otherwise>0mm</xsl:otherwise>
1463
+ </xsl:choose>
1464
+ </xsl:attribute>
1465
+ <xsl:attribute name="provisional-distance-between-starts">
1466
+ <xsl:choose>
1467
+ <xsl:when test="@section = ''">0mm</xsl:when>
1468
+ <xsl:when test="@level = 1">8mm</xsl:when>
1469
+ <xsl:when test="@level = 2">15mm</xsl:when>
1470
+ <xsl:when test="@level = 3">19mm</xsl:when>
1471
+ <xsl:otherwise>0mm</xsl:otherwise>
1472
+ </xsl:choose>
1473
+ </xsl:attribute>
1474
+ <fo:list-item>
1475
+ <fo:list-item-label end-indent="label-end()">
1476
+ <fo:block>
1477
+ <xsl:value-of select="@section"/>
1478
+ </fo:block>
1479
+ </fo:list-item-label>
1480
+ <fo:list-item-body start-indent="body-start()">
1481
+ <fo:block text-align-last="justify">
1482
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1483
+ <xsl:variable name="title">
1484
+ <xsl:apply-templates select="title"/>
1485
+ </xsl:variable>
1486
+ <xsl:call-template name="addLetterSpacing">
1487
+ <xsl:with-param name="text" select="$title"/>
1488
+ </xsl:call-template>
1489
+ <xsl:text> </xsl:text>
1490
+ <fo:inline keep-together.within-line="always">
1491
+ <fo:leader leader-pattern="dots"/>
1492
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1493
+ </fo:inline>
1494
+ </fo:basic-link>
1495
+ </fo:block>
1496
+ </fo:list-item-body>
1497
+ </fo:list-item>
1498
+ </fo:list-block>
1527
1499
  </fo:block>
1528
1500
  </xsl:for-each>
1529
- </xsl:if>
1530
-
1501
+
1502
+ <xsl:if test="//iec:figure[@id and iec:name]">
1503
+ <fo:block margin-bottom="5pt"> </fo:block>
1504
+ <xsl:for-each select="//iec:figure[@id and iec:name]">
1505
+ <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1506
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="Figure {@id}">
1507
+ <xsl:apply-templates select="iec:name" mode="contents"/>
1508
+ <fo:inline keep-together.within-line="always">
1509
+ <fo:leader leader-pattern="dots"/>
1510
+ <fo:page-number-citation ref-id="{@id}"/>
1511
+ </fo:inline>
1512
+ </fo:basic-link>
1513
+ </fo:block>
1514
+ </xsl:for-each>
1515
+ </xsl:if>
1516
+
1517
+ <xsl:if test="//iec:table[@id and iec:name]">
1518
+ <fo:block margin-bottom="5pt"> </fo:block>
1519
+ <xsl:for-each select="//iec:table[@id and iec:name]">
1520
+ <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1521
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="Table {@id}">
1522
+ <xsl:apply-templates select="iec:name" mode="contents"/>
1523
+ <fo:inline keep-together.within-line="always">
1524
+ <fo:leader leader-pattern="dots"/>
1525
+ <fo:page-number-citation ref-id="{@id}"/>
1526
+ </fo:inline>
1527
+ </fo:basic-link>
1528
+ </fo:block>
1529
+ </xsl:for-each>
1530
+ </xsl:if>
1531
+ </fo:block>
1531
1532
  </fo:block-container>
1532
1533
  </xsl:template>
1533
1534
 
@@ -1539,7 +1540,7 @@
1539
1540
  <fo:block><xsl:value-of select="/iec:iec-standard/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/></fo:block>
1540
1541
  <fo:block>___________</fo:block>
1541
1542
  <fo:block> </fo:block>
1542
- <fo:block font-weight="bold">
1543
+ <fo:block font-weight="bold" role="H1">
1543
1544
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-intro']))"/>
1544
1545
  <xsl:text> — </xsl:text>
1545
1546
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-main']))"/>
@@ -1582,7 +1583,7 @@
1582
1583
  <!-- <fo:block><xsl:value-of select="$organization"/></fo:block>
1583
1584
  <fo:block>____________</fo:block>
1584
1585
  <fo:block>&#xa0;</fo:block> -->
1585
- <fo:block font-weight="bold">
1586
+ <fo:block font-weight="bold" role="H1">
1586
1587
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-intro']))"/>
1587
1588
  <xsl:text> — </xsl:text>
1588
1589
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-main']))"/>
@@ -1626,7 +1627,10 @@
1626
1627
  </xsl:template>
1627
1628
 
1628
1629
  <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//iec:title" priority="3">
1629
- <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt">
1630
+ <xsl:variable name="level">
1631
+ <xsl:call-template name="getLevel"/>
1632
+ </xsl:variable>
1633
+ <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt" role="H{$level}">
1630
1634
  <xsl:apply-templates/>
1631
1635
  </fo:block>
1632
1636
  </xsl:template>
@@ -1653,7 +1657,10 @@
1653
1657
  </xsl:template>
1654
1658
 
1655
1659
  <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1656
- <fo:block font-weight="bold" keep-with-next="always"><xsl:apply-templates/></fo:block>
1660
+ <xsl:variable name="level">
1661
+ <xsl:call-template name="getLevel"/>
1662
+ </xsl:variable>
1663
+ <fo:block font-weight="bold" keep-with-next="always" role="H{$level}"><xsl:apply-templates/></fo:block>
1657
1664
  </xsl:template>
1658
1665
 
1659
1666
  <xsl:template match="iec:feedback-statement//iec:clause/iec:p" priority="2">
@@ -1756,7 +1763,10 @@
1756
1763
  <!-- ============================= -->
1757
1764
 
1758
1765
  <xsl:template match="iec:license-statement//iec:title">
1759
- <fo:block text-align="center" font-weight="bold">
1766
+ <xsl:variable name="level">
1767
+ <xsl:call-template name="getLevel"/>
1768
+ </xsl:variable>
1769
+ <fo:block text-align="center" font-weight="bold" role="H{$level}">
1760
1770
  <xsl:apply-templates/>
1761
1771
  </fo:block>
1762
1772
  </xsl:template>
@@ -1772,7 +1782,10 @@
1772
1782
  </xsl:template>
1773
1783
 
1774
1784
  <xsl:template match="iec:license-statement//iec:title" mode="cover-page-internal">
1775
- <fo:block text-align="center" font-weight="bold">
1785
+ <xsl:variable name="level">
1786
+ <xsl:call-template name="getLevel"/>
1787
+ </xsl:variable>
1788
+ <fo:block text-align="center" font-weight="bold" role="H{$level}">
1776
1789
  <xsl:apply-templates/>
1777
1790
  </fo:block>
1778
1791
  </xsl:template>
@@ -1890,8 +1903,9 @@
1890
1903
  <!-- title -->
1891
1904
  <!-- ====== -->
1892
1905
  <xsl:template match="iec:introduction/iec:title">
1893
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt">
1906
+ <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" role="H1">
1894
1907
  <xsl:apply-templates/>
1908
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1895
1909
  </fo:block>
1896
1910
  </xsl:template>
1897
1911
  <xsl:template match="iec:introduction/iec:title/text()">
@@ -1901,14 +1915,15 @@
1901
1915
  </xsl:template>
1902
1916
 
1903
1917
  <xsl:template match="iec:annex/iec:title">
1904
- <fo:block font-size="12pt" text-align="center" margin-bottom="32pt" keep-with-next="always">
1918
+ <fo:block font-size="12pt" text-align="center" margin-bottom="32pt" keep-with-next="always" role="H1">
1905
1919
  <xsl:apply-templates/>
1920
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1906
1921
  </fo:block>
1907
1922
  </xsl:template>
1908
1923
 
1909
1924
  <!-- Bibliography -->
1910
1925
  <xsl:template match="iec:references[not(@normative='true')]/iec:title">
1911
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always">
1926
+ <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" role="H1">
1912
1927
  <xsl:apply-templates/>
1913
1928
  </fo:block>
1914
1929
  </xsl:template>
@@ -1936,12 +1951,12 @@
1936
1951
 
1937
1952
  <xsl:choose>
1938
1953
  <xsl:when test="../@inline-header = 'true'">
1939
- <fo:inline font-size="{$font-size}" font-weight="bold">
1954
+ <fo:inline font-size="{$font-size}" font-weight="bold" role="H{$level}">
1940
1955
  <xsl:apply-templates/>
1941
1956
  </fo:inline>
1942
1957
  </xsl:when>
1943
1958
  <xsl:otherwise>
1944
- <fo:block font-size="{$font-size}" font-weight="bold" keep-with-next="always">
1959
+ <fo:block font-size="{$font-size}" font-weight="bold" keep-with-next="always" role="H{$level}">
1945
1960
  <xsl:attribute name="space-before"> <!-- margin-top -->
1946
1961
  <xsl:choose>
1947
1962
  <xsl:when test="$level = 2 and ancestor::iec:annex">22pt</xsl:when>
@@ -1959,6 +1974,7 @@
1959
1974
  </xsl:choose>
1960
1975
  </xsl:attribute>
1961
1976
  <xsl:apply-templates/>
1977
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1962
1978
  </fo:block>
1963
1979
  </xsl:otherwise>
1964
1980
  </xsl:choose>
@@ -2202,8 +2218,10 @@
2202
2218
 
2203
2219
 
2204
2220
  <xsl:template match="iec:preferred">
2205
-
2206
- <fo:block line-height="1.1" space-before="14pt">
2221
+ <xsl:variable name="levelTerm">
2222
+ <xsl:call-template name="getLevelTermName"/>
2223
+ </xsl:variable>
2224
+ <fo:block line-height="1.1" space-before="14pt" role="H{$levelTerm}">
2207
2225
  <fo:block font-weight="bold" keep-with-next="always">
2208
2226
  <xsl:apply-templates select="ancestor::iec:term/iec:name" mode="presentation"/>
2209
2227
  </fo:block>
@@ -2320,7 +2338,7 @@
2320
2338
 
2321
2339
 
2322
2340
  <xsl:template name="insertHeaderFooter">
2323
- <fo:static-content flow-name="header-even">
2341
+ <fo:static-content flow-name="header-even" role="artifact">
2324
2342
  <fo:block-container height="25mm" display-align="after">
2325
2343
  <fo:table table-layout="fixed" width="100%">
2326
2344
  <fo:table-column column-width="45%"/>
@@ -2345,7 +2363,7 @@
2345
2363
  </fo:block-container>
2346
2364
  </fo:static-content>
2347
2365
 
2348
- <fo:static-content flow-name="header-odd">
2366
+ <fo:static-content flow-name="header-odd" role="artifact">
2349
2367
  <fo:block-container height="25mm" display-align="after">
2350
2368
  <fo:table table-layout="fixed" width="100%">
2351
2369
  <fo:table-column column-width="45%"/>
@@ -2653,6 +2671,7 @@
2653
2671
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2654
2672
  <xsl:attribute name="white-space">pre</xsl:attribute>
2655
2673
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2674
+ <xsl:attribute name="role">Code</xsl:attribute>
2656
2675
 
2657
2676
 
2658
2677
 
@@ -2678,8 +2697,13 @@
2678
2697
 
2679
2698
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
2680
2699
 
2681
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
2682
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
2700
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
2701
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
2702
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
2703
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
2704
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
2705
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
2706
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
2683
2707
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
2684
2708
 
2685
2709
 
@@ -2849,6 +2873,11 @@
2849
2873
 
2850
2874
 
2851
2875
 
2876
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
2877
+
2878
+
2879
+
2880
+
2852
2881
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2853
2882
 
2854
2883
 
@@ -2882,7 +2911,8 @@
2882
2911
 
2883
2912
 
2884
2913
 
2885
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
2914
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
2915
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
2886
2916
 
2887
2917
 
2888
2918
 
@@ -3024,13 +3054,20 @@
3024
3054
 
3025
3055
  </xsl:attribute-set><xsl:attribute-set name="list-style">
3026
3056
 
3027
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
3057
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
3058
+ <xsl:attribute name="line-height">135%</xsl:attribute>
3059
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
3028
3060
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
3029
3061
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
3030
3062
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
3031
3063
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
3032
3064
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
3033
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
3065
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
3066
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
3067
+ <xsl:sort select="@displayorder" data-type="number"/>
3068
+ <xsl:apply-templates select="." mode="contents"/>
3069
+ </xsl:for-each>
3070
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
3034
3071
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
3035
3072
 
3036
3073
  <!-- Normative references -->
@@ -3043,13 +3080,33 @@
3043
3080
  <!-- Bibliography -->
3044
3081
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
3045
3082
 
3046
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3083
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
3084
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3085
+ <xsl:sort select="@displayorder" data-type="number"/>
3086
+ <xsl:apply-templates select="." mode="contents"/>
3087
+ </xsl:for-each>
3088
+
3089
+ <xsl:for-each select="/*/*[local-name()='annex']">
3090
+ <xsl:sort select="@displayorder" data-type="number"/>
3091
+ <xsl:apply-templates select="." mode="contents"/>
3092
+ </xsl:for-each>
3093
+
3094
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
3095
+ <xsl:sort select="@displayorder" data-type="number"/>
3096
+ <xsl:apply-templates select="." mode="contents"/>
3097
+ </xsl:for-each>
3098
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
3047
3099
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
3048
3100
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
3049
3101
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
3050
3102
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
3051
3103
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
3052
- </xsl:template><xsl:template name="processMainSectionsDefault">
3104
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3105
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
3106
+ <xsl:sort select="@displayorder" data-type="number"/>
3107
+ <xsl:apply-templates select="."/>
3108
+ </xsl:for-each>
3109
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
3053
3110
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
3054
3111
 
3055
3112
  <!-- Normative references -->
@@ -3061,6 +3118,22 @@
3061
3118
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
3062
3119
  <!-- Bibliography -->
3063
3120
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
3121
+ </xsl:template><xsl:template name="processMainSectionsDefault">
3122
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3123
+ <xsl:sort select="@displayorder" data-type="number"/>
3124
+ <xsl:apply-templates select="."/>
3125
+
3126
+ </xsl:for-each>
3127
+
3128
+ <xsl:for-each select="/*/*[local-name()='annex']">
3129
+ <xsl:sort select="@displayorder" data-type="number"/>
3130
+ <xsl:apply-templates select="."/>
3131
+ </xsl:for-each>
3132
+
3133
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
3134
+ <xsl:sort select="@displayorder" data-type="number"/>
3135
+ <xsl:apply-templates select="."/>
3136
+ </xsl:for-each>
3064
3137
  </xsl:template><xsl:template match="text()">
3065
3138
  <xsl:value-of select="."/>
3066
3139
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -3091,7 +3164,9 @@
3091
3164
 
3092
3165
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3093
3166
 
3094
-
3167
+
3168
+
3169
+
3095
3170
 
3096
3171
  <xsl:call-template name="fn_name_display"/>
3097
3172
 
@@ -3953,9 +4028,8 @@
3953
4028
 
3954
4029
  <!-- Table's note name (NOTE, for example) -->
3955
4030
 
3956
- <fo:inline padding-right="2mm">
4031
+ <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
3957
4032
 
3958
-
3959
4033
 
3960
4034
 
3961
4035
 
@@ -4606,6 +4680,8 @@
4606
4680
  <xsl:if test="$font-size != ''">
4607
4681
  <xsl:attribute name="font-size">
4608
4682
  <xsl:choose>
4683
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4684
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4609
4685
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4610
4686
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4611
4687
  </xsl:choose>
@@ -5040,16 +5116,68 @@
5040
5116
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
5041
5117
  </xsl:call-template>
5042
5118
 
5119
+
5120
+
5043
5121
  <xsl:variable name="mathml">
5044
5122
  <xsl:apply-templates select="." mode="mathml"/>
5045
5123
  </xsl:variable>
5046
5124
  <fo:instream-foreign-object fox:alt-text="Math">
5047
5125
 
5048
5126
 
5127
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
5128
+ <xsl:variable name="comment_text_">
5129
+ <xsl:choose>
5130
+ <xsl:when test="normalize-space($comment_text_following) != ''">
5131
+ <xsl:value-of select="$comment_text_following"/>
5132
+ </xsl:when>
5133
+ <xsl:otherwise>
5134
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
5135
+ </xsl:otherwise>
5136
+ </xsl:choose>
5137
+ </xsl:variable>
5138
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
5139
+
5140
+ <xsl:if test="normalize-space($comment_text) != ''">
5141
+ <!-- put Mathin Alternate Text -->
5142
+ <xsl:attribute name="fox:alt-text">
5143
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
5144
+ </xsl:attribute>
5145
+ </xsl:if>
5146
+
5147
+ <xsl:variable name="mathml_content">
5148
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
5149
+ </xsl:variable>
5150
+ <!-- put MathML in Actual Text -->
5151
+ <xsl:attribute name="fox:actual-text">
5152
+ <xsl:value-of select="$mathml_content"/>
5153
+ </xsl:attribute>
5154
+
5155
+
5049
5156
  <!-- <xsl:copy-of select="."/> -->
5050
5157
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
5051
5158
  </fo:instream-foreign-object>
5052
5159
  </fo:inline>
5160
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
5161
+ <!-- <xsl:text>a+b</xsl:text> -->
5162
+ <xsl:text>&lt;</xsl:text>
5163
+ <xsl:value-of select="local-name()"/>
5164
+ <xsl:if test="local-name() = 'math'">
5165
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
5166
+ </xsl:if>
5167
+ <xsl:for-each select="@*">
5168
+ <xsl:text> </xsl:text>
5169
+ <xsl:value-of select="local-name()"/>
5170
+ <xsl:text>="</xsl:text>
5171
+ <xsl:value-of select="."/>
5172
+ <xsl:text>"</xsl:text>
5173
+ </xsl:for-each>
5174
+ <xsl:text>&gt;</xsl:text>
5175
+ <xsl:apply-templates mode="mathml_actual_text"/>
5176
+ <xsl:text>&lt;/</xsl:text>
5177
+ <xsl:value-of select="local-name()"/>
5178
+ <xsl:text>&gt;</xsl:text>
5179
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
5180
+ <xsl:value-of select="normalize-space()"/>
5053
5181
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
5054
5182
  <xsl:copy>
5055
5183
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -5115,7 +5243,10 @@
5115
5243
  </fo:block>
5116
5244
  <xsl:apply-templates/>
5117
5245
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
5118
- <fo:inline><xsl:apply-templates/></fo:inline>
5246
+ <xsl:variable name="level">
5247
+ <xsl:call-template name="getLevel"/>
5248
+ </xsl:variable>
5249
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
5119
5250
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
5120
5251
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
5121
5252
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -5150,9 +5281,10 @@
5150
5281
 
5151
5282
  </xsl:variable>
5152
5283
 
5284
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
5153
5285
  <xsl:choose>
5154
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
5155
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
5286
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
5287
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
5156
5288
  </xsl:choose>
5157
5289
  <xsl:apply-templates/>
5158
5290
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -5298,7 +5430,10 @@
5298
5430
  </fo:block>
5299
5431
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5300
5432
  <xsl:if test="normalize-space() != ''">
5301
- <fo:inline>
5433
+ <xsl:variable name="level">
5434
+ <xsl:call-template name="getLevelTermName"/>
5435
+ </xsl:variable>
5436
+ <fo:inline role="H{$level}">
5302
5437
  <xsl:apply-templates/>
5303
5438
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
5304
5439
  <xsl:text>.</xsl:text>
@@ -5599,6 +5734,13 @@
5599
5734
  </xsl:attribute>
5600
5735
  <xsl:apply-templates mode="svg_update"/>
5601
5736
  </xsl:copy>
5737
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
5738
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
5739
+ <xsl:for-each select="*[local-name() = 'svg']">
5740
+ <xsl:call-template name="image_svg">
5741
+ <xsl:with-param name="name" select="$name"/>
5742
+ </xsl:call-template>
5743
+ </xsl:for-each>
5602
5744
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5603
5745
  <xsl:variable name="svg_content" select="document(@src)"/>
5604
5746
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5703,7 +5845,7 @@
5703
5845
  </fo:basic-link>
5704
5846
  </fo:block>
5705
5847
  </fo:block-container>
5706
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5848
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
5707
5849
  <xsl:apply-templates mode="contents"/>
5708
5850
  <xsl:text> </xsl:text>
5709
5851
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
@@ -5929,6 +6071,7 @@
5929
6071
  </xsl:when>
5930
6072
  <xsl:otherwise>
5931
6073
  <xsl:apply-templates/>
6074
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
5932
6075
  </xsl:otherwise>
5933
6076
  </xsl:choose>
5934
6077
  </fo:block>
@@ -6001,12 +6144,16 @@
6001
6144
  <xsl:if test="$font-size != ''">
6002
6145
  <xsl:attribute name="font-size">
6003
6146
  <xsl:choose>
6147
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6148
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6004
6149
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6005
6150
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6006
6151
  </xsl:choose>
6007
6152
  </xsl:attribute>
6008
6153
  </xsl:if>
6009
6154
 
6155
+
6156
+
6010
6157
  <xsl:apply-templates/>
6011
6158
  </fo:block>
6012
6159
 
@@ -6069,14 +6216,6 @@
6069
6216
  <fo:block>
6070
6217
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
6071
6218
  </fo:block>
6072
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
6073
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
6074
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6075
- </fo:block>
6076
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
6077
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
6078
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
6079
- </fo:block>
6080
6219
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
6081
6220
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
6082
6221
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -6093,6 +6232,38 @@
6093
6232
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
6094
6233
  <xsl:apply-templates/>
6095
6234
  </fo:block>
6235
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
6236
+ <fo:block xsl:use-attribute-sets="subject-style">
6237
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6238
+ </fo:block>
6239
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
6240
+ <fo:block xsl:use-attribute-sets="subject-style">
6241
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6242
+ </fo:block>
6243
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
6244
+ <fo:block xsl:use-attribute-sets="inherit-style">
6245
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
6246
+ </fo:block>
6247
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
6248
+ <fo:block xsl:use-attribute-sets="description-style">
6249
+ <xsl:apply-templates/>
6250
+ </fo:block>
6251
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
6252
+ <fo:block xsl:use-attribute-sets="specification-style">
6253
+ <xsl:apply-templates/>
6254
+ </fo:block>
6255
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
6256
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
6257
+ <xsl:apply-templates/>
6258
+ </fo:block>
6259
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
6260
+ <fo:block xsl:use-attribute-sets="verification-style">
6261
+ <xsl:apply-templates/>
6262
+ </fo:block>
6263
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
6264
+ <fo:block xsl:use-attribute-sets="import-style">
6265
+ <xsl:apply-templates/>
6266
+ </fo:block>
6096
6267
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
6097
6268
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
6098
6269
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -6358,14 +6529,15 @@
6358
6529
  </xsl:if>
6359
6530
  </xsl:template><xsl:variable name="localized.source">
6360
6531
  <xsl:call-template name="getLocalizedString">
6361
- <xsl:with-param name="key">source</xsl:with-param>
6362
- </xsl:call-template>
6532
+ <xsl:with-param name="key">source</xsl:with-param>
6533
+ </xsl:call-template>
6363
6534
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6364
6535
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6365
6536
  <xsl:if test="normalize-space(@citeas) = ''">
6366
6537
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6367
6538
  </xsl:if>
6368
6539
 
6540
+
6369
6541
  <fo:inline>
6370
6542
 
6371
6543
 
@@ -6373,6 +6545,7 @@
6373
6545
 
6374
6546
 
6375
6547
 
6548
+
6376
6549
  <xsl:call-template name="getTitle">
6377
6550
  <xsl:with-param name="name" select="'title-source'"/>
6378
6551
  </xsl:call-template>
@@ -6384,6 +6557,7 @@
6384
6557
  <fo:inline xsl:use-attribute-sets="origin-style">
6385
6558
  <xsl:apply-templates/>
6386
6559
  </fo:inline>
6560
+
6387
6561
  </fo:basic-link>
6388
6562
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6389
6563
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -6450,6 +6624,9 @@
6450
6624
 
6451
6625
  </xsl:if>
6452
6626
 
6627
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
6628
+ <xsl:variable name="text" select="normalize-space()"/>
6629
+
6453
6630
 
6454
6631
 
6455
6632
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -6462,7 +6639,9 @@
6462
6639
 
6463
6640
 
6464
6641
  </xsl:if>
6465
-
6642
+
6643
+
6644
+
6466
6645
  <xsl:apply-templates/>
6467
6646
  </fo:basic-link>
6468
6647
 
@@ -6797,6 +6976,7 @@
6797
6976
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6798
6977
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6799
6978
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6979
+
6800
6980
  <xsl:apply-templates/>
6801
6981
  </fo:block>
6802
6982
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -6965,6 +7145,97 @@
6965
7145
  <fo:block-container border="1pt solid black" width="50%">
6966
7146
  <fo:block> </fo:block>
6967
7147
  </fo:block-container>
7148
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
7149
+ <xsl:param name="colwidths"/>
7150
+ <xsl:variable name="colwidths_">
7151
+ <xsl:choose>
7152
+ <xsl:when test="not($colwidths)">
7153
+ <xsl:variable name="toc_table_simple">
7154
+ <tbody>
7155
+ <xsl:apply-templates mode="toc_table_width"/>
7156
+ </tbody>
7157
+ </xsl:variable>
7158
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
7159
+ <xsl:call-template name="calculate-column-widths">
7160
+ <xsl:with-param name="cols-count" select="$cols-count"/>
7161
+ <xsl:with-param name="table" select="$toc_table_simple"/>
7162
+ </xsl:call-template>
7163
+ </xsl:when>
7164
+ <xsl:otherwise>
7165
+ <xsl:copy-of select="$colwidths"/>
7166
+ </xsl:otherwise>
7167
+ </xsl:choose>
7168
+ </xsl:variable>
7169
+ <fo:block role="TOCI" space-after="16pt">
7170
+ <fo:table width="100%" table-layout="fixed">
7171
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
7172
+ <fo:table-column column-width="proportional-column-width({.})"/>
7173
+ </xsl:for-each>
7174
+ <fo:table-body>
7175
+ <xsl:apply-templates/>
7176
+ </fo:table-body>
7177
+ </fo:table>
7178
+ </fo:block>
7179
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
7180
+ <fo:table-row min-height="5mm">
7181
+ <xsl:apply-templates/>
7182
+ </fo:table-row>
7183
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
7184
+ <xsl:apply-templates/>
7185
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
7186
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7187
+ <xsl:variable name="target" select="@target"/>
7188
+ <xsl:for-each select="*[local-name() = 'tab']">
7189
+ <xsl:variable name="current_id" select="generate-id()"/>
7190
+ <fo:table-cell>
7191
+ <fo:block>
7192
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7193
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7194
+ <xsl:choose>
7195
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
7196
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
7197
+ </xsl:choose>
7198
+ </xsl:for-each>
7199
+ </fo:basic-link>
7200
+ </fo:block>
7201
+ </fo:table-cell>
7202
+ </xsl:for-each>
7203
+ <!-- last column - for page numbers -->
7204
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
7205
+ <fo:block>
7206
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
7207
+ <fo:page-number-citation ref-id="{$target}"/>
7208
+ </fo:basic-link>
7209
+ </fo:block>
7210
+ </fo:table-cell>
7211
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
7212
+ <xsl:apply-templates mode="toc_table_width"/>
7213
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
7214
+ <tr>
7215
+ <xsl:apply-templates mode="toc_table_width"/>
7216
+ </tr>
7217
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
7218
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
7219
+ <xsl:for-each select="*[local-name() = 'tab']">
7220
+ <xsl:variable name="current_id" select="generate-id()"/>
7221
+ <td>
7222
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
7223
+ <xsl:copy-of select="."/>
7224
+ </xsl:for-each>
7225
+ </td>
7226
+ </xsl:for-each>
7227
+ <td>333</td> <!-- page number, just for fill -->
7228
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
7229
+ <fo:inline padding-right="5mm"> </fo:inline>
7230
+ <fo:inline><xsl:apply-templates/></fo:inline>
7231
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
7232
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
7233
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
7234
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
7235
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
7236
+ </svg>
7237
+ </fo:instream-foreign-object>
7238
+ </fo:inline>
6968
7239
  </xsl:template><xsl:template name="convertDate">
6969
7240
  <xsl:param name="date"/>
6970
7241
  <xsl:param name="format" select="'short'"/>
@@ -7203,6 +7474,26 @@
7203
7474
  <xsl:value-of select="$level"/>
7204
7475
  </xsl:otherwise>
7205
7476
  </xsl:choose>
7477
+ </xsl:template><xsl:template name="getLevelTermName">
7478
+ <xsl:choose>
7479
+ <xsl:when test="normalize-space(../@depth) != ''">
7480
+ <xsl:value-of select="../@depth"/>
7481
+ </xsl:when>
7482
+ <xsl:otherwise>
7483
+ <xsl:variable name="title_level_">
7484
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
7485
+ <xsl:call-template name="getLevel"/>
7486
+ </xsl:for-each>
7487
+ </xsl:variable>
7488
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
7489
+ <xsl:choose>
7490
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
7491
+ <xsl:otherwise>
7492
+ <xsl:call-template name="getLevel"/>
7493
+ </xsl:otherwise>
7494
+ </xsl:choose>
7495
+ </xsl:otherwise>
7496
+ </xsl:choose>
7206
7497
  </xsl:template><xsl:template name="split">
7207
7498
  <xsl:param name="pText" select="."/>
7208
7499
  <xsl:param name="sep" select="','"/>