metanorma-csa 2.7.1 → 2.7.2

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: f9fbf21e53ed4478f6ec43e593984fd7ba6bf273df34a7b6a8b49c6d89b71e5b
4
- data.tar.gz: 8674dcf9228706dba024db8019a39037affca9fd4d41744d13813b2b31c0f516
3
+ metadata.gz: af1b39744c44f49ebc284d6f837057d307af5336822373c586f6bafe91c5454d
4
+ data.tar.gz: 5b7132926ce53c8d13e007e2108b887dfbf25cc91d1cb87cbae6ef660e383ccd
5
5
  SHA512:
6
- metadata.gz: b92d2ec6643339f6b7ccdba7ecf9956bd650ffd772848edb09608947d05f03b8214ce0d2615dc2ceacd5e4817e26756136530dfaac505e06de93f6d9b860009c
7
- data.tar.gz: 792f71be791f3403d8f5005f2de8086851aa559475014461149cf6a040d73b9f7a01b8470147e1141f5dfb28da41c8e41f76d08551700f7cf6dfb1582996a06d
6
+ metadata.gz: 3b23ccb7c0d414cd46ba49272aef1f00c4b7b1adb2bcfd7ef72288a2dd7a5d291535f65b0d78e2871321fe1808a8c2d8c4c5a7ee801f7c5fe9654a06bfb3048e
7
+ data.tar.gz: ccd3e3956e3dcec9568cd871e7ea06ca11f04454937c4302b58a7b08b59e355691ef09eea0af4a480f815e03c5f6cfd4d2d7c89a4ae4c175ec557894fb342f9c
@@ -2199,13 +2199,23 @@
2199
2199
  <xsl:attribute-set name="copyright-statement-style">
2200
2200
  </xsl:attribute-set> <!-- copyright-statement-style -->
2201
2201
 
2202
+ <xsl:template name="refine_copyright-statement-style">
2203
+ </xsl:template>
2204
+
2202
2205
  <xsl:attribute-set name="copyright-statement-title-style">
2203
2206
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
2204
2207
 
2208
+ <xsl:template name="refine_copyright-statement-title-style">
2209
+ </xsl:template>
2210
+
2205
2211
  <xsl:attribute-set name="copyright-statement-p-style">
2206
2212
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
2207
2213
 
2208
- <xsl:attribute-set name="license-statement-style">
2214
+ <xsl:template name="refine_copyright-statement-p-style">
2215
+
2216
+ </xsl:template>
2217
+
2218
+ <xsl:attribute-set name="license-statement-style">
2209
2219
  </xsl:attribute-set> <!-- license-statement-style -->
2210
2220
 
2211
2221
  <xsl:attribute-set name="license-statement-title-style">
@@ -2215,6 +2225,10 @@
2215
2225
  <xsl:attribute-set name="license-statement-p-style">
2216
2226
  </xsl:attribute-set> <!-- license-statement-p-style -->
2217
2227
 
2228
+ <xsl:template name="refine_license-statement-p-style">
2229
+
2230
+ </xsl:template>
2231
+
2218
2232
  <xsl:attribute-set name="legal-statement-style">
2219
2233
  </xsl:attribute-set> <!-- legal-statement-style -->
2220
2234
 
@@ -2242,6 +2256,8 @@
2242
2256
  <!-- ================================= -->
2243
2257
  <xsl:template match="mn:copyright-statement">
2244
2258
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
2259
+ <xsl:call-template name="refine_copyright-statement-style"/>
2260
+
2245
2261
  <xsl:apply-templates/>
2246
2262
  </fo:block>
2247
2263
  </xsl:template> <!-- copyright-statement -->
@@ -3340,7 +3356,7 @@
3340
3356
  </xsl:otherwise>
3341
3357
  </xsl:choose>
3342
3358
  </xsl:variable>
3343
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
3359
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
3344
3360
  <style name="{$key}"><xsl:value-of select="$value"/></style>
3345
3361
  </xsl:if>
3346
3362
  <xsl:if test="$key = 'text-indent'">
@@ -10829,13 +10845,31 @@
10829
10845
  <!-- skip here, see the template 'fmt-review-start' -->
10830
10846
  </xsl:when>
10831
10847
  <xsl:otherwise>
