metanorma-m3aawg 1.7.7 → 1.7.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/m3aawg/isodoc.rng +52 -11
- data/lib/asciidoctor/m3aawg/reqt.rng +15 -4
- data/lib/isodoc/m3aawg/m3aawg.policy.xsl +281 -62
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +281 -62
- data/lib/metanorma/m3aawg/processor.rb +1 -2
- data/lib/metanorma/m3aawg/version.rb +1 -1
- metadata +2 -2
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
<xsl:template match="/">
|
41
41
|
<xsl:call-template name="namespaceCheck"/>
|
42
|
-
<fo:root font-family="Garamond" font-size="12pt" xml:lang="{$lang}">
|
42
|
+
<fo:root font-family="EB Garamond 12" font-size="12pt" xml:lang="{$lang}">
|
43
43
|
<fo:layout-master-set>
|
44
44
|
|
45
45
|
<!-- cover page -->
|
@@ -114,7 +114,7 @@
|
|
114
114
|
</fo:block>
|
115
115
|
</fo:block-container>
|
116
116
|
</fo:static-content>
|
117
|
-
<fo:static-content flow-name="footer">
|
117
|
+
<fo:static-content flow-name="footer" role="artifact">
|
118
118
|
<fo:block-container height="31mm" font-size="10pt">
|
119
119
|
<fo:block text-align-last="justify" margin-top="2mm">
|
120
120
|
<fo:inline font-weight="bold">
|
@@ -173,7 +173,7 @@
|
|
173
173
|
</fo:inline>
|
174
174
|
</fo:block>
|
175
175
|
|
176
|
-
<fo:block font-size="22pt" margin-bottom="12pt">
|
176
|
+
<fo:block font-size="22pt" margin-bottom="12pt" role="H1">
|
177
177
|
<xsl:value-of select="$title-en"/>
|
178
178
|
</fo:block>
|
179
179
|
<!-- Version 1.0 -->
|
@@ -225,8 +225,8 @@
|
|
225
225
|
<xsl:with-param name="name" select="'title-toc'"/>
|
226
226
|
</xsl:call-template>
|
227
227
|
</xsl:variable>
|
228
|
-
<fo:block font-size="12pt" font-weight="bold" text-decoration="underline" margin-bottom="4pt"><xsl:value-of select="$title-toc"/></fo:block>
|
229
|
-
<fo:block font-size="10pt">
|
228
|
+
<fo:block font-size="12pt" font-weight="bold" text-decoration="underline" margin-bottom="4pt" role="H1"><xsl:value-of select="$title-toc"/></fo:block>
|
229
|
+
<fo:block font-size="10pt" role="TOC">
|
230
230
|
<xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
|
231
231
|
<xsl:choose>
|
232
232
|
<xsl:when test="@section = ''">
|
@@ -235,7 +235,7 @@
|
|
235
235
|
<fo:table-body>
|
236
236
|
<fo:table-row height="6mm">
|
237
237
|
<fo:table-cell>
|
238
|
-
<fo:block text-align-last="justify">
|
238
|
+
<fo:block text-align-last="justify" role="TOCI">
|
239
239
|
<xsl:if test="@level = 1">
|
240
240
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
241
241
|
</xsl:if>
|
@@ -261,7 +261,7 @@
|
|
261
261
|
<fo:table-body>
|
262
262
|
<fo:table-row height="6mm">
|
263
263
|
<fo:table-cell>
|
264
|
-
<fo:block font-weight="bold">
|
264
|
+
<fo:block font-weight="bold" role="TOCI">
|
265
265
|
<fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
|
266
266
|
<xsl:choose>
|
267
267
|
<!-- <xsl:when test="@section = ''">
|
@@ -279,7 +279,7 @@
|
|
279
279
|
</fo:block>
|
280
280
|
</fo:table-cell>
|
281
281
|
<fo:table-cell>
|
282
|
-
<fo:block text-align-last="justify">
|
282
|
+
<fo:block text-align-last="justify" role="TOCI">
|
283
283
|
<xsl:if test="@level = 1">
|
284
284
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
285
285
|
</xsl:if>
|
@@ -447,7 +447,10 @@
|
|
447
447
|
<!-- ====== -->
|
448
448
|
|
449
449
|
<xsl:template match="m3d:boilerplate//m3d:title">
|
450
|
-
<
|
450
|
+
<xsl:variable name="level">
|
451
|
+
<xsl:call-template name="getLevel"/>
|
452
|
+
</xsl:variable>
|
453
|
+
<fo:block font-size="14pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="15.5pt" keep-with-next="always" role="H{$level}">
|
451
454
|
<xsl:apply-templates/>
|
452
455
|
</fo:block>
|
453
456
|
</xsl:template>
|
@@ -463,8 +466,9 @@
|
|
463
466
|
<xsl:otherwise>12pt</xsl:otherwise>
|
464
467
|
</xsl:choose>
|
465
468
|
</xsl:variable>
|
466
|
-
<fo:block font-size="{$font-size}" text-align="center" margin-bottom="24pt" keep-with-next="always">
|
469
|
+
<fo:block font-size="{$font-size}" text-align="center" margin-bottom="24pt" keep-with-next="always" role="H1">
|
467
470
|
<xsl:apply-templates/>
|
471
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
468
472
|
</fo:block>
|
469
473
|
</xsl:template>
|
470
474
|
|
@@ -511,8 +515,10 @@
|
|
511
515
|
</xsl:choose>
|
512
516
|
</xsl:attribute>
|
513
517
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
518
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
514
519
|
|
515
520
|
<xsl:apply-templates/>
|
521
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
516
522
|
|
517
523
|
</xsl:element>
|
518
524
|
|
@@ -1066,13 +1072,14 @@
|
|
1066
1072
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
|
1067
1073
|
<xsl:attribute name="white-space">pre</xsl:attribute>
|
1068
1074
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
1075
|
+
<xsl:attribute name="role">Code</xsl:attribute>
|
1069
1076
|
|
1070
1077
|
|
1071
1078
|
|
1072
1079
|
|
1073
1080
|
|
1074
1081
|
|
1075
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
1082
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
1076
1083
|
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1077
1084
|
|
1078
1085
|
|
@@ -1090,8 +1097,13 @@
|
|
1090
1097
|
|
1091
1098
|
</xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
|
1092
1099
|
|
1093
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
1094
|
-
</xsl:attribute-set><xsl:attribute-set name="
|
1100
|
+
</xsl:attribute-set><xsl:attribute-set name="subject-style">
|
1101
|
+
</xsl:attribute-set><xsl:attribute-set name="inherit-style">
|
1102
|
+
</xsl:attribute-set><xsl:attribute-set name="description-style">
|
1103
|
+
</xsl:attribute-set><xsl:attribute-set name="specification-style">
|
1104
|
+
</xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
|
1105
|
+
</xsl:attribute-set><xsl:attribute-set name="verification-style">
|
1106
|
+
</xsl:attribute-set><xsl:attribute-set name="import-style">
|
1095
1107
|
</xsl:attribute-set><xsl:attribute-set name="recommendation-style">
|
1096
1108
|
|
1097
1109
|
|
@@ -1160,6 +1172,7 @@
|
|
1160
1172
|
|
1161
1173
|
|
1162
1174
|
|
1175
|
+
|
1163
1176
|
<xsl:attribute name="margin-top">8pt</xsl:attribute>
|
1164
1177
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
1165
1178
|
|
@@ -1179,7 +1192,9 @@
|
|
1179
1192
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1180
1193
|
|
1181
1194
|
|
1182
|
-
</xsl:attribute-set><xsl:
|
1195
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
1196
|
+
|
1197
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
1183
1198
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1184
1199
|
|
1185
1200
|
|
@@ -1300,7 +1315,8 @@
|
|
1300
1315
|
|
1301
1316
|
|
1302
1317
|
|
1303
|
-
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1318
|
+
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1319
|
+
<xsl:attribute name="role">BlockQuote</xsl:attribute>
|
1304
1320
|
|
1305
1321
|
|
1306
1322
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -1386,7 +1402,7 @@
|
|
1386
1402
|
</xsl:attribute-set><xsl:attribute-set name="tt-style">
|
1387
1403
|
|
1388
1404
|
|
1389
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
1405
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
1390
1406
|
|
1391
1407
|
|
1392
1408
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
|
@@ -1494,11 +1510,15 @@
|
|
1494
1510
|
<fo:block> </fo:block>
|
1495
1511
|
</xsl:if> -->
|
1496
1512
|
|
1513
|
+
|
1514
|
+
<!-- Display table's name before table as standalone block -->
|
1497
1515
|
<!-- $namespace = 'iso' or -->
|
1498
1516
|
|
1499
1517
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1500
1518
|
|
1501
|
-
|
1519
|
+
|
1520
|
+
|
1521
|
+
|
1502
1522
|
|
1503
1523
|
<xsl:call-template name="fn_name_display"/>
|
1504
1524
|
|
@@ -1569,6 +1589,12 @@
|
|
1569
1589
|
|
1570
1590
|
|
1571
1591
|
|
1592
|
+
|
1593
|
+
|
1594
|
+
|
1595
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
1596
|
+
|
1597
|
+
|
1572
1598
|
<xsl:variable name="table_width">
|
1573
1599
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1574
1600
|
100%
|
@@ -1587,6 +1613,7 @@
|
|
1587
1613
|
|
1588
1614
|
|
1589
1615
|
|
1616
|
+
|
1590
1617
|
|
1591
1618
|
|
1592
1619
|
|
@@ -1610,6 +1637,8 @@
|
|
1610
1637
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1611
1638
|
</xsl:if>
|
1612
1639
|
|
1640
|
+
|
1641
|
+
|
1613
1642
|
<xsl:choose>
|
1614
1643
|
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1615
1644
|
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
@@ -1897,9 +1926,9 @@
|
|
1897
1926
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
1898
1927
|
<xsl:with-param name="continued">true</xsl:with-param>
|
1899
1928
|
</xsl:apply-templates>
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1929
|
+
|
1930
|
+
|
1931
|
+
|
1903
1932
|
|
1904
1933
|
</fo:table-cell>
|
1905
1934
|
</fo:table-row>
|
@@ -1981,7 +2010,11 @@
|
|
1981
2010
|
|
1982
2011
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1983
2012
|
|
1984
|
-
<xsl:
|
2013
|
+
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
2014
|
+
|
2015
|
+
</xsl:variable>
|
2016
|
+
|
2017
|
+
<xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
|
1985
2018
|
|
1986
2019
|
<xsl:variable name="cols-count">
|
1987
2020
|
<xsl:choose>
|
@@ -2010,6 +2043,8 @@
|
|
2010
2043
|
</xsl:choose>
|
2011
2044
|
</xsl:for-each>
|
2012
2045
|
|
2046
|
+
|
2047
|
+
|
2013
2048
|
<xsl:choose>
|
2014
2049
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2015
2050
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -2046,6 +2081,7 @@
|
|
2046
2081
|
|
2047
2082
|
|
2048
2083
|
|
2084
|
+
|
2049
2085
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
2050
2086
|
|
2051
2087
|
|
@@ -2119,6 +2155,19 @@
|
|
2119
2155
|
|
2120
2156
|
</fo:table-body>
|
2121
2157
|
|
2158
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
|
2159
|
+
<xsl:choose>
|
2160
|
+
<xsl:when test="substring-after(., '—') != ''">
|
2161
|
+
<xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
|
2162
|
+
</xsl:when>
|
2163
|
+
<xsl:otherwise>
|
2164
|
+
<xsl:value-of select="."/>
|
2165
|
+
</xsl:otherwise>
|
2166
|
+
</xsl:choose>
|
2167
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
|
2168
|
+
<xsl:apply-templates mode="presentation_name"/>
|
2169
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
|
2170
|
+
<xsl:apply-templates select="."/>
|
2122
2171
|
</xsl:template><xsl:template match="*[local-name()='tr']">
|
2123
2172
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
2124
2173
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
@@ -2131,6 +2180,8 @@
|
|
2131
2180
|
|
2132
2181
|
|
2133
2182
|
|
2183
|
+
|
2184
|
+
|
2134
2185
|
</xsl:if>
|
2135
2186
|
<xsl:if test="$parent-name = 'tfoot'">
|
2136
2187
|
|
@@ -2145,6 +2196,8 @@
|
|
2145
2196
|
|
2146
2197
|
|
2147
2198
|
|
2199
|
+
|
2200
|
+
|
2148
2201
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2149
2202
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2150
2203
|
</xsl:if> -->
|
@@ -2287,14 +2340,12 @@
|
|
2287
2340
|
<xsl:apply-templates/>
|
2288
2341
|
</xsl:template><xsl:template name="fn_display">
|
2289
2342
|
<xsl:variable name="references">
|
2343
|
+
|
2290
2344
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
2291
|
-
<
|
2292
|
-
|
2293
|
-
|
2294
|
-
<xsl:apply-templates/>
|
2295
|
-
</fn>
|
2345
|
+
<xsl:call-template name="create_fn"/>
|
2296
2346
|
</xsl:for-each>
|
2297
2347
|
</xsl:variable>
|
2348
|
+
|
2298
2349
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
2299
2350
|
<xsl:variable name="reference" select="@reference"/>
|
2300
2351
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
@@ -2330,6 +2381,12 @@
|
|
2330
2381
|
</fo:block>
|
2331
2382
|
</xsl:if>
|
2332
2383
|
</xsl:for-each>
|
2384
|
+
</xsl:template><xsl:template name="create_fn">
|
2385
|
+
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
2386
|
+
|
2387
|
+
|
2388
|
+
<xsl:apply-templates/>
|
2389
|
+
</fn>
|
2333
2390
|
</xsl:template><xsl:template name="fn_name_display">
|
2334
2391
|
<!-- <xsl:variable name="references">
|
2335
2392
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
@@ -3314,16 +3371,68 @@
|
|
3314
3371
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3315
3372
|
</xsl:call-template>
|
3316
3373
|
|
3374
|
+
|
3375
|
+
|
3317
3376
|
<xsl:variable name="mathml">
|
3318
3377
|
<xsl:apply-templates select="." mode="mathml"/>
|
3319
3378
|
</xsl:variable>
|
3320
3379
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3321
3380
|
|
3322
3381
|
|
3382
|
+
<xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
|
3383
|
+
<xsl:variable name="comment_text_">
|
3384
|
+
<xsl:choose>
|
3385
|
+
<xsl:when test="normalize-space($comment_text_following) != ''">
|
3386
|
+
<xsl:value-of select="$comment_text_following"/>
|
3387
|
+
</xsl:when>
|
3388
|
+
<xsl:otherwise>
|
3389
|
+
<xsl:value-of select="normalize-space(translate(.,' ',' '))"/>
|
3390
|
+
</xsl:otherwise>
|
3391
|
+
</xsl:choose>
|
3392
|
+
</xsl:variable>
|
3393
|
+
<xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
|
3394
|
+
|
3395
|
+
<xsl:if test="normalize-space($comment_text) != ''">
|
3396
|
+
<!-- put Mathin Alternate Text -->
|
3397
|
+
<xsl:attribute name="fox:alt-text">
|
3398
|
+
<xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
|
3399
|
+
</xsl:attribute>
|
3400
|
+
</xsl:if>
|
3401
|
+
|
3402
|
+
<xsl:variable name="mathml_content">
|
3403
|
+
<xsl:apply-templates select="." mode="mathml_actual_text"/>
|
3404
|
+
</xsl:variable>
|
3405
|
+
<!-- put MathML in Actual Text -->
|
3406
|
+
<xsl:attribute name="fox:actual-text">
|
3407
|
+
<xsl:value-of select="$mathml_content"/>
|
3408
|
+
</xsl:attribute>
|
3409
|
+
|
3410
|
+
|
3323
3411
|
<!-- <xsl:copy-of select="."/> -->
|
3324
3412
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3325
3413
|
</fo:instream-foreign-object>
|
3326
3414
|
</fo:inline>
|
3415
|
+
</xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
|
3416
|
+
<!-- <xsl:text>a+b</xsl:text> -->
|
3417
|
+
<xsl:text><</xsl:text>
|
3418
|
+
<xsl:value-of select="local-name()"/>
|
3419
|
+
<xsl:if test="local-name() = 'math'">
|
3420
|
+
<xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
|
3421
|
+
</xsl:if>
|
3422
|
+
<xsl:for-each select="@*">
|
3423
|
+
<xsl:text> </xsl:text>
|
3424
|
+
<xsl:value-of select="local-name()"/>
|
3425
|
+
<xsl:text>="</xsl:text>
|
3426
|
+
<xsl:value-of select="."/>
|
3427
|
+
<xsl:text>"</xsl:text>
|
3428
|
+
</xsl:for-each>
|
3429
|
+
<xsl:text>></xsl:text>
|
3430
|
+
<xsl:apply-templates mode="mathml_actual_text"/>
|
3431
|
+
<xsl:text></</xsl:text>
|
3432
|
+
<xsl:value-of select="local-name()"/>
|
3433
|
+
<xsl:text>></xsl:text>
|
3434
|
+
</xsl:template><xsl:template match="text()" mode="mathml_actual_text">
|
3435
|
+
<xsl:value-of select="normalize-space()"/>
|
3327
3436
|
</xsl:template><xsl:template match="@*|node()" mode="mathml">
|
3328
3437
|
<xsl:copy>
|
3329
3438
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
@@ -3333,19 +3442,6 @@
|
|
3333
3442
|
<!-- replace start and end spaces to non-break space -->
|
3334
3443
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
3335
3444
|
</xsl:copy>
|
3336
|
-
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3337
|
-
<xsl:copy>
|
3338
|
-
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3339
|
-
</xsl:copy>
|
3340
|
-
<xsl:choose>
|
3341
|
-
<!-- if in msub, then don't add space -->
|
3342
|
-
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
3343
|
-
<!-- if next char in digit, don't add space -->
|
3344
|
-
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
3345
|
-
<xsl:otherwise>
|
3346
|
-
<mathml:mspace width="0.5ex"/>
|
3347
|
-
</xsl:otherwise>
|
3348
|
-
</xsl:choose>
|
3349
3445
|
</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">
|
3350
3446
|
<xsl:variable name="target">
|
3351
3447
|
<xsl:choose>
|
@@ -3398,7 +3494,10 @@
|
|
3398
3494
|
</fo:block>
|
3399
3495
|
<xsl:apply-templates/>
|
3400
3496
|
</xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
|
3401
|
-
<
|
3497
|
+
<xsl:variable name="level">
|
3498
|
+
<xsl:call-template name="getLevel"/>
|
3499
|
+
</xsl:variable>
|
3500
|
+
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
3402
3501
|
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
3403
3502
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
3404
3503
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -3433,9 +3532,10 @@
|
|
3433
3532
|
|
3434
3533
|
</xsl:variable>
|
3435
3534
|
|
3535
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3436
3536
|
<xsl:choose>
|
3437
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
3438
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
3537
|
+
<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>
|
3538
|
+
<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>
|
3439
3539
|
</xsl:choose>
|
3440
3540
|
<xsl:apply-templates/>
|
3441
3541
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
@@ -3585,7 +3685,10 @@
|
|
3585
3685
|
</fo:block>
|
3586
3686
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
3587
3687
|
<xsl:if test="normalize-space() != ''">
|
3588
|
-
<
|
3688
|
+
<xsl:variable name="level">
|
3689
|
+
<xsl:call-template name="getLevelTermName"/>
|
3690
|
+
</xsl:variable>
|
3691
|
+
<fo:inline role="H{$level}">
|
3589
3692
|
<xsl:apply-templates/>
|
3590
3693
|
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
|
3591
3694
|
<xsl:text>.</xsl:text>
|
@@ -3658,7 +3761,24 @@
|
|
3658
3761
|
</fo:instream-foreign-object>
|
3659
3762
|
</xsl:when>
|
3660
3763
|
<xsl:otherwise>
|
3661
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
3764
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
3765
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
3766
|
+
|
3767
|
+
<xsl:variable name="img_src">
|
3768
|
+
<xsl:choose>
|
3769
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
3770
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
3771
|
+
</xsl:choose>
|
3772
|
+
</xsl:variable>
|
3773
|
+
|
3774
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
3775
|
+
<xsl:if test="number($scale) < 100">
|
3776
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
3777
|
+
</xsl:if>
|
3778
|
+
|
3779
|
+
</xsl:if>
|
3780
|
+
|
3781
|
+
</fo:external-graphic>
|
3662
3782
|
</xsl:otherwise>
|
3663
3783
|
</xsl:choose>
|
3664
3784
|
|
@@ -3829,11 +3949,13 @@
|
|
3829
3949
|
<xsl:attribute name="width">100%</xsl:attribute>
|
3830
3950
|
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3831
3951
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3952
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
3953
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
3832
3954
|
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
3833
3955
|
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
3834
3956
|
<!-- effective height / width = 1.48, 1.4 - with title -->
|
3835
|
-
<xsl:if test="
|
3836
|
-
<xsl:variable name="width" select="((
|
3957
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
3958
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
3837
3959
|
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
3838
3960
|
</xsl:if>
|
3839
3961
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
@@ -3850,6 +3972,23 @@
|
|
3850
3972
|
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
3851
3973
|
<xsl:value-of select="."/>
|
3852
3974
|
</xsl:attribute>
|
3975
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
3976
|
+
<xsl:copy>
|
3977
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
3978
|
+
<xsl:variable name="viewbox">
|
3979
|
+
<xsl:call-template name="split">
|
3980
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
3981
|
+
<xsl:with-param name="sep" select="' '"/>
|
3982
|
+
</xsl:call-template>
|
3983
|
+
</xsl:variable>
|
3984
|
+
<xsl:attribute name="width">
|
3985
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
3986
|
+
</xsl:attribute>
|
3987
|
+
<xsl:attribute name="height">
|
3988
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
3989
|
+
</xsl:attribute>
|
3990
|
+
<xsl:apply-templates mode="svg_update"/>
|
3991
|
+
</xsl:copy>
|
3853
3992
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
3854
3993
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
3855
3994
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -4180,6 +4319,7 @@
|
|
4180
4319
|
</xsl:when>
|
4181
4320
|
<xsl:otherwise>
|
4182
4321
|
<xsl:apply-templates/>
|
4322
|
+
<xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
|
4183
4323
|
</xsl:otherwise>
|
4184
4324
|
</xsl:choose>
|
4185
4325
|
</fo:block>
|
@@ -4320,14 +4460,6 @@
|
|
4320
4460
|
<fo:block>
|
4321
4461
|
<fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
|
4322
4462
|
</fo:block>
|
4323
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
4324
|
-
<fo:block xsl:use-attribute-sets="requirement-subject-style">
|
4325
|
-
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
4326
|
-
</fo:block>
|
4327
|
-
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
|
4328
|
-
<fo:block xsl:use-attribute-sets="requirement-inherit-style">
|
4329
|
-
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
4330
|
-
</fo:block>
|
4331
4463
|
</xsl:template><xsl:template match="*[local-name() = 'recommendation']">
|
4332
4464
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
4333
4465
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -4344,6 +4476,38 @@
|
|
4344
4476
|
<fo:block xsl:use-attribute-sets="recommendation-label-style">
|
4345
4477
|
<xsl:apply-templates/>
|
4346
4478
|
</fo:block>
|
4479
|
+
</xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
|
4480
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
4481
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
4482
|
+
</fo:block>
|
4483
|
+
</xsl:template><xsl:template match="*[local-name() = 'subject']">
|
4484
|
+
<fo:block xsl:use-attribute-sets="subject-style">
|
4485
|
+
<xsl:text>Target Type </xsl:text><xsl:apply-templates/>
|
4486
|
+
</fo:block>
|
4487
|
+
</xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
|
4488
|
+
<fo:block xsl:use-attribute-sets="inherit-style">
|
4489
|
+
<xsl:text>Dependency </xsl:text><xsl:apply-templates/>
|
4490
|
+
</fo:block>
|
4491
|
+
</xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
|
4492
|
+
<fo:block xsl:use-attribute-sets="description-style">
|
4493
|
+
<xsl:apply-templates/>
|
4494
|
+
</fo:block>
|
4495
|
+
</xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
|
4496
|
+
<fo:block xsl:use-attribute-sets="specification-style">
|
4497
|
+
<xsl:apply-templates/>
|
4498
|
+
</fo:block>
|
4499
|
+
</xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
|
4500
|
+
<fo:block xsl:use-attribute-sets="measurement-target-style">
|
4501
|
+
<xsl:apply-templates/>
|
4502
|
+
</fo:block>
|
4503
|
+
</xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
|
4504
|
+
<fo:block xsl:use-attribute-sets="verification-style">
|
4505
|
+
<xsl:apply-templates/>
|
4506
|
+
</fo:block>
|
4507
|
+
</xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
|
4508
|
+
<fo:block xsl:use-attribute-sets="import-style">
|
4509
|
+
<xsl:apply-templates/>
|
4510
|
+
</fo:block>
|
4347
4511
|
</xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
4348
4512
|
<fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
|
4349
4513
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -4495,7 +4659,19 @@
|
|
4495
4659
|
</fo:inline>
|
4496
4660
|
</xsl:if>
|
4497
4661
|
</xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
|
4498
|
-
<
|
4662
|
+
<xsl:variable name="element">inline
|
4663
|
+
|
4664
|
+
</xsl:variable>
|
4665
|
+
<xsl:choose>
|
4666
|
+
<xsl:when test="contains($element, 'block')">
|
4667
|
+
<fo:block xsl:use-attribute-sets="example-p-style">
|
4668
|
+
<xsl:apply-templates/>
|
4669
|
+
</fo:block>
|
4670
|
+
</xsl:when>
|
4671
|
+
<xsl:otherwise>
|
4672
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4673
|
+
</xsl:otherwise>
|
4674
|
+
</xsl:choose>
|
4499
4675
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
4500
4676
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
4501
4677
|
|
@@ -5029,6 +5205,7 @@
|
|
5029
5205
|
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
5030
5206
|
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
5031
5207
|
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
5208
|
+
|
5032
5209
|
<xsl:apply-templates/>
|
5033
5210
|
</fo:block>
|
5034
5211
|
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
@@ -5068,7 +5245,6 @@
|
|
5068
5245
|
</xsl:template><xsl:template name="processBibitem">
|
5069
5246
|
|
5070
5247
|
|
5071
|
-
<!-- end BIPM bibitem processing-->
|
5072
5248
|
|
5073
5249
|
|
5074
5250
|
|
@@ -5198,6 +5374,9 @@
|
|
5198
5374
|
<fo:block-container border="1pt solid black" width="50%">
|
5199
5375
|
<fo:block> </fo:block>
|
5200
5376
|
</fo:block-container>
|
5377
|
+
</xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
|
5378
|
+
<fo:inline padding-right="5mm"> </fo:inline>
|
5379
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
5201
5380
|
</xsl:template><xsl:template name="convertDate">
|
5202
5381
|
<xsl:param name="date"/>
|
5203
5382
|
<xsl:param name="format" select="'short'"/>
|
@@ -5436,6 +5615,26 @@
|
|
5436
5615
|
<xsl:value-of select="$level"/>
|
5437
5616
|
</xsl:otherwise>
|
5438
5617
|
</xsl:choose>
|
5618
|
+
</xsl:template><xsl:template name="getLevelTermName">
|
5619
|
+
<xsl:choose>
|
5620
|
+
<xsl:when test="normalize-space(../@depth) != ''">
|
5621
|
+
<xsl:value-of select="../@depth"/>
|
5622
|
+
</xsl:when>
|
5623
|
+
<xsl:otherwise>
|
5624
|
+
<xsl:variable name="title_level_">
|
5625
|
+
<xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
|
5626
|
+
<xsl:call-template name="getLevel"/>
|
5627
|
+
</xsl:for-each>
|
5628
|
+
</xsl:variable>
|
5629
|
+
<xsl:variable name="title_level" select="normalize-space($title_level_)"/>
|
5630
|
+
<xsl:choose>
|
5631
|
+
<xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
|
5632
|
+
<xsl:otherwise>
|
5633
|
+
<xsl:call-template name="getLevel"/>
|
5634
|
+
</xsl:otherwise>
|
5635
|
+
</xsl:choose>
|
5636
|
+
</xsl:otherwise>
|
5637
|
+
</xsl:choose>
|
5439
5638
|
</xsl:template><xsl:template name="split">
|
5440
5639
|
<xsl:param name="pText" select="."/>
|
5441
5640
|
<xsl:param name="sep" select="','"/>
|
@@ -5533,20 +5732,40 @@
|
|
5533
5732
|
</xsl:call-template>
|
5534
5733
|
</xsl:if>
|
5535
5734
|
</xsl:template><xsl:template name="getLocalizedString">
|
5536
|
-
<xsl:param name="key"/>
|
5735
|
+
<xsl:param name="key"/>
|
5736
|
+
<xsl:param name="formatted">false</xsl:param>
|
5537
5737
|
|
5538
5738
|
<xsl:variable name="curr_lang">
|
5539
5739
|
<xsl:call-template name="getLang"/>
|
5540
5740
|
</xsl:variable>
|
5541
5741
|
|
5542
|
-
<xsl:variable name="data_value"
|
5742
|
+
<xsl:variable name="data_value">
|
5743
|
+
<xsl:choose>
|
5744
|
+
<xsl:when test="$formatted = 'true'">
|
5745
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5746
|
+
</xsl:when>
|
5747
|
+
<xsl:otherwise>
|
5748
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5749
|
+
</xsl:otherwise>
|
5750
|
+
</xsl:choose>
|
5751
|
+
</xsl:variable>
|
5543
5752
|
|
5544
5753
|
<xsl:choose>
|
5545
|
-
<xsl:when test="$data_value != ''">
|
5546
|
-
<xsl:
|
5754
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
5755
|
+
<xsl:choose>
|
5756
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
5757
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
5758
|
+
</xsl:choose>
|
5547
5759
|
</xsl:when>
|
5548
5760
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5549
|
-
<xsl:
|
5761
|
+
<xsl:choose>
|
5762
|
+
<xsl:when test="$formatted = 'true'">
|
5763
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5764
|
+
</xsl:when>
|
5765
|
+
<xsl:otherwise>
|
5766
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5767
|
+
</xsl:otherwise>
|
5768
|
+
</xsl:choose>
|
5550
5769
|
</xsl:when>
|
5551
5770
|
<xsl:otherwise>
|
5552
5771
|
<xsl:variable name="key_">
|
@@ -5557,7 +5776,7 @@
|
|
5557
5776
|
<xsl:value-of select="$key_"/>
|
5558
5777
|
</xsl:otherwise>
|
5559
5778
|
</xsl:choose>
|
5560
|
-
|
5779
|
+
|
5561
5780
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5562
5781
|
<xsl:param name="isAdded"/>
|
5563
5782
|
<xsl:param name="isDeleted"/>
|