metanorma-ogc 2.3.8 → 2.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/html/html_ogc_intro.html +0 -1
- data/lib/isodoc/ogc/html/word_ogc_intro.html +0 -3
- data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +0 -3
- data/lib/isodoc/ogc/html_convert.rb +1 -11
- data/lib/isodoc/ogc/i18n-en.yaml +1 -0
- data/lib/isodoc/ogc/metadata.rb +10 -0
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +852 -315
- data/lib/isodoc/ogc/ogc.best-practice.xsl +852 -315
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +852 -315
- data/lib/isodoc/ogc/ogc.community-practice.xsl +852 -315
- data/lib/isodoc/ogc/ogc.community-standard.xsl +852 -315
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +852 -315
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +852 -315
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +852 -315
- data/lib/isodoc/ogc/ogc.other.xsl +852 -315
- data/lib/isodoc/ogc/ogc.policy.xsl +852 -315
- data/lib/isodoc/ogc/ogc.reference-model.xsl +852 -315
- data/lib/isodoc/ogc/ogc.release-notes.xsl +852 -315
- data/lib/isodoc/ogc/ogc.standard.xsl +852 -315
- data/lib/isodoc/ogc/ogc.test-suite.xsl +852 -315
- data/lib/isodoc/ogc/ogc.user-guide.xsl +852 -315
- data/lib/isodoc/ogc/ogc.white-paper.xsl +814 -271
- data/lib/isodoc/ogc/presentation_xml_convert.rb +9 -6
- data/lib/isodoc/ogc/sections.rb +48 -48
- data/lib/isodoc/ogc/word_convert.rb +3 -0
- data/lib/isodoc/ogc/xref.rb +1 -1
- data/lib/metanorma/ogc/boilerplate.xml +1 -1
- data/lib/metanorma/ogc/isodoc.rng +16 -7
- data/lib/metanorma/ogc/ogc.rng +3 -8
- data/lib/metanorma/ogc/validate.rb +18 -11
- data/lib/metanorma/ogc/version.rb +1 -1
- metadata +2 -2
@@ -12,7 +12,6 @@ module IsoDoc
|
|
12
12
|
|
13
13
|
def convert1(docxml, filename, dir)
|
14
14
|
info docxml, nil
|
15
|
-
insert_preface_sections(docxml)
|
16
15
|
super
|
17
16
|
end
|
18
17
|
|
@@ -20,6 +19,11 @@ module IsoDoc
|
|
20
19
|
File.read(File.join(@libdir, "html", "rouge.css"))
|
21
20
|
end
|
22
21
|
|
22
|
+
def preface_rearrange(doc)
|
23
|
+
super
|
24
|
+
insert_preface_sections(doc)
|
25
|
+
end
|
26
|
+
|
23
27
|
def insert_preface_sections(doc)
|
24
28
|
preface_insert(doc.at(ns("//preface/clause" \
|
25
29
|
"[@type = 'executivesummary']")),
|
@@ -39,8 +43,7 @@ module IsoDoc
|
|
39
43
|
end
|
40
44
|
|
41
45
|
def preface_insert(clause, after, docxml)
|
42
|
-
|
43
|
-
|
46
|
+
clause or return
|
44
47
|
clause.remove
|
45
48
|
if after then after.next = clause
|
46
49
|
else
|
@@ -126,9 +129,9 @@ module IsoDoc
|
|
126
129
|
end
|
127
130
|
|
128
131
|
def clause1(elem)
|
129
|
-
|
130
|
-
elem.parent.xpath(ns("./terms")).size == 1
|
131
|
-
|
132
|
+
elem.name == "terms" && elem.parent.name == "annex" &&
|
133
|
+
elem.parent.xpath(ns("./terms")).size == 1 and return
|
134
|
+
elem.name == "clause" && elem["type"] == "toc" and return
|
132
135
|
super
|
133
136
|
end
|
134
137
|
|
data/lib/isodoc/ogc/sections.rb
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
module IsoDoc
|
2
2
|
module Ogc
|
3
3
|
module BaseConvert
|
4
|
-
def
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
8
19
|
end
|
9
20
|
end
|
10
21
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
def security(docxml, out)
|
23
|
-
f = docxml.at(ns("//preface/clause[@type = 'security']")) or return
|
24
|
-
intro_clause(f, out)
|
25
|
-
end
|
26
|
-
|
27
|
-
def executivesummary(docxml, out)
|
28
|
-
f = docxml.at(ns("//preface/clause[@type = 'executivesummary']")) or
|
29
|
-
return
|
30
|
-
intro_clause(f, out)
|
31
|
-
end
|
32
|
-
|
33
|
-
def submitters(docxml, out)
|
34
|
-
f = docxml.at(ns("//submitters")) || return
|
35
|
-
intro_clause(f, out)
|
22
|
+
def preface(clause, out)
|
23
|
+
case clause["type"]
|
24
|
+
when "toc"
|
25
|
+
table_of_contents(clause, out)
|
26
|
+
when "executivesummary", "security", "submitting_orgs",
|
27
|
+
"keywords"
|
28
|
+
intro_clause(clause, out)
|
29
|
+
else
|
30
|
+
intro_clause(clause, out)
|
31
|
+
end
|
36
32
|
end
|
37
33
|
|
38
|
-
def
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
.each do |
|
43
|
-
|
34
|
+
def intro_clause(elem, out)
|
35
|
+
out.div class: "Section3", id: elem["id"] do |div|
|
36
|
+
clause_name(elem, elem&.at(ns("./title")), div,
|
37
|
+
class: "IntroTitle")
|
38
|
+
elem.elements.each do |e|
|
39
|
+
parse(e, div) unless e.name == "title"
|
40
|
+
end
|
44
41
|
end
|
45
42
|
end
|
46
43
|
|
47
|
-
def abstract(
|
48
|
-
f = isoxml.at(ns("//preface/abstract")) || return
|
44
|
+
def abstract(clause, out)
|
49
45
|
page_break(out)
|
50
|
-
out.div **attr_code(id:
|
51
|
-
clause_name(
|
52
|
-
|
46
|
+
out.div **attr_code(id: clause["id"]) do |s|
|
47
|
+
clause_name(clause, clause.at(ns("./title")), s,
|
48
|
+
class: "AbstractTitle")
|
49
|
+
clause.elements.each do |e|
|
50
|
+
parse(e, s) unless e.name == "title"
|
51
|
+
end
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
56
|
-
def foreword(
|
57
|
-
f = isoxml.at(ns("//foreword")) || return
|
55
|
+
def foreword(clause, out)
|
58
56
|
page_break(out)
|
59
|
-
out.div **attr_code(id:
|
60
|
-
clause_name(
|
61
|
-
|
57
|
+
out.div **attr_code(id: clause["id"]) do |s|
|
58
|
+
clause_name(clause, clause&.at(ns("./title")), s,
|
59
|
+
class: "ForewordTitle")
|
60
|
+
clause.elements.each do |e|
|
61
|
+
parse(e, s) unless e.name == "title"
|
62
|
+
end
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
65
|
-
def acknowledgements(
|
66
|
-
|
67
|
-
intro_clause(f, out)
|
66
|
+
def acknowledgements(clause, out)
|
67
|
+
intro_clause(clause, out)
|
68
68
|
end
|
69
69
|
|
70
70
|
def conformance(isoxml, out, num)
|
@@ -91,6 +91,8 @@ module IsoDoc
|
|
91
91
|
@prefacenum = 0
|
92
92
|
info docxml, div2
|
93
93
|
boilerplate docxml, div2
|
94
|
+
front docxml, div2
|
95
|
+
=begin
|
94
96
|
preface_block docxml, div2
|
95
97
|
abstract docxml, div2
|
96
98
|
executivesummary docxml, div2
|
@@ -102,6 +104,7 @@ module IsoDoc
|
|
102
104
|
submitters docxml, div2
|
103
105
|
preface docxml, div2
|
104
106
|
acknowledgements docxml, div2
|
107
|
+
=end
|
105
108
|
div2.p { |p| p << " " } # placeholder
|
106
109
|
end
|
107
110
|
section_break(body)
|
data/lib/isodoc/ogc/xref.rb
CHANGED
@@ -31,7 +31,7 @@ module IsoDoc
|
|
31
31
|
end
|
32
32
|
doc.xpath(ns("//preface/clause[not(@type = 'keywords' or " \
|
33
33
|
"@type = 'submitting_orgs' or @type = 'security' or " \
|
34
|
-
"@type = 'executivesummary')]"))
|
34
|
+
"@type = 'executivesummary' or @type = 'toc')]"))
|
35
35
|
.each { |c| preface_names_numbered(c) }
|
36
36
|
preface_names_numbered(doc.at(ns("//acknowledgements")))
|
37
37
|
sequential_asset_names(
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<title>Copyright notice</title>
|
5
5
|
|
6
6
|
<p align="center">Copyright
|
7
|
-
© {{ docyear }}
|
7
|
+
© {{ docyear }} {{ copyright_holder }}<br/>
|
8
8
|
To obtain additional rights of use, visit
|
9
9
|
<link target="https://www.ogc.org/legal">https://www.ogc.org/legal</link>
|
10
10
|
</p>
|
@@ -17,6 +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
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">
|
21
22
|
<include href="reqt.rng"/>
|
22
23
|
<include href="basicdoc.rng">
|
@@ -210,6 +211,9 @@
|
|
210
211
|
<data type="boolean"/>
|
211
212
|
</attribute>
|
212
213
|
</optional>
|
214
|
+
<optional>
|
215
|
+
<attribute name="style"/>
|
216
|
+
</optional>
|
213
217
|
<ref name="CitationType"/>
|
214
218
|
<oneOrMore>
|
215
219
|
<ref name="PureTextElement"/>
|
@@ -1349,15 +1353,19 @@
|
|
1349
1353
|
</choice>
|
1350
1354
|
</element>
|
1351
1355
|
</define>
|
1356
|
+
<define name="Root-Attributes">
|
1357
|
+
<attribute name="version"/>
|
1358
|
+
<attribute name="schema-version"/>
|
1359
|
+
<attribute name="type">
|
1360
|
+
<choice>
|
1361
|
+
<value>semantic</value>
|
1362
|
+
<value>presentation</value>
|
1363
|
+
</choice>
|
1364
|
+
</attribute>
|
1365
|
+
</define>
|
1352
1366
|
<define name="standard-document">
|
1353
1367
|
<element name="standard-document">
|
1354
|
-
<
|
1355
|
-
<attribute name="type">
|
1356
|
-
<choice>
|
1357
|
-
<value>semantic</value>
|
1358
|
-
<value>presentation</value>
|
1359
|
-
</choice>
|
1360
|
-
</attribute>
|
1368
|
+
<ref name="Root-Attributes"/>
|
1361
1369
|
<ref name="bibdata"/>
|
1362
1370
|
<optional>
|
1363
1371
|
<ref name="misccontainer"/>
|
@@ -2131,6 +2139,7 @@
|
|
2131
2139
|
<choice>
|
2132
2140
|
<value>identical</value>
|
2133
2141
|
<value>modified</value>
|
2142
|
+
<value>adapted</value>
|
2134
2143
|
<value>restyled</value>
|
2135
2144
|
<value>context-added</value>
|
2136
2145
|
<value>generalisation</value>
|
data/lib/metanorma/ogc/ogc.rng
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns=
|
2
|
+
<grammar ns='https://www.metanorma.org/ns/ogc' xmlns="http://relaxng.org/ns/structure/1.0">
|
3
3
|
<!--
|
4
|
+
VERSION v1.2.1
|
4
5
|
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
5
6
|
we cannot have a new default namespace: we will end up with a grammar with two different
|
6
7
|
namespaces, one for isostandard and one for csand additions. And we do not want that.
|
@@ -45,13 +46,7 @@
|
|
45
46
|
</define>
|
46
47
|
<define name="ogc-standard">
|
47
48
|
<element name="ogc-standard">
|
48
|
-
<
|
49
|
-
<attribute name="type">
|
50
|
-
<choice>
|
51
|
-
<value>semantic</value>
|
52
|
-
<value>presentation</value>
|
53
|
-
</choice>
|
54
|
-
</attribute>
|
49
|
+
<ref name="Root-Attributes"/>
|
55
50
|
<ref name="bibdata"/>
|
56
51
|
<zeroOrMore>
|
57
52
|
<ref name="termdocsource"/>
|
@@ -2,6 +2,7 @@ module Metanorma
|
|
2
2
|
module Ogc
|
3
3
|
class Converter < Standoc::Converter
|
4
4
|
def validate(doc)
|
5
|
+
@doctype = doc.at("//bibdata/ext/doctype")&.text
|
5
6
|
content_validate(doc)
|
6
7
|
schema_validate(formattedstr_strip(doc.dup),
|
7
8
|
File.join(File.dirname(__FILE__), "ogc.rng"))
|
@@ -22,12 +23,13 @@ module Metanorma
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def stage_validate(xmldoc)
|
26
|
+
@doctype == "engineering-report" and return
|
25
27
|
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
26
28
|
%w(draft swg-draft oab-review public-rfc tc-vote work-item-draft
|
27
29
|
approved deprecated retired rescinded).include? stage or
|
28
30
|
@log.add("Document Attributes", nil,
|
29
31
|
"#{stage} is not a recognised status")
|
30
|
-
stage_type_validate(stage,
|
32
|
+
stage_type_validate(stage, @doctype)
|
31
33
|
end
|
32
34
|
|
33
35
|
def stage_type_validate(stage, doctype)
|
@@ -47,23 +49,21 @@ module Metanorma
|
|
47
49
|
|
48
50
|
def version_validate(xmldoc)
|
49
51
|
version = xmldoc.at("//bibdata/edition")&.text
|
50
|
-
|
51
|
-
if %w(engineering-report discussion-paper).include? doctype
|
52
|
+
if %w(engineering-report discussion-paper).include? @doctype
|
52
53
|
version.nil? or @log.add("Document Attributes", nil,
|
53
|
-
"Version not permitted for #{doctype}")
|
54
|
+
"Version not permitted for #{@doctype}")
|
54
55
|
else
|
55
56
|
version.nil? and @log.add("Document Attributes", nil,
|
56
|
-
"Version required for #{doctype}")
|
57
|
+
"Version required for #{@doctype}")
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
60
61
|
def execsummary_validate(xmldoc)
|
61
|
-
doctype = xmldoc.at("//bibdata/ext/doctype")&.text
|
62
62
|
sect = xmldoc.at("//clause[@type = 'executivesummary']")
|
63
|
-
doctype == "engineering-report" && sect.nil? and
|
63
|
+
@doctype == "engineering-report" && sect.nil? and
|
64
64
|
@log.add("Style", nil,
|
65
65
|
"Executive Summary required for Engineering Reports!")
|
66
|
-
doctype != "engineering-report" && !sect.nil? and
|
66
|
+
@doctype != "engineering-report" && !sect.nil? and
|
67
67
|
@log.add("Style", nil,
|
68
68
|
"Executive Summary only allowed for Engineering Reports!")
|
69
69
|
end
|
@@ -109,9 +109,7 @@ module Metanorma
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def sections_sequence_validate(root)
|
112
|
-
return unless STANDARDTYPE.include?(
|
113
|
-
root.at("//bibdata/ext/doctype")&.text,
|
114
|
-
)
|
112
|
+
return unless STANDARDTYPE.include?(@doctype)
|
115
113
|
|
116
114
|
names = root.xpath("//sections/* | //bibliography/*")
|
117
115
|
names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
|
@@ -132,6 +130,7 @@ module Metanorma
|
|
132
130
|
end
|
133
131
|
|
134
132
|
def preface_sequence_validate(root)
|
133
|
+
@doctype == "engineering-report" and return
|
135
134
|
root.at("//preface/abstract") or @log.add("Style", nil,
|
136
135
|
"Abstract is missing!")
|
137
136
|
root.at("//bibdata/keyword | //bibdata/ext/keyword") or
|
@@ -144,6 +143,14 @@ module Metanorma
|
|
144
143
|
root.at("//submitters") or @log.add("Style", nil,
|
145
144
|
"Submitters is missing!")
|
146
145
|
end
|
146
|
+
|
147
|
+
def norm_ref_validate(doc)
|
148
|
+
@doctype == "engineering-report" or return super
|
149
|
+
doc.xpath("//references[@normative = 'true']").each do |b|
|
150
|
+
@log.add("Bibliography", b,
|
151
|
+
"Engineering report should not contain normative references")
|
152
|
+
end
|
153
|
+
end
|
147
154
|
end
|
148
155
|
end
|
149
156
|
end
|
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.
|
4
|
+
version: 2.3.10
|
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-
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iso-639
|