10832
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
10833
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
10834
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
10835
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
10848
+ <xsl:choose>
10849
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
10850
+ <fo:block font-size="1pt" line-height="0.1">
10851
+ <xsl:call-template name="fo_inline_bookmark">
10852
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
10853
+ </xsl:call-template>
10854
+ </fo:block>
10855
+ </xsl:when>
10856
+ <xsl:otherwise>
10857
+ <xsl:call-template name="fo_inline_bookmark">
10858
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
10859
+ </xsl:call-template>
10860
+ </xsl:otherwise>
10861
+ </xsl:choose>
10836
10862
  </xsl:otherwise>
10837
10863
  </xsl:choose>
10838
10864
  </xsl:template>
10865
+
10866
+ <xsl:template name="fo_inline_bookmark">
10867
+ <xsl:param name="bookmark_id"/>
10868
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
10869
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
10870
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
10871
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
10872
+ </xsl:template>
10839
10873
  <!-- =================== -->
10840
10874
  <!-- End of Index processing -->
10841
10875
  <!-- =================== -->
@@ -12721,11 +12755,35 @@
12721
12755
 
12722
12756
  <xsl:template match="mn:svgmap"/>
12723
12757
 
12758
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
12759
+
12724
12760
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
12725
12761
  <xsl:template match="*[local-name() = 'lang_none']">
12726
12762
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
12727
12763
  </xsl:template>
12728
12764
 
12765
+ <xsl:template name="addTagElementT">
12766
+ <xsl:variable name="title_">
12767
+ <xsl:apply-templates select="mn:fmt-title"/>
12768
+ </xsl:variable>
12769
+ <xsl:variable name="title__">
12770
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
12771
+ <xsl:choose>
12772
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
12773
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
12774
+ </xsl:choose>
12775
+ </xsl:for-each>
12776
+ </xsl:variable>
12777
+ <xsl:variable name="title" select="normalize-space($title__)"/>
12778
+ <xsl:if test="$title != ''">
12779
+ <xsl:attribute name="fox:title">
12780
+ <xsl:if test="ancestor::mn:sections">
12781
+ <xsl:text>Section </xsl:text>
12782
+ </xsl:if>
12783
+ <xsl:value-of select="$title"/></xsl:attribute>
12784
+ </xsl:if>
12785
+ </xsl:template>
12786
+
12729
12787
  <xsl:template name="replaceChar">
12730
12788
  <xsl:param name="text"/>
12731
12789
  <xsl:param name="replace"/>
@@ -13492,6 +13550,13 @@
13492
13550
  <xsl:with-param name="default" select="$text_align_default"/>
13493
13551
  </xsl:call-template>
13494
13552
  <xsl:call-template name="setKeepAttributes"/>
13553
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
13554
+ <xsl:variable name="styles">
13555
+ <xsl:apply-templates select="*[1]"/>
13556
+ </xsl:variable>
13557
+ <!-- move attribute line-height from inline to block -->
13558
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
13559
+ </xsl:if>
13495
13560
  </xsl:template>
13496
13561
 
13497
13562
  <xsl:template name="setKeepAttributes">
@@ -13517,34 +13582,41 @@
13517
13582
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
13518
13583
  <fo:block>
13519
13584
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
13520
- <xsl:choose>
13521
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
13522
- <fo:instream-foreign-object fox:alt-text="Image Front">
13523
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
13524
- <xsl:call-template name="getSVG"/>
13525
- </fo:instream-foreign-object>
13526
- </xsl:when>
13527
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
13528
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
13529
- </xsl:when>
13530
- <xsl:otherwise> <!-- bitmap image -->
13531
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
13532
- <xsl:if test="$coverimage_src != ''">
13533
- <xsl:variable name="coverpage">
13534
- <xsl:call-template name="getImageURL">
13535
- <xsl:with-param name="src" select="$coverimage_src"/>
13536
- </xsl:call-template>
13537
- </xsl:variable>
13538
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
13539
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
13540
- </xsl:if>
13541
- </xsl:otherwise>
13542
- </xsl:choose>
13585
+
13586
+ <xsl:call-template name="insertPageImage"/>
13587
+
13543
13588
  </xsl:for-each>
13544
13589
  </fo:block>
13545
13590
  </fo:block-container>
13546
13591
  </xsl:template>
13547
13592
 
13593
+ <xsl:template name="insertPageImage">
13594
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
13595
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
13596
+ <xsl:choose>
13597
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
13598
+ <fo:instream-foreign-object fox:alt-text="Image Front">
13599
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
13600
+ <xsl:call-template name="getSVG"/>
13601
+ </fo:instream-foreign-object>
13602
+ </xsl:when>
13603
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
13604
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
13605
+ </xsl:when>
13606
+ <xsl:otherwise> <!-- bitmap image -->
13607
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
13608
+ <xsl:if test="$coverimage_src != ''">
13609
+ <xsl:variable name="coverpage">
13610
+ <xsl:call-template name="getImageURL">
13611
+ <xsl:with-param name="src" select="$coverimage_src"/>
13612
+ </xsl:call-template>
13613
+ </xsl:variable>
13614
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
13615
+ </xsl:if>
13616
+ </xsl:otherwise>
13617
+ </xsl:choose>
13618
+ </xsl:template>
13619
+
13548
13620
  <xsl:template name="getImageURL">
13549
13621
  <xsl:param name="src"/>
13550
13622
  <xsl:choose>
@@ -13972,6 +14044,14 @@
13972
14044
  </xsl:attribute>
13973
14045
  </xsl:template>
13974
14046
 
14047
+ <xsl:template name="getCharByCodePoint">
14048
+ <xsl:param name="codepoint"/>
14049
+ <xsl:param name="radix">16</xsl:param>
14050
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
14051
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
14052
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
14053
+ </xsl:template>
14054
+
13975
14055
  <xsl:template name="substring-after-last">
13976
14056
  <xsl:param name="value"/>
13977
14057
  <xsl:param name="delimiter"/>
@@ -23,7 +23,7 @@ module IsoDoc
23
23
 
24
24
  def author(isoxml, _out)
25
25
  set(:tc, "XXXX")
26
- tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
26
+ tc = isoxml.at(ns("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Technical committee']/name"))
27
27
  set(:tc, tc.text) if tc
28
28
  super
29
29
  end
@@ -76,12 +76,6 @@ from other documents in the same doctype</a:documentation>
76
76
  <ref name="flavor">
77
77
  <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
78
78
  </ref>
79
- <optional>
80
- <ref name="editorialgroup">
81
- <a:documentation>Groups associated with the production of the standards document, typically within
82
- a standards definition organization</a:documentation>
83
- </ref>
84
- </optional>
85
79
  <zeroOrMore>
86
80
  <ref name="ics">
87
81
  <a:documentation>Classification of the document contents taken from the International Classification of Standards</a:documentation>
@@ -130,49 +124,6 @@ a standards definition organization</a:documentation>
130
124
  However we prefer not to hardcode it, given ongoing extension.</a:documentation>
131
125
  <text/>
132
126
  </define>
133
- <define name="editorialgroup">
134
- <a:documentation>A group associated with the production of the standards document, typically within
135
- a standards definition organization</a:documentation>
136
- <element name="editorialgroup">
137
- <oneOrMore>
138
- <ref name="technical-committee">
139
- <a:documentation>A technical committee associated with the production of the standards document</a:documentation>
140
- </ref>
141
- </oneOrMore>
142
- </element>
143
- </define>
144
- <define name="technical-committee">
145
- <a:documentation>Technical committee associated with the production of a standards document</a:documentation>
146
- <element name="technical-committee">
147
- <ref name="IsoWorkgroup"/>
148
- </element>
149
- </define>
150
- <define name="IsoWorkgroup">
151
- <optional>
152
- <attribute name="number">
153
- <a:documentation>Numeric identifier of the technical committee</a:documentation>
154
- </attribute>
155
- </optional>
156
- <optional>
157
- <attribute name="type">
158
- <a:documentation>Type of the technical committee, used in identifying the technical committee</a:documentation>
159
- </attribute>
160
- </optional>
161
- <optional>
162
- <attribute name="identifier">
163
- <a:documentation>Non-numeric, complete identifier of the technical committee</a:documentation>
164
- </attribute>
165
- </optional>
166
- <optional>
167
- <attribute name="prefix">
168
- <a:documentation>Disambiguating prefix added to number to form the identifier of the technical committee,
169
- typically indicating its type</a:documentation>
170
- </attribute>
171
- </optional>
172
- <text>
173
- <a:documentation>Name of the technical committee</a:documentation>
174
- </text>
175
- </define>
176
127
  <define name="ics">
177
128
  <a:documentation>Classification taken from the International Classification of Standards.
178
129
  ICS is defined by ISO here -- https://www.iso.org/publication/PUB100033.html</a:documentation>
@@ -242,6 +242,8 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
242
242
  </choice>
243
243
  </define>
244
244
  <define name="roledescription">
245
+ <a:documentation>A more detailed description of the role of the contributor
246
+ Some descriptions are reserved words; in particular, the editorial committee of a standard has the role description "committee"</a:documentation>
245
247
  <element name="description">
246
248
  <ref name="LocalizedMarkedUpString"/>
247
249
  </element>
@@ -443,7 +445,10 @@ real names (if the person is named with a pseudonym or user name); previous lega
443
445
  </oneOrMore>
444
446
  <zeroOrMore>
445
447
  <ref name="subdivision">
446
- <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item</a:documentation>
448
+ <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item.
449
+ Multiple subdivisions can be specified for an organization, with no implication of hierarchical
450
+ relation between them
451
+ Editorial and advisory groups are represented as consecutive subdivisions of the SDO</a:documentation>
447
452
  </ref>
448
453
  </zeroOrMore>
449
454
  <optional>
@@ -485,6 +490,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
485
490
  <a:documentation>The type of subdivision</a:documentation>
486
491
  </attribute>
487
492
  </optional>
493
+ <optional>
494
+ <attribute name="subtype">
495
+ <a:documentation>The subtype of subdivision; e.g. different types of technical committee</a:documentation>
496
+ </attribute>
497
+ </optional>
488
498
  <ref name="OrganizationType">
489
499
  <a:documentation>The subdivision, modelled recursively as an organization</a:documentation>
490
500
  </ref>
@@ -28,20 +28,6 @@ module Metanorma
28
28
  end
29
29
  end
30
30
 
31
- def metadata_committee(node, xml)
32
- node.attr("technical-committee") or return
33
- xml.editorialgroup do |a|
34
- a.committee node.attr("technical-committee"),
35
- **attr_code(type: node.attr("technical-committee-type"))
36
- i = 2
37
- while node.attr("technical-committee_#{i}")
38
- a.committee node.attr("technical-committee_#{i}"),
39
- **attr_code(type: node.attr("technical-committee-type_#{i}"))
40
- i += 1
41
- end
42
- end
43
- end
44
-
45
31
  def title_validate(_root)
46
32
  nil
47
33
  end
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.1.0 -->
3
+ <!-- VERSION v2.1.1 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -2233,6 +2233,11 @@ used in document amendments</a:documentation>
2233
2233
  <ref name="RequiredId"/>
2234
2234
  <ref name="NumberingAttributes"/>
2235
2235
  <ref name="BlockAttributes"/>
2236
+ <optional>
2237
+ <attribute name="type">
2238
+ <a:documentation>Semantic classification of note</a:documentation>
2239
+ </attribute>
2240
+ </optional>
2236
2241
  <oneOrMore>
2237
2242
  <choice>
2238
2243
  <a:documentation>Content of the term note</a:documentation>
@@ -14,20 +14,5 @@
14
14
  <value>case-study</value>
15
15
  </choice>
16
16
  </define>
17
- <define name="editorialgroup">
18
- <element name="editorialgroup">
19
- <oneOrMore>
20
- <ref name="technical-committee"/>
21
- </oneOrMore>
22
- </element>
23
- </define>
24
- <define name="technical-committee">
25
- <element name="committee">
26
- <optional>
27
- <attribute name="type"/>
28
- </optional>
29
- <text/>
30
- </element>
31
- </define>
32
17
  </include>
33
18
  </grammar>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.7.1".freeze
3
+ VERSION = "2.7.2".freeze
4
4
  end
5
5
  end
data/metanorma.yml CHANGED
@@ -50,6 +50,8 @@ published_stages:
50
50
  - published
51
51
  - withdrawn
52
52
  default_stage: published
53
+ committee_types:
54
+ - technical-committee
53
55
  stage_abbreviations:
54
56
  proposal:
55
57
  working-draft: wd
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: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-08-04 00:00:00.000000000 Z
11
+ date: 2025-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic