metanorma-m3aawg 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -635,7 +635,7 @@
635
635
 
636
636
 
637
637
 
638
- <xsl:template match="m3d:ul | m3d:ol">
638
+ <xsl:template match="m3d:ul | m3d:ol" mode="ul_ol">
639
639
  <fo:block-container margin-left="6mm">
640
640
  <fo:block-container margin-left="0mm">
641
641
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="6mm"> <!-- margin-bottom="8pt" -->
@@ -673,7 +673,9 @@
673
673
  </fo:list-item>
674
674
  </xsl:template>
675
675
 
676
-
676
+ <xsl:template match="m3d:note" mode="process">
677
+ <xsl:call-template name="note"/>
678
+ </xsl:template>
677
679
 
678
680
  <xsl:template match="m3d:preferred">
679
681
 
@@ -777,8 +779,12 @@
777
779
 
778
780
  <xsl:template match="mathml:math" priority="2">
779
781
  <fo:inline font-family="Cambria Math">
782
+ <xsl:variable name="mathml">
783
+ <xsl:apply-templates select="." mode="mathml"/>
784
+ </xsl:variable>
780
785
  <fo:instream-foreign-object fox:alt-text="Math">
781
- <xsl:copy-of select="."/>
786
+ <!-- <xsl:copy-of select="."/> -->
787
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
782
788
  </fo:instream-foreign-object>
783
789
  </fo:inline>
784
790
  </xsl:template>
@@ -811,9 +817,9 @@
811
817
 
812
818
  <xsl:template match="m3d:formula/m3d:stem">
813
819
  <fo:block margin-top="14pt" margin-bottom="14pt">
814
- <fo:table table-layout="fixed" width="170mm">
815
- <fo:table-column column-width="165mm"/>
816
- <fo:table-column column-width="5mm"/>
820
+ <fo:table table-layout="fixed" width="100%"> <!-- 170mm -->
821
+ <fo:table-column column-width="95%"/> <!-- 165mm -->
822
+ <fo:table-column column-width="5%"/> <!-- 5mm -->
817
823
  <fo:table-body>
818
824
  <fo:table-row>
819
825
  <fo:table-cell display-align="center">
@@ -895,7 +901,12 @@
895
901
 
896
902
 
897
903
 
898
- <title-source lang="en">SOURCE</title-source>
904
+ <title-source lang="en">
905
+
906
+ <xsl:text>SOURCE</xsl:text>
907
+
908
+
909
+ </title-source>
899
910
 
900
911
  <title-keywords lang="en">Keywords</title-keywords>
901
912
 
@@ -938,6 +949,10 @@
938
949
  <title-warning lang="zh">警告</title-warning>
939
950
 
940
951
  <title-amendment lang="en">AMENDMENT</title-amendment>
952
+
953
+ <title-continued lang="en">(continued)</title-continued>
954
+ <title-continued lang="fr">(continué)</title-continued>
955
+
941
956
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
942
957
  <xsl:param name="name"/>
943
958
  <xsl:variable name="lang">
@@ -958,6 +973,7 @@
958
973
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
959
974
 
960
975
 
976
+
961
977
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
962
978
  <xsl:attribute name="white-space">pre</xsl:attribute>
963
979
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -972,6 +988,7 @@
972
988
 
973
989
 
974
990
 
991
+
975
992
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
976
993
 
977
994
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1020,6 +1037,7 @@
1020
1037
 
1021
1038
 
1022
1039
 
1040
+
1023
1041
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1024
1042
 
1025
1043
 
@@ -1041,6 +1059,7 @@
1041
1059
 
1042
1060
 
1043
1061
 
1062
+
1044
1063
 
1045
1064
 
1046
1065
 
@@ -1106,11 +1125,13 @@
1106
1125
 
1107
1126
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1108
1127
 
1109
-
1128
+
1129
+
1110
1130
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1111
1131
 
1112
1132
 
1113
1133
 
1134
+
1114
1135
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1115
1136
 
1116
1137
 
@@ -1130,9 +1151,7 @@
1130
1151
 
1131
1152
 
1132
1153
 
1133
-
1134
-
1135
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1154
+ </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">
1136
1155
 
1137
1156
 
1138
1157
 
@@ -1144,7 +1163,9 @@
1144
1163
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
1145
1164
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1146
1165
 
1147
-
1166
+
1167
+
1168
+
1148
1169
 
1149
1170
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1150
1171
 
@@ -1169,6 +1190,8 @@
1169
1190
 
1170
1191
 
1171
1192
 
1193
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1194
+
1172
1195
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1173
1196
 
1174
1197
 
@@ -1195,6 +1218,7 @@
1195
1218
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1196
1219
 
1197
1220
 
1221
+
1198
1222
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1199
1223
 
1200
1224
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1206,6 +1230,7 @@
1206
1230
 
1207
1231
 
1208
1232
 
1233
+
1209
1234
 
1210
1235
  <xsl:attribute name="text-align">center</xsl:attribute>
1211
1236
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1244,14 +1269,16 @@
1244
1269
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1245
1270
 
1246
1271
 
1247
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1248
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1272
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1273
+
1249
1274
 
1250
1275
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1251
1276
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1252
1277
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1253
1278
  <xsl:attribute name="text-align">center</xsl:attribute>
1254
1279
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1280
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1281
+
1255
1282
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1256
1283
 
1257
1284
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1319,6 +1346,8 @@
1319
1346
 
1320
1347
 
1321
1348
 
1349
+ <!-- $namespace = 'iso' or -->
1350
+
1322
1351
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1323
1352
 
1324
1353
 
@@ -1378,7 +1407,7 @@
1378
1407
 
1379
1408
 
1380
1409
 
1381
-
1410
+
1382
1411
 
1383
1412
 
1384
1413
 
@@ -1395,6 +1424,8 @@
1395
1424
 
1396
1425
 
1397
1426
 
1427
+
1428
+
1398
1429
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1399
1430
  <xsl:choose>
1400
1431
  <xsl:when test=". = 1 or . = 0">
@@ -1425,8 +1456,9 @@
1425
1456
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1426
1457
  <xsl:if test="normalize-space() != ''">
1427
1458
  <fo:block xsl:use-attribute-sets="table-name-style">
1428
- <xsl:apply-templates/>
1429
- </fo:block>
1459
+
1460
+ <xsl:apply-templates/>
1461
+ </fo:block>
1430
1462
  </xsl:if>
1431
1463
  </xsl:template><xsl:template name="calculate-columns-numbers">
1432
1464
  <xsl:param name="table-row"/>
@@ -1542,10 +1574,25 @@
1542
1574
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1543
1575
  <xsl:param name="cols-count"/>
1544
1576
  <!-- font-weight="bold" -->
1545
- <fo:table-header>
1546
-
1577
+ <fo:table-header>
1578
+
1547
1579
  <xsl:apply-templates/>
1548
1580
  </fo:table-header>
1581
+ </xsl:template><xsl:template name="table-header-title">
1582
+ <xsl:param name="cols-count"/>
1583
+ <!-- row for title -->
1584
+ <fo:table-row>
1585
+ <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">
1586
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1587
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1588
+ <xsl:call-template name="fn_name_display"/>
1589
+ </xsl:for-each>
1590
+ <fo:block text-align="right" font-style="italic">
1591
+ <xsl:text> </xsl:text>
1592
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1593
+ </fo:block>
1594
+ </fo:table-cell>
1595
+ </fo:table-row>
1549
1596
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1550
1597
  <fo:table-body>
1551
1598
  <xsl:apply-templates/>
@@ -1609,6 +1656,8 @@
1609
1656
  </xsl:choose>
1610
1657
  </xsl:variable>
1611
1658
 
1659
+
1660
+
1612
1661
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1613
1662
  <xsl:with-param name="cols-count" select="$cols-count"/>
1614
1663
  </xsl:apply-templates>
@@ -1618,6 +1667,8 @@
1618
1667
  </xsl:call-template>
1619
1668
 
1620
1669
  <fo:table-body>
1670
+
1671
+
1621
1672
  <xsl:apply-templates/>
1622
1673
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1623
1674
 
@@ -1640,6 +1691,8 @@
1640
1691
 
1641
1692
  </xsl:if>
1642
1693
 
1694
+
1695
+
1643
1696
 
1644
1697
  <xsl:apply-templates/>
1645
1698
  </fo:table-row>
@@ -1662,6 +1715,7 @@
1662
1715
 
1663
1716
 
1664
1717
 
1718
+
1665
1719
  <xsl:if test="@colspan">
1666
1720
  <xsl:attribute name="number-columns-spanned">
1667
1721
  <xsl:value-of select="@colspan"/>
@@ -1672,10 +1726,22 @@
1672
1726
  <xsl:value-of select="@rowspan"/>
1673
1727
  </xsl:attribute>
1674
1728
  </xsl:if>
1729
+ <xsl:call-template name="display-align"/>
1675
1730
  <fo:block>
1676
1731
  <xsl:apply-templates/>
1677
1732
  </fo:block>
1678
1733
  </fo:table-cell>
1734
+ </xsl:template><xsl:template name="display-align">
1735
+ <xsl:if test="@valign">
1736
+ <xsl:attribute name="display-align">
1737
+ <xsl:choose>
1738
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1739
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1740
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1741
+ <xsl:otherwise>before</xsl:otherwise>
1742
+ </xsl:choose>
1743
+ </xsl:attribute>
1744
+ </xsl:if>
1679
1745
  </xsl:template><xsl:template match="*[local-name()='td']">
1680
1746
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1681
1747
  <xsl:attribute name="text-align">
@@ -1695,6 +1761,7 @@
1695
1761
 
1696
1762
 
1697
1763
 
1764
+
1698
1765
  <xsl:if test="@colspan">
1699
1766
  <xsl:attribute name="number-columns-spanned">
1700
1767
  <xsl:value-of select="@colspan"/>
@@ -1705,8 +1772,8 @@
1705
1772
  <xsl:value-of select="@rowspan"/>
1706
1773
  </xsl:attribute>
1707
1774
  </xsl:if>
1708
- <fo:block>
1709
-
1775
+ <xsl:call-template name="display-align"/>
1776
+ <fo:block>
1710
1777
  <xsl:apply-templates/>
1711
1778
  </fo:block>
1712
1779
  </fo:table-cell>
@@ -1883,6 +1950,7 @@
1883
1950
 
1884
1951
 
1885
1952
 
1953
+
1886
1954
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1887
1955
 
1888
1956
  <xsl:value-of select="@reference"/>
@@ -1893,115 +1961,129 @@
1893
1961
  <xsl:apply-templates/>
1894
1962
  </fo:inline>
1895
1963
  </xsl:template><xsl:template match="*[local-name()='dl']">
1896
- <xsl:variable name="parent" select="local-name(..)"/>
1897
-
1898
- <xsl:variable name="key_iso">
1899
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
1900
- </xsl:variable>
1901
-
1902
- <xsl:choose>
1903
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1904
-
1905
-
1906
- <fo:block margin-bottom="12pt" text-align="left">
1907
-
1908
- <xsl:variable name="title-where">
1909
- <xsl:call-template name="getTitle">
1910
- <xsl:with-param name="name" select="'title-where'"/>
1911
- </xsl:call-template>
1912
- </xsl:variable>
1913
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1914
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
1915
- <xsl:text/>
1916
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
1917
- </fo:block>
1918
-
1919
- </xsl:when>
1920
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1921
- <fo:block margin-bottom="12pt" text-align="left">
1922
-
1923
-
1924
-
1925
-
1926
- <xsl:variable name="title-where">
1927
- <xsl:call-template name="getTitle">
1928
- <xsl:with-param name="name" select="'title-where'"/>
1929
- </xsl:call-template>
1930
- </xsl:variable>
1931
- <xsl:value-of select="$title-where"/>
1932
- </fo:block>
1933
- </xsl:when>
1934
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1935
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1936
-
1937
-
1938
-
1939
- <xsl:variable name="title-key">
1940
- <xsl:call-template name="getTitle">
1941
- <xsl:with-param name="name" select="'title-key'"/>
1942
- </xsl:call-template>
1943
- </xsl:variable>
1944
- <xsl:value-of select="$title-key"/>
1945
- </fo:block>
1946
- </xsl:when>
1947
- </xsl:choose>
1948
-
1949
- <!-- a few components -->
1950
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1951
- <fo:block>
1964
+ <fo:block-container margin-left="0mm">
1965
+ <xsl:if test="parent::*[local-name() = 'note']">
1966
+ <xsl:attribute name="margin-left">
1967
+ <xsl:choose>
1968
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
1969
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
1970
+ </xsl:choose>
1971
+ </xsl:attribute>
1952
1972
 
1973
+ </xsl:if>
1974
+ <fo:block-container margin-left="0mm">
1975
+
1976
+ <xsl:variable name="parent" select="local-name(..)"/>
1953
1977
 
1978
+ <xsl:variable name="key_iso">
1979
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
1980
+ </xsl:variable>
1954
1981
 
1982
+ <xsl:choose>
1983
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1984
+
1985
+
1986
+ <fo:block margin-bottom="12pt" text-align="left">
1987
+
1988
+ <xsl:variable name="title-where">
1989
+ <xsl:call-template name="getTitle">
1990
+ <xsl:with-param name="name" select="'title-where'"/>
1991
+ </xsl:call-template>
1992
+ </xsl:variable>
1993
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1994
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
1995
+ <xsl:text/>
1996
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
1997
+ </fo:block>
1998
+
1999
+ </xsl:when>
2000
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2001
+ <fo:block margin-bottom="12pt" text-align="left">
2002
+
2003
+
2004
+
2005
+
2006
+ <xsl:variable name="title-where">
2007
+ <xsl:call-template name="getTitle">
2008
+ <xsl:with-param name="name" select="'title-where'"/>
2009
+ </xsl:call-template>
2010
+ </xsl:variable>
2011
+ <xsl:value-of select="$title-where"/>
2012
+ </fo:block>
2013
+ </xsl:when>
2014
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2015
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2016
+
2017
+
2018
+
2019
+ <xsl:variable name="title-key">
2020
+ <xsl:call-template name="getTitle">
2021
+ <xsl:with-param name="name" select="'title-key'"/>
2022
+ </xsl:call-template>
2023
+ </xsl:variable>
2024
+ <xsl:value-of select="$title-key"/>
2025
+ </fo:block>
2026
+ </xsl:when>
2027
+ </xsl:choose>
1955
2028
 
1956
- <fo:block>
1957
-
1958
-
1959
-
1960
-
1961
- <fo:table width="95%" table-layout="fixed">
2029
+ <!-- a few components -->
2030
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2031
+ <fo:block>
1962
2032
 
1963
- <xsl:choose>
1964
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
1965
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1966
- </xsl:when>
1967
- <xsl:when test="normalize-space($key_iso) = 'true'">
1968
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2033
+
2034
+
2035
+
2036
+ <fo:block>
2037
+
2038
+
2039
+
2040
+
2041
+ <fo:table width="95%" table-layout="fixed">
1969
2042
 
