metanorma-csa 1.8.7 → 1.8.8

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: 9094d8995d85f10e6c8eddfce465454dcfe379e7db8efe451be85797e53561d8
4
- data.tar.gz: 6a26595d2a01ff9d0eb8b06cb398d335c5677dbf199d9c6e783183537cdb4f08
3
+ metadata.gz: 55933818281eeb7a3afcc20e0fe8bd36384a593825a1e1d90a558a4f533131b3
4
+ data.tar.gz: 83a4b1c0e41f8b5b4b068a26f8956cf20b04bab1cc3a565d572936e3229656d3
5
5
  SHA512:
6
- metadata.gz: cb9383ca3d2fe13856b32c444d4c045f068b0a43600bef990da214a4d73d13444e2b5cb9e142831e3c01325a0f28c5c908220d23b2c8ae27b6666396cef3c529
7
- data.tar.gz: 19f78275afd29167bdc5813fc41fb155e9137e1dbece3ad3be8415f430244296ad2fafd1d3bee3ed41a845dce383968ea0922e4277f114f1b2e1fe2a5cdb9c87
6
+ metadata.gz: 73b56afc526f229741eefb23a31ca242077da831857f2fabc04706a3b13129b2829a040453d0c959a247f6d44d72d8c2c6131947cc3e65f7dbc0b7d35c56ab40
7
+ data.tar.gz: fcd16d242bb9b74d7698566a23aec17c73dfbfdec439b4ede7e02557df9b5322e3822ed136367235a93450e00507fbb5e2336cd02c10b77defb9326faa576a2b
@@ -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">
@@ -1170,7 +1170,9 @@
1170
1170
 
1171
1171
 
1172
1172
 
1173
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1173
+ </xsl:attribute-set><xsl:variable name="table-border_">
1174
+
1175
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1174
1176
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1175
1177
 
1176
1178
 
@@ -1485,6 +1487,8 @@
1485
1487
  <fo:block>&#xA0;</fo:block>
1486
1488
  </xsl:if> -->
1487
1489
 
1490
+
1491
+ <!-- Display table's name before table as standalone block -->
1488
1492
  <!-- $namespace = 'iso' or -->
1489
1493
 
1490
1494
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1558,6 +1562,12 @@
1558
1562
 
1559
1563
 
1560
1564
 
1565
+
1566
+
1567
+
1568
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1569
+
1570
+
1561
1571
  <xsl:variable name="table_width">
1562
1572
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1563
1573
  100%
@@ -1576,6 +1586,7 @@
1576
1586
 
1577
1587
 
1578
1588
 
1589
+
1579
1590
 
1580
1591
 
1581
1592
 
@@ -1999,6 +2010,8 @@
1999
2010
  </xsl:choose>
2000
2011
  </xsl:for-each>
2001
2012
 
2013
+
2014
+
2002
2015
  <xsl:choose>
2003
2016
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2004
2017
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -2035,6 +2048,7 @@
2035
2048
 
2036
2049
 
2037
2050
 
2051
+
2038
2052
  <!-- for BSI (not PAS) display Notes before footnotes -->
2039
2053
 
2040
2054
 
@@ -2120,6 +2134,8 @@
2120
2134
 
2121
2135
 
2122
2136
 
2137
+
2138
+
2123
2139
  </xsl:if>
2124
2140
  <xsl:if test="$parent-name = 'tfoot'">
2125
2141
 
@@ -2134,6 +2150,8 @@
2134
2150
 
2135
2151
 
2136
2152
 
2153
+
2154
+
2137
2155
  <!-- <xsl:if test="$namespace = 'bipm'">
2138
2156
  <xsl:attribute name="height">8mm</xsl:attribute>
2139
2157
  </xsl:if> -->
@@ -3638,7 +3656,24 @@
3638
3656
  </fo:instream-foreign-object>
3639
3657
  </xsl:when>
3640
3658
  <xsl:otherwise>
3641
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3659
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
3660
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
3661
+
3662
+ <xsl:variable name="img_src">
3663
+ <xsl:choose>
3664
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
3665
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
3666
+ </xsl:choose>
3667
+ </xsl:variable>
3668
+
3669
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
3670
+ <xsl:if test="number($scale) &lt; 100">
3671
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
3672
+ </xsl:if>
3673
+
3674
+ </xsl:if>
3675
+
3676
+ </fo:external-graphic>
3642
3677
  </xsl:otherwise>
3643
3678
  </xsl:choose>
3644
3679
 
@@ -3809,11 +3844,13 @@
3809
3844
  <xsl:attribute name="width">100%</xsl:attribute>
3810
3845
  <xsl:attribute name="content-height">100%</xsl:attribute>
3811
3846
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3847
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
3848
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
3812
3849
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3813
3850
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3814
3851
  <!-- effective height / width = 1.48, 1.4 - with title -->
3815
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3816
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3852
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
3853
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
3817
3854
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3818
3855
  </xsl:if>
3819
3856
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -3830,6 +3867,23 @@
3830
3867
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3831
3868
  <xsl:value-of select="."/>
3832
3869
  </xsl:attribute>
3870
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
3871
+ <xsl:copy>
3872
+ <xsl:apply-templates select="@*" mode="svg_update"/>
3873
+ <xsl:variable name="viewbox">
3874
+ <xsl:call-template name="split">
3875
+ <xsl:with-param name="pText" select="@viewBox"/>
3876
+ <xsl:with-param name="sep" select="' '"/>
3877
+ </xsl:call-template>
3878
+ </xsl:variable>
3879
+ <xsl:attribute name="width">
3880
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
3881
+ </xsl:attribute>
3882
+ <xsl:attribute name="height">
3883
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
3884
+ </xsl:attribute>
3885
+ <xsl:apply-templates mode="svg_update"/>
3886
+ </xsl:copy>
3833
3887
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3834
3888
  <xsl:variable name="svg_content" select="document(@src)"/>
3835
3889
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5518,20 +5572,40 @@
5518
5572
  </xsl:call-template>
5519
5573
  </xsl:if>
5520
5574
  </xsl:template><xsl:template name="getLocalizedString">
5521
- <xsl:param name="key"/>
5575
+ <xsl:param name="key"/>
5576
+ <xsl:param name="formatted">false</xsl:param>
5522
5577
 
5523
5578
  <xsl:variable name="curr_lang">
5524
5579
  <xsl:call-template name="getLang"/>
5525
5580
  </xsl:variable>
5526
5581
 
5527
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5582
+ <xsl:variable name="data_value">
5583
+ <xsl:choose>
5584
+ <xsl:when test="$formatted = 'true'">
5585
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5586
+ </xsl:when>
5587
+ <xsl:otherwise>
5588
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5589
+ </xsl:otherwise>
5590
+ </xsl:choose>
5591
+ </xsl:variable>
5528
5592
 
5529
5593
  <xsl:choose>
5530
- <xsl:when test="$data_value != ''">
5531
- <xsl:value-of select="$data_value"/>
5594
+ <xsl:when test="normalize-space($data_value) != ''">
5595
+ <xsl:choose>
5596
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
5597
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
5598
+ </xsl:choose>
5532
5599
  </xsl:when>
5533
5600
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5534
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5601
+ <xsl:choose>
5602
+ <xsl:when test="$formatted = 'true'">
5603
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5604
+ </xsl:when>
5605
+ <xsl:otherwise>
5606
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5607
+ </xsl:otherwise>
5608
+ </xsl:choose>
5535
5609
  </xsl:when>
5536
5610
  <xsl:otherwise>
5537
5611
  <xsl:variable name="key_">
@@ -5542,7 +5616,7 @@
5542
5616
  <xsl:value-of select="$key_"/>
5543
5617
  </xsl:otherwise>
5544
5618
  </xsl:choose>
5545
-
5619
+
5546
5620
  </xsl:template><xsl:template name="setTrackChangesStyles">
5547
5621
  <xsl:param name="isAdded"/>
5548
5622
  <xsl:param name="isDeleted"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "1.8.7".freeze
3
+ VERSION = "1.8.8".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.7
4
+ version: 1.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic