metanorma-ogc 2.3.14 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -193,33 +195,6 @@ module IsoDoc
193
195
  xml.children = "#{f}#{xml.xpath(ns(keep)).to_xml}"
194
196
  end
195
197
 
196
- SECT_TERMS = "//sections/terms | //sections/clause[descendant::terms]"
197
- .freeze
198
-
199
- def display_order(docxml)
200
- i = 0
201
- i = display_order_xpath(docxml, "//preface/*", i)
202
- i = display_order_at(docxml, "//clause[@type = 'scope']", i)
203
- i = display_order_at(docxml, "//clause[@type = 'conformance']", i)
204
- i = display_order_at(docxml, @xrefs.klass.norm_ref_xpath, i)
205
- i = display_order_clauses(docxml, i)
206
- i = display_order_xpath(docxml, "//annex", i)
207
- i = display_order_xpath(docxml, @xrefs.klass.bibliography_xpath, i)
208
- display_order_xpath(docxml, "//indexsect", i)
209
- end
210
-
211
- def display_order_clauses(docxml, idx)
212
- if docxml.at(ns("//bibdata/ext/doctype"))&.text == "engineering-report"
213
- xpath = "#{SECT_TERMS} | //sections/definitions | " +
214
- @xrefs.klass.middle_clause(docxml)
215
- return display_order_xpath(docxml, xpath, idx)
216
- end
217
- idx = display_order_at(docxml, SECT_TERMS, idx)
218
- idx = display_order_at(docxml, "//sections/definitions", idx)
219
- display_order_xpath(docxml, @xrefs.klass.middle_clause(docxml),
220
- idx)
221
- end
222
-
223
198
  def norm_ref_entry_code(_ordinal, _idents, _ids, _standard, _datefn, _bib)
224
199
  ""
225
200
  end
@@ -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,
@@ -4,52 +4,22 @@ module IsoDoc
4
4
  end
5
5
 
6
6
  class Xref < IsoDoc::Xref
7
- def initial_anchor_names(doc)
8
- if @parse_settings.empty? || @parse_settings[:clauses]
9
- preface_anchor_names(doc)
10
- n = Counter.new
11
- n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
12
- n = section_names(doc.at(ns("//clause[@type = 'conformance']")), n, 1)
13
- n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
14
- initial_anchor_names_middle(doc, n,
15
- doc.at(ns("//bibdata/ext/doctype"))&.text)
16
- end
17
- end
18
-
19
- TERMS_SECT = "//sections/terms | //sections/clause[descendant::terms]"
20
- .freeze
21
-
22
- def initial_anchor_names_middle(doc, num, doctype)
23
- if doctype == "engineering-report"
24
- doc.xpath(ns(@klass.middle_clause(doc)) +
25
- " | #{ns(TERMS_SECT)} | " + ns("//sections/definitions"))
26
- .each_with_index { |c, _i| section_names(c, num, 1) }
27
- else
28
- num = section_names(doc.at(ns(TERMS_SECT)), num, 1)
29
- num = section_names(doc.at(ns("//sections/definitions")), num, 1)
30
- clause_names(doc, num)
31
- end
7
+ def clause_order_main(docxml)
8
+ ret = [{ path: "//clause[@type = 'scope']" },
9
+ { path: "//clause[@type = 'conformance']" },
10
+ { path: @klass.norm_ref_xpath }]
11
+ a = ["//sections/terms | //sections/clause[descendant::terms]",
12
+ "//sections/definitions | " \
13
+ "//sections/clause[descendant::definitions][not(descendant::terms)]",
14
+ @klass.middle_clause(docxml)]
15
+ ret + if docxml.at(ns("//bibdata/ext/doctype"))&.text == "engineering-report"
16
+ [{ path: a.join(" | "), multi: true }]
17
+ else
18
+ [{ path: a[0] }, { path: a[1] }, { path: a[2], multi: true }]
19
+ end
32
20
  end
33
21
 
34
- def preface_anchor_names(doc)
35
- @prefacenum = 0
36
- ["//preface/abstract", "//preface/clause[@type = 'executivesummary']",
37
- "//preface/clause[@type = 'keywords']",
38
- "//foreword", "//preface/clause[@type = 'security']",
39
- "//preface/clause[@type = 'submitting_orgs']", "//submitters",
40
- "//introduction"].each do |path|
41
- preface_names_numbered(doc.at(ns(path)))
42
- end
43
- doc.xpath(ns("//preface/clause[not(@type = 'keywords' or " \
44
- "@type = 'submitting_orgs' or @type = 'security' or " \
45
- "@type = 'executivesummary' or @type = 'toc')]"))
46
- .each { |c| preface_names_numbered(c) }
47
- preface_names_numbered(doc.at(ns("//acknowledgements")))
48
- sequential_asset_names(
49
- doc.xpath(ns("//preface/abstract | //foreword | //introduction | " \
50
- "//submitters | //acknowledgements | //preface/clause")),
51
- )
52
- end
22
+ # ["//preface/abstract", "//preface/clause[@type = 'executivesummary']", "//preface/clause[@type = 'keywords']", "//foreword", "//preface/clause[@type = 'security']", "//preface/clause[@type = 'submitting_orgs']", "//submitters", "//introduction"]
53
23
 
54
24
  def middle_section_asset_names(doc)
55
25
  middle_sections =
@@ -61,9 +31,14 @@ module IsoDoc
61
31
  sequential_asset_names(doc.xpath(ns(middle_sections)))
62
32
  end
63
33
 
64
- def preface_names_numbered(clause)
65
- return if clause.nil?
34
+ def preface_anchor_names(xml)
35
+ @prefacenum = 0
36
+ super
37
+ end
66
38
 
39
+ def preface_names(clause)
40
+ clause.nil? and return
41
+ clause["type"] == "toc" and return
67
42
  @prefacenum += 1
68
43
  pref = preface_number(@prefacenum, 1)
69
44
  @anchors[clause["id"]] =
@@ -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.4 -->
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>
@@ -2046,6 +2068,9 @@
2046
2068
  </define>
2047
2069
  <define name="termdefinition">
2048
2070
  <element name="definition">
2071
+ <optional>
2072
+ <attribute name="type"/>
2073
+ </optional>
2049
2074
  <choice>
2050
2075
  <ref name="verbaldefinition"/>
2051
2076
  <ref name="nonverbalrep"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.3.14".freeze
3
+ VERSION = "2.4.1".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.4"
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.1
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-28 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.4
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.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement