metanorma-ogc 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.hound.yml +3 -0
  4. data/.rubocop.yml +10 -0
  5. data/.travis.yml +16 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE +25 -0
  9. data/README.adoc +323 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +14 -0
  12. data/bin/rspec +17 -0
  13. data/bin/setup +8 -0
  14. data/lib/asciidoctor/ogc.rb +7 -0
  15. data/lib/asciidoctor/ogc/biblio.rng +890 -0
  16. data/lib/asciidoctor/ogc/converter.rb +253 -0
  17. data/lib/asciidoctor/ogc/front.rb +163 -0
  18. data/lib/asciidoctor/ogc/isodoc.rng +1091 -0
  19. data/lib/asciidoctor/ogc/isostandard.rng +1068 -0
  20. data/lib/asciidoctor/ogc/ogc.rng +210 -0
  21. data/lib/isodoc/ogc.rb +10 -0
  22. data/lib/isodoc/ogc/html/header.html +181 -0
  23. data/lib/isodoc/ogc/html/html_ogc_intro.html +85 -0
  24. data/lib/isodoc/ogc/html/html_ogc_titlepage.html +172 -0
  25. data/lib/isodoc/ogc/html/htmlstyle.scss +1054 -0
  26. data/lib/isodoc/ogc/html/ogc.scss +644 -0
  27. data/lib/isodoc/ogc/html/scripts.html +82 -0
  28. data/lib/isodoc/ogc/html/scripts.pdf.html +70 -0
  29. data/lib/isodoc/ogc/html/word_ogc_intro.html +92 -0
  30. data/lib/isodoc/ogc/html/word_ogc_titlepage.html +194 -0
  31. data/lib/isodoc/ogc/html/wordstyle.scss +1104 -0
  32. data/lib/isodoc/ogc/html_convert.rb +355 -0
  33. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  34. data/lib/isodoc/ogc/metadata.rb +102 -0
  35. data/lib/isodoc/ogc/pdf_convert.rb +357 -0
  36. data/lib/isodoc/ogc/word_convert.rb +345 -0
  37. data/lib/metanorma-ogc.rb +8 -0
  38. data/lib/metanorma/ogc.rb +11 -0
  39. data/lib/metanorma/ogc/processor.rb +43 -0
  40. data/lib/metanorma/ogc/version.rb +5 -0
  41. data/metanorma-ogc.gemspec +45 -0
  42. metadata +338 -0
@@ -0,0 +1,253 @@
1
+ require "asciidoctor"
2
+ require "asciidoctor/standoc/converter"
3
+ require "fileutils"
4
+ require_relative "front"
5
+
6
+ module Asciidoctor
7
+ module Ogc
8
+
9
+ # A {Converter} implementation that generates RSD output, and a document
10
+ # schema encapsulation of the document for validation
11
+ #
12
+ class Converter < Standoc::Converter
13
+
14
+ register_for "ogc"
15
+
16
+ # ignore, we generate ToC outside of asciidoctor
17
+ def toc(value)
18
+ end
19
+
20
+ def title_validate(root)
21
+ nil
22
+ end
23
+
24
+ def makexml(node)
25
+ result = ["<?xml version='1.0' encoding='UTF-8'?>\n<ogc-standard>"]
26
+ @draft = node.attributes.has_key?("draft")
27
+ result << noko { |ixml| front node, ixml }
28
+ result << noko { |ixml| middle node, ixml }
29
+ result << "</ogc-standard>"
30
+ result = textcleanup(result.flatten * "\n")
31
+ ret1 = cleanup(Nokogiri::XML(result))
32
+ validate(ret1)
33
+ ret1.root.add_namespace(nil, Metanorma::Ogc::DOCUMENT_NAMESPACE)
34
+ ret1
35
+ end
36
+
37
+ def doctype(node)
38
+ d = node.attr("doctype")
39
+ unless %w{standard standard-with-suite abstract-specification
40
+ community-standard profile best-practice
41
+ engineering-report discussion-paper reference-model user-guide
42
+ policy guide amendment technical-corrigendum administrative}.include? d
43
+ warn "#{d} is not a legal document type: reverting to 'standard'"
44
+ d = "standard"
45
+ end
46
+ d
47
+ end
48
+
49
+ def document(node)
50
+ init(node)
51
+ ret1 = makexml(node)
52
+ ret = ret1.to_xml(indent: 2)
53
+ unless node.attr("nodoc") || !node.attr("docfile")
54
+ filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
55
+ gsub(%r{^.*/}, "")
56
+ File.open(filename, "w") { |f| f.write(ret) }
57
+ html_converter(node).convert filename unless node.attr("nodoc")
58
+ word_converter(node).convert filename unless node.attr("nodoc")
59
+ pdf_converter(node).convert filename unless node.attr("nodoc")
60
+ end
61
+ @files_to_delete.each { |f| FileUtils.rm f }
62
+ ret
63
+ end
64
+
65
+ def validate(doc)
66
+ content_validate(doc)
67
+ schema_validate(formattedstr_strip(doc.dup),
68
+ File.join(File.dirname(__FILE__), "ogc.rng"))
69
+ end
70
+
71
+ def section_validate(doc)
72
+ sections_sequence_validate(doc.root)
73
+ end
74
+
75
+ STANDARDTYPE = %w{standard standard-with-suite abstract-specification
76
+ community-standard profile}.freeze
77
+
78
+ # spec of permissible section sequence
79
+ # we skip normative references, it goes to end of list
80
+ SEQ =
81
+ [
82
+ {
83
+ msg: "Prefatory material must be followed by (clause) Scope",
84
+ val: [{ tag: "clause", title: "Scope" }],
85
+ },
86
+ {
87
+ msg: "Scope must be followed by Conformance",
88
+ val: [{ tag: "clause", title: "Conformance" }],
89
+ },
90
+ {
91
+ msg: "Normative References must be followed by "\
92
+ "Terms and Definitions",
93
+ val: [
94
+ { tag: "terms", title: "Terms and definitions" },
95
+ { tag: "clause", title: "Terms and definitions" },
96
+ {
97
+ tag: "terms",
98
+ title: "Terms, definitions, symbols and abbreviated terms",
99
+ },
100
+ {
101
+ tag: "clause",
102
+ title: "Terms, definitions, symbols and abbreviated terms",
103
+ },
104
+ ],
105
+ },
106
+ ].freeze
107
+
108
+ def seqcheck(names, msg, accepted)
109
+ n = names.shift
110
+ unless accepted.include? n
111
+ warn "OGC style: #{msg}"
112
+ names = []
113
+ end
114
+ names
115
+ end
116
+
117
+ def sections_sequence_validate(root)
118
+ return unless STANDARDTYPE.include? root&.at("//bibdata/@type")&.text
119
+ f = root.at("//sections").elements
120
+ names = f.map { |s| { tag: s.name, title: s&.at("./title")&.text } }
121
+ names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val]) || return
122
+ names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val]) || return
123
+ names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val]) || return
124
+ n = names.shift
125
+ if n == { tag: "definitions", title: nil }
126
+ n = names.shift
127
+ end
128
+ unless n
129
+ warn "OGC style: Document must contain at least one clause"
130
+ return
131
+ end
132
+ root.at("//references | //clause[descendant::references][not(parent::clause)]") or
133
+ seqcheck([{tag: "clause"}],
134
+ "Normative References are mandatory", [{tag: "references"}])
135
+ end
136
+
137
+ def sections_cleanup(x)
138
+ super
139
+ x.xpath("//*[@inline-header]").each do |h|
140
+ h.delete("inline-header")
141
+ end
142
+ end
143
+
144
+ def make_preface(x, s)
145
+ super
146
+ if x.at("//submitters")
147
+ preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
148
+ submitters = x.at("//submitters").remove
149
+ preface.add_child submitters.remove
150
+ end
151
+ end
152
+
153
+ def clause_parse(attrs, xml, node)
154
+ clausetype = node&.attr("heading")&.downcase || node.title.downcase
155
+ if clausetype == "submitters" then submitters_parse(attrs, xml, node)
156
+ else
157
+ super
158
+ end
159
+ end
160
+
161
+ def bibliography_parse(attrs, xml, node)
162
+ clausetype = node&.attr("heading")&.downcase || node.title.downcase
163
+ if clausetype == "references" then norm_ref_parse(attrs, xml, node)
164
+ else
165
+ super
166
+ end
167
+ end
168
+
169
+ def submitters_parse(attrs, xml, node)
170
+ xml.submitters **attr_code(attrs) do |xml_section|
171
+ xml_section << node.content
172
+ end
173
+ end
174
+
175
+ def example(node)
176
+ return term_example(node) if in_terms?
177
+ noko do |xml|
178
+ xml.example **id_attr(node) do |ex|
179
+ figure_title(node, ex)
180
+ wrap_in_para(node, ex)
181
+ end
182
+ end.join("\n")
183
+ end
184
+
185
+ def style(n, t)
186
+ return
187
+ end
188
+
189
+ def termdef_boilerplate_cleanup(xmldoc)
190
+ return
191
+ end
192
+
193
+ def cleanup(xmldoc)
194
+ recommendation_cleanup(xmldoc)
195
+ requirement_cleanup(xmldoc)
196
+ permission_cleanup(xmldoc)
197
+ super
198
+ end
199
+
200
+ def recommendation_cleanup(xmldoc)
201
+ xmldoc.xpath("//table").each do |t|
202
+ td = t&.at("./tbody/tr/td[1]")&.text
203
+ /^\s*(Recommendation( \d+)?)\s*$/.match td or next
204
+ body = t&.at("./tbody/tr/td[2]") or next
205
+ t.name = "recommendation"
206
+ t.children = body&.children
207
+ label = t&.at("./p")&.remove or next
208
+ label.name = "name"
209
+ t.prepend_child label
210
+ end
211
+ end
212
+
213
+ def requirement_cleanup(xmldoc)
214
+ xmldoc.xpath("//table").each do |t|
215
+ td = t&.at("./tbody/tr/td[1]")&.text
216
+ /^\s*(Requirement( \d+)?)\s*$/.match td or next
217
+ body = t&.at("./tbody/tr/td[2]") or next
218
+ t.name = "requirement"
219
+ t.children = body&.children
220
+ label = t&.at("./p")&.remove or next
221
+ label.name = "name"
222
+ t.prepend_child label
223
+ end
224
+ end
225
+
226
+ def permission_cleanup(xmldoc)
227
+ xmldoc.xpath("//table").each do |t|
228
+ td = t&.at("./tbody/tr/td[1]")&.text
229
+ /^\s*(Permission( \d+)?)\s*/.match td or next
230
+ body = t&.at("./tbody/tr/td[2]") or next
231
+ t.name = "permission"
232
+ t.children = body&.children
233
+ label = t&.at("./p")&.remove or next
234
+ label.name = "name"
235
+ t.prepend_child label
236
+ end
237
+ end
238
+
239
+
240
+ def html_converter(node)
241
+ IsoDoc::Ogc::HtmlConvert.new(html_extract_attributes(node))
242
+ end
243
+
244
+ def pdf_converter(node)
245
+ IsoDoc::Ogc::PdfConvert.new(html_extract_attributes(node))
246
+ end
247
+
248
+ def word_converter(node)
249
+ IsoDoc::Ogc::WordConvert.new(doc_extract_attributes(node))
250
+ end
251
+ end
252
+ end
253
+ end
@@ -0,0 +1,163 @@
1
+ require "asciidoctor"
2
+ require "asciidoctor/standoc/converter"
3
+ require "fileutils"
4
+
5
+ module Asciidoctor
6
+ module Ogc
7
+
8
+ # A {Converter} implementation that generates RSD output, and a document
9
+ # schema encapsulation of the document for validation
10
+ #
11
+ class Converter < Standoc::Converter
12
+
13
+ def metadata_author(node, xml)
14
+ corporate_author(node, xml)
15
+ personal_author(node, xml)
16
+ end
17
+
18
+ def corporate_author(node, xml)
19
+ return unless node.attr("submitting-organizations")
20
+ node.attr("submitting-organizations").split(/;[ ]*/).each do |org|
21
+ xml.contributor do |c|
22
+ c.role **{ type: "author" }
23
+ c.organization do |a|
24
+ a.name org
25
+ end
26
+ end
27
+ end
28
+ end
29
+
30
+ def personal_author(node, xml)
31
+ ogc_editor(node, xml)
32
+ if node.attr("fullname") || node.attr("surname")
33
+ personal_author1(node, xml, "")
34
+ end
35
+ i = 2
36
+ while node.attr("fullname_#{i}") || node.attr("surname_#{i}")
37
+ personal_author1(node, xml, "_#{i}")
38
+ i += 1
39
+ end
40
+ end
41
+
42
+ def ogc_editor(node, xml)
43
+ return unless node.attr("editor")
44
+ xml.contributor do |c|
45
+ c.role **{ type: "editor" }
46
+ c.person do |p|
47
+ p.name do |n|
48
+ n.completename node.attr("editor")
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ def personal_author1(node, xml, suffix)
55
+ xml.contributor do |c|
56
+ c.role **{ type: node&.attr("role#{suffix}")&.downcase || "editor" }
57
+ c.person do |p|
58
+ p.name do |n|
59
+ if node.attr("fullname#{suffix}")
60
+ n.completename node.attr("fullname#{suffix}")
61
+ else
62
+ n.forename node.attr("givenname#{suffix}")
63
+ n.surname node.attr("surname#{suffix}")
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+
70
+ def metadata_publisher(node, xml)
71
+ xml.contributor do |c|
72
+ c.role **{ type: "publisher" }
73
+ c.organization do |a|
74
+ a.name Metanorma::Ogc::ORGANIZATION_NAME_SHORT
75
+ end
76
+ end
77
+ end
78
+
79
+ def metadata_committee(node, xml)
80
+ xml.editorialgroup do |a|
81
+ a.committee(node.attr("committee") || "technical")
82
+ node.attr("subcommittee") and
83
+ a.subcommittee(node.attr("subcommittee"),
84
+ **attr_code(type: node.attr("subcommittee-type"),
85
+ number: node.attr("subcommittee-number")))
86
+ (node.attr("workgroup") || node.attr("workinggroup")) and
87
+ a.workgroup(node.attr("workgroup") || node.attr("workinggroup"),
88
+ **attr_code(type: node.attr("workgroup-type"),
89
+ number: node.attr("workgroup-number")))
90
+ end
91
+ end
92
+
93
+ def metadata_status(node, xml)
94
+ status = node.attr("status") || "published"
95
+ xml.status(**{ format: "plain" }) { |s| s << status }
96
+ end
97
+
98
+ def metadata_id(node, xml)
99
+ node.attr("external-id") and
100
+ xml.docidentifier node.attr("external-id"), **{ type: "ogc-external" }
101
+ node.attr("referenceurlid") and
102
+ xml.docidentifier externalurl(node), **{ type: "ogc-external" }
103
+ docnumber = node.attr("docnumber") || node.attr("docreference")
104
+ if docnumber
105
+ xml.docidentifier docnumber, **{ type: "ogc-internal" }
106
+ xml.docnumber docnumber
107
+ end
108
+ end
109
+
110
+ def externalurl(node)
111
+ if node.attr("doctype") == "engineering-report"
112
+ "http://www.opengis.net/doc/PER/t14-#{node.attr('referenceurlid')}"
113
+ else
114
+ node.attr('referenceurlid')
115
+ end
116
+ end
117
+
118
+ def metadata_source(node, xml)
119
+ super
120
+ node.attr("previous-uri") && xml.source(node.attr("previous-uri"), type: "previous")
121
+ end
122
+
123
+ def metadata_copyright(node, xml)
124
+ from = node.attr("copyright-year") || node.attr("copyrightyear") || Date.today.year
125
+ xml.copyright do |c|
126
+ c.from from
127
+ c.owner do |owner|
128
+ owner.organization do |o|
129
+ o.name Metanorma::Ogc::ORGANIZATION_NAME_SHORT
130
+ end
131
+ end
132
+ end
133
+ end
134
+
135
+ def metadata_keywords(node, xml)
136
+ return unless node.attr("keywords")
137
+ node.attr("keywords").split(/,[ ]*/).each do |kw|
138
+ xml.keyword kw
139
+ end
140
+ end
141
+
142
+ def metadata_date(node, xml)
143
+ super
144
+ ogc_date(node, xml, "submissiondate", "received" )
145
+ ogc_date(node, xml, "publicationdate", "published" )
146
+ ogc_date(node, xml, "approvaldate", "issued" )
147
+ end
148
+
149
+ def ogc_date(node, xml, ogcname, metanormaname)
150
+ if node.attr(ogcname)
151
+ xml.date **{ type: metanormaname } do |d|
152
+ d.on node.attr(ogcname)
153
+ end
154
+ end
155
+ end
156
+
157
+ def metadata(node, xml)
158
+ super
159
+ metadata_keywords(node, xml)
160
+ end
161
+ end
162
+ end
163
+ end
@@ -0,0 +1,1091 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ instantiations of this grammar may replace leaf strings
4
+ with more elaborated types; e.g. title (text) replaced with
5
+ title-main, title-intro, title-part; type replaced with
6
+ enum.
7
+
8
+ some renaming at leaf nodes is permissible
9
+
10
+ obligations can change both from optional to mandatory,
11
+ and from mandatory to optional; optional elements may
12
+ be omitted; freely positioned alternatives may be replaced
13
+ with strict ordering
14
+
15
+ DO NOT introduce a namespace here. We do not want a distinct namespace
16
+ for these elements, and a distinct namespace for any grammar inheriting
17
+ these elements; we just want one namespace for any child grammars
18
+ of this.
19
+ -->
20
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
+ <include href="biblio.rng">
22
+ <define name="status">
23
+ <element name="status">
24
+ <choice>
25
+ <value>proposal</value>
26
+ <value>working_draft</value>
27
+ <value>committee_draft</value>
28
+ <value>draft_standard</value>
29
+ <value>final_draft</value>
30
+ <value>published</value>
31
+ <value>withdrawn</value>
32
+ </choice>
33
+ </element>
34
+ </define>
35
+ </include>
36
+ <start>
37
+ <ref name="standard-document"/>
38
+ </start>
39
+ <define name="standard-document">
40
+ <element name="standard-document">
41
+ <ref name="bibdata"/>
42
+ <optional>
43
+ <ref name="version"/>
44
+ </optional>
45
+ <optional>
46
+ <ref name="preface"/>
47
+ </optional>
48
+ <ref name="sections"/>
49
+ <zeroOrMore>
50
+ <ref name="annex"/>
51
+ </zeroOrMore>
52
+ <zeroOrMore>
53
+ <ref name="references"/>
54
+ </zeroOrMore>
55
+ </element>
56
+ </define>
57
+ <define name="bibdata">
58
+ <element name="bibdata">
59
+ <ref name="BibData"/>
60
+ </element>
61
+ </define>
62
+ <define name="version">
63
+ <element name="version">
64
+ <optional>
65
+ <ref name="vedition"/>
66
+ </optional>
67
+ <optional>
68
+ <ref name="revision-date"/>
69
+ </optional>
70
+ <zeroOrMore>
71
+ <ref name="draft"/>
72
+ </zeroOrMore>
73
+ </element>
74
+ </define>
75
+ <define name="vedition">
76
+ <element name="edition">
77
+ <data type="int"/>
78
+ </element>
79
+ </define>
80
+ <define name="revision-date">
81
+ <element name="revision-date">
82
+ <data type="date"/>
83
+ </element>
84
+ </define>
85
+ <define name="draft">
86
+ <element name="draft">
87
+ <text/>
88
+ </element>
89
+ </define>
90
+ <define name="preface">
91
+ <element name="preface">
92
+ <oneOrMore>
93
+ <ref name="content"/>
94
+ </oneOrMore>
95
+ </element>
96
+ </define>
97
+ <define name="sections">
98
+ <element name="sections">
99
+ <oneOrMore>
100
+ <choice>
101
+ <ref name="content"/>
102
+ <ref name="clause"/>
103
+ <ref name="terms"/>
104
+ <ref name="definitions"/>
105
+ </choice>
106
+ </oneOrMore>
107
+ </element>
108
+ </define>
109
+ <define name="definitions">
110
+ <element name="definitions">
111
+ <optional>
112
+ <attribute name="id">
113
+ <data type="ID"/>
114
+ </attribute>
115
+ </optional>
116
+ <optional>
117
+ <ref name="section-title"/>
118
+ </optional>
119
+ <ref name="dl"/>
120
+ </element>
121
+ </define>
122
+ <define name="section-title">
123
+ <element name="title">
124
+ <zeroOrMore>
125
+ <ref name="TextElement"/>
126
+ </zeroOrMore>
127
+ </element>
128
+ </define>
129
+ <define name="content">
130
+ <element name="content">
131
+ <ref name="Content-Section"/>
132
+ </element>
133
+ </define>
134
+ <define name="content-subsection">
135
+ <element name="clause">
136
+ <ref name="Content-Section"/>
137
+ </element>
138
+ </define>
139
+ <define name="Basic-Section">
140
+ <optional>
141
+ <attribute name="id">
142
+ <data type="ID"/>
143
+ </attribute>
144
+ </optional>
145
+ <optional>
146
+ <ref name="section-title"/>
147
+ </optional>
148
+ <oneOrMore>
149
+ <ref name="BasicBlock"/>
150
+ </oneOrMore>
151
+ <zeroOrMore>
152
+ <ref name="note"/>
153
+ </zeroOrMore>
154
+ </define>
155
+ <define name="Content-Section">
156
+ <optional>
157
+ <attribute name="id">
158
+ <data type="ID"/>
159
+ </attribute>
160
+ </optional>
161
+ <optional>
162
+ <ref name="section-title"/>
163
+ </optional>
164
+ <choice>
165
+ <group>
166
+ <oneOrMore>
167
+ <ref name="BasicBlock"/>
168
+ </oneOrMore>
169
+ <zeroOrMore>
170
+ <ref name="note"/>
171
+ </zeroOrMore>
172
+ </group>
173
+ <oneOrMore>
174
+ <ref name="content-subsection"/>
175
+ </oneOrMore>
176
+ </choice>
177
+ </define>
178
+ <define name="clause">
179
+ <element name="clause">
180
+ <ref name="Clause-Section"/>
181
+ </element>
182
+ </define>
183
+ <define name="Clause-Section">
184
+ <optional>
185
+ <attribute name="id">
186
+ <data type="ID"/>
187
+ </attribute>
188
+ </optional>
189
+ <optional>
190
+ <ref name="section-title"/>
191
+ </optional>
192
+ <choice>
193
+ <group>
194
+ <oneOrMore>
195
+ <ref name="BasicBlock"/>
196
+ </oneOrMore>
197
+ <zeroOrMore>
198
+ <ref name="note"/>
199
+ </zeroOrMore>
200
+ </group>
201
+ <oneOrMore>
202
+ <ref name="clause-subsection"/>
203
+ </oneOrMore>
204
+ </choice>
205
+ </define>
206
+ <define name="clause-subsection">
207
+ <element name="clause">
208
+ <ref name="Clause-Section"/>
209
+ </element>
210
+ </define>
211
+ <define name="annex">
212
+ <element name="annex">
213
+ <optional>
214
+ <attribute name="id">
215
+ <data type="ID"/>
216
+ </attribute>
217
+ </optional>
218
+ <attribute name="obligation">
219
+ <choice>
220
+ <value>normative</value>
221
+ <value>informative</value>
222
+ </choice>
223
+ </attribute>
224
+ <optional>
225
+ <ref name="section-title"/>
226
+ </optional>
227
+ <choice>
228
+ <group>
229
+ <oneOrMore>
230
+ <ref name="BasicBlock"/>
231
+ </oneOrMore>
232
+ <zeroOrMore>
233
+ <ref name="note"/>
234
+ </zeroOrMore>
235
+ </group>
236
+ <oneOrMore>
237
+ <ref name="clause-subsection"/>
238
+ </oneOrMore>
239
+ </choice>
240
+ </element>
241
+ </define>
242
+ <define name="references">
243
+ <element name="references">
244
+ <optional>
245
+ <attribute name="id">
246
+ <data type="ID"/>
247
+ </attribute>
248
+ </optional>
249
+ <optional>
250
+ <ref name="section-title"/>
251
+ </optional>
252
+ <zeroOrMore>
253
+ <ref name="bibitem"/>
254
+ </zeroOrMore>
255
+ </element>
256
+ </define>
257
+ <define name="terms">
258
+ <element name="terms">
259
+ <optional>
260
+ <attribute name="id">
261
+ <data type="ID"/>
262
+ </attribute>
263
+ </optional>
264
+ <oneOrMore>
265
+ <ref name="term"/>
266
+ </oneOrMore>
267
+ </element>
268
+ </define>
269
+ <define name="term">
270
+ <element name="term">
271
+ <optional>
272
+ <attribute name="id">
273
+ <data type="ID"/>
274
+ </attribute>
275
+ </optional>
276
+ <oneOrMore>
277
+ <ref name="preferred"/>
278
+ </oneOrMore>
279
+ <zeroOrMore>
280
+ <ref name="admitted"/>
281
+ </zeroOrMore>
282
+ <zeroOrMore>
283
+ <ref name="deprecates"/>
284
+ </zeroOrMore>
285
+ <optional>
286
+ <ref name="termdomain"/>
287
+ </optional>
288
+ <ref name="definition"/>
289
+ <zeroOrMore>
290
+ <ref name="termnote"/>
291
+ </zeroOrMore>
292
+ <zeroOrMore>
293
+ <ref name="termexample"/>
294
+ </zeroOrMore>
295
+ <zeroOrMore>
296
+ <ref name="termsource"/>
297
+ </zeroOrMore>
298
+ </element>
299
+ </define>
300
+ <define name="preferred">
301
+ <element name="preferred">
302
+ <oneOrMore>
303
+ <ref name="TextElement"/>
304
+ </oneOrMore>
305
+ </element>
306
+ </define>
307
+ <define name="admitted">
308
+ <element name="admitted">
309
+ <oneOrMore>
310
+ <ref name="TextElement"/>
311
+ </oneOrMore>
312
+ </element>
313
+ </define>
314
+ <define name="deprecates">
315
+ <element name="deprecates">
316
+ <oneOrMore>
317
+ <ref name="TextElement"/>
318
+ </oneOrMore>
319
+ </element>
320
+ </define>
321
+ <define name="termdomain">
322
+ <element name="domain">
323
+ <oneOrMore>
324
+ <ref name="TextElement"/>
325
+ </oneOrMore>
326
+ </element>
327
+ </define>
328
+ <define name="definition">
329
+ <element name="definition">
330
+ <ref name="paragraph"/>
331
+ </element>
332
+ </define>
333
+ <define name="termnote">
334
+ <element name="termnote">
335
+ <attribute name="id">
336
+ <data type="ID"/>
337
+ </attribute>
338
+ <ref name="paragraph"/>
339
+ </element>
340
+ </define>
341
+ <define name="termexample">
342
+ <element name="termexample">
343
+ <attribute name="id">
344
+ <data type="ID"/>
345
+ </attribute>
346
+ <ref name="paragraph"/>
347
+ </element>
348
+ </define>
349
+ <define name="termsource">
350
+ <element name="termsource">
351
+ <attribute name="status">
352
+ <choice>
353
+ <value>identical</value>
354
+ <value>modified</value>
355
+ </choice>
356
+ </attribute>
357
+ <ref name="origin"/>
358
+ <optional>
359
+ <ref name="modification"/>
360
+ </optional>
361
+ </element>
362
+ </define>
363
+ <define name="origin">
364
+ <element name="origin">
365
+ <ref name="erefType"/>
366
+ </element>
367
+ </define>
368
+ <define name="modification">
369
+ <element name="modification">
370
+ <ref name="paragraph"/>
371
+ </element>
372
+ </define>
373
+ <define name="BasicBlock">
374
+ <choice>
375
+ <ref name="paragraph-with-footnote"/>
376
+ <ref name="table"/>
377
+ <ref name="formula"/>
378
+ <ref name="admonition"/>
379
+ <ref name="ol"/>
380
+ <ref name="ul"/>
381
+ <ref name="dl"/>
382
+ <ref name="figure"/>
383
+ <ref name="quote"/>
384
+ <ref name="sourcecode"/>
385
+ <ref name="example"/>
386
+ <ref name="review"/>
387
+ <ref name="pre"/>
388
+ </choice>
389
+ </define>
390
+ <define name="paragraph">
391
+ <element name="p">
392
+ <ref name="ParagraphType"/>
393
+ </element>
394
+ </define>
395
+ <define name="Alignments">
396
+ <choice>
397
+ <value>left</value>
398
+ <value>right</value>
399
+ <value>center</value>
400
+ <value>justified</value>
401
+ </choice>
402
+ </define>
403
+ <define name="ParagraphType">
404
+ <attribute name="id">
405
+ <data type="ID"/>
406
+ </attribute>
407
+ <optional>
408
+ <attribute name="align">
409
+ <ref name="Alignments"/>
410
+ </attribute>
411
+ </optional>
412
+ <zeroOrMore>
413
+ <ref name="TextElement"/>
414
+ </zeroOrMore>
415
+ <zeroOrMore>
416
+ <ref name="note"/>
417
+ </zeroOrMore>
418
+ </define>
419
+ <define name="paragraph-with-footnote">
420
+ <element name="p">
421
+ <attribute name="id">
422
+ <data type="ID"/>
423
+ </attribute>
424
+ <optional>
425
+ <attribute name="align">
426
+ <ref name="Alignments"/>
427
+ </attribute>
428
+ </optional>
429
+ <zeroOrMore>
430
+ <choice>
431
+ <ref name="TextElement"/>
432
+ <ref name="fn"/>
433
+ </choice>
434
+ </zeroOrMore>
435
+ <zeroOrMore>
436
+ <ref name="note"/>
437
+ </zeroOrMore>
438
+ </element>
439
+ </define>
440
+ <define name="note">
441
+ <element name="note">
442
+ <attribute name="id">
443
+ <data type="ID"/>
444
+ </attribute>
445
+ <oneOrMore>
446
+ <ref name="paragraph"/>
447
+ </oneOrMore>
448
+ </element>
449
+ </define>
450
+ <define name="review">
451
+ <element name="review">
452
+ <attribute name="id">
453
+ <data type="ID"/>
454
+ </attribute>
455
+ <attribute name="reviewer"/>
456
+ <optional>
457
+ <attribute name="date">
458
+ <data type="dateTime"/>
459
+ </attribute>
460
+ </optional>
461
+ <attribute name="from">
462
+ <data type="IDREF"/>
463
+ </attribute>
464
+ <optional>
465
+ <attribute name="to">
466
+ <data type="IDREF"/>
467
+ </attribute>
468
+ </optional>
469
+ <oneOrMore>
470
+ <ref name="paragraph"/>
471
+ </oneOrMore>
472
+ </element>
473
+ </define>
474
+ <define name="formula">
475
+ <element name="formula">
476
+ <attribute name="id">
477
+ <data type="ID"/>
478
+ </attribute>
479
+ <ref name="stem"/>
480
+ <optional>
481
+ <ref name="dl"/>
482
+ </optional>
483
+ <zeroOrMore>
484
+ <ref name="note"/>
485
+ </zeroOrMore>
486
+ </element>
487
+ </define>
488
+ <define name="quote">
489
+ <element name="quote">
490
+ <attribute name="id">
491
+ <data type="ID"/>
492
+ </attribute>
493
+ <optional>
494
+ <attribute name="alignment">
495
+ <ref name="Alignments"/>
496
+ </attribute>
497
+ </optional>
498
+ <optional>
499
+ <ref name="quote-source"/>
500
+ </optional>
501
+ <optional>
502
+ <ref name="quote-author"/>
503
+ </optional>
504
+ <oneOrMore>
505
+ <ref name="paragraph-with-footnote"/>
506
+ </oneOrMore>
507
+ <zeroOrMore>
508
+ <ref name="note"/>
509
+ </zeroOrMore>
510
+ </element>
511
+ </define>
512
+ <define name="quote-source">
513
+ <element name="source">
514
+ <ref name="erefType"/>
515
+ </element>
516
+ </define>
517
+ <define name="quote-author">
518
+ <element name="author">
519
+ <text/>
520
+ </element>
521
+ </define>
522
+ <define name="sourcecode">
523
+ <element name="sourcecode">
524
+ <attribute name="id">
525
+ <data type="ID"/>
526
+ </attribute>
527
+ <optional>
528
+ <ref name="tname"/>
529
+ </optional>
530
+ <oneOrMore>
531
+ <choice>
532
+ <text/>
533
+ <ref name="callout"/>
534
+ </choice>
535
+ </oneOrMore>
536
+ <zeroOrMore>
537
+ <ref name="annotation"/>
538
+ </zeroOrMore>
539
+ <zeroOrMore>
540
+ <ref name="note"/>
541
+ </zeroOrMore>
542
+ </element>
543
+ </define>
544
+ <define name="pre">
545
+ <element name="pre">
546
+ <attribute name="id">
547
+ <data type="ID"/>
548
+ </attribute>
549
+ <optional>
550
+ <ref name="tname"/>
551
+ </optional>
552
+ <text/>
553
+ <zeroOrMore>
554
+ <ref name="note"/>
555
+ </zeroOrMore>
556
+ </element>
557
+ </define>
558
+ <define name="table">
559
+ <element name="table">
560
+ <attribute name="id">
561
+ <data type="ID"/>
562
+ </attribute>
563
+ <optional>
564
+ <ref name="tname"/>
565
+ </optional>
566
+ <optional>
567
+ <ref name="thead"/>
568
+ </optional>
569
+ <ref name="tbody"/>
570
+ <optional>
571
+ <ref name="tfoot"/>
572
+ </optional>
573
+ <zeroOrMore>
574
+ <ref name="table-note"/>
575
+ </zeroOrMore>
576
+ <optional>
577
+ <ref name="dl"/>
578
+ </optional>
579
+ </element>
580
+ </define>
581
+ <define name="tname">
582
+ <element name="name">
583
+ <text/>
584
+ </element>
585
+ </define>
586
+ <define name="thead">
587
+ <element name="thead">
588
+ <ref name="tr"/>
589
+ </element>
590
+ </define>
591
+ <define name="tfoot">
592
+ <element name="tfoot">
593
+ <ref name="tr"/>
594
+ </element>
595
+ </define>
596
+ <define name="tbody">
597
+ <element name="tbody">
598
+ <oneOrMore>
599
+ <ref name="tr"/>
600
+ </oneOrMore>
601
+ </element>
602
+ </define>
603
+ <define name="table-note">
604
+ <element name="note">
605
+ <ref name="paragraph"/>
606
+ </element>
607
+ </define>
608
+ <define name="tr">
609
+ <element name="tr">
610
+ <oneOrMore>
611
+ <choice>
612
+ <ref name="td"/>
613
+ <ref name="th"/>
614
+ </choice>
615
+ </oneOrMore>
616
+ </element>
617
+ </define>
618
+ <define name="td">
619
+ <element name="td">
620
+ <optional>
621
+ <attribute name="colspan"/>
622
+ </optional>
623
+ <optional>
624
+ <attribute name="rowspan"/>
625
+ </optional>
626
+ <optional>
627
+ <attribute name="align">
628
+ <choice>
629
+ <value>left</value>
630
+ <value>right</value>
631
+ <value>center</value>
632
+ </choice>
633
+ </attribute>
634
+ </optional>
635
+ <choice>
636
+ <zeroOrMore>
637
+ <ref name="TextElement"/>
638
+ </zeroOrMore>
639
+ <oneOrMore>
640
+ <ref name="paragraph-with-footnote"/>
641
+ </oneOrMore>
642
+ </choice>
643
+ </element>
644
+ </define>
645
+ <define name="th">
646
+ <element name="th">
647
+ <optional>
648
+ <attribute name="colspan"/>
649
+ </optional>
650
+ <optional>
651
+ <attribute name="rowspan"/>
652
+ </optional>
653
+ <optional>
654
+ <attribute name="align">
655
+ <choice>
656
+ <value>left</value>
657
+ <value>right</value>
658
+ <value>center</value>
659
+ </choice>
660
+ </attribute>
661
+ </optional>
662
+ <choice>
663
+ <zeroOrMore>
664
+ <ref name="TextElement"/>
665
+ </zeroOrMore>
666
+ <oneOrMore>
667
+ <ref name="paragraph-with-footnote"/>
668
+ </oneOrMore>
669
+ </choice>
670
+ </element>
671
+ </define>
672
+ <define name="example">
673
+ <element name="example">
674
+ <attribute name="id">
675
+ <data type="ID"/>
676
+ </attribute>
677
+ <oneOrMore>
678
+ <choice>
679
+ <ref name="formula"/>
680
+ <ref name="ul"/>
681
+ <ref name="ol"/>
682
+ <ref name="dl"/>
683
+ <ref name="quote"/>
684
+ <ref name="sourcecode"/>
685
+ <ref name="paragraph-with-footnote"/>
686
+ </choice>
687
+ </oneOrMore>
688
+ <zeroOrMore>
689
+ <ref name="note"/>
690
+ </zeroOrMore>
691
+ </element>
692
+ </define>
693
+ <define name="admonition">
694
+ <element name="admonition">
695
+ <attribute name="type">
696
+ <choice>
697
+ <value>warning</value>
698
+ <value>note</value>
699
+ <value>tip</value>
700
+ <value>important</value>
701
+ <value>caution</value>
702
+ </choice>
703
+ </attribute>
704
+ <attribute name="id">
705
+ <data type="ID"/>
706
+ </attribute>
707
+ <zeroOrMore>
708
+ <ref name="paragraph-with-footnote"/>
709
+ </zeroOrMore>
710
+ <zeroOrMore>
711
+ <ref name="note"/>
712
+ </zeroOrMore>
713
+ </element>
714
+ </define>
715
+ <define name="figure">
716
+ <element name="figure">
717
+ <attribute name="id">
718
+ <data type="ID"/>
719
+ </attribute>
720
+ <optional>
721
+ <ref name="source"/>
722
+ </optional>
723
+ <optional>
724
+ <ref name="tname"/>
725
+ </optional>
726
+ <choice>
727
+ <ref name="image"/>
728
+ <ref name="pre"/>
729
+ <zeroOrMore>
730
+ <ref name="figure"/>
731
+ </zeroOrMore>
732
+ </choice>
733
+ <zeroOrMore>
734
+ <ref name="fn"/>
735
+ </zeroOrMore>
736
+ <optional>
737
+ <ref name="dl"/>
738
+ </optional>
739
+ <zeroOrMore>
740
+ <ref name="note"/>
741
+ </zeroOrMore>
742
+ </element>
743
+ </define>
744
+ <define name="TextElement">
745
+ <choice>
746
+ <text/>
747
+ <ref name="em"/>
748
+ <ref name="eref"/>
749
+ <ref name="strong"/>
750
+ <ref name="stem"/>
751
+ <ref name="sub"/>
752
+ <ref name="sup"/>
753
+ <ref name="tt"/>
754
+ <ref name="keyword"/>
755
+ <ref name="strike"/>
756
+ <ref name="smallcap"/>
757
+ <ref name="xref"/>
758
+ <ref name="br"/>
759
+ <ref name="hyperlink"/>
760
+ <ref name="hr"/>
761
+ <ref name="pagebreak"/>
762
+ <ref name="bookmark"/>
763
+ </choice>
764
+ </define>
765
+ <define name="source">
766
+ <element name="source">
767
+ <ref name="TypedUri"/>
768
+ </element>
769
+ </define>
770
+ <define name="em">
771
+ <element name="em">
772
+ <text/>
773
+ </element>
774
+ </define>
775
+ <define name="strong">
776
+ <element name="strong">
777
+ <text/>
778
+ </element>
779
+ </define>
780
+ <define name="tt">
781
+ <element name="tt">
782
+ <text/>
783
+ </element>
784
+ </define>
785
+ <define name="keyword">
786
+ <element name="keyword">
787
+ <text/>
788
+ </element>
789
+ </define>
790
+ <define name="sub">
791
+ <element name="sub">
792
+ <text/>
793
+ </element>
794
+ </define>
795
+ <define name="sup">
796
+ <element name="sup">
797
+ <text/>
798
+ </element>
799
+ </define>
800
+ <define name="strike">
801
+ <element name="strike">
802
+ <text/>
803
+ </element>
804
+ </define>
805
+ <define name="smallcap">
806
+ <element name="smallcap">
807
+ <text/>
808
+ </element>
809
+ </define>
810
+ <define name="br">
811
+ <element name="br">
812
+ <empty/>
813
+ </element>
814
+ </define>
815
+ <define name="hr">
816
+ <element name="hr">
817
+ <empty/>
818
+ </element>
819
+ </define>
820
+ <define name="pagebreak">
821
+ <element name="pagebreak">
822
+ <empty/>
823
+ </element>
824
+ </define>
825
+ <!-- bare ID element, used for referencing arbitrary spans of text -->
826
+ <define name="bookmark">
827
+ <element name="bookmark">
828
+ <attribute name="id">
829
+ <data type="ID"/>
830
+ </attribute>
831
+ <empty/>
832
+ </element>
833
+ </define>
834
+ <define name="ReferenceFormat">
835
+ <choice>
836
+ <value>external</value>
837
+ <value>inline</value>
838
+ <value>footnote</value>
839
+ <value>callout</value>
840
+ </choice>
841
+ </define>
842
+ <define name="eref">
843
+ <element name="eref">
844
+ <ref name="erefType"/>
845
+ </element>
846
+ </define>
847
+ <define name="erefType">
848
+ <optional>
849
+ <attribute name="normative">
850
+ <data type="boolean"/>
851
+ </attribute>
852
+ </optional>
853
+ <attribute name="citeas"/>
854
+ <attribute name="type">
855
+ <ref name="ReferenceFormat"/>
856
+ </attribute>
857
+ <ref name="CitationType"/>
858
+ <text/>
859
+ </define>
860
+ <define name="hyperlink">
861
+ <element name="link">
862
+ <attribute name="target">
863
+ <data type="anyURI"/>
864
+ </attribute>
865
+ <attribute name="type">
866
+ <ref name="ReferenceFormat"/>
867
+ </attribute>
868
+ <text/>
869
+ </element>
870
+ </define>
871
+ <define name="xref">
872
+ <element name="xref">
873
+ <attribute name="target">
874
+ <data type="IDREF"/>
875
+ </attribute>
876
+ <attribute name="type">
877
+ <ref name="ReferenceFormat"/>
878
+ </attribute>
879
+ <text/>
880
+ </element>
881
+ </define>
882
+ <define name="fn">
883
+ <element name="fn">
884
+ <attribute name="reference"/>
885
+ <oneOrMore>
886
+ <ref name="paragraph"/>
887
+ </oneOrMore>
888
+ </element>
889
+ </define>
890
+ <!--
891
+ This is xref with fixed @type="footnote", and @target built in as paragraph+
892
+ @reference replaces ReferenceElement/text
893
+ so <fn reference="2"><p>This is a footnote</p></fn>
894
+ corresponds to
895
+ <eref type="footnote" target="fn2">2</xref> <p id="fn2">This is a footnote</p>
896
+ -->
897
+ <define name="callout">
898
+ <element name="callout">
899
+ <attribute name="target">
900
+ <data type="IDREF"/>
901
+ </attribute>
902
+ <text/>
903
+ </element>
904
+ </define>
905
+ <!--
906
+ This is xref with fixed @type="callout"; the target by convention is in an annotation in the same source code snippet
907
+ so <callout target="xyz">1</callout>
908
+ corresponds to <xref type="callout" target="xyz">1</xref>
909
+ -->
910
+ <define name="image">
911
+ <element name="image">
912
+ <attribute name="id">
913
+ <data type="ID"/>
914
+ </attribute>
915
+ <optional>
916
+ <attribute name="src">
917
+ <data type="anyURI"/>
918
+ </attribute>
919
+ </optional>
920
+ <attribute name="imagetype">
921
+ <choice>
922
+ <value>SVG</value>
923
+ <value>JPEG</value>
924
+ <value>GIF</value>
925
+ <value>PNG</value>
926
+ <value>PDF</value>
927
+ </choice>
928
+ </attribute>
929
+ <optional>
930
+ <attribute name="width">
931
+ <choice>
932
+ <data type="int"/>
933
+ <value>auto</value>
934
+ </choice>
935
+ </attribute>
936
+ </optional>
937
+ <optional>
938
+ <attribute name="height">
939
+ <choice>
940
+ <data type="int"/>
941
+ <value>auto</value>
942
+ </choice>
943
+ </attribute>
944
+ </optional>
945
+ </element>
946
+ </define>
947
+ <define name="stem">
948
+ <element name="stem">
949
+ <attribute name="type">
950
+ <choice>
951
+ <value>MathML</value>
952
+ <value>AsciiMath</value>
953
+ </choice>
954
+ </attribute>
955
+ <text/>
956
+ </element>
957
+ </define>
958
+ <define name="annotation">
959
+ <element name="annotation">
960
+ <attribute name="id">
961
+ <data type="ID"/>
962
+ </attribute>
963
+ <ref name="paragraph"/>
964
+ </element>
965
+ </define>
966
+ <define name="ul">
967
+ <element name="ul">
968
+ <attribute name="id">
969
+ <data type="ID"/>
970
+ </attribute>
971
+ <oneOrMore>
972
+ <ref name="li"/>
973
+ </oneOrMore>
974
+ <zeroOrMore>
975
+ <ref name="note"/>
976
+ </zeroOrMore>
977
+ </element>
978
+ </define>
979
+ <define name="li">
980
+ <element name="li">
981
+ <optional>
982
+ <attribute name="id">
983
+ <data type="ID"/>
984
+ </attribute>
985
+ </optional>
986
+ <oneOrMore>
987
+ <ref name="paragraph-with-footnote"/>
988
+ </oneOrMore>
989
+ </element>
990
+ </define>
991
+ <define name="ol">
992
+ <element name="ol">
993
+ <attribute name="id">
994
+ <data type="ID"/>
995
+ </attribute>
996
+ <attribute name="type">
997
+ <choice>
998
+ <value>roman</value>
999
+ <value>alphabet</value>
1000
+ <value>arabic</value>
1001
+ <value>roman_upper</value>
1002
+ <value>alphabet_upper</value>
1003
+ </choice>
1004
+ </attribute>
1005
+ <oneOrMore>
1006
+ <ref name="li"/>
1007
+ </oneOrMore>
1008
+ <zeroOrMore>
1009
+ <ref name="note"/>
1010
+ </zeroOrMore>
1011
+ </element>
1012
+ </define>
1013
+ <define name="dl">
1014
+ <element name="dl">
1015
+ <attribute name="id">
1016
+ <data type="ID"/>
1017
+ </attribute>
1018
+ <oneOrMore>
1019
+ <ref name="dt"/>
1020
+ <ref name="dd"/>
1021
+ </oneOrMore>
1022
+ <zeroOrMore>
1023
+ <ref name="note"/>
1024
+ </zeroOrMore>
1025
+ </element>
1026
+ </define>
1027
+ <define name="dt">
1028
+ <element name="dt">
1029
+ <zeroOrMore>
1030
+ <ref name="TextElement"/>
1031
+ </zeroOrMore>
1032
+ </element>
1033
+ </define>
1034
+ <define name="dd">
1035
+ <element name="dd">
1036
+ <zeroOrMore>
1037
+ <ref name="paragraph-with-footnote"/>
1038
+ </zeroOrMore>
1039
+ </element>
1040
+ </define>
1041
+ <define name="BibData">
1042
+ <optional>
1043
+ <attribute name="type">
1044
+ <ref name="BibItemType"/>
1045
+ </attribute>
1046
+ </optional>
1047
+ <oneOrMore>
1048
+ <ref name="btitle"/>
1049
+ </oneOrMore>
1050
+ <optional>
1051
+ <ref name="formattedref"/>
1052
+ </optional>
1053
+ <zeroOrMore>
1054
+ <ref name="bsource"/>
1055
+ </zeroOrMore>
1056
+ <zeroOrMore>
1057
+ <ref name="docidentifier"/>
1058
+ </zeroOrMore>
1059
+ <optional>
1060
+ <ref name="docnumber"/>
1061
+ </optional>
1062
+ <zeroOrMore>
1063
+ <ref name="bdate"/>
1064
+ </zeroOrMore>
1065
+ <zeroOrMore>
1066
+ <ref name="contributor"/>
1067
+ </zeroOrMore>
1068
+ <optional>
1069
+ <ref name="edition"/>
1070
+ </optional>
1071
+ <zeroOrMore>
1072
+ <ref name="biblionote"/>
1073
+ </zeroOrMore>
1074
+ <zeroOrMore>
1075
+ <ref name="language"/>
1076
+ </zeroOrMore>
1077
+ <zeroOrMore>
1078
+ <ref name="script"/>
1079
+ </zeroOrMore>
1080
+ <optional>
1081
+ <ref name="abstract"/>
1082
+ </optional>
1083
+ <optional>
1084
+ <ref name="status"/>
1085
+ </optional>
1086
+ <ref name="copyright"/>
1087
+ <zeroOrMore>
1088
+ <ref name="docrelation"/>
1089
+ </zeroOrMore>
1090
+ </define>
1091
+ </grammar>