metanorma-itu 2.1.13 → 2.2.0

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.
@@ -4690,6 +4690,10 @@
4690
4690
  <xsl:variable name="footnote_inline">
4691
4691
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4692
4692
 
4693
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4694
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4695
+ </xsl:if>
4696
+
4693
4697
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4694
4698
  <xsl:value-of select="$current_fn_number_text"/>
4695
4699
  </fo:basic-link>
@@ -5864,6 +5868,23 @@
5864
5868
  <xsl:apply-templates/>
5865
5869
  </xsl:template>
5866
5870
 
5871
+ <!-- Don't break standard's numbers -->
5872
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5873
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5874
+ <xsl:choose>
5875
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5876
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5877
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>
5880
+ <xsl:apply-templates/>
5881
+ </xsl:otherwise>
5882
+ </xsl:choose>
5883
+ </xsl:template>
5884
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
5885
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5886
+ </xsl:template>
5887
+
5867
5888
  <!-- ========================= -->
5868
5889
  <!-- END Rich text formatting -->
5869
5890
  <!-- ========================= -->
@@ -6259,7 +6280,7 @@
6259
6280
  <xsl:choose>
6260
6281
  <xsl:when test="@colspan">
6261
6282
  <xsl:variable name="td">
6262
- <xsl:element name="td">
6283
+ <xsl:element name="{local-name()}">
6263
6284
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6264
6285
  <xsl:if test="local-name()='th'">
6265
6286
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6274,7 +6295,7 @@
6274
6295
  </xsl:call-template>
6275
6296
  </xsl:when>
6276
6297
  <xsl:otherwise>
6277
- <xsl:element name="td">
6298
+ <xsl:element name="{local-name()}">
6278
6299
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6279
6300
  <xsl:if test="local-name()='th'">
6280
6301
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6341,7 +6362,7 @@
6341
6362
  <xsl:variable name="currentRow" select="."/>
6342
6363
 
6343
6364
  <xsl:variable name="normalizedTDs">
6344
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
6365
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
6345
6366
  <xsl:choose>
6346
6367
  <xsl:when test="@rowspan &gt; 1">
6347
6368
  <xsl:copy>
@@ -6353,7 +6374,7 @@
6353
6374
  </xsl:copy>
6354
6375
  </xsl:when>
6355
6376
  <xsl:otherwise>
6356
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
6377
+ <xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
6357
6378
  </xsl:otherwise>
6358
6379
  </xsl:choose>
6359
6380
  </xsl:for-each>
@@ -7023,12 +7044,6 @@
7023
7044
 
7024
7045
  <fo:block-container margin-left="0mm">
7025
7046
 
7026
- <!-- <xsl:if test="$namespace = 'iho'">
7027
- <xsl:if test="ancestor::iho:td">
7028
- <xsl:attribute name="font-size">12pt</xsl:attribute>
7029
- </xsl:if>
7030
- </xsl:if> -->
7031
-
7032
7047
  <fo:block>
7033
7048
 
7034
7049
  <xsl:if test="ancestor::itu:figure">
@@ -7538,6 +7553,31 @@
7538
7553
  <xsl:apply-templates mode="svg_update"/>
7539
7554
  </xsl:copy>
7540
7555
  </xsl:template>
7556
+
7557
+ <!-- regex for 'display: inline-block;' -->
7558
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7559
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7560
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7561
+ </xsl:template>
7562
+
7563
+ <!-- replace
7564
+ stroke="rgba(r, g, b, alpha)" to
7565
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7566
+ fill="rgba(r, g, b, alpha)" to
7567
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7568
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7569
+ <xsl:variable name="components_">
7570
+ <xsl:call-template name="split">
7571
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7572
+ <xsl:with-param name="sep" select="','"/>
7573
+ </xsl:call-template>
7574
+ </xsl:variable>
7575
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7576
+ <xsl:variable name="att_name" select="local-name()"/>
7577
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7578
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7579
+ </xsl:template>
7580
+
7541
7581
  <!-- ============== -->
7542
7582
  <!-- END: svg_update -->
7543
7583
  <!-- ============== -->
@@ -10516,7 +10556,9 @@
10516
10556
  <!-- Update xml -->
10517
10557
  <!-- ===================================== -->
10518
10558
  <!-- =========================================================================== -->
10519
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10559
+ <!-- STEP1: -->
10560
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10561
+ <!-- - Ignore 'span' without style -->
10520
10562
  <!-- =========================================================================== -->
10521
10563
  <xsl:template match="@*|node()" mode="update_xml_step1">
10522
10564
  <xsl:copy>
@@ -10599,7 +10641,8 @@
10599
10641
  </xsl:copy>
10600
10642
  </xsl:template>
10601
10643
 
10602
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10644
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10645
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
10603
10646
  <xsl:copy>
10604
10647
  <xsl:copy-of select="@*"/>
10605
10648
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -150,13 +150,13 @@ module IsoDoc
150
150
 
151
151
  elem.elements.first.previous = annex1_supertitle(elem)
152
152
  t = elem.at(ns("./title")) and
153
- t.children = "<strong>#{t.children.to_xml}</strong>"
153
+ t.children = "<strong>#{to_xml(t.children)}</strong>"
154
154
  end
155
155
 
156
156
  def annex1_supertitle(elem)
157
157
  lbl = @xrefs.anchor(elem["id"], :label)
158
158
  res = elem.at(ns("//bibdata/title[@type = 'resolution']"))
159
- subhead = @i18n.l10n("(#{@i18n.get['to']} #{res.children.to_xml})")
159
+ subhead = @i18n.l10n("(#{@i18n.get['to']} #{to_xml(res.children)})")
160
160
  "<p class='supertitle'>#{lbl}<br/>#{subhead}</p>"
161
161
  end
162
162
 
@@ -683,6 +683,9 @@
683
683
  </define>
684
684
  <define name="underline">
685
685
  <element name="underline">
686
+ <optional>
687
+ <attribute name="style"/>
688
+ </optional>
686
689
  <zeroOrMore>
687
690
  <ref name="PureTextElement"/>
688
691
  </zeroOrMore>
@@ -47,7 +47,7 @@
47
47
  </element>
48
48
  </define>
49
49
  <define name="DocumentType">
50
- <value>document</value>
50
+ <text/>
51
51
  </define>
52
52
  <define name="docsubtype">
53
53
  <element name="subdoctype">
@@ -2653,6 +2653,7 @@
2653
2653
  <value>full</value>
2654
2654
  <value>short</value>
2655
2655
  <value>id</value>
2656
+ <value>modspec</value>
2656
2657
  </choice>
2657
2658
  </define>
2658
2659
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "2.1.13".freeze
3
+ VERSION = "2.2.0".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "htmlentities", "~> 4.3.4"
29
- spec.add_dependency "metanorma-standoc", "~> 2.2.4"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.3.0"
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "twitter_cldr", ">= 3.0.0"
32
32
  spec.add_dependency "tzinfo-data" # we need this for windows only
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.13
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-21 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.4
33
+ version: 2.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.2.4
40
+ version: 2.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby-jing
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  - !ruby/object:Gem::Version
356
356
  version: '0'
357
357
  requirements: []
358
- rubygems_version: 3.3.7
358
+ rubygems_version: 3.3.26
359
359
  signing_key:
360
360
  specification_version: 4
361
361
  summary: Metanorma for the ITU