metanorma-csa 1.8.11 → 1.8.12

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: 67e8c48422b9d3bbcc856a2b9873fc39e6dd0f3cd73d8397f0c5a2c3172179f2
4
- data.tar.gz: e77a59da99e5904c6ada3a8542441b4a4833005d8928c5539eefcd9f7feaf541
3
+ metadata.gz: 7923068a35e847979dc2ee0497ee0477fd2b899c88b565bd27f57fb6f5344f0a
4
+ data.tar.gz: e408bee67dde1b247d108a84574ca3706b2895a59ce8c5e78437214df22c50f9
5
5
  SHA512:
6
- metadata.gz: 2f151843e9027e6f9d2f6dd2881fb476829bcccefaa2e86a402ef7767968675f9221bafd026a568f82968af7dfef9e9fe2e165bec61b2c88b90067c07b945bb4
7
- data.tar.gz: d0a41c184349583417dcc306c6ddcef5e5fa8dbafbee149c7c2d333a19c18abb3dd7f7d90aae75531fac1a873f81a1d2ed8660fd416b03afc24d92bcfd0c89f6
6
+ metadata.gz: f9633afd77e0b03429d076c4bed50b48962def81a088fa8aa937d12930b2d77a98759100f494f771ceadbb2a1d97cdc867dcf63771093663c3bda9b704f344c8
7
+ data.tar.gz: 75b412b2c7c6a2640a1f70e73c2f02c3fa38bcba914384e75ffae3d513e24de358d1fd772ed402744c8e1879a6ee7136e688020a8efcbaf8ff5a53050b737381
@@ -1036,6 +1036,7 @@
1036
1036
  <ref name="svgmap"/>
1037
1037
  <ref name="inputform"/>
1038
1038
  <ref name="toc"/>
1039
+ <ref name="passthrough"/>
1039
1040
  </choice>
1040
1041
  </define>
1041
1042
  <define name="toc">
@@ -1043,6 +1044,14 @@
1043
1044
  <ref name="ul"/>
1044
1045
  </element>
1045
1046
  </define>
1047
+ <define name="passthrough">
1048
+ <element name="passthrough">
1049
+ <optional>
1050
+ <attribute name="formats"/>
1051
+ </optional>
1052
+ <text/>
1053
+ </element>
1054
+ </define>
1046
1055
  <define name="inputform">
1047
1056
  <element name="form">
1048
1057
  <attribute name="id">
@@ -1449,13 +1449,20 @@
1449
1449
 
1450
1450
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1451
1451
 
1452
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1452
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1453
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1454
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1453
1455
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1454
1456
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1455
1457
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1456
1458
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1457
1459
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1458
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1460
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1461
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1462
+ <xsl:sort select="@displayorder" data-type="number"/>
1463
+ <xsl:apply-templates select="." mode="contents"/>
1464
+ </xsl:for-each>
1465
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1459
1466
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1460
1467
 
1461
1468
  <!-- Normative references -->
@@ -1468,13 +1475,33 @@
1468
1475
  <!-- Bibliography -->
1469
1476
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1470
1477
 
1471
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1478
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1479
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1480
+ <xsl:sort select="@displayorder" data-type="number"/>
1481
+ <xsl:apply-templates select="." mode="contents"/>
1482
+ </xsl:for-each>
1483
+
1484
+ <xsl:for-each select="/*/*[local-name()='annex']">
1485
+ <xsl:sort select="@displayorder" data-type="number"/>
1486
+ <xsl:apply-templates select="." mode="contents"/>
1487
+ </xsl:for-each>
1488
+
1489
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1490
+ <xsl:sort select="@displayorder" data-type="number"/>
1491
+ <xsl:apply-templates select="." mode="contents"/>
1492
+ </xsl:for-each>
1493
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1472
1494
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1473
1495
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1474
1496
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1475
1497
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1476
1498
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1477
- </xsl:template><xsl:template name="processMainSectionsDefault">
1499
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1500
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1501
+ <xsl:sort select="@displayorder" data-type="number"/>
1502
+ <xsl:apply-templates select="."/>
1503
+ </xsl:for-each>
1504
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1478
1505
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1479
1506
 
1480
1507
  <!-- Normative references -->
@@ -1486,6 +1513,22 @@
1486
1513
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1487
1514
  <!-- Bibliography -->
1488
1515
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1516
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1517
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1518
+ <xsl:sort select="@displayorder" data-type="number"/>
1519
+ <xsl:apply-templates select="."/>
1520
+
1521
+ </xsl:for-each>
1522
+
1523
+ <xsl:for-each select="/*/*[local-name()='annex']">
1524
+ <xsl:sort select="@displayorder" data-type="number"/>
1525
+ <xsl:apply-templates select="."/>
1526
+ </xsl:for-each>
1527
+
1528
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1529
+ <xsl:sort select="@displayorder" data-type="number"/>
1530
+ <xsl:apply-templates select="."/>
1531
+ </xsl:for-each>
1489
1532
  </xsl:template><xsl:template match="text()">
1490
1533
  <xsl:value-of select="."/>
1491
1534
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -3978,6 +4021,13 @@
3978
4021
  </xsl:attribute>
3979
4022
  <xsl:apply-templates mode="svg_update"/>
3980
4023
  </xsl:copy>
4024
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
4025
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4026
+ <xsl:for-each select="*[local-name() = 'svg']">
4027
+ <xsl:call-template name="image_svg">
4028
+ <xsl:with-param name="name" select="$name"/>
4029
+ </xsl:call-template>
4030
+ </xsl:for-each>
3981
4031
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3982
4032
  <xsl:variable name="svg_content" select="document(@src)"/>
3983
4033
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -4082,7 +4132,7 @@
4082
4132
  </fo:basic-link>
4083
4133
  </fo:block>
4084
4134
  </fo:block-container>
4085
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4135
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4086
4136
  <xsl:apply-templates mode="contents"/>
4087
4137
  <xsl:text> </xsl:text>
4088
4138
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
@@ -4762,14 +4812,15 @@
4762
4812
  </xsl:if>
4763
4813
  </xsl:template><xsl:variable name="localized.source">
4764
4814
  <xsl:call-template name="getLocalizedString">
4765
- <xsl:with-param name="key">source</xsl:with-param>
4766
- </xsl:call-template>
4815
+ <xsl:with-param name="key">source</xsl:with-param>
4816
+ </xsl:call-template>
4767
4817
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4768
4818
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4769
4819
  <xsl:if test="normalize-space(@citeas) = ''">
4770
4820
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4771
4821
  </xsl:if>
4772
4822
 
4823
+
4773
4824
  <fo:inline>
4774
4825
 
4775
4826
 
@@ -4777,6 +4828,7 @@
4777
4828
 
4778
4829
 
4779
4830
 
4831
+
4780
4832
  <xsl:call-template name="getTitle">
4781
4833
  <xsl:with-param name="name" select="'title-source'"/>
4782
4834
  </xsl:call-template>
@@ -4788,6 +4840,7 @@
4788
4840
  <fo:inline xsl:use-attribute-sets="origin-style">
4789
4841
  <xsl:apply-templates/>
4790
4842
  </fo:inline>
4843
+
4791
4844
  </fo:basic-link>
4792
4845
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4793
4846
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -4854,6 +4907,9 @@
4854
4907
 
4855
4908
  </xsl:if>
4856
4909
 
4910
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
4911
+ <xsl:variable name="text" select="normalize-space()"/>
4912
+
4857
4913
 
4858
4914
 
4859
4915
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4866,7 +4922,9 @@
4866
4922
 
4867
4923
 
4868
4924
  </xsl:if>
4869
-
4925
+
4926
+
4927
+
4870
4928
  <xsl:apply-templates/>
4871
4929
  </fo:basic-link>
4872
4930
 
@@ -5368,9 +5426,97 @@
5368
5426
  <fo:block-container border="1pt solid black" width="50%">
5369
5427
  <fo:block> </fo:block>
5370
5428
  </fo:block-container>
5429
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
5430
+ <xsl:param name="colwidths"/>
5431
+ <xsl:variable name="colwidths_">
5432
+ <xsl:choose>
5433
+ <xsl:when test="not($colwidths)">
5434
+ <xsl:variable name="toc_table_simple">
5435
+ <tbody>
5436
+ <xsl:apply-templates mode="toc_table_width"/>
5437
+ </tbody>
5438
+ </xsl:variable>
5439
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
5440
+ <xsl:call-template name="calculate-column-widths">
5441
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5442
+ <xsl:with-param name="table" select="$toc_table_simple"/>
5443
+ </xsl:call-template>
5444
+ </xsl:when>
5445
+ <xsl:otherwise>
5446
+ <xsl:copy-of select="$colwidths"/>
5447
+ </xsl:otherwise>
5448
+ </xsl:choose>
5449
+ </xsl:variable>
5450
+ <fo:block role="TOCI" space-after="16pt">
5451
+ <fo:table width="100%" table-layout="fixed">
5452
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
5453
+ <fo:table-column column-width="proportional-column-width({.})"/>
5454
+ </xsl:for-each>
5455
+ <fo:table-body>
5456
+ <xsl:apply-templates/>
5457
+ </fo:table-body>
5458
+ </fo:table>
5459
+ </fo:block>
5460
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
5461
+ <fo:table-row min-height="5mm">
5462
+ <xsl:apply-templates/>
5463
+ </fo:table-row>
5464
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
5465
+ <xsl:apply-templates/>
5466
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
5467
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5468
+ <xsl:variable name="target" select="@target"/>
5469
+ <xsl:for-each select="*[local-name() = 'tab']">
5470
+ <xsl:variable name="current_id" select="generate-id()"/>
5471
+ <fo:table-cell>
5472
+ <fo:block>
5473
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5474
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5475
+ <xsl:choose>
5476
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5477
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
5478
+ </xsl:choose>
5479
+ </xsl:for-each>
5480
+ </fo:basic-link>
5481
+ </fo:block>
5482
+ </fo:table-cell>
5483
+ </xsl:for-each>
5484
+ <!-- last column - for page numbers -->
5485
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
5486
+ <fo:block>
5487
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5488
+ <fo:page-number-citation ref-id="{$target}"/>
5489
+ </fo:basic-link>
5490
+ </fo:block>
5491
+ </fo:table-cell>
5492
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
5493
+ <xsl:apply-templates mode="toc_table_width"/>
5494
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
5495
+ <tr>
5496
+ <xsl:apply-templates mode="toc_table_width"/>
5497
+ </tr>
5498
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
5499
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5500
+ <xsl:for-each select="*[local-name() = 'tab']">
5501
+ <xsl:variable name="current_id" select="generate-id()"/>
5502
+ <td>
5503
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5504
+ <xsl:copy-of select="."/>
5505
+ </xsl:for-each>
5506
+ </td>
5507
+ </xsl:for-each>
5508
+ <td>333</td> <!-- page number, just for fill -->
5371
5509
  </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5372
5510
  <fo:inline padding-right="5mm"> </fo:inline>
5373
5511
  <fo:inline><xsl:apply-templates/></fo:inline>
5512
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
5513
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
5514
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
5515
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
5516
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
5517
+ </svg>
5518
+ </fo:instream-foreign-object>
5519
+ </fo:inline>
5374
5520
  </xsl:template><xsl:template name="convertDate">
5375
5521
  <xsl:param name="date"/>
5376
5522
  <xsl:param name="format" select="'short'"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "1.8.11".freeze
3
+ VERSION = "1.8.12".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.11
4
+ version: 1.8.12
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-09-13 00:00:00.000000000 Z
11
+ date: 2021-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic