metanorma-ogc 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 390c8c2832913f515a1abb08358f4b5bb91ff39e507cffee4ee0539f481f69cd
4
- data.tar.gz: dfb5bc1463751a80084b5ea31de579f3021b2b12ff638e56356cfdab49f8544c
3
+ metadata.gz: e1cf7a554aa5d0925f31dadc79986085ae51643cdcc2e3367087da1b2dc9e99b
4
+ data.tar.gz: 95a95b35de2d3f9613779bcef6a32b3a21ecfd7b4df77c3411b9da2755369a35
5
5
  SHA512:
6
- metadata.gz: c7adb184dd688ab8cb4b7ff196c899468928d4c805791313ac74da37e36a781f02df71af3a22fdea2c484c39fc9dc89aa01040737e07df618e0fce677b298c88
7
- data.tar.gz: 61c90e5a53d7e09c04593c0a435d4860f55a5823d896b98d9c216c4a38147cd113330e90c83c242b45bca4b8abdb811a884325d484227c7e3ca2bcae6f4a170a
6
+ metadata.gz: 4b11e5d10627ebd1946e97cdd36ac9c32018033d3044242437149212d9ff6f182ba8c5e1fd9fda1a8fbb66629e36f2de8c40e20ed3022e33aa55a3850dc27141
7
+ data.tar.gz: b362a4c65d8c69d3ab99251c9067d6c5a3225e1d391c05953eab122ce5b0a154c17c6d4ac25c5933d12f7542a2c57d42120e8e9eb9561f5b959ded3c2128ddb4
@@ -1011,8 +1011,14 @@
1011
1011
  <ref name="imagemap"/>
1012
1012
  <ref name="svgmap"/>
1013
1013
  <ref name="inputform"/>
1014
+ <ref name="toc"/>
1014
1015
  </choice>
1015
1016
  </define>
1017
+ <define name="toc">
1018
+ <element name="toc">
1019
+ <ref name="ul"/>
1020
+ </element>
1021
+ </define>
1016
1022
  <define name="inputform">
1017
1023
  <element name="form">
1018
1024
  <attribute name="id">
@@ -1254,6 +1260,12 @@
1254
1260
  <optional>
1255
1261
  <attribute name="type"/>
1256
1262
  </optional>
1263
+ <optional>
1264
+ <attribute name="identifier"/>
1265
+ </optional>
1266
+ <optional>
1267
+ <attribute name="prefix"/>
1268
+ </optional>
1257
1269
  <text/>
1258
1270
  </define>
1259
1271
  <define name="ics">
@@ -1790,7 +1790,9 @@
1790
1790
 
1791
1791
 
1792
1792
 
1793
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1793
+ </xsl:attribute-set><xsl:variable name="table-border_">
1794
+
1795
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1794
1796
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1795
1797
 
1796
1798
 
@@ -2120,6 +2122,8 @@
2120
2122
  <fo:block>&#xA0;</fo:block>
2121
2123
  </xsl:if> -->
2122
2124
 
2125
+
2126
+ <!-- Display table's name before table as standalone block -->
2123
2127
  <!-- $namespace = 'iso' or -->
2124
2128
 
2125
2129
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2203,6 +2207,12 @@
2203
2207
 
2204
2208
 
2205
2209
 
2210
+
2211
+
2212
+
2213
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2214
+
2215
+
2206
2216
  <xsl:variable name="table_width">
2207
2217
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2208
2218
 
@@ -2227,6 +2237,7 @@
2227
2237
 
2228
2238
 
2229
2239
 
2240
+
2230
2241
  <attribute name="margin-left">0mm</attribute>
2231
2242
  <attribute name="margin-right">0mm</attribute>
2232
2243
 
@@ -2651,6 +2662,8 @@
2651
2662
  </xsl:choose>
2652
2663
  </xsl:for-each>
2653
2664
 
2665
+
2666
+
2654
2667
  <xsl:choose>
2655
2668
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2656
2669
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -2689,6 +2702,7 @@
2689
2702
 
2690
2703
 
2691
2704
 
2705
+
2692
2706
  <!-- for BSI (not PAS) display Notes before footnotes -->
2693
2707
 
2694
2708
 
@@ -2774,6 +2788,8 @@
2774
2788
 
2775
2789
 
2776
2790
 
2791
+
2792
+
2777
2793
  </xsl:if>
2778
2794
  <xsl:if test="$parent-name = 'tfoot'">
2779
2795
 
@@ -2800,6 +2816,8 @@
2800
2816
 
2801
2817
 
2802
2818
 
2819
+
2820
+
2803
2821
  <!-- <xsl:if test="$namespace = 'bipm'">
2804
2822
  <xsl:attribute name="height">8mm</xsl:attribute>
2805
2823
  </xsl:if> -->
@@ -4332,7 +4350,24 @@
4332
4350
  </fo:instream-foreign-object>
4333
4351
  </xsl:when>
4334
4352
  <xsl:otherwise>
4335
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4353
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
4354
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
4355
+
4356
+ <xsl:variable name="img_src">
4357
+ <xsl:choose>
4358
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
4359
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
4360
+ </xsl:choose>
4361
+ </xsl:variable>
4362
+
4363
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
4364
+ <xsl:if test="number($scale) &lt; 100">
4365
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
4366
+ </xsl:if>
4367
+
4368
+ </xsl:if>
4369
+
4370
+ </fo:external-graphic>
4336
4371
  </xsl:otherwise>
4337
4372
  </xsl:choose>
4338
4373
 
@@ -4503,11 +4538,13 @@
4503
4538
  <xsl:attribute name="width">100%</xsl:attribute>
4504
4539
  <xsl:attribute name="content-height">100%</xsl:attribute>
4505
4540
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4541
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
4542
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
4506
4543
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4507
4544
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4508
4545
  <!-- effective height / width = 1.48, 1.4 - with title -->
4509
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
4510
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
4546
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
4547
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
4511
4548
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4512
4549
  </xsl:if>
4513
4550
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -4524,6 +4561,23 @@
4524
4561
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4525
4562
  <xsl:value-of select="."/>
4526
4563
  </xsl:attribute>
4564
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
4565
+ <xsl:copy>
4566
+ <xsl:apply-templates select="@*" mode="svg_update"/>
4567
+ <xsl:variable name="viewbox">
4568
+ <xsl:call-template name="split">
4569
+ <xsl:with-param name="pText" select="@viewBox"/>
4570
+ <xsl:with-param name="sep" select="' '"/>
4571
+ </xsl:call-template>
4572
+ </xsl:variable>
4573
+ <xsl:attribute name="width">
4574
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
4575
+ </xsl:attribute>
4576
+ <xsl:attribute name="height">
4577
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
4578
+ </xsl:attribute>
4579
+ <xsl:apply-templates mode="svg_update"/>
4580
+ </xsl:copy>
4527
4581
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4528
4582
  <xsl:variable name="svg_content" select="document(@src)"/>
4529
4583
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -6410,20 +6464,40 @@
6410
6464
  </xsl:call-template>
6411
6465
  </xsl:if>
6412
6466
  </xsl:template><xsl:template name="getLocalizedString">
6413
- <xsl:param name="key"/>
6467
+ <xsl:param name="key"/>
6468
+ <xsl:param name="formatted">false</xsl:param>
6414
6469
 
6415
6470
  <xsl:variable name="curr_lang">
6416
6471
  <xsl:call-template name="getLang"/>
6417
6472
  </xsl:variable>
6418
6473
 
6419
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6474
+ <xsl:variable name="data_value">
6475
+ <xsl:choose>
6476
+ <xsl:when test="$formatted = 'true'">
6477
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6478
+ </xsl:when>
6479
+ <xsl:otherwise>
6480
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6481
+ </xsl:otherwise>
6482
+ </xsl:choose>
6483
+ </xsl:variable>
6420
6484
 
6421
6485
  <xsl:choose>
6422
- <xsl:when test="$data_value != ''">
6423
- <xsl:value-of select="$data_value"/>
6486
+ <xsl:when test="normalize-space($data_value) != ''">
6487
+ <xsl:choose>
6488
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
6489
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
6490
+ </xsl:choose>
6424
6491
  </xsl:when>
6425
6492
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6426
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6493
+ <xsl:choose>
6494
+ <xsl:when test="$formatted = 'true'">
6495
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6496
+ </xsl:when>
6497
+ <xsl:otherwise>
6498
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6499
+ </xsl:otherwise>
6500
+ </xsl:choose>
6427
6501
  </xsl:when>
6428
6502
  <xsl:otherwise>
6429
6503
  <xsl:variable name="key_">
@@ -6434,7 +6508,7 @@
6434
6508
  <xsl:value-of select="$key_"/>
6435
6509
  </xsl:otherwise>
6436
6510
  </xsl:choose>
6437
-
6511
+
6438
6512
  </xsl:template><xsl:template name="setTrackChangesStyles">
6439
6513
  <xsl:param name="isAdded"/>
6440
6514
  <xsl:param name="isDeleted"/>
@@ -1790,7 +1790,9 @@
1790
1790
 
1791
1791
 
1792
1792
 
1793
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1793
+ </xsl:attribute-set><xsl:variable name="table-border_">
1794
+
1795
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1794
1796
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1795
1797
 
1796
1798
 
@@ -2120,6 +2122,8 @@
2120
2122
  <fo:block>&#xA0;</fo:block>
2121
2123
  </xsl:if> -->
2122
2124
 
2125
+
2126
+ <!-- Display table's name before table as standalone block -->
2123
2127
  <!-- $namespace = 'iso' or -->
2124
2128
 
2125
2129
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2203,6 +2207,12 @@
2203
2207
 
2204
2208
 
2205
2209
 
2210
+
2211
+
2212
+
2213
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2214
+
2215
+
2206
2216
  <xsl:variable name="table_width">
2207
2217
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2208
2218
 
@@ -2227,6 +2237,7 @@
2227
2237
 
2228
2238
 
2229
2239
 
2240
+
2230
2241
  <attribute name="margin-left">0mm</attribute>
2231
2242
  <attribute name="margin-right">0mm</attribute>
2232
2243
 
@@ -2651,6 +2662,8 @@
2651
2662
  </xsl:choose>
2652
2663
  </xsl:for-each>
2653
2664
 
2665
+
2666
+
2654
2667
  <xsl:choose>
2655
2668
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2656
2669
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -2689,6 +2702,7 @@
2689
2702
 
2690
2703
 
2691
2704
 
2705
+
2692
2706
  <!-- for BSI (not PAS) display Notes before footnotes -->
2693
2707
 
2694
2708
 
@@ -2774,6 +2788,8 @@
2774
2788
 
2775
2789
 
2776
2790
 
2791
+
2792
+
2777
2793
  </xsl:if>
2778
2794
  <xsl:if test="$parent-name = 'tfoot'">
2779
2795
 
@@ -2800,6 +2816,8 @@
2800
2816
 
2801
2817
 
2802
2818
 
2819
+
2820
+
2803
2821
  <!-- <xsl:if test="$namespace = 'bipm'">
2804
2822
  <xsl:attribute name="height">8mm</xsl:attribute>
2805
2823
  </xsl:if> -->
@@ -4332,7 +4350,24 @@
4332
4350
  </fo:instream-foreign-object>
4333
4351
  </xsl:when>
4334
4352
  <xsl:otherwise>
4335
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4353
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
4354
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
4355
+
4356
+ <xsl:variable name="img_src">
4357
+ <xsl:choose>
4358
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
4359
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
4360
+ </xsl:choose>
4361
+ </xsl:variable>
4362
+
4363
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
4364
+ <xsl:if test="number($scale) &lt; 100">
4365
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
4366
+ </xsl:if>
4367
+
4368
+ </xsl:if>
4369
+
4370
+ </fo:external-graphic>
4336
4371
  </xsl:otherwise>
4337
4372
  </xsl:choose>
4338
4373
 
@@ -4503,11 +4538,13 @@
4503
4538
  <xsl:attribute name="width">100%</xsl:attribute>
4504
4539
  <xsl:attribute name="content-height">100%</xsl:attribute>
4505
4540
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4541
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
4542
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
4506
4543
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4507
4544
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4508
4545
  <!-- effective height / width = 1.48, 1.4 - with title -->
4509
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
4510
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
4546
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
4547
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
4511
4548
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4512
4549
  </xsl:if>
4513
4550
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -4524,6 +4561,23 @@
4524
4561
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4525
4562
  <xsl:value-of select="."/>
4526
4563
  </xsl:attribute>
4564
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
4565
+ <xsl:copy>
4566
+ <xsl:apply-templates select="@*" mode="svg_update"/>
4567
+ <xsl:variable name="viewbox">
4568
+ <xsl:call-template name="split">
4569
+ <xsl:with-param name="pText" select="@viewBox"/>
4570
+ <xsl:with-param name="sep" select="' '"/>
4571
+ </xsl:call-template>
4572
+ </xsl:variable>
4573
+ <xsl:attribute name="width">
4574
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
4575
+ </xsl:attribute>
4576
+ <xsl:attribute name="height">
4577
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
4578
+ </xsl:attribute>
4579
+ <xsl:apply-templates mode="svg_update"/>
4580
+ </xsl:copy>
4527
4581
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4528
4582
  <xsl:variable name="svg_content" select="document(@src)"/>
4529
4583
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -6410,20 +6464,40 @@
6410
6464
  </xsl:call-template>
6411
6465
  </xsl:if>
6412
6466
  </xsl:template><xsl:template name="getLocalizedString">
6413
- <xsl:param name="key"/>
6467
+ <xsl:param name="key"/>
6468
+ <xsl:param name="formatted">false</xsl:param>
6414
6469
 
6415
6470
  <xsl:variable name="curr_lang">
6416
6471
  <xsl:call-template name="getLang"/>
6417
6472
  </xsl:variable>
6418
6473
 
6419
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6474
+ <xsl:variable name="data_value">
6475
+ <xsl:choose>
6476
+ <xsl:when test="$formatted = 'true'">
6477
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6478
+ </xsl:when>
6479
+ <xsl:otherwise>
6480
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6481
+ </xsl:otherwise>
6482
+ </xsl:choose>
6483
+ </xsl:variable>
6420
6484
 
6421
6485
  <xsl:choose>
6422
- <xsl:when test="$data_value != ''">
6423
- <xsl:value-of select="$data_value"/>
6486
+ <xsl:when test="normalize-space($data_value) != ''">
6487
+ <xsl:choose>
6488
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
6489
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
6490
+ </xsl:choose>
6424
6491
  </xsl:when>
6425
6492
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6426
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6493
+ <xsl:choose>
6494
+ <xsl:when test="$formatted = 'true'">
6495
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6496
+ </xsl:when>
6497
+ <xsl:otherwise>
6498
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6499
+ </xsl:otherwise>
6500
+ </xsl:choose>
6427
6501
  </xsl:when>
6428
6502
  <xsl:otherwise>
6429
6503
  <xsl:variable name="key_">
@@ -6434,7 +6508,7 @@
6434
6508
  <xsl:value-of select="$key_"/>
6435
6509
  </xsl:otherwise>
6436
6510
  </xsl:choose>
6437
-
6511
+
6438
6512
  </xsl:template><xsl:template name="setTrackChangesStyles">
6439
6513
  <xsl:param name="isAdded"/>
6440
6514
  <xsl:param name="isDeleted"/>
@@ -1790,7 +1790,9 @@
1790
1790
 
1791
1791
 
1792
1792
 
1793
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1793
+ </xsl:attribute-set><xsl:variable name="table-border_">
1794
+
1795
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1794
1796
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1795
1797
 
1796
1798
 
@@ -2120,6 +2122,8 @@
2120
2122
  <fo:block>&#xA0;</fo:block>
2121
2123
  </xsl:if> -->
2122
2124
 
2125
+
2126
+ <!-- Display table's name before table as standalone block -->
2123
2127
  <!-- $namespace = 'iso' or -->
2124
2128
 
2125
2129
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2203,6 +2207,12 @@
2203
2207
 
2204
2208
 
2205
2209
 
2210
+
2211
+
2212
+
2213
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2214
+
2215
+
2206
2216
  <xsl:variable name="table_width">
2207
2217
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2208
2218
 
@@ -2227,6 +2237,7 @@
2227
2237
 
2228
2238
 
2229
2239
 
2240
+
2230
2241
  <attribute name="margin-left">0mm</attribute>
2231
2242
  <attribute name="margin-right">0mm</attribute>
2232
2243
 
@@ -2651,6 +2662,8 @@
2651
2662
  </xsl:choose>
2652
2663
  </xsl:for-each>
2653
2664
 
2665
+
2666
+
2654
2667
  <xsl:choose>
2655
2668
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2656
2669
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -2689,6 +2702,7 @@
2689
2702
 
2690
2703
 
2691
2704
 
2705
+
2692
2706
  <!-- for BSI (not PAS) display Notes before footnotes -->
2693
2707
 
2694
2708
 
@@ -2774,6 +2788,8 @@
2774
2788
 
2775
2789
 
2776
2790
 
2791
+
2792
+
2777
2793
  </xsl:if>
2778
2794
  <xsl:if test="$parent-name = 'tfoot'">
2779
2795
 
@@ -2800,6 +2816,8 @@
2800
2816
 
2801
2817
 
2802
2818
 
2819
+
2820
+
2803
2821
  <!-- <xsl:if test="$namespace = 'bipm'">
2804
2822
  <xsl:attribute name="height">8mm</xsl:attribute>
2805
2823
  </xsl:if> -->
@@ -4332,7 +4350,24 @@
4332
4350
  </fo:instream-foreign-object>
4333
4351
  </xsl:when>
4334
4352
  <xsl:otherwise>
4335
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4353
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
4354
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
4355
+
4356
+ <xsl:variable name="img_src">
4357
+ <xsl:choose>
4358
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
4359
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
4360
+ </xsl:choose>
4361
+ </xsl:variable>
4362
+
4363
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
4364
+ <xsl:if test="number($scale) &lt; 100">
4365
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
4366
+ </xsl:if>
4367
+
4368
+ </xsl:if>
4369
+
4370
+ </fo:external-graphic>
4336
4371
  </xsl:otherwise>
4337
4372
  </xsl:choose>
4338
4373
 
@@ -4503,11 +4538,13 @@
4503
4538
  <xsl:attribute name="width">100%</xsl:attribute>
4504
4539
  <xsl:attribute name="content-height">100%</xsl:attribute>
4505
4540
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4541
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
4542
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
4506
4543
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4507
4544
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4508
4545
  <!-- effective height / width = 1.48, 1.4 - with title -->
4509
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
4510
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
4546
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
4547
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
4511
4548
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4512
4549
  </xsl:if>
4513
4550
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -4524,6 +4561,23 @@
4524
4561
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4525
4562
  <xsl:value-of select="."/>
4526
4563
  </xsl:attribute>
4564
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
4565
+ <xsl:copy>
4566
+ <xsl:apply-templates select="@*" mode="svg_update"/>
4567
+ <xsl:variable name="viewbox">
4568
+ <xsl:call-template name="split">
4569
+ <xsl:with-param name="pText" select="@viewBox"/>
4570
+ <xsl:with-param name="sep" select="' '"/>
4571
+ </xsl:call-template>
4572
+ </xsl:variable>
4573
+ <xsl:attribute name="width">
4574
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
4575
+ </xsl:attribute>
4576
+ <xsl:attribute name="height">
4577
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
4578
+ </xsl:attribute>
4579
+ <xsl:apply-templates mode="svg_update"/>
4580
+ </xsl:copy>
4527
4581
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4528
4582
  <xsl:variable name="svg_content" select="document(@src)"/>
4529
4583
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -6410,20 +6464,40 @@
6410
6464
  </xsl:call-template>
6411
6465
  </xsl:if>
6412
6466
  </xsl:template><xsl:template name="getLocalizedString">
6413
- <xsl:param name="key"/>
6467
+ <xsl:param name="key"/>
6468
+ <xsl:param name="formatted">false</xsl:param>
6414
6469
 
6415
6470
  <xsl:variable name="curr_lang">
6416
6471
  <xsl:call-template name="getLang"/>
6417
6472
  </xsl:variable>
6418
6473
 
6419
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6474
+ <xsl:variable name="data_value">
6475
+ <xsl:choose>
6476
+ <xsl:when test="$formatted = 'true'">
6477
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6478
+ </xsl:when>
6479
+ <xsl:otherwise>
6480
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6481
+ </xsl:otherwise>
6482
+ </xsl:choose>
6483
+ </xsl:variable>
6420
6484
 
6421
6485
  <xsl:choose>
6422
- <xsl:when test="$data_value != ''">
6423
- <xsl:value-of select="$data_value"/>
6486
+ <xsl:when test="normalize-space($data_value) != ''">
6487
+ <xsl:choose>
6488
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
6489
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
6490
+ </xsl:choose>
6424
6491
  </xsl:when>
6425
6492
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6426
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6493
+ <xsl:choose>
6494
+ <xsl:when test="$formatted = 'true'">
6495
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6496
+ </xsl:when>
6497
+ <xsl:otherwise>
6498
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6499
+ </xsl:otherwise>
6500
+ </xsl:choose>
6427
6501
  </xsl:when>
6428
6502
  <xsl:otherwise>
6429
6503
  <xsl:variable name="key_">
@@ -6434,7 +6508,7 @@
6434
6508
  <xsl:value-of select="$key_"/>
6435
6509
  </xsl:otherwise>
6436
6510
  </xsl:choose>
6437
-
6511
+
6438
6512
  </xsl:template><xsl:template name="setTrackChangesStyles">
6439
6513
  <xsl:param name="isAdded"/>
6440
6514
  <xsl:param name="isDeleted"/>