metanorma-ieee 1.2.1 → 1.2.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: daaebf8c438f244ad1a0cc4c804f1aac05fcdf3252bb9b2847f0ab056ed5ffc0
4
- data.tar.gz: 4cf01847b8a56f6e9a520cd7509cc56cec8077d891bef18beed30262688e87bf
3
+ metadata.gz: b7f574040d82c858fbb3b98fc96b1e02878cd228cfeaca8f9f911f39e6109896
4
+ data.tar.gz: 7246caedc4a16824404480f881c24b6197079874bc676e872bd86f0bae639a1d
5
5
  SHA512:
6
- metadata.gz: 8af52bc41555e8ef7ff4f296dd65522cab8896226b9cbdad0b443f49a4a428343c0c205ff733845f8a4e93f707f543e152897b5895456ab2b72494e3c0a2cddc
7
- data.tar.gz: f2b0d65f7e1e5e853363ac60dd7608b90d04f97368360dd60701e60d115f09d7973bd4791edd76b990f13d5628224c78e0883185743187efb532e1e1a68dad00
6
+ metadata.gz: e0b6d672c80a2f0d3847e572e26c738ce506e4918eeccbe521d99e1a65d4fe4095296000eb9d5e4ac286c4618cf13d77cdf9f103b92987fbd05152c151125ebb
7
+ data.tar.gz: 0f851f69bb307f2ba91825b31e6dd40113d25d1f07263c895ac4569547630d1f40732661e898a15d51f7c3503e285381e8d51ec0b55f4411ff7706426a1b1d68
@@ -4327,6 +4327,10 @@
4327
4327
 
4328
4328
  </xsl:attribute-set>
4329
4329
 
4330
+ <xsl:template name="refine_termexample-style">
4331
+
4332
+ </xsl:template>
4333
+
4330
4334
  <xsl:attribute-set name="example-style">
4331
4335
 
4332
4336
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -5496,6 +5500,36 @@
5496
5500
  </xsl:for-each>
5497
5501
  </xsl:template>
5498
5502
 
5503
+ <xsl:template name="processMainSectionsDefault_flatxml">
5504
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
5505
+ <xsl:sort select="@displayorder" data-type="number"/>
5506
+ <xsl:variable name="flatxml">
5507
+ <xsl:apply-templates select="." mode="flatxml"/>
5508
+ </xsl:variable>
5509
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5510
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5511
+
5512
+ </xsl:for-each>
5513
+
5514
+ <xsl:for-each select="/*/*[local-name()='annex']">
5515
+ <xsl:sort select="@displayorder" data-type="number"/>
5516
+ <xsl:variable name="flatxml">
5517
+ <xsl:apply-templates select="." mode="flatxml"/>
5518
+ </xsl:variable>
5519
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5520
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5521
+ </xsl:for-each>
5522
+
5523
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
5524
+ <xsl:sort select="@displayorder" data-type="number"/>
5525
+ <xsl:variable name="flatxml">
5526
+ <xsl:apply-templates select="." mode="flatxml"/>
5527
+ </xsl:variable>
5528
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5529
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5530
+ </xsl:for-each>
5531
+ </xsl:template>
5532
+
5499
5533
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
5500
5534
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
5501
5535
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -7602,13 +7636,13 @@
7602
7636
  <tr>
7603
7637
  <td>
7604
7638
  <xsl:attribute name="id">
7605
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
7639
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
7606
7640
  </xsl:attribute>
7607
7641
  <xsl:apply-templates/>
7608
7642
  </td>
7609
7643
  <td>
7610
7644
  <xsl:attribute name="id">
7611
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
7645
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
7612
7646
  </xsl:attribute>
7613
7647
 
7614
7648
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -8217,6 +8251,10 @@
8217
8251
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
8218
8252
  </xsl:template>
8219
8253
 
8254
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
8255
+ <xsl:value-of select="."/>
8256
+ </xsl:template>
8257
+
8220
8258
  <!-- ========================= -->
8221
8259
  <!-- END Rich text formatting -->
8222
8260
  <!-- ========================= -->
@@ -8847,7 +8885,7 @@
8847
8885
  </xsl:choose>
8848
8886
  </xsl:variable>
8849
8887
  <xsl:attribute name="id">
8850
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
8888
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
8851
8889
  </xsl:attribute>
8852
8890
 
8853
8891
  <xsl:for-each select="*[local-name() = 'p']">
@@ -8855,7 +8893,7 @@
8855
8893
  <xsl:copy-of select="@*"/>
8856
8894
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
8857
8895
  <xsl:attribute name="id">
8858
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8896
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8859
8897
  </xsl:attribute>
8860
8898
 
8861
8899
  <!-- <xsl:copy-of select="node()" /> -->
@@ -8919,7 +8957,7 @@
8919
8957
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
8920
8958
  <xsl:copy>
8921
8959
  <xsl:attribute name="id">
8922
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
8960
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
8923
8961
  </xsl:attribute>
8924
8962
  <xsl:copy-of select="node()"/>
8925
8963
  </xsl:copy>
@@ -11724,7 +11762,7 @@
11724
11762
  <!-- ====== -->
11725
11763
  <xsl:template match="*[local-name() = 'termexample']">
11726
11764
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
11727
-
11765
+ <xsl:call-template name="refine_termexample-style"/>
11728
11766
  <xsl:call-template name="setBlockSpanAll"/>
11729
11767
 
11730
11768
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -4327,6 +4327,10 @@
4327
4327
 
4328
4328
  </xsl:attribute-set>
4329
4329
 
4330
+ <xsl:template name="refine_termexample-style">
4331
+
4332
+ </xsl:template>
4333
+
4330
4334
  <xsl:attribute-set name="example-style">
4331
4335
 
4332
4336
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -5496,6 +5500,36 @@
5496
5500
  </xsl:for-each>
5497
5501
  </xsl:template>
5498
5502
 
5503
+ <xsl:template name="processMainSectionsDefault_flatxml">
5504
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
5505
+ <xsl:sort select="@displayorder" data-type="number"/>
5506
+ <xsl:variable name="flatxml">
5507
+ <xsl:apply-templates select="." mode="flatxml"/>
5508
+ </xsl:variable>
5509
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5510
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5511
+
5512
+ </xsl:for-each>
5513
+
5514
+ <xsl:for-each select="/*/*[local-name()='annex']">
5515
+ <xsl:sort select="@displayorder" data-type="number"/>
5516
+ <xsl:variable name="flatxml">
5517
+ <xsl:apply-templates select="." mode="flatxml"/>
5518
+ </xsl:variable>
5519
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5520
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5521
+ </xsl:for-each>
5522
+
5523
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
5524
+ <xsl:sort select="@displayorder" data-type="number"/>
5525
+ <xsl:variable name="flatxml">
5526
+ <xsl:apply-templates select="." mode="flatxml"/>
5527
+ </xsl:variable>
5528
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
5529
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
5530
+ </xsl:for-each>
5531
+ </xsl:template>
5532
+
5499
5533
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
5500
5534
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
5501
5535
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -7602,13 +7636,13 @@
7602
7636
  <tr>
7603
7637
  <td>
7604
7638
  <xsl:attribute name="id">
7605
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
7639
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
7606
7640
  </xsl:attribute>
7607
7641
  <xsl:apply-templates/>
7608
7642
  </td>
7609
7643
  <td>
7610
7644
  <xsl:attribute name="id">
7611
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
7645
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
7612
7646
  </xsl:attribute>
7613
7647
 
7614
7648
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -8217,6 +8251,10 @@
8217
8251
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
8218
8252
  </xsl:template>
8219
8253
 
8254
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
8255
+ <xsl:value-of select="."/>
8256
+ </xsl:template>
8257
+
8220
8258
  <!-- ========================= -->
8221
8259
  <!-- END Rich text formatting -->
8222
8260
  <!-- ========================= -->
@@ -8847,7 +8885,7 @@
8847
8885
  </xsl:choose>
8848
8886
  </xsl:variable>
8849
8887
  <xsl:attribute name="id">
8850
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
8888
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
8851
8889
  </xsl:attribute>
8852
8890
 
8853
8891
  <xsl:for-each select="*[local-name() = 'p']">
@@ -8855,7 +8893,7 @@
8855
8893
  <xsl:copy-of select="@*"/>
8856
8894
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
8857
8895
  <xsl:attribute name="id">
8858
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8896
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
8859
8897
  </xsl:attribute>
8860
8898
 
8861
8899
  <!-- <xsl:copy-of select="node()" /> -->
@@ -8919,7 +8957,7 @@
8919
8957
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
8920
8958
  <xsl:copy>
8921
8959
  <xsl:attribute name="id">
8922
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
8960
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
8923
8961
  </xsl:attribute>
8924
8962
  <xsl:copy-of select="node()"/>
8925
8963
  </xsl:copy>
@@ -11724,7 +11762,7 @@
11724
11762
  <!-- ====== -->
11725
11763
  <xsl:template match="*[local-name() = 'termexample']">
11726
11764
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
11727
-
11765
+ <xsl:call-template name="refine_termexample-style"/>
11728
11766
  <xsl:call-template name="setBlockSpanAll"/>
11729
11767
 
11730
11768
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -44,7 +44,7 @@ module IsoDoc
44
44
  # AGENCY+ TYPE NUMBER YEAR
45
45
  def std_docid_semantic_full(ident)
46
46
  m = ident.match(%r{(?<text>[^0-9]+\p{Zs})
47
- (?<num>[0-9]+)
47
+ (?<num>[0-9]+[^:]*)
48
48
  (?:[:](?<yr>(?:19|20)\d\d))?}x)
49
49
  m or return ident
50
50
  ret = std_docid_sdo(m[:text]) +
@@ -66,12 +66,11 @@ module IsoDoc
66
66
  end
67
67
 
68
68
  def bibliography_bibitem_number1(bibitem, idx)
69
- if mn = bibitem.at(ns(".//docidentifier[@type = 'metanorma']"))
70
- /^\[?\d\]?$/.match?(mn&.text) and
71
- idx = mn.text.sub(/^\[B?/, "").sub(/\]$/, "").to_i
69
+ bibitem.xpath(ns(".//docidentifier[@type = 'metanorma' or " \
70
+ "@type = 'metanorma-ordinal']")).each do |mn|
71
+ /^\[?B?\d\]?$/.match?(mn&.text) and mn.remove
72
72
  end
73
73
  unless bibliography_bibitem_number_skip(bibitem)
74
-
75
74
  idx += 1
76
75
  bibitem.at(ns(".//docidentifier")).previous =
77
76
  "<docidentifier type='metanorma-ordinal'>[B#{idx}]</docidentifier>"
@@ -31,6 +31,7 @@ module Metanorma
31
31
  xml.docidentifier a, type: "ISBN", scope: "PDF"
32
32
  a = node.attr("isbn-print") and
33
33
  xml.docidentifier a, type: "ISBN", scope: "print"
34
+ xml.docnumber node.attr("docnumber")
34
35
  end
35
36
 
36
37
  def metadata_id(node, xml)
@@ -42,7 +43,6 @@ module Metanorma
42
43
  xml.docidentifier id, type: "IEEE", scope: "PDF"
43
44
  id = node.attr("stdid-print") and
44
45
  xml.docidentifier id, type: "IEEE", scope: "print"
45
- xml.docnumber node.attr("docnumber")
46
46
  end
47
47
 
48
48
  def ieee_id(node, xml)
@@ -57,6 +57,10 @@ module Metanorma
57
57
  core.merge(amd)
58
58
  end
59
59
 
60
+ def compact_blank(hash)
61
+ hash.compact.reject { |_, v| v.is_a?(String) && v.empty? }
62
+ end
63
+
60
64
  def ieee_id_params_core(node)
61
65
  pub = ieee_id_pub(node)
62
66
  ret = { number: node.attr("docnumber"),
@@ -64,9 +68,9 @@ module Metanorma
64
68
  year: ieee_id_year(node, initial: true),
65
69
  redline: @doctype == "redline",
66
70
  publisher: pub[0],
67
- copublisher: pub[1..-1] }.compact
71
+ copublisher: pub[1..-1] }
68
72
  ret[:copublisher].empty? and ret.delete(:copublisher)
69
- ret
73
+ compact_blank(ret)
70
74
  end
71
75
 
72
76
  def ieee_id_params_amd(node, core)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IEEE
3
- VERSION = "1.2.1".freeze
3
+ VERSION = "1.2.2".freeze
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
- spec.add_dependency "metanorma-standoc", "~> 2.8.0"
28
+ spec.add_dependency "metanorma-standoc", "~> 2.8.2"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
30
  spec.add_dependency "pubid-ieee"
31
31
  #spec.add_dependency "pubid-iso", "~> 0.5.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.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: 2024-02-05 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.0
19
+ version: 2.8.2
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: 2.8.0
26
+ version: 2.8.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement