metanorma-ogc 2.3.14 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4677,6 +4677,9 @@
4677
4677
  <!-- END Definition List -->
4678
4678
  <!-- ===================== -->
4679
4679
 
4680
+ <!-- default: ignore title in sections/p -->
4681
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
4682
+
4680
4683
  <!-- ========================= -->
4681
4684
  <!-- Rich text formatting -->
4682
4685
  <!-- ========================= -->
@@ -6762,25 +6765,45 @@
6762
6765
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6763
6766
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6764
6767
 
6765
- <xsl:variable name="img_src">
6766
- <xsl:choose>
6767
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6768
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6769
- </xsl:choose>
6770
- </xsl:variable>
6768
+ <xsl:if test="@width != '' and @width != 'auto'">
6769
+ <xsl:attribute name="width">
6770
+ <xsl:value-of select="@width"/>
6771
+ </xsl:attribute>
6772
+ </xsl:if>
6771
6773
 
6772
- <xsl:variable name="image_width_effective">
6774
+ <xsl:if test="@height != '' and @height != 'auto'">
6775
+ <xsl:attribute name="height">
6776
+ <xsl:value-of select="@height"/>
6777
+ </xsl:attribute>
6778
+ </xsl:if>
6773
6779
 
6774
- <xsl:value-of select="$width_effective"/>
6780
+ <xsl:choose>
6781
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
6782
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
6783
+ </xsl:when>
6784
+ <xsl:otherwise>
6775
6785
 
6776
- </xsl:variable>
6786
+ <xsl:variable name="img_src">
6787
+ <xsl:choose>
6788
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6789
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6790
+ </xsl:choose>
6791
+ </xsl:variable>
6777
6792
 
6778
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6779
- <xsl:if test="number($scale) &lt; 100">
6793
+ <xsl:variable name="image_width_effective">
6780
6794
 
6781
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6795
+ <xsl:value-of select="$width_effective"/>
6782
6796
 
6783
- </xsl:if>
6797
+ </xsl:variable>
6798
+
6799
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6800
+ <xsl:if test="number($scale) &lt; 100">
6801
+
6802
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6803
+
6804
+ </xsl:if>
6805
+ </xsl:otherwise>
6806
+ </xsl:choose>
6784
6807
 
6785
6808
  </xsl:if>
6786
6809
 
@@ -10462,7 +10485,7 @@
10462
10485
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10463
10486
  <xsl:apply-templates mode="update_xml_step1"/>
10464
10487
  </xsl:template>
10465
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10488
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10466
10489
  <xsl:copy>
10467
10490
  <xsl:copy-of select="@*"/>
10468
10491
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -10,6 +10,8 @@ module IsoDoc
10
10
  super
11
11
  end
12
12
 
13
+ def middle_title(docxml); end
14
+
13
15
  def convert1(docxml, filename, dir)
14
16
  info docxml, nil
15
17
  super
@@ -1,21 +1,10 @@
1
1
  module IsoDoc
2
2
  module Ogc
3
3
  module BaseConvert
4
- def front(isoxml, out)
5
- p = isoxml.at(ns("//preface")) or return
6
- p.elements.each do |e|
7
- if is_clause?(e.name)
8
- case e.name
9
- when "abstract" then abstract e, out
10
- when "foreword" then foreword e, out
11
- when "introduction" then introduction e, out
12
- when "submitters" then intro_clause e, out
13
- when "clause" then preface e, out
14
- when "acknowledgements" then acknowledgements e, out
15
- end
16
- else
17
- preface_block(e, out)
18
- end
4
+ def top_element_render(node, out)
5
+ case node.name
6
+ when "submitters" then intro_clause node, out
7
+ else super
19
8
  end
20
9
  end
21
10
 
@@ -23,9 +12,6 @@ module IsoDoc
23
12
  case clause["type"]
24
13
  when "toc"
25
14
  table_of_contents(clause, out)
26
- when "executivesummary", "security", "submitting_orgs",
27
- "keywords"
28
- intro_clause(clause, out)
29
15
  else
30
16
  intro_clause(clause, out)
31
17
  end
@@ -66,15 +52,6 @@ module IsoDoc
66
52
  def acknowledgements(clause, out)
67
53
  intro_clause(clause, out)
68
54
  end
69
-
70
- def conformance(isoxml, out, num)
71
- f = isoxml.at(ns("//clause[@type = 'conformance']")) or return num
72
- out.div **attr_code(id: f["id"]) do |div|
73
- clause_name(f, f&.at(ns("./title")), div, nil)
74
- f.elements.each { |e| parse(e, div) unless e.name == "title" }
75
- end
76
- num
77
- end
78
55
  end
