metanorma-mpfa 0.5.4 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -328,16 +328,16 @@
328
328
  <xsl:otherwise> <!-- for ordered lists -->
329
329
  <xsl:choose>
330
330
  <xsl:when test="../@type = 'arabic'">
331
- <xsl:number format="a)"/>
331
+ <xsl:number format="a)" lang="en"/>
332
332
  </xsl:when>
333
333
  <xsl:when test="../@type = 'roman'">
334
334
  <xsl:number format="1)"/>
335
335
  </xsl:when>
336
336
  <xsl:when test="../@type = 'alphabet'">
337
- <xsl:number format="a)"/>
337
+ <xsl:number format="a)" lang="en"/>
338
338
  </xsl:when>
339
339
  <xsl:otherwise>
340
- <xsl:number format="a)"/>
340
+ <xsl:number format="a)" lang="en"/>
341
341
  </xsl:otherwise>
342
342
  </xsl:choose>
343
343
  </xsl:otherwise>
@@ -810,7 +810,12 @@
810
810
 
811
811
 
812
812
  </title-toc>
813
- <title-toc lang="fr">Sommaire</title-toc>
813
+ <title-toc lang="fr">
814
+
815
+ <xsl:text>Sommaire</xsl:text>
816
+
817
+
818
+ </title-toc>
814
819
 
815
820
 
816
821
 
@@ -828,13 +833,22 @@
828
833
  <title-part lang="en">
829
834
 
830
835
 
836
+
831
837
  </title-part>
832
838
  <title-part lang="fr">
833
839
 
834
840
 
841
+
835
842
  </title-part>
836
843
  <title-part lang="zh">第 # 部分:</title-part>
837
844
 
845
+ <title-subpart lang="en">
846
+
847
+ </title-subpart>
848
+ <title-subpart lang="fr">
849
+
850
+ </title-subpart>
851
+
838
852
  <title-modified lang="en">modified</title-modified>
839
853
  <title-modified lang="fr">modifiée</title-modified>
840
854
 
@@ -896,10 +910,19 @@
896
910
 
897
911
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
898
912
  <xsl:param name="name"/>
899
- <xsl:variable name="lang">
900
- <xsl:call-template name="getLang"/>
913
+ <xsl:param name="lang"/>
914
+ <xsl:variable name="lang_">
915
+ <xsl:choose>
916
+ <xsl:when test="$lang != ''">
917
+ <xsl:value-of select="$lang"/>
918
+ </xsl:when>
919
+ <xsl:otherwise>
920
+ <xsl:call-template name="getLang"/>
921
+ </xsl:otherwise>
922
+ </xsl:choose>
901
923
  </xsl:variable>
902
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
924
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
925
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
903
926
  <xsl:choose>
904
927
  <xsl:when test="normalize-space($title_) != ''">
905
928
  <xsl:value-of select="$title_"/>
@@ -1036,11 +1059,12 @@
1036
1059
 
1037
1060
 
1038
1061
 
1039
-
1062
+
1040
1063
  <xsl:attribute name="text-align">center</xsl:attribute>
1041
1064
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1042
1065
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1043
1066
 
1067
+
1044
1068
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1045
1069
 
1046
1070
 
@@ -1078,6 +1102,7 @@
1078
1102
 
1079
1103
 
1080
1104
 
1105
+
1081
1106
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1082
1107
 
1083
1108
 
@@ -1142,6 +1167,7 @@
1142
1167
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1143
1168
 
1144
1169
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1170
+
1145
1171
 
1146
1172
 
1147
1173
 
@@ -1261,6 +1287,10 @@
1261
1287
 
1262
1288
 
1263
1289
 
1290
+ <!-- <xsl:if test="$namespace = 'bipm'">
1291
+ <fo:block>&#xA0;</fo:block>
1292
+ </xsl:if> -->
1293
+
1264
1294
  <!-- $namespace = 'iso' or -->
1265
1295
 
1266
1296
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1293,11 +1323,14 @@
1293
1323
 
1294
1324
 
1295
1325
  <xsl:variable name="colwidths">
1296
- <xsl:call-template name="calculate-column-widths">
1297
- <xsl:with-param name="cols-count" select="$cols-count"/>
1298
- <xsl:with-param name="table" select="$simple-table"/>
1299
- </xsl:call-template>
1326
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1327
+ <xsl:call-template name="calculate-column-widths">
1328
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1329
+ <xsl:with-param name="table" select="$simple-table"/>
1330
+ </xsl:call-template>
1331
+ </xsl:if>
1300
1332
  </xsl:variable>
1333
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1301
1334
 
1302
1335
  <!-- <xsl:variable name="colwidths2">
1303
1336
  <xsl:call-template name="calculate-column-widths">
@@ -1319,10 +1352,13 @@
1319
1352
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1320
1353
 
1321
1354
 
1355
+
1356
+
1357
+
1322
1358
 
1323
1359
 
1360
+
1324
1361
 
1325
-
1326
1362
 
1327
1363
 
1328
1364
 
@@ -1330,23 +1366,90 @@
1330
1366
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1331
1367
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
1332
1368
 
1333
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1334
-
1335
-
1369
+
1370
+
1371
+
1372
+ <xsl:variable name="table_attributes">
1373
+ <attribute name="table-layout">fixed</attribute>
1374
+ <attribute name="width">100%</attribute>
1375
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1376
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1336
1377
 
1337
1378
 
1338
1379
 
1339
1380
 
1381
+
1382
+
1383
+
1340
1384
 
1341
1385
 
1386
+ <attribute name="border-top">2pt solid black</attribute>
1387
+ <attribute name="border-bottom">2pt solid black</attribute>
1388
+
1342
1389
 
1390
+ </xsl:variable>
1391
+
1392
+
1393
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1343
1394
 
1395
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1396
+ <xsl:attribute name="{@name}">
1397
+ <xsl:value-of select="."/>
1398
+ </xsl:attribute>
1399
+ </xsl:for-each>
1344
1400
 
1401
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1402
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1403
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1404
+ </xsl:if>
1345
1405
 
1406
+ <xsl:choose>
1407
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1408
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1409
+ <fo:table-column column-width="{@width}"/>
1410
+ </xsl:for-each>
1411
+ </xsl:when>
1412
+ <xsl:otherwise>
1413
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1414
+ <xsl:choose>
1415
+ <xsl:when test=". = 1 or . = 0">
1416
+ <fo:table-column column-width="proportional-column-width(2)"/>
1417
+ </xsl:when>
1418
+ <xsl:otherwise>
1419
+ <fo:table-column column-width="proportional-column-width({.})"/>
1420
+ </xsl:otherwise>
1421
+ </xsl:choose>
1422
+ </xsl:for-each>
1423
+ </xsl:otherwise>
1424
+ </xsl:choose>
1346
1425
 
1347
- <xsl:attribute name="border-top">2pt solid black</xsl:attribute>
1348
- <xsl:attribute name="border-bottom">2pt solid black</xsl:attribute>
1426
+ <xsl:choose>
1427
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1428
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1429
+ </xsl:when>
1430
+ <xsl:otherwise>
1431
+ <xsl:apply-templates/>
1432
+ </xsl:otherwise>
1433
+ </xsl:choose>
1349
1434
 
1435
+ </fo:table>
1436
+
1437
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1438
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1439
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1440
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1441
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1442
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1443
+ </xsl:call-template>
1444
+ </xsl:for-each>
1445
+
1446
+ <!-- insert footer as table -->
1447
+ <!-- <fo:table>
1448
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1449
+ <xsl:attribute name="{@name}">
1450
+ <xsl:value-of select="."/>
1451
+ </xsl:attribute>
1452
+ </xsl:for-each>
1350
1453
 
1351
1454
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1352
1455
  <xsl:choose>
@@ -1358,17 +1461,7 @@
1358
1461
  </xsl:otherwise>
1359
1462
  </xsl:choose>
1360
1463
  </xsl:for-each>
1361
-
1362
- <xsl:choose>
1363
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1364
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1365
- </xsl:when>
1366
- <xsl:otherwise>
1367
- <xsl:apply-templates/>
1368
- </xsl:otherwise>
1369
- </xsl:choose>
1370
-
1371
- </fo:table>
1464
+ </fo:table>-->
1372
1465
 
1373
1466
 
1374
1467
 
@@ -1379,6 +1472,7 @@
1379
1472
  <xsl:if test="normalize-space() != ''">
1380
1473
  <fo:block xsl:use-attribute-sets="table-name-style">
1381
1474
 
1475
+
1382
1476
  <xsl:apply-templates/>
1383
1477
  </fo:block>
1384
1478
  </xsl:if>
@@ -1434,6 +1528,13 @@
1434
1528
  <xsl:for-each select="xalan:nodeset($table)//tr">
1435
1529
  <xsl:variable name="td_text">
1436
1530
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1531
+
1532
+ <!-- <xsl:if test="$namespace = 'bipm'">
1533
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1534
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1535
+ </xsl:for-each>
1536
+ </xsl:if> -->
1537
+
1437
1538
  </xsl:variable>
1438
1539
  <xsl:variable name="words">
1439
1540
  <xsl:variable name="string_with_added_zerospaces">
@@ -1493,11 +1594,14 @@
1493
1594
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1494
1595
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1495
1596
  <xsl:value-of select="@target"/>
1597
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1598
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1599
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1496
1600
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1497
1601
  <xsl:param name="cols-count"/>
1498
1602
  <!-- font-weight="bold" -->
1499
1603
  <fo:table-header>
1500
-
1604
+
1501
1605
  <xsl:apply-templates/>
1502
1606
  </fo:table-header>
1503
1607
  </xsl:template><xsl:template name="table-header-title">
@@ -1522,6 +1626,13 @@
1522
1626
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1523
1627
  <xsl:apply-templates/>
1524
1628
  </xsl:template><xsl:template name="insertTableFooter">
1629
+ <xsl:param name="cols-count"/>
1630
+ <xsl:if test="../*[local-name()='tfoot']">
1631
+ <fo:table-footer>
1632
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1633
+ </fo:table-footer>
1634
+ </xsl:if>
1635
+ </xsl:template><xsl:template name="insertTableFooter2">
1525
1636
  <xsl:param name="cols-count"/>
1526
1637
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1527
1638
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1543,11 +1654,29 @@
1543
1654
  <!-- fn will be processed inside 'note' processing -->
1544
1655
 
1545
1656
 
1657
+
1658
+
1659
+
1660
+
1546
1661
  <!-- except gb -->
1547
1662
 
1548
1663
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1549
1664
 
1550
1665
 
1666
+ <!-- show Note under table in preface (ex. abstract) sections -->
1667
+ <!-- empty, because notes show at page side in main sections -->
1668
+ <!-- <xsl:if test="$namespace = 'bipm'">
1669
+ <xsl:choose>
1670
+ <xsl:when test="ancestor::*[local-name()='preface']">
1671
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1672
+ </xsl:when>
1673
+ <xsl:otherwise>
1674
+ <fo:block/>
1675
+ </xsl:otherwise>
1676
+ </xsl:choose>
1677
+ </xsl:if> -->
1678
+
1679
+
1551
1680
  <!-- horizontal row separator -->
1552
1681
 
1553
1682
 
@@ -1561,6 +1690,107 @@
1561
1690
  </fo:table-footer>
1562
1691
 
1563
1692
  </xsl:if>
1693
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1694
+ <xsl:param name="table_attributes"/>
1695
+ <xsl:param name="colwidths"/>
1696
+ <xsl:param name="colgroup"/>
1697
+
1698
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1699
+
1700
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1701
+
1702
+ <xsl:variable name="cols-count">
1703
+ <xsl:choose>
1704
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1705
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1706
+ </xsl:when>
1707
+ <xsl:otherwise>
1708
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1709
+ </xsl:otherwise>
1710
+ </xsl:choose>
1711
+ </xsl:variable>
1712
+
1713
+ <fo:table keep-with-previous="always">
1714
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1715
+ <xsl:choose>
1716
+ <xsl:when test="@name = 'border-top'">
1717
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1718
+ </xsl:when>
1719
+ <xsl:when test="@name = 'border'">
1720
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1721
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1722
+ </xsl:when>
1723
+ <xsl:otherwise>
1724
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1725
+ </xsl:otherwise>
1726
+ </xsl:choose>
1727
+ </xsl:for-each>
1728
+
1729
+ <xsl:choose>
1730
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1731
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1732
+ <fo:table-column column-width="{@width}"/>
1733
+ </xsl:for-each>
1734
+ </xsl:when>
1735
+ <xsl:otherwise>
1736
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1737
+ <xsl:choose>
1738
+ <xsl:when test=". = 1 or . = 0">
1739
+ <fo:table-column column-width="proportional-column-width(2)"/>
1740
+ </xsl:when>
1741
+ <xsl:otherwise>
1742
+ <fo:table-column column-width="proportional-column-width({.})"/>
1743
+ </xsl:otherwise>
1744
+ </xsl:choose>
1745
+ </xsl:for-each>
1746
+ </xsl:otherwise>
1747
+ </xsl:choose>
1748
+
1749
+ <fo:table-body>
1750
+ <fo:table-row>
1751
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1752
+
1753
+
1754
+
1755
+ <!-- fn will be processed inside 'note' processing -->
1756
+
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+
1763
+ <!-- except gb -->
1764
+
1765
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1766
+
1767
+
1768
+ <!-- <xsl:if test="$namespace = 'bipm'">
1769
+ <xsl:choose>
1770
+ <xsl:when test="ancestor::*[local-name()='preface']">
1771
+ show Note under table in preface (ex. abstract) sections
1772
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1773
+ </xsl:when>
1774
+ <xsl:otherwise>
1775
+ empty, because notes show at page side in main sections
1776
+ <fo:block/>
1777
+ </xsl:otherwise>
1778
+ </xsl:choose>
1779
+ </xsl:if> -->
1780
+
1781
+
1782
+ <!-- horizontal row separator -->
1783
+
1784
+
1785
+ <!-- fn processing -->
1786
+ <xsl:call-template name="fn_display"/>
1787
+
1788
+ </fo:table-cell>
1789
+ </fo:table-row>
1790
+ </fo:table-body>
1791
+
1792
+ </fo:table>
1793
+ </xsl:if>
1564
1794
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1565
1795
 
1566
1796
  <xsl:variable name="cols-count">
@@ -1613,8 +1843,12 @@
1613
1843
 
1614
1844
  </xsl:if>
1615
1845
 
1616
-
1617
-
1846
+
1847
+
1848
+
1849
+ <!-- <xsl:if test="$namespace = 'bipm'">
1850
+ <xsl:attribute name="height">8mm</xsl:attribute>
1851
+ </xsl:if> -->
1618
1852
 
1619
1853
  <xsl:apply-templates/>
1620
1854
  </fo:table-row>
@@ -1639,7 +1873,8 @@
1639
1873
 
1640
1874
 
1641
1875
  <xsl:attribute name="border-top">solid black 2pt</xsl:attribute>
1642
- <xsl:attribute name="border-bottom">solid black 2pt</xsl:attribute>
1876
+ <xsl:attribute name="border-bottom">solid black 2pt</xsl:attribute>
1877
+
1643
1878
 
1644
1879
  <xsl:if test="@colspan">
1645
1880
  <xsl:attribute name="number-columns-spanned">
@@ -1680,7 +1915,8 @@
1680
1915
 
1681
1916
 
1682
1917
 
1683
-
1918
+
1919
+
1684
1920
 
1685
1921
 
1686
1922
 
@@ -1698,7 +1934,8 @@
1698
1934
  </xsl:attribute>
1699
1935
  </xsl:if>
1700
1936
  <xsl:call-template name="display-align"/>
1701
- <fo:block>
1937
+ <fo:block>
1938
+
1702
1939
  <xsl:apply-templates/>
1703
1940
  </fo:block>
1704
1941
  </fo:table-cell>
@@ -1710,14 +1947,17 @@
1710
1947
 
1711
1948
 
1712
1949
 
1950
+
1951
+
1713
1952
  <fo:inline padding-right="2mm">
1714
1953
 
1715
1954
 
1716
1955
 
1717
-
1956
+
1718
1957
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1719
1958
 
1720
1959
  </fo:inline>
1960
+
1721
1961
  <xsl:apply-templates mode="process"/>
1722
1962
  </fo:block>
1723
1963
 
@@ -1741,6 +1981,7 @@
1741
1981
 
1742
1982
 
1743
1983
 
1984
+
1744
1985
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1745
1986
 
1746
1987
 
@@ -1748,12 +1989,15 @@
1748
1989
 
1749
1990
 
1750
1991
 
1992
+
1751
1993
  <xsl:value-of select="@reference"/>
1752
1994
 
1995
+
1753
1996
  </fo:inline>
1754
1997
  <fo:inline>
1755
1998
 
1756
- <xsl:apply-templates/>
1999
+ <!-- <xsl:apply-templates /> -->
2000
+ <xsl:copy-of select="./node()"/>
1757
2001
  </fo:inline>
1758
2002
  </fo:block>
1759
2003
  </xsl:if>
@@ -1790,7 +2034,20 @@
1790
2034
  <xsl:variable name="following_dl_colwidths">
1791
2035
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1792
2036
  <xsl:variable name="html-table">
1793
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2037
+ <xsl:variable name="doc_ns">
2038
+
2039
+ </xsl:variable>
2040
+ <xsl:variable name="ns">
2041
+ <xsl:choose>
2042
+ <xsl:when test="normalize-space($doc_ns) != ''">
2043
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2044
+ </xsl:when>
2045
+ <xsl:otherwise>
2046
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2047
+ </xsl:otherwise>
2048
+ </xsl:choose>
2049
+ </xsl:variable>
2050
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1794
2051
  <xsl:element name="{$ns}:table">
1795
2052
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1796
2053
  <tbody>
@@ -1855,7 +2112,8 @@
1855
2112
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1856
2113
  </xsl:if>
1857
2114
 
1858
- <xsl:apply-templates/>
2115
+ <!-- <xsl:apply-templates /> -->
2116
+ <xsl:copy-of select="./node()"/>
1859
2117
  </fo:block>
1860
2118
  </fo:table-cell>
1861
2119
  </fo:table-row>
@@ -1874,9 +2132,12 @@
1874
2132
 
1875
2133
 
1876
2134
 
2135
+
1877
2136
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1878
2137
 
2138
+
1879
2139
  <xsl:value-of select="@reference"/>
2140
+
1880
2141
  </fo:basic-link>
1881
2142
  </fo:inline>
1882
2143
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1884,7 +2145,11 @@
1884
2145
  <xsl:apply-templates/>
1885
2146
  </fo:inline>
1886
2147
  </xsl:template><xsl:template match="*[local-name()='dl']">
1887
- <fo:block-container margin-left="0mm">
2148
+ <fo:block-container>
2149
+
2150
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2151
+
2152
+
1888
2153
  <xsl:if test="parent::*[local-name() = 'note']">
1889
2154
  <xsl:attribute name="margin-left">
1890
2155
  <xsl:choose>
@@ -1894,8 +2159,11 @@
1894
2159
  </xsl:attribute>
1895
2160
 
1896
2161
  </xsl:if>
1897
- <fo:block-container margin-left="0mm">
1898
-
2162
+ <fo:block-container>
2163
+
2164
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2165
+
2166
+
1899
2167
  <xsl:variable name="parent" select="local-name(..)"/>
1900
2168
 
1901
2169
  <xsl:variable name="key_iso">
@@ -1909,9 +2177,12 @@
1909
2177
  <fo:block margin-bottom="12pt" text-align="left">
1910
2178
 
1911
2179
  <xsl:variable name="title-where">
1912
- <xsl:call-template name="getTitle">
1913
- <xsl:with-param name="name" select="'title-where'"/>
1914
- </xsl:call-template>
2180
+
2181
+
2182
+ <xsl:call-template name="getTitle">
2183
+ <xsl:with-param name="name" select="'title-where'"/>
2184
+ </xsl:call-template>
2185
+
1915
2186
  </xsl:variable>
1916
2187
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1917
2188
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -1927,9 +2198,12 @@
1927
2198
 
1928
2199
 
1929
2200
  <xsl:variable name="title-where">
1930
- <xsl:call-template name="getTitle">
1931
- <xsl:with-param name="name" select="'title-where'"/>
1932
- </xsl:call-template>
2201
+
2202
+
2203
+ <xsl:call-template name="getTitle">
2204
+ <xsl:with-param name="name" select="'title-where'"/>
2205
+ </xsl:call-template>
2206
+
1933
2207
  </xsl:variable>
1934
2208
  <xsl:value-of select="$title-where"/>
1935
2209
  </fo:block>
@@ -1940,9 +2214,12 @@
1940
2214
 
1941
2215
 
1942
2216
  <xsl:variable name="title-key">
1943
- <xsl:call-template name="getTitle">
1944
- <xsl:with-param name="name" select="'title-key'"/>
1945
- </xsl:call-template>
2217
+
2218
+
2219
+ <xsl:call-template name="getTitle">
2220
+ <xsl:with-param name="name" select="'title-key'"/>
2221
+ </xsl:call-template>
2222
+
1946
2223
  </xsl:variable>
1947
2224
  <xsl:value-of select="$title-key"/>
1948
2225
  </fo:block>
@@ -1974,7 +2251,20 @@
1974
2251
  </xsl:choose>
1975
2252
  <!-- create virtual html table for dl/[dt and dd] -->
1976
2253
  <xsl:variable name="html-table">
1977
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2254
+ <xsl:variable name="doc_ns">
2255
+
2256
+ </xsl:variable>
2257
+ <xsl:variable name="ns">
2258
+ <xsl:choose>
2259
+ <xsl:when test="normalize-space($doc_ns) != ''">
2260
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2261
+ </xsl:when>
2262
+ <xsl:otherwise>
2263
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2264
+ </xsl:otherwise>
2265
+ </xsl:choose>
2266
+ </xsl:variable>
2267
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1978
2268
  <xsl:element name="{$ns}:table">
1979
2269
  <tbody>
1980
2270
  <xsl:apply-templates mode="dl"/>
@@ -2118,6 +2408,7 @@
2118
2408
 
2119
2409
 
2120
2410
 
2411
+
2121
2412
  <xsl:apply-templates/>
2122
2413
  <!-- <xsl:if test="$namespace = 'gb'">
2123
2414
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2171,6 +2462,7 @@
2171
2462
  </fo:inline>
2172
2463
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2173
2464
  <fo:inline font-weight="bold">
2465
+
2174
2466
  <xsl:apply-templates/>
2175
2467
  </fo:inline>
2176
2468
  </xsl:template><xsl:template match="*[local-name()='sup']">
@@ -2184,18 +2476,18 @@
2184
2476
  </xsl:template><xsl:template match="*[local-name()='tt']">
2185
2477
  <fo:inline xsl:use-attribute-sets="tt-style">
2186
2478
  <xsl:variable name="_font-size">
2187
-
2188
-
2189
-
2190
2479
 
2191
2480
 
2192
2481
 
2193
2482
 
2194
2483
 
2195
2484
 
2196
-
2197
2485
 
2198
-
2486
+
2487
+
2488
+
2489
+
2490
+
2199
2491
 
2200
2492
 
2201
2493
  </xsl:variable>
@@ -2499,7 +2791,18 @@
2499
2791
  <xsl:with-param name="previousRow" select="$newRow"/>
2500
2792
  </xsl:apply-templates>
2501
2793
  </xsl:template><xsl:template name="getLang">
2502
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2794
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2795
+ <xsl:variable name="language">
2796
+ <xsl:choose>
2797
+ <xsl:when test="$language_current != ''">
2798
+ <xsl:value-of select="$language_current"/>
2799
+ </xsl:when>
2800
+ <xsl:otherwise>
2801
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2802
+ </xsl:otherwise>
2803
+ </xsl:choose>
2804
+ </xsl:variable>
2805
+
2503
2806
  <xsl:choose>
2504
2807
  <xsl:when test="$language = 'English'">en</xsl:when>
2505
2808
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2533,7 +2836,8 @@
2533
2836
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2534
2837
  <xsl:value-of select="substring($str, 2)"/>
2535
2838
  </xsl:template><xsl:template match="mathml:math">
2536
- <fo:inline font-family="STIX2Math">
2839
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2840
+
2537
2841
  <xsl:variable name="mathml">
2538
2842
  <xsl:apply-templates select="." mode="mathml"/>
2539
2843
  </xsl:variable>
@@ -2563,6 +2867,7 @@
2563
2867
  </xsl:choose>
2564
2868
  </xsl:variable>
2565
2869
  <fo:inline xsl:use-attribute-sets="link-style">
2870
+
2566
2871
  <xsl:choose>
2567
2872
  <xsl:when test="$target = ''">
2568
2873
  <xsl:apply-templates/>
@@ -2616,10 +2921,14 @@
2616
2921
  </fo:inline>
2617
2922
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2618
2923
  <xsl:variable name="title-modified">
2619
- <xsl:call-template name="getTitle">
2620
- <xsl:with-param name="name" select="'title-modified'"/>
2621
- </xsl:call-template>
2924
+
2925
+
2926
+ <xsl:call-template name="getTitle">
2927
+ <xsl:with-param name="name" select="'title-modified'"/>
2928
+ </xsl:call-template>
2929
+
2622
2930
  </xsl:variable>
2931
+
2623
2932
  <xsl:choose>
2624
2933
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2625
2934
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2627,7 +2936,7 @@
2627
2936
  <xsl:apply-templates/>
2628
2937
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2629
2938
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2630
-
2939
+
2631
2940
  <xsl:apply-templates/>
2632
2941
  </fo:basic-link>
2633
2942
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -2680,6 +2989,8 @@
2680
2989
 
2681
2990
 
2682
2991
 
2992
+
2993
+
2683
2994
  <fo:inline xsl:use-attribute-sets="note-name-style">
2684
2995
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2685
2996
  </fo:inline>
@@ -2768,7 +3079,8 @@
2768
3079
  </fo:inline>
2769
3080
  </xsl:if>
2770
3081
  </xsl:template><xsl:template match="*[local-name() = 'figure']">
2771
- <fo:block-container id="{@id}">
3082
+ <fo:block-container id="{@id}">
3083
+
2772
3084
  <fo:block>
2773
3085
  <xsl:apply-templates/>
2774
3086
  </fo:block>
@@ -2819,7 +3131,7 @@
2819
3131
  <xsl:apply-templates mode="bookmarks"/>
2820
3132
  </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
2821
3133
  <xsl:apply-templates select="."/>
2822
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3134
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
2823
3135
  <xsl:apply-templates mode="bookmarks"/>
2824
3136
  </xsl:template><xsl:template name="addBookmarks">
2825
3137
  <xsl:param name="contents"/>
@@ -2833,18 +3145,9 @@
2833
3145
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
2834
3146
  <fo:bookmark-title>
2835
3147
  <xsl:variable name="bookmark-title_">
2836
- <xsl:choose>
2837
- <xsl:when test="@lang = 'en'">
2838
-
2839
-
2840
- </xsl:when>
2841
- <xsl:when test="@lang = 'fr'">
2842
-
2843
-
2844
- </xsl:when>
2845
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2846
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2847
- </xsl:choose>
3148
+ <xsl:call-template name="getLangVersion">
3149
+ <xsl:with-param name="lang" select="@lang"/>
3150
+ </xsl:call-template>
2848
3151
  </xsl:variable>
2849
3152
  <xsl:choose>
2850
3153
  <xsl:when test="normalize-space($bookmark-title_) != ''">
@@ -2886,6 +3189,20 @@
2886
3189
 
2887
3190
  </fo:bookmark-tree>
2888
3191
  </xsl:if>
3192
+ </xsl:template><xsl:template name="getLangVersion">
3193
+ <xsl:param name="lang"/>
3194
+ <xsl:choose>
3195
+ <xsl:when test="$lang = 'en'">
3196
+
3197
+
3198
+ </xsl:when>
3199
+ <xsl:when test="$lang = 'fr'">
3200
+
3201
+
3202
+ </xsl:when>
3203
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3204
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3205
+ </xsl:choose>
2889
3206
  </xsl:template><xsl:template match="item" mode="bookmark">
2890
3207
  <fo:bookmark internal-destination="{@id}" starting-state="hide">
2891
3208
  <fo:bookmark-title>
@@ -2900,7 +3217,7 @@
2900
3217
  </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2901
3218
  <xsl:if test="normalize-space() != ''">
2902
3219
  <fo:block xsl:use-attribute-sets="figure-name-style">
2903
-
3220
+
2904
3221
  <xsl:apply-templates/>
2905
3222
  </fo:block>
2906
3223
  </xsl:if>
@@ -3333,9 +3650,14 @@
3333
3650
 
3334
3651
  <fo:inline>
3335
3652
 
3336
- <xsl:call-template name="getTitle">
3337
- <xsl:with-param name="name" select="'title-source'"/>
3338
- </xsl:call-template>
3653
+
3654
+
3655
+
3656
+ <xsl:call-template name="getTitle">
3657
+ <xsl:with-param name="name" select="'title-source'"/>
3658
+ </xsl:call-template>
3659
+
3660
+
3339
3661
  <xsl:text>: </xsl:text>
3340
3662
  </fo:inline>
3341
3663
 
@@ -3482,9 +3804,12 @@
3482
3804
  </fo:block>
3483
3805
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3484
3806
  <xsl:variable name="title-deprecated">
3485
- <xsl:call-template name="getTitle">
3486
- <xsl:with-param name="name" select="'title-deprecated'"/>
3487
- </xsl:call-template>
3807
+
3808
+
3809
+ <xsl:call-template name="getTitle">
3810
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3811
+ </xsl:call-template>
3812
+
3488
3813
  </xsl:variable>
3489
3814
  <fo:block xsl:use-attribute-sets="deprecates-style">
3490
3815
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3526,13 +3851,14 @@
3526
3851
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3527
3852
  <fo:block>
3528
3853
  <xsl:call-template name="setId"/>
3854
+
3529
3855
  <xsl:apply-templates/>
3530
3856
  </fo:block>
3531
3857
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3532
3858
  <fo:block id="{@id}">
3533
3859
  <xsl:apply-templates/>
3534
3860
  </fo:block>
3535
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3861
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3536
3862
 
3537
3863
  <fo:block id="{@id}">
3538
3864
  <xsl:apply-templates/>
@@ -3561,6 +3887,7 @@
3561
3887
  </xsl:choose>
3562
3888
  </xsl:attribute>
3563
3889
 
3890
+
3564
3891
  <fo:block-container margin-left="0mm">
3565
3892
  <fo:block>
3566
3893
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -3588,7 +3915,8 @@
3588
3915
  <fo:table-column column-width="107mm"/>
3589
3916
  <fo:table-column column-width="15mm"/>
3590
3917
  <fo:table-body>
3591
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3918
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
3919
+
3592
3920
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3593
3921
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3594
3922
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -3606,6 +3934,10 @@
3606
3934
  <fo:block><xsl:apply-templates/></fo:block>
3607
3935
  </fo:table-cell>
3608
3936
  </xsl:template><xsl:template name="processBibitem">
3937
+
3938
+
3939
+ <!-- end BIPM bibitem processing-->
3940
+
3609
3941
 
3610
3942
 
3611
3943
 
@@ -3742,6 +4074,7 @@
3742
4074
  <dc:title>
3743
4075
  <xsl:variable name="title">
3744
4076
 
4077
+
3745
4078
 
3746
4079
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3747
4080
 
@@ -3760,6 +4093,7 @@
3760
4093
  <dc:creator>
3761
4094
 
3762
4095
 
4096
+
3763
4097
  </dc:creator>
3764
4098
  <dc:description>
3765
4099
  <xsl:variable name="abstract">
@@ -3767,6 +4101,7 @@
3767
4101
 
3768
4102
 
3769
4103
 
4104
+
3770
4105
  </xsl:variable>
3771
4106
  <xsl:value-of select="normalize-space($abstract)"/>
3772
4107
  </dc:description>
@@ -3838,13 +4173,22 @@
3838
4173
  </xsl:template><xsl:template name="split">
3839
4174
  <xsl:param name="pText" select="."/>
3840
4175
  <xsl:param name="sep" select="','"/>
4176
+ <xsl:param name="normalize-space" select="'true'"/>
3841
4177
  <xsl:if test="string-length($pText) &gt;0">
3842
4178
  <item>
3843
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4179
+ <xsl:choose>
4180
+ <xsl:when test="$normalize-space = 'true'">
4181
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4182
+ </xsl:when>
4183
+ <xsl:otherwise>
4184
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4185
+ </xsl:otherwise>
4186
+ </xsl:choose>
3844
4187
  </item>
3845
4188
  <xsl:call-template name="split">
3846
4189
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3847
4190
  <xsl:with-param name="sep" select="$sep"/>
4191
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
3848
4192
  </xsl:call-template>
3849
4193
  </xsl:if>
3850
4194
  </xsl:template><xsl:template name="getDocumentId">
@@ -3910,4 +4254,23 @@
3910
4254
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
3911
4255
  </xsl:call-template>
3912
4256
  </xsl:if>
4257
+ </xsl:template><xsl:template name="repeat">
4258
+ <xsl:param name="char" select="'*'"/>
4259
+ <xsl:param name="count"/>
4260
+ <xsl:if test="$count &gt; 0">
4261
+ <xsl:value-of select="$char"/>
4262
+ <xsl:call-template name="repeat">
4263
+ <xsl:with-param name="char" select="$char"/>
4264
+ <xsl:with-param name="count" select="$count - 1"/>
4265
+ </xsl:call-template>
4266
+ </xsl:if>
4267
+ </xsl:template><xsl:template name="getLocalizedString">
4268
+ <xsl:param name="key"/>
4269
+
4270
+ <xsl:variable name="curr_lang">
4271
+ <xsl:call-template name="getLang"/>
4272
+ </xsl:variable>
4273
+
4274
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4275
+
3913
4276
  </xsl:template></xsl:stylesheet>