1970
- </xsl:when>
1971
- </xsl:choose>
1972
- <!-- create virtual html table for dl/[dt and dd] -->
1973
- <xsl:variable name="html-table">
1974
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
1975
- <xsl:element name="{$ns}:table">
1976
- <tbody>
1977
- <xsl:apply-templates mode="dl"/>
1978
- </tbody>
1979
- </xsl:element>
1980
- </xsl:variable>
1981
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
1982
- <xsl:variable name="colwidths">
1983
- <xsl:call-template name="calculate-column-widths">
1984
- <xsl:with-param name="cols-count" select="2"/>
1985
- <xsl:with-param name="table" select="$html-table"/>
1986
- </xsl:call-template>
1987
- </xsl:variable>
1988
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
1989
- <xsl:variable name="maxlength_dt">
1990
- <xsl:call-template name="getMaxLength_dt"/>
1991
- </xsl:variable>
1992
- <xsl:call-template name="setColumnWidth_dl">
1993
- <xsl:with-param name="colwidths" select="$colwidths"/>
1994
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
1995
- </xsl:call-template>
1996
- <fo:table-body>
1997
- <xsl:apply-templates>
1998
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
1999
- </xsl:apply-templates>
2000
- </fo:table-body>
2001
- </fo:table>
2002
- </fo:block>
2003
- </fo:block>
2004
- </xsl:if>
2043
+ <xsl:choose>
2044
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2045
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2046
+ </xsl:when>
2047
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2048
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2049
+
2050
+ </xsl:when>
2051
+ </xsl:choose>
2052
+ <!-- create virtual html table for dl/[dt and dd] -->
2053
+ <xsl:variable name="html-table">
2054
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2055
+ <xsl:element name="{$ns}:table">
2056
+ <tbody>
2057
+ <xsl:apply-templates mode="dl"/>
2058
+ </tbody>
2059
+ </xsl:element>
2060
+ </xsl:variable>
2061
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2062
+ <xsl:variable name="colwidths">
2063
+ <xsl:call-template name="calculate-column-widths">
2064
+ <xsl:with-param name="cols-count" select="2"/>
2065
+ <xsl:with-param name="table" select="$html-table"/>
2066
+ </xsl:call-template>
2067
+ </xsl:variable>
2068
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2069
+ <xsl:variable name="maxlength_dt">
2070
+ <xsl:call-template name="getMaxLength_dt"/>
2071
+ </xsl:variable>
2072
+ <xsl:call-template name="setColumnWidth_dl">
2073
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2074
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2075
+ </xsl:call-template>
2076
+ <fo:table-body>
2077
+ <xsl:apply-templates>
2078
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2079
+ </xsl:apply-templates>
2080
+ </fo:table-body>
2081
+ </fo:table>
2082
+ </fo:block>
2083
+ </fo:block>
2084
+ </xsl:if>
2085
+ </fo:block-container>
2086
+ </fo:block-container>
2005
2087
  </xsl:template><xsl:template name="setColumnWidth_dl">
2006
2088
  <xsl:param name="colwidths"/>
2007
2089
  <xsl:param name="maxlength_dt"/>
@@ -2098,6 +2180,7 @@
2098
2180
  <xsl:param name="key_iso"/>
2099
2181
 
2100
2182
  <fo:table-row>
2183
+
2101
2184
  <fo:table-cell>
2102
2185
 
2103
2186
  <fo:block margin-top="6pt">
@@ -2177,6 +2260,36 @@
2177
2260
  </fo:inline>
2178
2261
  </xsl:template><xsl:template match="*[local-name()='tt']">
2179
2262
  <fo:inline xsl:use-attribute-sets="tt-style">
2263
+ <xsl:variable name="_font-size">
2264
+
2265
+
2266
+
2267
+
2268
+
2269
+
2270
+
2271
+
2272
+ <xsl:choose>
2273
+ <xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
2274
+ <xsl:otherwise>11</xsl:otherwise>
2275
+ </xsl:choose>
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+ </xsl:variable>
2284
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2285
+ <xsl:if test="$font-size != ''">
2286
+ <xsl:attribute name="font-size">
2287
+ <xsl:choose>
2288
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2289
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2290
+ </xsl:choose>
2291
+ </xsl:attribute>
2292
+ </xsl:if>
2180
2293
  <xsl:apply-templates/>
2181
2294
  </fo:inline>
2182
2295
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2503,10 +2616,23 @@
2503
2616
  <xsl:value-of select="substring($str, 2)"/>
2504
2617
  </xsl:template><xsl:template match="mathml:math">
2505
2618
  <fo:inline font-family="STIX2Math">
2506
- <fo:instream-foreign-object fox:alt-text="Math">
2507
- <xsl:copy-of select="."/>
2508
- </fo:instream-foreign-object>
2619
+ <xsl:variable name="mathml">
2620
+ <xsl:apply-templates select="." mode="mathml"/>
2621
+ </xsl:variable>
2622
+ <fo:instream-foreign-object fox:alt-text="Math">
2623
+ <!-- <xsl:copy-of select="."/> -->
2624
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2625
+ </fo:instream-foreign-object>
2509
2626
  </fo:inline>
2627
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2628
+ <xsl:copy>
2629
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2630
+ </xsl:copy>
2631
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2632
+ <xsl:copy>
2633
+ <!-- replace start and end spaces to non-break space -->
2634
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2635
+ </xsl:copy>
2510
2636
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2511
2637
  <xsl:variable name="target">
2512
2638
  <xsl:choose>
@@ -2587,9 +2713,22 @@
2587
2713
  <xsl:apply-templates/>
2588
2714
  </fo:basic-link>
2589
2715
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2590
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2591
- <xsl:apply-templates/>
2592
- </fo:block>
2716
+ <fo:block-container margin-left="0mm">
2717
+ <xsl:if test="parent::*[local-name() = 'note']">
2718
+ <xsl:attribute name="margin-left">
2719
+ <xsl:choose>
2720
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2721
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2722
+ </xsl:choose>
2723
+ </xsl:attribute>
2724
+
2725
+ </xsl:if>
2726
+ <fo:block-container margin-left="0mm">
2727
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2728
+ <xsl:apply-templates/>
2729
+ </fo:block>
2730
+ </fo:block-container>
2731
+ </fo:block-container>
2593
2732
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2594
2733
  <fo:inline>
2595
2734
  <xsl:apply-templates/>
@@ -2649,7 +2788,9 @@
2649
2788
  </xsl:choose>
2650
2789
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2651
2790
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2652
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2791
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
2792
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2793
+ </fo:inline>
2653
2794
  <xsl:apply-templates/>
2654
2795
  </fo:block>
2655
2796
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
@@ -2822,21 +2963,61 @@
2822
2963
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2823
2964
  <xsl:text> </xsl:text>
2824
2965
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2825
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2826
- <xsl:apply-templates/>
2827
- </fo:block>
2828
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2829
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
2966
+
2967
+ <fo:block-container margin-left="0mm">
2968
+ <xsl:if test="parent::*[local-name() = 'note']">
2969
+ <xsl:attribute name="margin-left">
2970
+ <xsl:choose>
2971
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2972
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2973
+ </xsl:choose>
2974
+ </xsl:attribute>
2975
+
2976
+ </xsl:if>
2977
+ <fo:block-container margin-left="0mm">
2978
+
2979
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
2980
+ <xsl:variable name="_font-size">
2981
+
2982
+
2983
+
2984
+
2985
+
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+
2992
+
2993
+
2994
+
2995
+ </xsl:variable>
2996
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2997
+ <xsl:if test="$font-size != ''">
2998
+ <xsl:attribute name="font-size">
2999
+ <xsl:choose>
3000
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3001
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3002
+ </xsl:choose>
3003
+ </xsl:attribute>
3004
+ </xsl:if>
3005
+ <xsl:apply-templates/>
3006
+ </fo:block>
3007
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3008
+
3009
+ </fo:block-container>
3010
+ </fo:block-container>
3011
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2830
3012
  <xsl:variable name="text">
2831
3013
  <xsl:call-template name="add-zero-spaces-equal"/>
2832
3014
  </xsl:variable>
2833
- <xsl:call-template name="add-zero-spaces">
3015
+ <xsl:call-template name="add-zero-spaces-java">
2834
3016
  <xsl:with-param name="text" select="$text"/>
2835
3017
  </xsl:call-template>
2836
3018
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2837
3019
  <xsl:if test="normalize-space() != ''">
2838
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2839
-
3020
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2840
3021
  <xsl:apply-templates/>
2841
3022
  </fo:block>
2842
3023
  </xsl:if>
@@ -2910,9 +3091,9 @@
2910
3091
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2911
3092
  </xsl:if>
2912
3093
  <fo:block-container margin-left="0mm" margin-right="0mm">
2913
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3094
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
2914
3095
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2915
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3096
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
2916
3097
  </xsl:if>
2917
3098
  <xsl:variable name="simple-table">
2918
3099
  <xsl:call-template name="getSimpleTable"/>
@@ -2921,8 +3102,8 @@
2921
3102
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
2922
3103
  <!-- <fo:table-column column-width="35mm"/>
2923
3104
  <fo:table-column column-width="115mm"/> -->
2924
- <fo:table-column column-width="25%"/>
2925
- <fo:table-column column-width="75%"/>
3105
+ <fo:table-column column-width="30%"/>
3106
+ <fo:table-column column-width="70%"/>
2926
3107
  </xsl:if>
2927
3108
  <xsl:apply-templates mode="requirement"/>
2928
3109
  </fo:table>