79
56
  end
80
57
  end
@@ -87,27 +87,8 @@ module IsoDoc
87
87
  end
88
88
 
89
89
  def make_body2(body, docxml)
90
- body.div **{ class: "WordSection2" } do |div2|
91
- @prefacenum = 0
92
- info docxml, div2
93
- boilerplate docxml, div2
94
- front docxml, div2
95
- =begin
96
- preface_block docxml, div2
97
- abstract docxml, div2
98
- executivesummary docxml, div2
99
- keywords docxml, div2
100
- foreword docxml, div2
101
- introduction docxml, div2
102
- security docxml, div2
103
- submittingorgs docxml, div2
104
- submitters docxml, div2
105
- preface docxml, div2
106
- acknowledgements docxml, div2
107
- =end
108
- div2.p { |p| p << "&#xA0;" } # placeholder
109
- end
110
- section_break(body)
90
+ @prefacenum = 0
91
+ super
111
92
  end
112
93
 
113
94
  def word_cleanup(docxml)
@@ -160,7 +141,7 @@ module IsoDoc
160
141
 
161
142
  def toWord(result, filename, dir, header)
162
143
  result = from_xhtml(word_cleanup(to_xhtml(result)))
163
- .gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
144
+ .gsub("-DOUBLE_HYPHEN_ESCAPE-", "--")
164
145
  @wordstylesheet = wordstylesheet_update
165
146
  Html2Doc.new(
166
147
  filename: filename, imagedir: @localdir,
@@ -16,7 +16,7 @@ Recipients of this document are requested to submit, with their comments, notifi
16
16
  == license-statement
17
17
  === License Agreement
18
18
 
19
- >Use of this document is subject to the license agreement at https://www.ogc.org/license[]
19
+ Use of this document is subject to the license agreement at https://www.ogc.org/license[]
20
20
 
21
21
  == legal-statement
22
22
  {% if doctype == "Standard" or doctype == "Community Standard" or doctype == "Abstract Specification" %}
@@ -35,7 +35,7 @@ Recipients of this document are invited to submit, with their comments, notifica
35
35
 
36
36
  {% elsif doctype == "Engineering Report" %}
37
37
  === Notice
38
- This document is not an OGC Standard. This document is an OGC Public Engineering Report created as a deliverable in an OGC Interoperability Initiative and is <em>not an official position</em> of the OGC membership. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard.
38
+ This document is not an OGC Standard. This document is an OGC Public Engineering Report created as a deliverable in an OGC Interoperability Initiative and is _not an official position_ of the OGC membership. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard.
39
39
 
40
40
  Further, any OGC Engineering Report should not be referenced as required or mandatory technology in procurements. However, the discussions in this document could very well lead to the definition of an OGC Standard.
41
41
 
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.2 -->
20
+ <!-- VERSION v1.2.3 -->
21
21
  <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">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -192,9 +192,11 @@
192
192
  </attribute>
193
193
  </optional>
194
194
  <attribute name="citeas"/>
195
- <attribute name="type">
196
- <ref name="ReferenceFormat"/>
197
- </attribute>
195
+ <optional>
196
+ <attribute name="type">
197
+ <ref name="ReferenceFormat"/>
198
+ </attribute>
199
+ </optional>
198
200
  <optional>
199
201
  <attribute name="alt"/>
200
202
  </optional>
@@ -836,6 +838,26 @@
836
838
  <ref name="paragraph"/>
837
839
  </element>
838
840
  </define>
841
+ <define name="stem">
842
+ <element name="stem">
843
+ <attribute name="type">
844
+ <choice>
845
+ <value>MathML</value>
846
+ <value>AsciiMath</value>
847
+ <value>LatexMath</value>
848
+ </choice>
849
+ </attribute>
850
+ <attribute name="block">
851
+ <data type="boolean"/>
852
+ </attribute>
853
+ <oneOrMore>
854
+ <choice>
855
+ <text/>
856
+ <ref name="AnyElement"/>
857
+ </choice>
858
+ </oneOrMore>
859
+ </element>
860
+ </define>
839
861
  <define name="em">
840
862
  <element name="em">
841
863
  <zeroOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.3.14".freeze
3
+ VERSION = "2.4.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 "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.4.2"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.5.0"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.14
4
+ version: 2.4.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: 2023-07-24 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.2
33
+ version: 2.5.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.4.2
40
+ version: 2.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement