metanorma-mpfa 0.6.7 → 0.6.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c818430af1d1598cedf9fdb864222fe07444a590c359d35395851328acd8c493
4
- data.tar.gz: 16d387bc8dae24d430ae296c260ecc0be3bf9a2fa226aada3e486bdd5624bcd6
3
+ metadata.gz: dfafc3185e7d9e6bddfdde8a22da506f2aec254829aecb6ae57fc6b162a89881
4
+ data.tar.gz: 6e0554f7279cbb5458af4d69cadd9ad102b213cf927f603a7e553bd7d1e66d49
5
5
  SHA512:
6
- metadata.gz: b367fb98cab4120873e8083476f6c7058558c0941dbd4f259055793698d56bebbb068687d70261bd764a9bfb8bc9a98ae23914537feff88dbbe05021b4a8b51a
7
- data.tar.gz: 599e33cbd382cb25ccd516deb193c48d0afebd168bcc6ea8680d4c1e01283e65f779df5e78b495d7c6ccc2743a3a5afd3b900d1751f7abf60756854a9ba84056
6
+ metadata.gz: c913d6e10884e68983b282adfc52fe761db5b50a08bd0425b132de02390ae9ff7febac1c99a1bfb32d6a7d0ee2706cfeb7cd257d6d29022f3649f1f1a59805f0
7
+ data.tar.gz: 7596c1de95381be729a9fcac5c9a0eacc75c1d63449e64fdaab39af771024fed0fbf45be8a2a8865a80e85f2401f6310fd57eb62b4c7a58615e36e56c0a7aafa
@@ -32,6 +32,18 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="section-title">
36
+ <element name="title">
37
+ <zeroOrMore>
38
+ <ref name="TextElement"/>
39
+ </zeroOrMore>
40
+ </element>
41
+ <zeroOrMore>
42
+ <element name="variant-title">
43
+ <ref name="TypedTitleString"/>
44
+ </element>
45
+ </zeroOrMore>
46
+ </define>
35
47
  <define name="hyperlink">
36
48
  <element name="link">
37
49
  <attribute name="target">
@@ -158,15 +170,17 @@
158
170
  <data type="boolean"/>
159
171
  </attribute>
160
172
  </optional>
161
- <attribute name="type">
162
- <choice>
163
- <value>roman</value>
164
- <value>alphabet</value>
165
- <value>arabic</value>
166
- <value>roman_upper</value>
167
- <value>alphabet_upper</value>
168
- </choice>
169
- </attribute>
173
+ <optional>
174
+ <attribute name="type">
175
+ <choice>
176
+ <value>roman</value>
177
+ <value>alphabet</value>
178
+ <value>arabic</value>
179
+ <value>roman_upper</value>
180
+ <value>alphabet_upper</value>
181
+ </choice>
182
+ </attribute>
183
+ </optional>
170
184
  <oneOrMore>
171
185
  <ref name="li"/>
172
186
  </oneOrMore>
@@ -976,6 +990,16 @@
976
990
  <data type="boolean"/>
977
991
  </attribute>
978
992
  </optional>
993
+ <optional>
994
+ <attribute name="linkmention">
995
+ <data type="boolean"/>
996
+ </attribute>
997
+ </optional>
998
+ <optional>
999
+ <attribute name="linkref">
1000
+ <data type="boolean"/>
1001
+ </attribute>
1002
+ </optional>
979
1003
  <optional>
980
1004
  <element name="refterm">
981
1005
  <zeroOrMore>
@@ -1011,8 +1035,14 @@
1011
1035
  <ref name="imagemap"/>
1012
1036
  <ref name="svgmap"/>
1013
1037
  <ref name="inputform"/>
1038
+ <ref name="toc"/>
1014
1039
  </choice>
1015
1040
  </define>
1041
+ <define name="toc">
1042
+ <element name="toc">
1043
+ <ref name="ul"/>
1044
+ </element>
1045
+ </define>
1016
1046
  <define name="inputform">
1017
1047
  <element name="form">
1018
1048
  <attribute name="id">
@@ -1254,6 +1284,12 @@
1254
1284
  <optional>
1255
1285
  <attribute name="type"/>
1256
1286
  </optional>
1287
+ <optional>
1288
+ <attribute name="identifier"/>
1289
+ </optional>
1290
+ <optional>
1291
+ <attribute name="prefix"/>
1292
+ </optional>
1257
1293
  <text/>
1258
1294
  </define>
1259
1295
  <define name="ics">
@@ -1674,7 +1710,9 @@
1674
1710
  <zeroOrMore>
1675
1711
  <ref name="termgrammar"/>
1676
1712
  </zeroOrMore>
1677
- <ref name="definition"/>
1713
+ <oneOrMore>
1714
+ <ref name="termdefinition"/>
1715
+ </oneOrMore>
1678
1716
  <zeroOrMore>
1679
1717
  <ref name="termnote"/>
1680
1718
  </zeroOrMore>
@@ -1737,7 +1775,7 @@
1737
1775
  </oneOrMore>
1738
1776
  </element>
1739
1777
  </define>
1740
- <define name="definition">
1778
+ <define name="termdefinition">
1741
1779
  <element name="definition">
1742
1780
  <oneOrMore>
1743
1781
  <choice>
@@ -1746,6 +1784,9 @@
1746
1784
  <ref name="formula"/>
1747
1785
  </choice>
1748
1786
  </oneOrMore>
1787
+ <zeroOrMore>
1788
+ <ref name="termsource"/>
1789
+ </zeroOrMore>
1749
1790
  </element>
1750
1791
  </define>
1751
1792
  <define name="termnote">
@@ -64,9 +64,9 @@
64
64
  <optional>
65
65
  <ref name="label"/>
66
66
  </optional>
67
- <optional>
67
+ <zeroOrMore>
68
68
  <ref name="subject"/>
69
- </optional>
69
+ </zeroOrMore>
70
70
  <zeroOrMore>
71
71
  <ref name="reqinherit"/>
72
72
  </zeroOrMore>
@@ -80,6 +80,7 @@
80
80
  <ref name="verification"/>
81
81
  <ref name="import"/>
82
82
  <ref name="description"/>
83
+ <ref name="component"/>
83
84
  </choice>
84
85
  </zeroOrMore>
85
86
  <optional>
@@ -105,12 +106,16 @@
105
106
  </define>
106
107
  <define name="subject">
107
108
  <element name="subject">
108
- <text/>
109
+ <oneOrMore>
110
+ <ref name="TextElement"/>
111
+ </oneOrMore>
109
112
  </element>
110
113
  </define>
111
114
  <define name="reqinherit">
112
115
  <element name="inherit">
113
- <text/>
116
+ <oneOrMore>
117
+ <ref name="TextElement"/>
118
+ </oneOrMore>
114
119
  </element>
115
120
  </define>
116
121
  <define name="measurementtarget">
@@ -138,6 +143,12 @@
138
143
  <ref name="RequirementSubpart"/>
139
144
  </element>
140
145
  </define>
146
+ <define name="component">
147
+ <element name="component">
148
+ <attribute name="class"/>
149
+ <ref name="RequirementSubpart"/>
150
+ </element>
151
+ </define>
141
152
  <define name="reqt_references">
142
153
  <element name="references">
143
154
  <oneOrMore>
@@ -661,6 +661,12 @@ ul > li p:first-child {
661
661
  ul > li:first-child {
662
662
  margin-top: 1em; }
663
663
 
664
+ ul ul > li:first-child {
665
+ margin-top: 0; }
666
+
667
+ ol ul > li:first-child {
668
+ margin-top: 0; }
669
+
664
670
  #toc-list ul {
665
671
  margin-bottom: 0.25em; }
666
672
 
@@ -325,6 +325,14 @@ ul > li:first-child {
325
325
  margin-top: 1em;
326
326
  }
327
327
 
328
+ ul ul > li:first-child {
329
+ margin-top: 0;
330
+ }
331
+ ol ul > li:first-child {
332
+ margin-top: 0;
333
+ }
334
+
335
+
328
336
  #toc-list ul {margin-bottom: 0.25em;}
329
337
 
330
338
  #toc-list li {list-style-type: none;}
@@ -37,7 +37,6 @@ module IsoDoc
37
37
  def googlefonts
38
38
  <<~HEAD.freeze
39
39
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
40
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
41
40
  <link href="https://fonts.googleapis.com/css?family=Titillium+Web:400,400i,700,700i" rel="stylesheet">
42
41
  HEAD
43
42
  end
@@ -134,7 +134,7 @@
134
134
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-MPFD-Logo))}" width="13.2mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image MPFD Logo"/>
135
135
  </fo:block>
136
136
  <fo:block-container text-align="center">
137
- <fo:block>
137
+ <fo:block role="H1">
138
138
  <fo:inline font-size="24pt" font-weight="bold">
139
139
  <xsl:call-template name="capitalizeWords">
140
140
  <xsl:with-param name="str" select="java:replaceAll(java:java.lang.String.new(/mpfd:mpfd-standard/mpfd:bibdata/mpfd:ext/mpfd:doctype),'MPF','')"/>
@@ -181,10 +181,10 @@
181
181
  <xsl:with-param name="name" select="'title-toc'"/>
182
182
  </xsl:call-template>
183
183
  </xsl:variable>
184
- <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
185
- <fo:block line-height="115%">
184
+ <fo:block font-size="14pt" margin-bottom="15.5pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
185
+ <fo:block line-height="115%" role="TOC">
186
186
  <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
187
- <fo:block>
187
+ <fo:block role="TOCI">
188
188
  <xsl:if test="@level = 1">
189
189
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
190
190
  </xsl:if>
@@ -240,7 +240,7 @@
240
240
 
241
241
 
242
242
 
243
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt">
243
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt" role="H1">
244
244
  <xsl:value-of select="$title-en"/>
245
245
  </fo:block>
246
246
 
@@ -389,12 +389,13 @@
389
389
  </xsl:choose>
390
390
  </xsl:variable>
391
391
 
392
- <fo:block font-size="{$font-size}" color="rgb(14, 26, 133)" font-weight="bold" space-before="{$space-before}" space-after="{$space-after}" keep-with-next="always">
392
+ <fo:block font-size="{$font-size}" color="rgb(14, 26, 133)" font-weight="bold" space-before="{$space-before}" space-after="{$space-after}" keep-with-next="always" role="H{$level}">
393
393
  <xsl:if test="parent::mpfd:annex">
394
394
  <xsl:attribute name="text-align">center</xsl:attribute>
395
395
  <xsl:attribute name="font-size">12pt</xsl:attribute>
396
396
  </xsl:if>
397
397
  <xsl:apply-templates/>
398
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
398
399
  </fo:block>
399
400
 
400
401
  </xsl:template>
@@ -737,14 +738,14 @@
737
738
 
738
739
  <xsl:template name="insertHeaderFooter">
739
740
  <xsl:param name="font-weight">normal</xsl:param>
740
- <fo:static-content flow-name="header-even">
741
+ <fo:static-content flow-name="header-even" role="artifact">
741
742
  <fo:block-container height="100%" display-align="before">
742
743
  <fo:block padding-top="12.5mm">
743
744
  <xsl:value-of select="$copyrightShort"/>
744
745
  </fo:block>
745
746
  </fo:block-container>
746
747
  </fo:static-content>
747
- <fo:static-content flow-name="footer-even">
748
+ <fo:static-content flow-name="footer-even" role="artifact">
748
749
  <fo:block-container font-size="10pt" height="100%" display-align="after">
749
750
  <fo:table table-layout="fixed" width="100%">
750
751
  <fo:table-column column-width="10%"/>
@@ -762,14 +763,14 @@
762
763
  </fo:table>
763
764
  </fo:block-container>
764
765
  </fo:static-content>
765
- <fo:static-content flow-name="header-odd">
766
+ <fo:static-content flow-name="header-odd" role="artifact">
766
767
  <fo:block-container height="100%" display-align="before">
767
768
  <fo:block text-align="right" padding-top="12.5mm">
768
769
  <xsl:value-of select="$copyrightShort"/>
769
770
  </fo:block>
770
771
  </fo:block-container>
771
772
  </fo:static-content>
772
- <fo:static-content flow-name="footer-odd">
773
+ <fo:static-content flow-name="footer-odd" role="artifact">
773
774
  <fo:block-container font-size="10pt" height="100%" display-align="after">
774
775
  <fo:table table-layout="fixed" width="100%">
775
776
  <fo:table-column column-width="90%"/>
@@ -957,6 +958,7 @@
957
958
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
958
959
  <xsl:attribute name="white-space">pre</xsl:attribute>
959
960
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
961
+ <xsl:attribute name="role">Code</xsl:attribute>
960
962
 
961
963
 
962
964
 
@@ -978,8 +980,13 @@
978
980
 
979
981
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
980
982
 
981
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
982
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
983
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
984
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
985
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
986
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
987
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
988
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
989
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
983
990
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
984
991
 
985
992
 
@@ -1053,6 +1060,7 @@
1053
1060
 
1054
1061
 
1055
1062
 
1063
+
1056
1064
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1057
1065
 
1058
1066
 
@@ -1062,7 +1070,9 @@
1062
1070
 
1063
1071
 
1064
1072
 
1065
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1073
+ </xsl:attribute-set><xsl:variable name="table-border_">
1074
+
1075
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1066
1076
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1067
1077
 
1068
1078
 
@@ -1169,7 +1179,8 @@
1169
1179
 
1170
1180
 
1171
1181
 
1172
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1182
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1183
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1173
1184
 
1174
1185
 
1175
1186
 
@@ -1357,11 +1368,15 @@
1357
1368
  <fo:block>&#xA0;</fo:block>
1358
1369
  </xsl:if> -->
1359
1370
 
1371
+
1372
+ <!-- Display table's name before table as standalone block -->
1360
1373
  <!-- $namespace = 'iso' or -->
1361
1374
 
1362
1375
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1363
1376
 
1364
-
1377
+
1378
+
1379
+
1365
1380
 
1366
1381
  <xsl:call-template name="fn_name_display"/>
1367
1382
 
@@ -1436,6 +1451,12 @@
1436
1451
 
1437
1452
 
1438
1453
 
1454
+
1455
+
1456
+
1457
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1458
+
1459
+
1439
1460
  <xsl:variable name="table_width">
1440
1461
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1441
1462
  100%
@@ -1454,6 +1475,7 @@
1454
1475
 
1455
1476
 
1456
1477
 
1478
+
1457
1479
 
1458
1480
 
1459
1481
 
@@ -1480,6 +1502,8 @@
1480
1502
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1481
1503
  </xsl:if>
1482
1504
 
1505
+
1506
+
1483
1507
  <xsl:choose>
1484
1508
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1485
1509
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1767,9 +1791,9 @@
1767
1791
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1768
1792
  <xsl:with-param name="continued">true</xsl:with-param>
1769
1793
  </xsl:apply-templates>
1770
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1771
- <xsl:call-template name="fn_name_display"/>
1772
- </xsl:for-each>
1794
+
1795
+
1796
+
1773
1797
 
1774
1798
  </fo:table-cell>
1775
1799
  </fo:table-row>
@@ -1851,7 +1875,11 @@
1851
1875
 
1852
1876
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1853
1877
 
1854
- <xsl:if test="$isNoteOrFnExist = 'true'">
1878
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
1879
+
1880
+ </xsl:variable>
1881
+
1882
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
1855
1883
 
1856
1884
  <xsl:variable name="cols-count">
1857
1885
  <xsl:choose>
@@ -1880,6 +1908,8 @@
1880
1908
  </xsl:choose>
1881
1909
  </xsl:for-each>
1882
1910
 
1911
+
1912
+
1883
1913
  <xsl:choose>
1884
1914
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1885
1915
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -1916,6 +1946,7 @@
1916
1946
 
1917
1947
 
1918
1948
 
1949
+
1919
1950
  <!-- for BSI (not PAS) display Notes before footnotes -->
1920
1951
 
1921
1952
 
@@ -1989,6 +2020,19 @@
1989
2020
 
1990
2021
  </fo:table-body>
1991
2022
 
2023
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
2024
+ <xsl:choose>
2025
+ <xsl:when test="substring-after(., '—') != ''">
2026
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
2027
+ </xsl:when>
2028
+ <xsl:otherwise>
2029
+ <xsl:value-of select="."/>
2030
+ </xsl:otherwise>
2031
+ </xsl:choose>
2032
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2033
+ <xsl:apply-templates mode="presentation_name"/>
2034
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2035
+ <xsl:apply-templates select="."/>
1992
2036
  </xsl:template><xsl:template match="*[local-name()='tr']">
1993
2037
  <xsl:variable name="parent-name" select="local-name(..)"/>
1994
2038
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -2001,6 +2045,8 @@
2001
2045
 
2002
2046
 
2003
2047
 
2048
+
2049
+
2004
2050
  </xsl:if>
2005
2051
  <xsl:if test="$parent-name = 'tfoot'">
2006
2052
 
@@ -2015,6 +2061,8 @@
2015
2061
 
2016
2062
 
2017
2063
 
2064
+
2065
+
2018
2066
  <!-- <xsl:if test="$namespace = 'bipm'">
2019
2067
  <xsl:attribute name="height">8mm</xsl:attribute>
2020
2068
  </xsl:if> -->
@@ -2160,14 +2208,12 @@
2160
2208
  <xsl:apply-templates/>
2161
2209
  </xsl:template><xsl:template name="fn_display">
2162
2210
  <xsl:variable name="references">
2211
+
2163
2212
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2164
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2165
-
2166
-
2167
- <xsl:apply-templates/>
2168
- </fn>
2213
+ <xsl:call-template name="create_fn"/>
2169
2214
  </xsl:for-each>
2170
2215
  </xsl:variable>
2216
+
2171
2217
  <xsl:for-each select="xalan:nodeset($references)//fn">
2172
2218
  <xsl:variable name="reference" select="@reference"/>
2173
2219
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -2201,6 +2247,12 @@
2201
2247
  </fo:block>
2202
2248
  </xsl:if>
2203
2249
  </xsl:for-each>
2250
+ </xsl:template><xsl:template name="create_fn">
2251
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2252
+
2253
+
2254
+ <xsl:apply-templates/>
2255
+ </fn>
2204
2256
  </xsl:template><xsl:template name="fn_name_display">
2205
2257
  <!-- <xsl:variable name="references">
2206
2258
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3180,16 +3232,68 @@
3180
3232
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3181
3233
  </xsl:call-template>
3182
3234
 
3235
+
3236
+
3183
3237
  <xsl:variable name="mathml">
3184
3238
  <xsl:apply-templates select="." mode="mathml"/>
3185
3239
  </xsl:variable>
3186
3240
  <fo:instream-foreign-object fox:alt-text="Math">
3187
3241
 
3188
3242
 
3243
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3244
+ <xsl:variable name="comment_text_">
3245
+ <xsl:choose>
3246
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3247
+ <xsl:value-of select="$comment_text_following"/>
3248
+ </xsl:when>
3249
+ <xsl:otherwise>
3250
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3251
+ </xsl:otherwise>
3252
+ </xsl:choose>
3253
+ </xsl:variable>
3254
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3255
+
3256
+ <xsl:if test="normalize-space($comment_text) != ''">
3257
+ <!-- put Mathin Alternate Text -->
3258
+ <xsl:attribute name="fox:alt-text">
3259
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3260
+ </xsl:attribute>
3261
+ </xsl:if>
3262
+
3263
+ <xsl:variable name="mathml_content">
3264
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3265
+ </xsl:variable>
3266
+ <!-- put MathML in Actual Text -->
3267
+ <xsl:attribute name="fox:actual-text">
3268
+ <xsl:value-of select="$mathml_content"/>
3269
+ </xsl:attribute>
3270
+
3271
+
3189
3272
  <!-- <xsl:copy-of select="."/> -->
3190
3273
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3191
3274
  </fo:instream-foreign-object>
3192
3275
  </fo:inline>
3276
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3277
+ <!-- <xsl:text>a+b</xsl:text> -->
3278
+ <xsl:text>&lt;</xsl:text>
3279
+ <xsl:value-of select="local-name()"/>
3280
+ <xsl:if test="local-name() = 'math'">
3281
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3282
+ </xsl:if>
3283
+ <xsl:for-each select="@*">
3284
+ <xsl:text> </xsl:text>
3285
+ <xsl:value-of select="local-name()"/>
3286
+ <xsl:text>="</xsl:text>
3287
+ <xsl:value-of select="."/>
3288
+ <xsl:text>"</xsl:text>
3289
+ </xsl:for-each>
3290
+ <xsl:text>&gt;</xsl:text>
3291
+ <xsl:apply-templates mode="mathml_actual_text"/>
3292
+ <xsl:text>&lt;/</xsl:text>
3293
+ <xsl:value-of select="local-name()"/>
3294
+ <xsl:text>&gt;</xsl:text>
3295
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3296
+ <xsl:value-of select="normalize-space()"/>
3193
3297
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3194
3298
  <xsl:copy>
3195
3299
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3199,19 +3303,6 @@
3199
3303
  <!-- replace start and end spaces to non-break space -->
3200
3304
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3201
3305
  </xsl:copy>
3202
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3203
- <xsl:copy>
3204
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
3205
- </xsl:copy>
3206
- <xsl:choose>
3207
- <!-- if in msub, then don't add space -->
3208
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3209
- <!-- if next char in digit, don't add space -->
3210
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3211
- <xsl:otherwise>
3212
- <mathml:mspace width="0.5ex"/>
3213
- </xsl:otherwise>
3214
- </xsl:choose>
3215
3306
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3216
3307
  <xsl:variable name="target">
3217
3308
  <xsl:choose>
@@ -3264,7 +3355,10 @@
3264
3355
  </fo:block>
3265
3356
  <xsl:apply-templates/>
3266
3357
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3267
- <fo:inline><xsl:apply-templates/></fo:inline>
3358
+ <xsl:variable name="level">
3359
+ <xsl:call-template name="getLevel"/>
3360
+ </xsl:variable>
3361
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3268
3362
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3269
3363
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3270
3364
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3299,9 +3393,10 @@
3299
3393
 
3300
3394
  </xsl:variable>
3301
3395
 
3396
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3302
3397
  <xsl:choose>
3303
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3304
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3398
+ <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>
3399
+ <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>
3305
3400
  </xsl:choose>
3306
3401
  <xsl:apply-templates/>
3307
3402
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3445,7 +3540,10 @@
3445
3540
  </fo:block>
3446
3541
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3447
3542
  <xsl:if test="normalize-space() != ''">
3448
- <fo:inline>
3543
+ <xsl:variable name="level">
3544
+ <xsl:call-template name="getLevelTermName"/>
3545
+ </xsl:variable>
3546
+ <fo:inline role="H{$level}">
3449
3547
  <xsl:apply-templates/>
3450
3548
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3451
3549
  <xsl:text>.</xsl:text>
@@ -3518,7 +3616,24 @@
3518
3616
  </fo:instream-foreign-object>
3519
3617
  </xsl:when>
3520
3618
  <xsl:otherwise>
3521
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3619
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
3620
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
3621
+
3622
+ <xsl:variable name="img_src">
3623
+ <xsl:choose>
3624
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
3625
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
3626
+ </xsl:choose>
3627
+ </xsl:variable>
3628
+
3629
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
3630
+ <xsl:if test="number($scale) &lt; 100">
3631
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
3632
+ </xsl:if>
3633
+
3634
+ </xsl:if>
3635
+
3636
+ </fo:external-graphic>
3522
3637
  </xsl:otherwise>
3523
3638
  </xsl:choose>
3524
3639
 
@@ -3689,11 +3804,13 @@
3689
3804
  <xsl:attribute name="width">100%</xsl:attribute>
3690
3805
  <xsl:attribute name="content-height">100%</xsl:attribute>
3691
3806
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3807
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
3808
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
3692
3809
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3693
3810
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3694
3811
  <!-- effective height / width = 1.48, 1.4 - with title -->
3695
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3696
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3812
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
3813
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
3697
3814
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3698
3815
  </xsl:if>
3699
3816
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -3710,6 +3827,23 @@
3710
3827
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3711
3828
  <xsl:value-of select="."/>
3712
3829
  </xsl:attribute>
3830
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
3831
+ <xsl:copy>
3832
+ <xsl:apply-templates select="@*" mode="svg_update"/>
3833
+ <xsl:variable name="viewbox">
3834
+ <xsl:call-template name="split">
3835
+ <xsl:with-param name="pText" select="@viewBox"/>
3836
+ <xsl:with-param name="sep" select="' '"/>
3837
+ </xsl:call-template>
3838
+ </xsl:variable>
3839
+ <xsl:attribute name="width">
3840
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
3841
+ </xsl:attribute>
3842
+ <xsl:attribute name="height">
3843
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
3844
+ </xsl:attribute>
3845
+ <xsl:apply-templates mode="svg_update"/>
3846
+ </xsl:copy>
3713
3847
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3714
3848
  <xsl:variable name="svg_content" select="document(@src)"/>
3715
3849
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -4040,6 +4174,7 @@
4040
4174
  </xsl:when>
4041
4175
  <xsl:otherwise>
4042
4176
  <xsl:apply-templates/>
4177
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4043
4178
  </xsl:otherwise>
4044
4179
  </xsl:choose>
4045
4180
  </fo:block>
@@ -4180,14 +4315,6 @@
4180
4315
  <fo:block>
4181
4316
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4182
4317
  </fo:block>
4183
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4184
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4185
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4186
- </fo:block>
4187
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4188
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4189
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4190
- </fo:block>
4191
4318
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4192
4319
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4193
4320
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4204,6 +4331,38 @@
4204
4331
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4205
4332
  <xsl:apply-templates/>
4206
4333
  </fo:block>
4334
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4335
+ <fo:block xsl:use-attribute-sets="subject-style">
4336
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4337
+ </fo:block>
4338
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4339
+ <fo:block xsl:use-attribute-sets="subject-style">
4340
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4341
+ </fo:block>
4342
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4343
+ <fo:block xsl:use-attribute-sets="inherit-style">
4344
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4345
+ </fo:block>
4346
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4347
+ <fo:block xsl:use-attribute-sets="description-style">
4348
+ <xsl:apply-templates/>
4349
+ </fo:block>
4350
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4351
+ <fo:block xsl:use-attribute-sets="specification-style">
4352
+ <xsl:apply-templates/>
4353
+ </fo:block>
4354
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4355
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4356
+ <xsl:apply-templates/>
4357
+ </fo:block>
4358
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4359
+ <fo:block xsl:use-attribute-sets="verification-style">
4360
+ <xsl:apply-templates/>
4361
+ </fo:block>
4362
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4363
+ <fo:block xsl:use-attribute-sets="import-style">
4364
+ <xsl:apply-templates/>
4365
+ </fo:block>
4207
4366
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4208
4367
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4209
4368
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -4355,7 +4514,19 @@
4355
4514
  </fo:inline>
4356
4515
  </xsl:if>
4357
4516
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
4358
- <fo:inline><xsl:apply-templates/></fo:inline>
4517
+ <xsl:variable name="element">inline
4518
+
4519
+ </xsl:variable>
4520
+ <xsl:choose>
4521
+ <xsl:when test="contains($element, 'block')">
4522
+ <fo:block xsl:use-attribute-sets="example-p-style">
4523
+ <xsl:apply-templates/>
4524
+ </fo:block>
4525
+ </xsl:when>
4526
+ <xsl:otherwise>
4527
+ <fo:inline><xsl:apply-templates/></fo:inline>
4528
+ </xsl:otherwise>
4529
+ </xsl:choose>
4359
4530
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4360
4531
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4361
4532
 
@@ -4888,6 +5059,7 @@
4888
5059
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4889
5060
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4890
5061
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5062
+
4891
5063
  <xsl:apply-templates/>
4892
5064
  </fo:block>
4893
5065
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -4927,7 +5099,6 @@
4927
5099
  </xsl:template><xsl:template name="processBibitem">
4928
5100
 
4929
5101
 
4930
- <!-- end BIPM bibitem processing-->
4931
5102
 
4932
5103
 
4933
5104
 
@@ -5057,6 +5228,9 @@
5057
5228
  <fo:block-container border="1pt solid black" width="50%">
5058
5229
  <fo:block> </fo:block>
5059
5230
  </fo:block-container>
5231
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5232
+ <fo:inline padding-right="5mm"> </fo:inline>
5233
+ <fo:inline><xsl:apply-templates/></fo:inline>
5060
5234
  </xsl:template><xsl:template name="convertDate">
5061
5235
  <xsl:param name="date"/>
5062
5236
  <xsl:param name="format" select="'short'"/>
@@ -5288,6 +5462,26 @@
5288
5462
  <xsl:value-of select="$level"/>
5289
5463
  </xsl:otherwise>
5290
5464
  </xsl:choose>
5465
+ </xsl:template><xsl:template name="getLevelTermName">
5466
+ <xsl:choose>
5467
+ <xsl:when test="normalize-space(../@depth) != ''">
5468
+ <xsl:value-of select="../@depth"/>
5469
+ </xsl:when>
5470
+ <xsl:otherwise>
5471
+ <xsl:variable name="title_level_">
5472
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
5473
+ <xsl:call-template name="getLevel"/>
5474
+ </xsl:for-each>
5475
+ </xsl:variable>
5476
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
5477
+ <xsl:choose>
5478
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
5479
+ <xsl:otherwise>
5480
+ <xsl:call-template name="getLevel"/>
5481
+ </xsl:otherwise>
5482
+ </xsl:choose>
5483
+ </xsl:otherwise>
5484
+ </xsl:choose>
5291
5485
  </xsl:template><xsl:template name="split">
5292
5486
  <xsl:param name="pText" select="."/>
5293
5487
  <xsl:param name="sep" select="','"/>
@@ -5385,20 +5579,40 @@
5385
5579
  </xsl:call-template>
5386
5580
  </xsl:if>
5387
5581
  </xsl:template><xsl:template name="getLocalizedString">
5388
- <xsl:param name="key"/>
5582
+ <xsl:param name="key"/>
5583
+ <xsl:param name="formatted">false</xsl:param>
5389
5584
 
5390
5585
  <xsl:variable name="curr_lang">
5391
5586
  <xsl:call-template name="getLang"/>
5392
5587
  </xsl:variable>
5393
5588
 
5394
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5589
+ <xsl:variable name="data_value">
5590
+ <xsl:choose>
5591
+ <xsl:when test="$formatted = 'true'">
5592
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5593
+ </xsl:when>
5594
+ <xsl:otherwise>
5595
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5596
+ </xsl:otherwise>
5597
+ </xsl:choose>
5598
+ </xsl:variable>
5395
5599
 
5396
5600
  <xsl:choose>
5397
- <xsl:when test="$data_value != ''">
5398
- <xsl:value-of select="$data_value"/>
5601
+ <xsl:when test="normalize-space($data_value) != ''">
5602
+ <xsl:choose>
5603
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
5604
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
5605
+ </xsl:choose>
5399
5606
  </xsl:when>
5400
5607
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5401
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5608
+ <xsl:choose>
5609
+ <xsl:when test="$formatted = 'true'">
5610
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5611
+ </xsl:when>
5612
+ <xsl:otherwise>
5613
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5614
+ </xsl:otherwise>
5615
+ </xsl:choose>
5402
5616
  </xsl:when>
5403
5617
  <xsl:otherwise>
5404
5618
  <xsl:variable name="key_">
@@ -5409,7 +5623,7 @@
5409
5623
  <xsl:value-of select="$key_"/>
5410
5624
  </xsl:otherwise>
5411
5625
  </xsl:choose>
5412
-
5626
+
5413
5627
  </xsl:template><xsl:template name="setTrackChangesStyles">
5414
5628
  <xsl:param name="isAdded"/>
5415
5629
  <xsl:param name="isDeleted"/>