@@ -2945,14 +3126,21 @@
2945
3126
  <xsl:apply-templates mode="requirement"/>
2946
3127
  </fo:table-body>
2947
3128
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
2948
- <fo:table-row height="7mm">
2949
- <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
2950
- <xsl:attribute name="border">1pt solid black</xsl:attribute>
3129
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3130
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3131
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3132
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3133
+ </xsl:if>
3134
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3135
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3136
+ </xsl:if>
3137
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3138
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
2951
3139
  </xsl:if>
2952
3140
  <xsl:apply-templates mode="requirement"/>
2953
3141
  </fo:table-row>
2954
3142
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
2955
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3143
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
2956
3144
  <xsl:attribute name="text-align">
2957
3145
  <xsl:choose>
2958
3146
  <xsl:when test="@align">
@@ -2971,6 +3159,7 @@
2971
3159
  <xsl:value-of select="@rowspan"/>
2972
3160
  </xsl:attribute>
2973
3161
  </xsl:if>
3162
+ <xsl:call-template name="display-align"/>
2974
3163
 
2975
3164
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2976
3165
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
@@ -2986,7 +3175,7 @@
2986
3175
  </fo:block>
2987
3176
  </fo:table-cell>
2988
3177
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
2989
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3178
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
2990
3179
  <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2991
3180
  <xsl:attribute name="padding">0mm</xsl:attribute>
2992
3181
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -2999,6 +3188,9 @@
2999
3188
  <xsl:otherwise>left</xsl:otherwise>
3000
3189
  </xsl:choose>
3001
3190
  </xsl:attribute>
3191
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3192
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3193
+ </xsl:if>
3002
3194
  <xsl:if test="@colspan">
3003
3195
  <xsl:attribute name="number-columns-spanned">
3004
3196
  <xsl:value-of select="@colspan"/>
@@ -3009,6 +3201,7 @@
3009
3201
  <xsl:value-of select="@rowspan"/>
3010
3202
  </xsl:attribute>
3011
3203
  </xsl:if>
3204
+ <xsl:call-template name="display-align"/>
3012
3205
 
3013
3206
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3014
3207
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
@@ -3024,7 +3217,7 @@
3024
3217
  </fo:block>
3025
3218
  </fo:table-cell>
3026
3219
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3027
- <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3220
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3028
3221
  <xsl:apply-templates/>
3029
3222
  </fo:block>
3030
3223
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -3050,12 +3243,13 @@
3050
3243
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3051
3244
 
3052
3245
  <xsl:variable name="element">
3053
-
3246
+
3054
3247
  inline
3248
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3055
3249
  </xsl:variable>
3056
3250
 
3057
3251
  <xsl:choose>
3058
- <xsl:when test="normalize-space($element) = 'block'">
3252
+ <xsl:when test="contains(normalize-space($element), 'block')">
3059
3253
  <fo:block xsl:use-attribute-sets="example-body-style">
3060
3254
  <xsl:apply-templates/>
3061
3255
  </fo:block>
@@ -3092,25 +3286,44 @@
3092
3286
  </xsl:otherwise>
3093
3287
  </xsl:choose>
3094
3288
 
3095
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3096
- <fo:block xsl:use-attribute-sets="example-p-style">
3289
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3290
+
3291
+ <xsl:variable name="element">
3292
+ block
3097
3293
 
3098
- <xsl:apply-templates/>
3099
- </fo:block>
3294
+ </xsl:variable>
3295
+ <xsl:choose>
3296
+ <xsl:when test="normalize-space($element) = 'block'">
3297
+ <fo:block xsl:use-attribute-sets="example-p-style">
3298
+
3299
+ <xsl:apply-templates/>
3300
+ </fo:block>
3301
+ </xsl:when>
3302
+ <xsl:otherwise>
3303
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3304
+ <xsl:apply-templates/>
3305
+ </fo:inline>
3306
+ </xsl:otherwise>
3307
+ </xsl:choose>
3100
3308
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3101
3309
  <fo:block xsl:use-attribute-sets="termsource-style">
3102
3310
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3103
3311
  <xsl:variable name="termsource_text">
3104
3312
  <xsl:apply-templates/>
3105
3313
  </xsl:variable>
3314
+
3106
3315
  <xsl:choose>
3107
3316
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3108
3317
  <xsl:apply-templates/>
3109
3318
  </xsl:when>
3110
- <xsl:otherwise>
3111
- <xsl:text>[</xsl:text>
3112
- <xsl:apply-templates/>
3113
- <xsl:text>]</xsl:text>
3319
+ <xsl:otherwise>
3320
+
3321
+ <xsl:text>[</xsl:text>
3322
+
3323
+ <xsl:apply-templates/>
3324
+
3325
+ <xsl:text>]</xsl:text>
3326
+
3114
3327
  </xsl:otherwise>
3115
3328
  </xsl:choose>
3116
3329
  </fo:block>
@@ -3131,18 +3344,29 @@
3131
3344
  <xsl:if test="normalize-space() != ''">
3132
3345
  <xsl:value-of select="."/>
3133
3346
  </xsl:if>
3134
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3347
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3348
+ <fo:block-container margin-left="0mm">
3349
+ <xsl:if test="parent::*[local-name() = 'note']">
3350
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3351
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3352
+ </xsl:if>
3353
+ </xsl:if>
3354
+
3355
+ <fo:block-container margin-left="0mm">
3135
3356
 
3136
- <fo:block xsl:use-attribute-sets="quote-style">
3137
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3138
- </fo:block>
3139
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3140
- <fo:block xsl:use-attribute-sets="quote-source-style">
3141
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3142
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3143
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3144
- </fo:block>
3145
- </xsl:if>
3357
+ <fo:block xsl:use-attribute-sets="quote-style">
3358
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3359
+ </fo:block>
3360
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3361
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3362
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3363
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3364
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3365
+ </fo:block>
3366
+ </xsl:if>
3367
+
3368
+ </fo:block-container>
3369
+ </fo:block-container>
3146
3370
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3147
3371
  <xsl:if test="../*[local-name() = 'author']">
3148
3372
  <xsl:text>, </xsl:text>
@@ -3170,6 +3394,7 @@
3170
3394
  <xsl:if test="@type = 'inline'">
3171
3395
 
3172
3396
 
3397
+
3173
3398
  </xsl:if>
3174
3399
 
3175
3400
 
@@ -3210,6 +3435,7 @@
3210
3435
 
3211
3436
 
3212
3437
 
3438
+
3213
3439
  </xsl:variable>
3214
3440
 
3215
3441
  <xsl:variable name="padding-right">
@@ -3331,6 +3557,21 @@
3331
3557
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3332
3558
  <!-- 0xA0 to space replacement -->
3333
3559
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3560
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3561
+ <fo:block-container margin-left="0mm">
3562
+ <xsl:if test="parent::*[local-name() = 'note']">
3563
+ <xsl:attribute name="margin-left">
3564
+ <xsl:choose>
3565
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3566
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3567
+ </xsl:choose>
3568
+ </xsl:attribute>
3569
+
3570
+ </xsl:if>
3571
+ <fo:block-container margin-left="0mm">
3572
+ <xsl:apply-templates select="." mode="ul_ol"/>
3573
+ </fo:block-container>
3574
+ </fo:block-container>
3334
3575
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3335
3576
  <!-- <row>
3336
3577
  <date>05-07-2013</date>
@@ -3363,7 +3604,28 @@
3363
3604
  <fo:block><xsl:apply-templates/></fo:block>
3364
3605
  </fo:table-cell>
3365
3606
  </xsl:template><xsl:template name="processBibitem">
3607
+
3608
+
3366
3609
 
3610
+
3611
+ </xsl:template><xsl:template name="processBibitemDocId">
3612
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
3613
+ <xsl:choose>
3614
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3615
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
3616
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3617
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3618
+ </xsl:if>
3619
+ <xsl:value-of select="$_doc_ident"/>
3620
+ </xsl:when>
3621
+ <xsl:otherwise>
3622
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3623
+ <xsl:if test="$type != ''">
3624
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3625
+ </xsl:if>
3626
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3627
+ </xsl:otherwise>
3628
+ </xsl:choose>
3367
3629
  </xsl:template><xsl:template name="processPersonalAuthor">
3368
3630
  <xsl:choose>
3369
3631
  <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">