metanorma-ietf 3.0.10.1 → 3.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/automerge.yml +31 -0
- data/lib/isodoc/ietf/init.rb +3 -2
- data/lib/isodoc/ietf/rfc_convert.rb +4 -4
- data/lib/isodoc/ietf/validation.rb +45 -36
- data/lib/metanorma/ietf/basicdoc.rng +0 -27
- data/lib/metanorma/ietf/biblio-standoc.rng +164 -0
- data/lib/metanorma/ietf/biblio.rng +77 -19
- data/lib/metanorma/ietf/converter.rb +3 -3
- data/lib/metanorma/ietf/ietf.rng +1 -309
- data/lib/metanorma/ietf/isodoc.rng +31 -194
- data/lib/metanorma/ietf/relaton-ietf.rng +318 -0
- data/lib/metanorma/ietf/version.rb +1 -1
- data/metanorma-ietf.gemspec +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 873ffa398b400f3f0188c99cf1283ae24074f79f74f8757b88b65bbe44a4d8f6
|
4
|
+
data.tar.gz: 5b4d877eb0e92ec31335828982d3a42e579c3bff8cfaf476dab7cafd54f9e30b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24cf62a1815e74d14e62ba8cb090f5ea9415ffe4c0e5261403bab3de76bc894311e279eac549f68635c02f33621c296a2d4b1e812bfd2802b1945c949847a683
|
7
|
+
data.tar.gz: 5991493ac2c13acc90215ef46388bf0e0cfa0fead0b10d030a2816086bc2ff1854034fb23d7fa44e5d6ecd2fa7413d368a127729273962428d37c8e23a50ab05
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
# source: https://github.com/marketplace/actions/merge-pull-requests#usage
|
4
|
+
name: automerge
|
5
|
+
on:
|
6
|
+
pull_request:
|
7
|
+
types:
|
8
|
+
- labeled
|
9
|
+
- unlabeled
|
10
|
+
- synchronize
|
11
|
+
- opened
|
12
|
+
- edited
|
13
|
+
- ready_for_review
|
14
|
+
- reopened
|
15
|
+
- unlocked
|
16
|
+
pull_request_review:
|
17
|
+
types:
|
18
|
+
- submitted
|
19
|
+
check_suite:
|
20
|
+
types:
|
21
|
+
- completed
|
22
|
+
status: {}
|
23
|
+
jobs:
|
24
|
+
automerge:
|
25
|
+
runs-on: ubuntu-latest
|
26
|
+
steps:
|
27
|
+
- id: automerge
|
28
|
+
name: automerge
|
29
|
+
uses: "pascalgn/automerge-action@v0.15.3"
|
30
|
+
env:
|
31
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
data/lib/isodoc/ietf/init.rb
CHANGED
@@ -4,8 +4,9 @@ require_relative "i18n"
|
|
4
4
|
module IsoDoc
|
5
5
|
module Ietf
|
6
6
|
module Init
|
7
|
-
def i18n_init(lang, script, i18nyaml = nil)
|
8
|
-
@i18n = I18n.new(lang, script,
|
7
|
+
def i18n_init(lang, script, locale, i18nyaml = nil)
|
8
|
+
@i18n = I18n.new(lang, script, locale: locale,
|
9
|
+
i18nyaml: i18nyaml || @i18nyaml)
|
9
10
|
end
|
10
11
|
|
11
12
|
def fileloc(loc)
|
@@ -32,7 +32,7 @@ module IsoDoc
|
|
32
32
|
def document_preprocess(docxml)
|
33
33
|
@isodoc.reqt_models = Metanorma::Requirements
|
34
34
|
.new({ default: "default", lang: @lang, script: @script,
|
35
|
-
labels: @i18n.get })
|
35
|
+
locale: @locale, labels: @i18n.get })
|
36
36
|
info docxml, nil
|
37
37
|
@xrefs.parse docxml
|
38
38
|
@isodoc.xrefs = @xrefs
|
@@ -43,8 +43,8 @@ module IsoDoc
|
|
43
43
|
@xrefs.parse docxml
|
44
44
|
end
|
45
45
|
|
46
|
-
def metadata_init(lang, script, i18n)
|
47
|
-
@meta = Metadata.new(lang, script, i18n)
|
46
|
+
def metadata_init(lang, script, locale, i18n)
|
47
|
+
@meta = Metadata.new(lang, script, locale, i18n)
|
48
48
|
end
|
49
49
|
|
50
50
|
def xref_init(lang, script, klass, i18n, options)
|
@@ -105,7 +105,7 @@ module IsoDoc
|
|
105
105
|
@format = :rfc
|
106
106
|
@suffix = "rfc.xml"
|
107
107
|
@isodoc = IsoDoc::PresentationXMLConvert.new({})
|
108
|
-
@isodoc.i18n_init("en", "Latn")
|
108
|
+
@isodoc.i18n_init("en", "Latn", nil, nil)
|
109
109
|
end
|
110
110
|
|
111
111
|
include ::IsoDoc::Ietf::Init
|
@@ -8,7 +8,7 @@ module IsoDoc
|
|
8
8
|
errors = Jing.new(File.join(File.dirname(__FILE__), "v3.rng"))
|
9
9
|
.validate(filename)
|
10
10
|
errors.each do |error|
|
11
|
-
warn "RFC XML: Line #{'%06d' % error[:line]}:#{error[:column]} "\
|
11
|
+
warn "RFC XML: Line #{'%06d' % error[:line]}:#{error[:column]} " \
|
12
12
|
"#{error[:message]}"
|
13
13
|
end
|
14
14
|
rescue Jing::Error => e
|
@@ -38,26 +38,35 @@ module IsoDoc
|
|
38
38
|
def numbered_sections_check(xml)
|
39
39
|
ret = []
|
40
40
|
xml.xpath("//section[@numbered = 'false']").each do |s1|
|
41
|
-
|
42
|
-
|
43
|
-
ret << "Numbered section #{label(s2)} under unnumbered section "\
|
44
|
-
"#{label(s1)}"
|
45
|
-
end
|
46
|
-
s1.xpath("./following-sibling::*[name() = 'section']"\
|
47
|
-
"[not(@numbered) or @numbered = 'true']").each do |s2|
|
48
|
-
ret << "Numbered section #{label(s2)} following unnumbered "\
|
49
|
-
"section #{label(s1)}"
|
50
|
-
end
|
41
|
+
ret += numbered_sections_check1(s1)
|
42
|
+
ret += numbered_sections_check2(s1)
|
51
43
|
end
|
52
44
|
ret
|
53
45
|
end
|
54
46
|
|
47
|
+
def numbered_sections_check1(section)
|
48
|
+
section.xpath("./section[not(@numbered) or @numbered = 'true']")
|
49
|
+
.each_with_object([]) do |s2, m|
|
50
|
+
m << "Numbered section #{label(s2)} under unnumbered section " \
|
51
|
+
"#{label(section)}"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def numbered_sections_check2(section)
|
56
|
+
section.xpath("./following-sibling::*[name() = 'section']" \
|
57
|
+
"[not(@numbered) or @numbered = 'true']")
|
58
|
+
.each_with_object([]) do |s2, m|
|
59
|
+
m << "Numbered section #{label(s2)} following unnumbered " \
|
60
|
+
"section #{label(section)}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
55
64
|
# 5.2.7. Section "toc" attribute
|
56
65
|
def toc_sections_check(xml)
|
57
66
|
ret = []
|
58
67
|
xml.xpath("//section[@toc = 'exclude']").each do |s1|
|
59
68
|
s1.xpath(".//section[@toc = 'include']").each do |s2|
|
60
|
-
ret << "Section #{label(s2)} with toc=include is included in "\
|
69
|
+
ret << "Section #{label(s2)} with toc=include is included in " \
|
61
70
|
"section #{label(s1)} with toc=exclude"
|
62
71
|
end
|
63
72
|
end
|
@@ -69,14 +78,14 @@ module IsoDoc
|
|
69
78
|
def references_check(xml)
|
70
79
|
ret = []
|
71
80
|
xml.xpath("//reference[not(@target)]").each do |s|
|
72
|
-
s.xpath(".//seriesInfo[@name = 'RFC' or @name = 'Internet-Draft' "\
|
81
|
+
s.xpath(".//seriesInfo[@name = 'RFC' or @name = 'Internet-Draft' " \
|
73
82
|
"or @name = 'DOI'][not(@value)]").each do |s1|
|
74
|
-
ret << "for reference #{s['anchor']}, the seriesInfo with "\
|
83
|
+
ret << "for reference #{s['anchor']}, the seriesInfo with " \
|
75
84
|
"name=#{s1['name']} has been given no value"
|
76
85
|
end
|
77
86
|
end
|
78
87
|
xml.xpath("//references | //section").each do |s|
|
79
|
-
s.at("./name") or ret << "Cannot generate table of contents entry "\
|
88
|
+
s.at("./name") or ret << "Cannot generate table of contents entry " \
|
80
89
|
"for #{label(s)}, as it has no title"
|
81
90
|
end
|
82
91
|
ret
|
@@ -95,48 +104,48 @@ module IsoDoc
|
|
95
104
|
x.delete("section") if x["section"] && x["section"].empty?
|
96
105
|
if x["format"] == "title" && t.name == "reference"
|
97
106
|
t.at("./front/title") or
|
98
|
-
ret << "reference #{t['anchor']} has been referenced by #{x.name} "\
|
107
|
+
ret << "reference #{t['anchor']} has been referenced by #{x.name} " \
|
99
108
|
"with format=title, but the reference has no title"
|
100
109
|
end
|
101
110
|
if x["format"] == "counter" && !%w(section table figure li
|
102
111
|
reference references t dt).include?(t.name)
|
103
|
-
ret << "#{x.to_xml} with format=counter is only allowed for "\
|
104
|
-
"clauses, tables, figures, list entries, definition terms, "\
|
112
|
+
ret << "#{x.to_xml} with format=counter is only allowed for " \
|
113
|
+
"clauses, tables, figures, list entries, definition terms, " \
|
105
114
|
"paragraphs, bibliographies, and bibliographic entries"
|
106
115
|
end
|
107
116
|
if x["format"] == "counter" && t.name == "reference" && !x["section"]
|
108
|
-
ret << "reference #{t['anchor']} has been referenced by xref "\
|
109
|
-
"#{x.to_xml} with format=counter, which requires a "\
|
117
|
+
ret << "reference #{t['anchor']} has been referenced by xref " \
|
118
|
+
"#{x.to_xml} with format=counter, which requires a " \
|
110
119
|
"section attribute"
|
111
120
|
end
|
112
121
|
if x["format"] == "counter" && t.name == "li" && t.parent.name != "ol"
|
113
|
-
ret << "#{x.to_xml} with format=counter refers to an unnumbered "\
|
122
|
+
ret << "#{x.to_xml} with format=counter refers to an unnumbered " \
|
114
123
|
"list entry"
|
115
124
|
end
|
116
125
|
if x["format"] == "title" && %w(u author contact).include?(t.name)
|
117
|
-
ret << "#{x.to_xml} with format=title cannot reference a "\
|
126
|
+
ret << "#{x.to_xml} with format=title cannot reference a " \
|
118
127
|
"<#{t.name}> element"
|
119
128
|
end
|
120
129
|
if x["relative"] && !x["section"]
|
121
|
-
ret << "#{x.to_xml} with relative attribute requires a section "\
|
130
|
+
ret << "#{x.to_xml} with relative attribute requires a section " \
|
122
131
|
"attribute"
|
123
132
|
end
|
124
133
|
if (x["section"]) && t.name != "reference"
|
125
|
-
ret << "#{x.to_xml} has a section attribute, but #{x['target']} "\
|
134
|
+
ret << "#{x.to_xml} has a section attribute, but #{x['target']} " \
|
126
135
|
"points to a #{t.name}"
|
127
136
|
end
|
128
137
|
if (x["relative"]) && t.name != "reference"
|
129
|
-
ret << "#{x.to_xml} has a relative attribute, but #{x['target']} "\
|
138
|
+
ret << "#{x.to_xml} has a relative attribute, but #{x['target']} " \
|
130
139
|
"points to a #{t.name}"
|
131
140
|
end
|
132
|
-
if !x["relative"] && x["section"] && !t.at(".//seriesInfo[@name = 'RFC' or @name = "\
|
141
|
+
if !x["relative"] && x["section"] && !t.at(".//seriesInfo[@name = 'RFC' or @name = " \
|
133
142
|
"'Internet-Draft']")
|
134
|
-
ret << "#{x.to_xml} must use a relative attribute, "\
|
143
|
+
ret << "#{x.to_xml} must use a relative attribute, " \
|
135
144
|
"since it does not point to a RFC or Internet-Draft reference"
|
136
145
|
end
|
137
|
-
if x["relative"] && !(t.at(".//seriesInfo[@name = 'RFC' or @name = "\
|
146
|
+
if x["relative"] && !(t.at(".//seriesInfo[@name = 'RFC' or @name = " \
|
138
147
|
"'Internet-Draft']") || t["target"])
|
139
|
-
ret << "need an explicit target= URL attribute in the reference "\
|
148
|
+
ret << "need an explicit target= URL attribute in the reference " \
|
140
149
|
"pointed to by #{x.to_xml}"
|
141
150
|
end
|
142
151
|
end
|
@@ -155,8 +164,8 @@ module IsoDoc
|
|
155
164
|
def link_check(xml)
|
156
165
|
l = xml&.at("//link[@rel = 'convertedFrom']")&.text
|
157
166
|
!l || %r{^https://datatracker\.ietf\.org/doc/draft-}.match(l) or
|
158
|
-
return ["<link rel='convertedFrom'> (:derived-from: document "\
|
159
|
-
"attribute) must start with "\
|
167
|
+
return ["<link rel='convertedFrom'> (:derived-from: document " \
|
168
|
+
"attribute) must start with " \
|
160
169
|
"https://datatracker.ietf.org/doc/draft-"]
|
161
170
|
[]
|
162
171
|
end
|
@@ -168,12 +177,12 @@ module IsoDoc
|
|
168
177
|
rfcinfo = xml.at("//front//seriesInfo[@name = 'RFC']")
|
169
178
|
rfcnumber = xml.root["number"]
|
170
179
|
rfcinfo && rfcnumber && rfcnumber != rfcinfo["value"] and
|
171
|
-
ret << "Mismatch between <rfc number='#{rfcnumber}'> "\
|
172
|
-
"(:docnumber: NUMBER) "\
|
173
|
-
"and <seriesInfo name='RFC' value='#{rfcinfo['value']}'> "\
|
180
|
+
ret << "Mismatch between <rfc number='#{rfcnumber}'> " \
|
181
|
+
"(:docnumber: NUMBER) " \
|
182
|
+
"and <seriesInfo name='RFC' value='#{rfcinfo['value']}'> " \
|
174
183
|
"(:intended-series: TYPE NUMBER)"
|
175
184
|
rfcinfo && !/^\d+$/.match(rfcnumber) and
|
176
|
-
ret << "RFC identifier <rfc number='#{rfcnumber}'> "\
|
185
|
+
ret << "RFC identifier <rfc number='#{rfcnumber}'> " \
|
177
186
|
"(:docnumber: NUMBER) must be a number"
|
178
187
|
ret
|
179
188
|
end
|
@@ -183,7 +192,7 @@ module IsoDoc
|
|
183
192
|
xml.root["ipr"] or
|
184
193
|
return ["Missing ipr attribute on <rfc> element (:ipr:)"]
|
185
194
|
/trust200902$/.match(xml.root["ipr"]) or
|
186
|
-
return ["Unknown ipr attribute on <rfc> element (:ipr:): "\
|
195
|
+
return ["Unknown ipr attribute on <rfc> element (:ipr:): " \
|
187
196
|
"#{xml.root['ipr']}"]
|
188
197
|
[]
|
189
198
|
end
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<include href="biblio.rng">
|
4
|
-
<start>
|
5
|
-
<ref name="document"/>
|
6
|
-
</start>
|
7
|
-
</include>
|
8
3
|
<define name="document">
|
9
4
|
<element name="document">
|
10
5
|
<optional>
|
@@ -1125,26 +1120,4 @@
|
|
1125
1120
|
</zeroOrMore>
|
1126
1121
|
</element>
|
1127
1122
|
</define>
|
1128
|
-
<define name="ext">
|
1129
|
-
<element name="ext">
|
1130
|
-
<ref name="BibDataExtensionType"/>
|
1131
|
-
</element>
|
1132
|
-
</define>
|
1133
|
-
<define name="BibDataExtensionType">
|
1134
|
-
<ref name="doctype"/>
|
1135
|
-
</define>
|
1136
|
-
<define name="doctype">
|
1137
|
-
<element name="doctype">
|
1138
|
-
<ref name="DocumentType"/>
|
1139
|
-
</element>
|
1140
|
-
</define>
|
1141
|
-
<define name="DocumentType">
|
1142
|
-
<value>document</value>
|
1143
|
-
</define>
|
1144
|
-
<define name="BibData">
|
1145
|
-
<ref name="BibliographicItem"/>
|
1146
|
-
<optional>
|
1147
|
-
<ref name="ext"/>
|
1148
|
-
</optional>
|
1149
|
-
</define>
|
1150
1123
|
</grammar>
|
@@ -0,0 +1,164 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
3
|
+
<!--
|
4
|
+
Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
|
5
|
+
of relaton
|
6
|
+
|
7
|
+
Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
|
8
|
+
(SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
|
9
|
+
-->
|
10
|
+
<include href="biblio.rng">
|
11
|
+
<define name="BibData">
|
12
|
+
<ref name="BibliographicItem"/>
|
13
|
+
<optional>
|
14
|
+
<ref name="ext"/>
|
15
|
+
</optional>
|
16
|
+
</define>
|
17
|
+
</include>
|
18
|
+
<define name="ext">
|
19
|
+
<element name="ext">
|
20
|
+
<ref name="BibDataExtensionType"/>
|
21
|
+
</element>
|
22
|
+
</define>
|
23
|
+
<define name="BibDataExtensionType">
|
24
|
+
<optional>
|
25
|
+
<attribute name="schema-version"/>
|
26
|
+
</optional>
|
27
|
+
<ref name="doctype"/>
|
28
|
+
<optional>
|
29
|
+
<ref name="docsubtype"/>
|
30
|
+
</optional>
|
31
|
+
<optional>
|
32
|
+
<ref name="editorialgroup"/>
|
33
|
+
</optional>
|
34
|
+
<zeroOrMore>
|
35
|
+
<ref name="ics"/>
|
36
|
+
</zeroOrMore>
|
37
|
+
<zeroOrMore>
|
38
|
+
<ref name="structuredidentifier"/>
|
39
|
+
</zeroOrMore>
|
40
|
+
</define>
|
41
|
+
<define name="doctype">
|
42
|
+
<element name="doctype">
|
43
|
+
<optional>
|
44
|
+
<attribute name="abbreviation"/>
|
45
|
+
</optional>
|
46
|
+
<ref name="DocumentType"/>
|
47
|
+
</element>
|
48
|
+
</define>
|
49
|
+
<define name="DocumentType">
|
50
|
+
<value>document</value>
|
51
|
+
</define>
|
52
|
+
<define name="docsubtype">
|
53
|
+
<element name="subdoctype">
|
54
|
+
<ref name="DocumentSubtype"/>
|
55
|
+
</element>
|
56
|
+
</define>
|
57
|
+
<define name="DocumentSubtype">
|
58
|
+
<text/>
|
59
|
+
</define>
|
60
|
+
<define name="editorialgroup">
|
61
|
+
<element name="editorialgroup">
|
62
|
+
<oneOrMore>
|
63
|
+
<ref name="technical-committee"/>
|
64
|
+
</oneOrMore>
|
65
|
+
</element>
|
66
|
+
</define>
|
67
|
+
<define name="technical-committee">
|
68
|
+
<element name="technical-committee">
|
69
|
+
<ref name="IsoWorkgroup"/>
|
70
|
+
</element>
|
71
|
+
</define>
|
72
|
+
<define name="IsoWorkgroup">
|
73
|
+
<optional>
|
74
|
+
<attribute name="number"/>
|
75
|
+
</optional>
|
76
|
+
<optional>
|
77
|
+
<attribute name="type"/>
|
78
|
+
</optional>
|
79
|
+
<optional>
|
80
|
+
<attribute name="identifier"/>
|
81
|
+
</optional>
|
82
|
+
<optional>
|
83
|
+
<attribute name="prefix"/>
|
84
|
+
</optional>
|
85
|
+
<text/>
|
86
|
+
</define>
|
87
|
+
<define name="ics">
|
88
|
+
<element name="ics">
|
89
|
+
<element name="code">
|
90
|
+
<text/>
|
91
|
+
</element>
|
92
|
+
<optional>
|
93
|
+
<element name="text">
|
94
|
+
<text/>
|
95
|
+
</element>
|
96
|
+
</optional>
|
97
|
+
</element>
|
98
|
+
</define>
|
99
|
+
<define name="structuredidentifier">
|
100
|
+
<element name="structuredidentifier">
|
101
|
+
<optional>
|
102
|
+
<attribute name="type"/>
|
103
|
+
</optional>
|
104
|
+
<oneOrMore>
|
105
|
+
<element name="agency">
|
106
|
+
<text/>
|
107
|
+
</element>
|
108
|
+
</oneOrMore>
|
109
|
+
<optional>
|
110
|
+
<element name="class">
|
111
|
+
<text/>
|
112
|
+
</element>
|
113
|
+
</optional>
|
114
|
+
<element name="docnumber">
|
115
|
+
<text/>
|
116
|
+
</element>
|
117
|
+
<optional>
|
118
|
+
<element name="partnumber">
|
119
|
+
<text/>
|
120
|
+
</element>
|
121
|
+
</optional>
|
122
|
+
<optional>
|
123
|
+
<element name="edition">
|
124
|
+
<text/>
|
125
|
+
</element>
|
126
|
+
</optional>
|
127
|
+
<optional>
|
128
|
+
<element name="version">
|
129
|
+
<text/>
|
130
|
+
</element>
|
131
|
+
</optional>
|
132
|
+
<optional>
|
133
|
+
<element name="supplementtype">
|
134
|
+
<text/>
|
135
|
+
</element>
|
136
|
+
</optional>
|
137
|
+
<optional>
|
138
|
+
<element name="supplementnumber">
|
139
|
+
<text/>
|
140
|
+
</element>
|
141
|
+
</optional>
|
142
|
+
<optional>
|
143
|
+
<element name="amendment">
|
144
|
+
<text/>
|
145
|
+
</element>
|
146
|
+
</optional>
|
147
|
+
<optional>
|
148
|
+
<element name="corrigendum">
|
149
|
+
<text/>
|
150
|
+
</element>
|
151
|
+
</optional>
|
152
|
+
<optional>
|
153
|
+
<element name="language">
|
154
|
+
<text/>
|
155
|
+
</element>
|
156
|
+
</optional>
|
157
|
+
<optional>
|
158
|
+
<element name="year">
|
159
|
+
<text/>
|
160
|
+
</element>
|
161
|
+
</optional>
|
162
|
+
</element>
|
163
|
+
</define>
|
164
|
+
</grammar>
|
@@ -33,9 +33,10 @@
|
|
33
33
|
<param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
|
34
34
|
</data>
|
35
35
|
</define>
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
<!-- start = bibitem -->
|
37
|
+
<define name="BibData">
|
38
|
+
<ref name="BibliographicItem"/>
|
39
|
+
</define>
|
39
40
|
<define name="status">
|
40
41
|
<element name="status">
|
41
42
|
<ref name="stage"/>
|
@@ -73,8 +74,14 @@
|
|
73
74
|
<text/>
|
74
75
|
</element>
|
75
76
|
</define>
|
76
|
-
<define name="
|
77
|
+
<define name="locale">
|
77
78
|
<a:documentation>ISO-639</a:documentation>
|
79
|
+
<element name="locale">
|
80
|
+
<text/>
|
81
|
+
</element>
|
82
|
+
</define>
|
83
|
+
<define name="script">
|
84
|
+
<a:documentation>ISO-3166</a:documentation>
|
78
85
|
<element name="script">
|
79
86
|
<text/>
|
80
87
|
</element>
|
@@ -93,6 +100,9 @@
|
|
93
100
|
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
94
101
|
<attribute name="language"/>
|
95
102
|
</optional>
|
103
|
+
<optional>
|
104
|
+
<attribute name="locale"/>
|
105
|
+
</optional>
|
96
106
|
<optional>
|
97
107
|
<attribute name="script"/>
|
98
108
|
</optional>
|
@@ -136,6 +146,9 @@
|
|
136
146
|
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
137
147
|
<attribute name="language"/>
|
138
148
|
</optional>
|
149
|
+
<optional>
|
150
|
+
<attribute name="locale"/>
|
151
|
+
</optional>
|
139
152
|
<optional>
|
140
153
|
<attribute name="script"/>
|
141
154
|
</optional>
|
@@ -158,27 +171,25 @@
|
|
158
171
|
</define>
|
159
172
|
<define name="contributor">
|
160
173
|
<element name="contributor">
|
161
|
-
<
|
174
|
+
<oneOrMore>
|
162
175
|
<ref name="role"/>
|
163
|
-
</
|
176
|
+
</oneOrMore>
|
164
177
|
<ref name="ContributorInfo"/>
|
165
178
|
</element>
|
166
179
|
</define>
|
167
180
|
<define name="role">
|
168
181
|
<element name="role">
|
169
|
-
<
|
170
|
-
<
|
171
|
-
<
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
</attribute>
|
181
|
-
</optional>
|
182
|
+
<attribute name="type">
|
183
|
+
<choice>
|
184
|
+
<value>author</value>
|
185
|
+
<value>performer</value>
|
186
|
+
<value>publisher</value>
|
187
|
+
<value>editor</value>
|
188
|
+
<value>adapter</value>
|
189
|
+
<value>translator</value>
|
190
|
+
<value>distributor</value>
|
191
|
+
</choice>
|
192
|
+
</attribute>
|
182
193
|
<zeroOrMore>
|
183
194
|
<ref name="roledescription"/>
|
184
195
|
</zeroOrMore>
|
@@ -500,6 +511,17 @@
|
|
500
511
|
</define>
|
501
512
|
<define name="localityStack">
|
502
513
|
<element name="localityStack">
|
514
|
+
<optional>
|
515
|
+
<attribute name="connective">
|
516
|
+
<choice>
|
517
|
+
<value>and</value>
|
518
|
+
<value>or</value>
|
519
|
+
<value>from</value>
|
520
|
+
<value>to</value>
|
521
|
+
<value/>
|
522
|
+
</choice>
|
523
|
+
</attribute>
|
524
|
+
</optional>
|
503
525
|
<zeroOrMore>
|
504
526
|
<ref name="locality"/>
|
505
527
|
</zeroOrMore>
|
@@ -512,6 +534,17 @@
|
|
512
534
|
</define>
|
513
535
|
<define name="sourceLocalityStack">
|
514
536
|
<element name="sourceLocalityStack">
|
537
|
+
<optional>
|
538
|
+
<attribute name="connective">
|
539
|
+
<choice>
|
540
|
+
<value>and</value>
|
541
|
+
<value>or</value>
|
542
|
+
<value>from</value>
|
543
|
+
<value>to</value>
|
544
|
+
<value/>
|
545
|
+
</choice>
|
546
|
+
</attribute>
|
547
|
+
</optional>
|
515
548
|
<zeroOrMore>
|
516
549
|
<ref name="sourceLocality"/>
|
517
550
|
</zeroOrMore>
|
@@ -614,6 +647,9 @@
|
|
614
647
|
<ref name="BibItemType"/>
|
615
648
|
</attribute>
|
616
649
|
</optional>
|
650
|
+
<optional>
|
651
|
+
<attribute name="schema-version"/>
|
652
|
+
</optional>
|
617
653
|
<optional>
|
618
654
|
<ref name="fetched"/>
|
619
655
|
</optional>
|
@@ -650,6 +686,9 @@
|
|
650
686
|
<zeroOrMore>
|
651
687
|
<ref name="language"/>
|
652
688
|
</zeroOrMore>
|
689
|
+
<zeroOrMore>
|
690
|
+
<ref name="locale"/>
|
691
|
+
</zeroOrMore>
|
653
692
|
<zeroOrMore>
|
654
693
|
<ref name="script"/>
|
655
694
|
</zeroOrMore>
|
@@ -705,6 +744,9 @@
|
|
705
744
|
<ref name="BibItemType"/>
|
706
745
|
</attribute>
|
707
746
|
</optional>
|
747
|
+
<optional>
|
748
|
+
<attribute name="schema-version"/>
|
749
|
+
</optional>
|
708
750
|
<optional>
|
709
751
|
<ref name="fetched"/>
|
710
752
|
</optional>
|
@@ -741,6 +783,9 @@
|
|
741
783
|
<zeroOrMore>
|
742
784
|
<ref name="language"/>
|
743
785
|
</zeroOrMore>
|
786
|
+
<zeroOrMore>
|
787
|
+
<ref name="locale"/>
|
788
|
+
</zeroOrMore>
|
744
789
|
<zeroOrMore>
|
745
790
|
<ref name="script"/>
|
746
791
|
</zeroOrMore>
|
@@ -854,6 +899,15 @@
|
|
854
899
|
<optional>
|
855
900
|
<attribute name="type"/>
|
856
901
|
</optional>
|
902
|
+
<optional>
|
903
|
+
<attribute name="language"/>
|
904
|
+
</optional>
|
905
|
+
<optional>
|
906
|
+
<attribute name="locale"/>
|
907
|
+
</optional>
|
908
|
+
<optional>
|
909
|
+
<attribute name="script"/>
|
910
|
+
</optional>
|
857
911
|
<data type="anyURI"/>
|
858
912
|
</define>
|
859
913
|
<define name="DateType">
|
@@ -882,6 +936,7 @@
|
|
882
936
|
<value>vote-started</value>
|
883
937
|
<value>vote-ended</value>
|
884
938
|
<value>announced</value>
|
939
|
+
<value>stable-until</value>
|
885
940
|
</choice>
|
886
941
|
</define>
|
887
942
|
<define name="bdate">
|
@@ -930,6 +985,9 @@
|
|
930
985
|
<optional>
|
931
986
|
<attribute name="language"/>
|
932
987
|
</optional>
|
988
|
+
<optional>
|
989
|
+
<attribute name="locale"/>
|
990
|
+
</optional>
|
933
991
|
<optional>
|
934
992
|
<attribute name="script"/>
|
935
993
|
</optional>
|
@@ -166,10 +166,10 @@ module Metanorma
|
|
166
166
|
IsoDoc::Ietf::RfcConvert.new(html_extract_attributes(node))
|
167
167
|
end
|
168
168
|
|
169
|
-
def isodoc(lang, script, i18nyaml = nil)
|
169
|
+
def isodoc(lang, script, locale, i18nyaml = nil)
|
170
170
|
conv = rfc_converter(EmptyAttr.new)
|
171
|
-
i18n = conv.i18n_init(lang, script, i18nyaml)
|
172
|
-
conv.metadata_init(lang, script, i18n)
|
171
|
+
i18n = conv.i18n_init(lang, script, locale, i18nyaml)
|
172
|
+
conv.metadata_init(lang, script, locale, i18n)
|
173
173
|
conv
|
174
174
|
end
|
175
175
|
end
|