metanorma-iec 2.8.3 → 2.8.4

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: e2a3beafed0d59c715ad2d3ee28cff96847e66ea5a81474aba330bd5433206e8
4
- data.tar.gz: 448025bfed257cd06e848fdb3f4d2e54d9c81e8a279c1cf87c85d189981c4d7f
3
+ metadata.gz: eb1dc9dfb4442c5aa285a2756a49aa7677c86b3e23afef2605e5c33ecfb496be
4
+ data.tar.gz: af3759a361296ee46fa952eaac21b89e5b70100404b62a34ff1c851267484f67
5
5
  SHA512:
6
- metadata.gz: e0404119c4072ec1a139ce6d12cf72ff5e1dfad066d6ce2e8ea473374a53287b4d80a92a909ea4c7084301136f5e60d26a25f84bd4c19b88adb5500bc7eace3a
7
- data.tar.gz: 672b5b1c9534b42889ec232e1a350f6369af3879ced8e513f6fa1127970cfca7311d3c2dc88bcd48d67c7b046926ea0c8939335938b3dfa0b67cf8497447dbbb
6
+ metadata.gz: f56d4a6c17d033c899c9d18fee752aab51c799c837efb60d232dc3be3532496dcbf67b853c5316e134c1b8716f971f03964b7b6c4c1257e34176cba3ae86c45e
7
+ data.tar.gz: 9f04b3a60e29a75e36272f56ca7a6f1594c4f195d4f2f750b10b6092aec7476d56382cf7f5a4b712ceeecde5a95a8b88d294b63b26106c227a06798747e4303b
@@ -6,6 +6,8 @@
6
6
 
7
7
  <xsl:key name="kfn" match="mn:fn[not(ancestor::*[self::mn:table or self::mn:figure or self::mn:localized-strings] and not(ancestor::mn:fmt-name))]" use="@reference"/>
8
8
 
9
+ <xsl:key name="kid" match="*" use="@id"/>
10
+
9
11
  <xsl:variable name="additionalXMLsArray">
10
12
  <xsl:call-template name="split">
11
13
  <xsl:with-param name="pText" select="normalize-space($additionalXMLs)"/>
@@ -1381,6 +1383,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1381
1383
 
1382
1384
  <xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="3">
1383
1385
  <fo:block-container role="SKIP">
1386
+ <xsl:copy-of select="@id"/>
1384
1387
  <!-- render 'Contents' outside if role="TOC" -->
1385
1388
  <xsl:apply-templates select="mn:fmt-title"/>
1386
1389
  <fo:block role="TOC">
@@ -1719,12 +1722,14 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1719
1722
  </xsl:template>
1720
1723
 
1721
1724
  <xsl:template match="mn:annex//mn:clause" priority="2">
1725
+ <xsl:call-template name="setNamedDestination"/>
1722
1726
  <fo:block id="{@id}" margin-top="5pt" margin-bottom="10pt" text-align="justify">
1723
1727
  <xsl:apply-templates/>
1724
1728
  </fo:block>
1725
1729
  </xsl:template>
1726
1730
 
1727
1731
  <xsl:template match="mn:clause//mn:clause" priority="2">
1732
+ <xsl:call-template name="setNamedDestination"/>
1728
1733
  <fo:block id="{@id}" space-after="10pt">
1729
1734
  <xsl:apply-templates/>
1730
1735
  </fo:block>
@@ -1756,6 +1761,8 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1756
1761
  </xsl:choose>
1757
1762
  </xsl:variable>
1758
1763
 
1764
+ <xsl:call-template name="setNamedDestination"/>
1765
+
1759
1766
  <xsl:variable name="title_styles">
1760
1767
  <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
1761
1768
  </xsl:variable>
@@ -1763,6 +1770,8 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1763
1770
  <xsl:element name="{$element-name}">
1764
1771
  <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
1765
1772
 
1773
+ <xsl:call-template name="setIDforNamedDestination"/>
1774
+
1766
1775
  <xsl:apply-templates/>
1767
1776
  <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1768
1777
  </xsl:element>
@@ -1784,6 +1793,8 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1784
1793
  </xsl:choose>
1785
1794
  </xsl:variable>
1786
1795
 
1796
+ <xsl:call-template name="setNamedDestination"/>
1797
+
1787
1798
  <xsl:variable name="p_styles">
1788
1799
  <styles xsl:use-attribute-sets="p-style">
1789
1800
  <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
@@ -3005,6 +3016,46 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
3005
3016
  </xsl:template>
3006
3017
 
3007
3018
  <xsl:template name="addNamedDestinationAttribute">
3019
+ <xsl:variable name="docnum"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
3020
+ <xsl:variable name="caption_label" select="translate(normalize-space(.//mn:span[@class = 'fmt-caption-label']), ' ()', '')"/>
3021
+
3022
+ <xsl:variable name="named_dest_">
3023
+ <xsl:choose>
3024
+ <xsl:when test="count(ancestor::mn:figure) &gt; 1"/> <!-- prevent id 'a)' -->
3025
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example or ancestor::mn:termnote or ancestor::mn:termexample or ancestor::mn:admonition"/>
3026
+ <xsl:when test="$caption_label = '' and parent::mn:foreword">
3027
+ <xsl:variable name="foreword_number"><xsl:number count="mn:foreword" level="any"/></xsl:variable>
3028
+ <xsl:if test="$foreword_number = 1">Foreword</xsl:if>
3029
+ </xsl:when>
3030
+ <xsl:when test="$caption_label = '' and parent::mn:introduction">
3031
+ <xsl:variable name="introduction_number"><xsl:number count="mn:introduction" level="any"/></xsl:variable>
3032
+ <xsl:if test="$introduction_number = 1">Introduction</xsl:if>
3033
+ </xsl:when>
3034
+ <xsl:when test="$caption_label = ''"/>
3035
+ <xsl:when test="../@unnumbered = 'true'"/>
3036
+ <xsl:when test="normalize-space(java:matches(java:java.lang.String.new($caption_label), '[\x21-\xFF]+')) = 'false'"/>
3037
+ <!-- 1.1 in Appendix 1 -->
3038
+ <xsl:otherwise>
3039
+ <xsl:if test="ancestor::mn:annex and string(number(substring($caption_label, 1, 1))) != 'NaN'">
3040
+ <xsl:variable name="annex_caption_label" select="translate(normalize-space(ancestor::mn:annex[1]/mn:fmt-title//mn:span[@class = 'fmt-caption-label']), ' ()', '')"/>
3041
+ <xsl:value-of select="concat($annex_caption_label, '_')"/>
3042
+ </xsl:if>
3043
+ <xsl:if test="parent::mn:formula">Formula</xsl:if>
3044
+ <xsl:value-of select="$caption_label"/>
3045
+ </xsl:otherwise>
3046
+ </xsl:choose>
3047
+ </xsl:variable>
3048
+ <xsl:variable name="named_dest" select="normalize-space($named_dest_)"/>
3049
+ <xsl:if test="$named_dest != ''">
3050
+ <xsl:variable name="named_dest_doc_">
3051
+ <xsl:value-of select="$named_dest"/>
3052
+ <xsl:if test="$docnum != '1'">_<xsl:value-of select="$docnum"/></xsl:if>
3053
+ </xsl:variable>
3054
+ <xsl:variable name="named_dest_doc" select="normalize-space($named_dest_doc_)"/>
3055
+ <xsl:if test="not(key('kid', $named_dest_doc))"> <!-- if element with id '$named_dest_doc' doesn't exist in the document -->
3056
+ <xsl:attribute name="named_dest"><xsl:value-of select="normalize-space($named_dest_doc)"/></xsl:attribute>
3057
+ </xsl:if>
3058
+ </xsl:if>
3008
3059
  </xsl:template>
3009
3060
 
3010
3061
  <xsl:template match="mn:fmt-name" mode="update_xml_step1">
@@ -3951,6 +4002,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
3951
4002
  </xsl:template>
3952
4003
 
3953
4004
  <xsl:template match="mn:feedback-statement//mn:p">
4005
+ <xsl:param name="skip_id">false</xsl:param>
3954
4006
  <xsl:param name="margin"/>
3955
4007
  <fo:block xsl:use-attribute-sets="feedback-statement-p-style">
3956
4008
  <xsl:call-template name="refine_feedback-statement-p-style"/>
@@ -10422,7 +10474,12 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
10422
10474
  <xsl:template match="mn:figure[@class = 'pseudocode']">
10423
10475
  <xsl:call-template name="setNamedDestination"/>
10424
10476
  <fo:block id="{@id}">
10425
- <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10477
+ <fo:block role="SKIP">
10478
+ <xsl:for-each select="mn:fmt-name"> <!-- set context -->
10479
+ <xsl:call-template name="setIDforNamedDestination"/>
10480
+ </xsl:for-each>
10481
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
10482
+ </fo:block>
10426
10483
  </fo:block>
10427
10484
  <xsl:apply-templates select="mn:fmt-name"/>
10428
10485
  </xsl:template>
@@ -13005,7 +13062,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
13005
13062
  </xsl:variable>
13006
13063
 
13007
13064
  <xsl:template name="index-pages">
13008
- <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
13065
+ <xsl:param name="num"/>
13009
13066
 
13010
13067
  <xsl:variable name="docid">
13011
13068
  <xsl:call-template name="getDocumentId"/>
@@ -14915,6 +14972,15 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14915
14972
  </xsl:if>
14916
14973
  </xsl:template>
14917
14974
 
14975
+ <!-- debug templates -->
14976
+ <xsl:template name="debug_contents">
14977
+ <xsl:if test="$debug = 'true'">
14978
+ <redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
14979
+ <xsl:copy-of select="$contents"/>
14980
+ </redirect:write>
14981
+ </xsl:if>
14982
+ </xsl:template>
14983
+
14918
14984
  <xsl:template name="processPrefaceSectionsDefault">
14919
14985
  <xsl:param name="num"/>
14920
14986
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
@@ -16149,14 +16215,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
16149
16215
  </xsl:template>
16150
16216
 
16151
16217
  <xsl:template name="setIDforNamedDestination">
16152
- <xsl:if test="@named_dest">
16153
- <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
16218
+ <xsl:if test="$isGenerateTableIF = 'false'">
16219
+ <xsl:if test="@named_dest">
16220
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
16221
+ </xsl:if>
16154
16222
  </xsl:if>
16155
16223
  </xsl:template>
16156
16224
 
16157
16225
  <xsl:template name="setIDforNamedDestinationInline">
16158
- <xsl:if test="@named_dest">
16159
- <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16226
+ <xsl:if test="$isGenerateTableIF = 'false'">
16227
+ <xsl:if test="@named_dest">
16228
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
16229
+ </xsl:if>
16160
16230
  </xsl:if>
16161
16231
  </xsl:template>
16162
16232
 
@@ -16166,7 +16236,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
16166
16236
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}.*')) = 'false'">
16167
16237
  <fox:destination internal-destination="{@id}"/>
16168
16238
  </xsl:if>
16169
- <xsl:for-each select=". | mn:fmt-title | mn:fmt-name">
16239
+ <xsl:for-each select=". | mn:fmt-title[1] | mn:fmt-name[1]">
16170
16240
  <xsl:if test="@named_dest">
16171
16241
  <fox:destination internal-destination="{@named_dest}"/>
16172
16242
  </xsl:if>
@@ -16174,6 +16244,12 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
16174
16244
  </xsl:if>
16175
16245
  </xsl:template>
16176
16246
 
16247
+ <xsl:template name="copyParagraphId">
16248
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}.*')) = 'false'">
16249
+ <xsl:copy-of select="@id"/>
16250
+ </xsl:if>
16251
+ </xsl:template>
16252
+
16177
16253
  <xsl:template name="add-letter-spacing">
16178
16254
  <xsl:param name="text"/>
16179
16255
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -16396,7 +16472,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
16396
16472
  <xsl:template name="insertCoverPageFullImage">
16397
16473
  <xsl:param name="name">coverpage-image</xsl:param>
16398
16474
  <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/*[local-name() = $name][1]/mn:image">
16399
- <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
16475
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force" initial-page-number="1">
16400
16476
  <fo:flow flow-name="xsl-region-body">
16401
16477
  <xsl:call-template name="insertBackgroundPageImage">
16402
16478
  <xsl:with-param name="number" select="position()"/>
@@ -16860,6 +16936,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
16860
16936
  </xsl:attribute>
16861
16937
  </xsl:template>
16862
16938
 
16939
+ <xsl:template name="insert_firstpage_id">
16940
+ <xsl:param name="num"/>
16941
+ <fo:wrapper role="artifact">
16942
+ <fo:block-container absolute-position="fixed" top="1mm">
16943
+ <xsl:if test="$num = 1">
16944
+ <xsl:attribute name="id">firstpage_id_0</xsl:attribute>
16945
+ </xsl:if>
16946
+ <fo:block id="firstpage_id_{$num}" role="SKIP"> </fo:block>
16947
+ </fo:block-container>
16948
+ </fo:wrapper>
16949
+ </xsl:template>
16950
+
16863
16951
  <xsl:template name="getCharByCodePoint">
16864
16952
  <xsl:param name="codepoint"/>
16865
16953
  <xsl:param name="radix">16</xsl:param>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.8.3".freeze
3
+ VERSION = "2.8.4".freeze
4
4
  end
5
5
  end
6
6
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
32
32
 
33
- spec.add_dependency "metanorma-iso", "~> 3.3.1"
33
+ spec.add_dependency "metanorma-iso", "~> 3.4.0"
34
34
  spec.add_dependency "pubid"
35
35
 
36
36
  spec.add_development_dependency "canon", "= 0.1.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.3
4
+ version: 2.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-30 00:00:00.000000000 Z
11
+ date: 2026-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.1
19
+ version: 3.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.3.1
26
+ version: 3.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pubid
29
29
  requirement: !ruby/object:Gem::Requirement