metanorma-acme 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f439036427eeadbfc4bf41f65e4c4d8e655fc754708a3f05e8e55a7fd38f576f
4
+ data.tar.gz: 066e2fa159203120aa60a98d774e9ce83ab2e4775354b0f6699d9c3d0e779bd2
5
+ SHA512:
6
+ metadata.gz: f714a3a4da7da69ecd037fafb25666dd54d76e945b9813d1f2f1deaed0e44d6329e4f58daf0f7307352a8e643d246e4c086bf72136151e00ed9276a7f600b23b
7
+ data.tar.gz: 478b6069bba6f07a30b25760bb67c5b4b9264a393b19d427dba30d6803156159e807feed15f0d96814a9365e1dab3154201132093db0d49452697565203e67f1
@@ -0,0 +1 @@
1
+ .DS_Store
@@ -0,0 +1,13 @@
1
+ dist: trusty
2
+ sudo: false
3
+ language: ruby
4
+ rvm:
5
+ - 2.5
6
+ - 2.4
7
+ - ruby-head
8
+ before_install:
9
+ - gem install bundler
10
+ - unset _JAVA_OPTIONS
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: ruby-head
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ronald.tse@ribose.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+ git_source(:github) {|repo| "https://github.com/#{repo}" }
3
+
4
+ gem "isodoc", github: "riboseinc/isodoc"
5
+ gem "asciidoctor-iso", github: "riboseinc/asciidoctor-iso"
6
+ gem "html2doc", github: "riboseinc/html2doc"
7
+
8
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2018, Ribose
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,13 @@
1
+ = metanorma-acme: Sample Asciidoctor processor for Metanorma documents
2
+
3
+ ////
4
+ image:https://img.shields.io/gem/v/metanorma-acme.svg["Gem Version", link="https://rubygems.org/gems/metanorma-acme"]
5
+ image:https://img.shields.io/travis/riboseinc/metanorma-acme/master.svg["Build Status", link="https://travis-ci.org/riboseinc/metanorma-acme"]
6
+ image:https://codeclimate.com/github/riboseinc/metanorma-acme/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/metanorma-acme"]
7
+ ////
8
+
9
+ == Functionality
10
+
11
+ This is an example of a https://github.com/riboseinc/metanorma[Metanorma] gem for processing input formats (Asciidoctor) and generating output formats (Word, HTML, PDF).
12
+ It has been created as an exemplar for generating new instances of Metanorma gems, as illustrated in https://github.com/riboseinc/asciidoctor-iso/wiki/Gem-Customisation-Guide
13
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "metanorma/acme"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
11
+ "../../Gemfile", Pathname.new(__FILE__).realpath
12
+ )
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rspec-core", "rspec")
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ require "asciidoctor/acme/converter"
2
+
3
+ module Asciidoctor
4
+ module Acme
5
+
6
+ end
7
+ end
@@ -0,0 +1,212 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!--
4
+ Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
+ we cannot have a new default namespace: we will end up with a grammar with two different
6
+ namespaces, one for isostandard and one for csand additions. And we do not want that.
7
+ -->
8
+ <include href="isostandard.rng">
9
+ <start>
10
+ <ref name="acme-standard"/>
11
+ </start>
12
+ <define name="language">
13
+ <element name="language">
14
+ <value>en</value>
15
+ </element>
16
+ </define>
17
+ <define name="docidentifier">
18
+ <element name="docidentifier">
19
+ <text/>
20
+ </element>
21
+ </define>
22
+ <define name="btitle">
23
+ <element name="title">
24
+ <ref name="FormattedString"/>
25
+ </element>
26
+ </define>
27
+ <define name="figure">
28
+ <element name="figure">
29
+ <attribute name="id">
30
+ <data type="ID"/>
31
+ </attribute>
32
+ <optional>
33
+ <ref name="source"/>
34
+ </optional>
35
+ <optional>
36
+ <ref name="tname"/>
37
+ </optional>
38
+ <choice>
39
+ <oneOrMore>
40
+ <ref name="figure"/>
41
+ </oneOrMore>
42
+ <group>
43
+ <choice>
44
+ <zeroOrMore>
45
+ <ref name="TextElement"/>
46
+ </zeroOrMore>
47
+ <ref name="pre"/>
48
+ </choice>
49
+ <zeroOrMore>
50
+ <ref name="note"/>
51
+ </zeroOrMore>
52
+ <optional>
53
+ <ref name="dl"/>
54
+ </optional>
55
+ </group>
56
+ </choice>
57
+ </element>
58
+ </define>
59
+ <define name="status">
60
+ <element name="status">
61
+ <choice>
62
+ <value>proposal</value>
63
+ <value>working-draft</value>
64
+ <value>committee-draft</value>
65
+ <value>draft-standard</value>
66
+ <value>final-draft</value>
67
+ <value>published</value>
68
+ <value>withdrawn</value>
69
+ <ref name="LocalizedString"/>
70
+ </choice>
71
+ </element>
72
+ </define>
73
+ <!-- TextElement |= keyword -->
74
+ <define name="TextElement">
75
+ <choice>
76
+ <text/>
77
+ <ref name="em"/>
78
+ <ref name="eref"/>
79
+ <ref name="strong"/>
80
+ <ref name="stem"/>
81
+ <ref name="sub"/>
82
+ <ref name="sup"/>
83
+ <ref name="tt"/>
84
+ <ref name="strike"/>
85
+ <ref name="smallcap"/>
86
+ <ref name="xref"/>
87
+ <ref name="br"/>
88
+ <ref name="hyperlink"/>
89
+ <ref name="hr"/>
90
+ <ref name="pagebreak"/>
91
+ <ref name="bookmark"/>
92
+ <ref name="keyword"/>
93
+ </choice>
94
+ </define>
95
+ <define name="BibItemType" combine="choice">
96
+ <choice>
97
+ <value>policy-and-procedures</value>
98
+ <value>best-practices</value>
99
+ <value>supporting-document</value>
100
+ <value>report</value>
101
+ <value>legal</value>
102
+ <value>directives</value>
103
+ <value>proposal</value>
104
+ <value>standard</value>
105
+ </choice>
106
+ </define>
107
+ <define name="editorialgroup">
108
+ <element name="editorialgroup">
109
+ <ref name="committee"/>
110
+ </element>
111
+ </define>
112
+ <define name="BibData">
113
+ <optional>
114
+ <attribute name="type">
115
+ <ref name="BibItemType"/>
116
+ </attribute>
117
+ </optional>
118
+ <oneOrMore>
119
+ <ref name="btitle"/>
120
+ </oneOrMore>
121
+ <optional>
122
+ <ref name="formattedref"/>
123
+ </optional>
124
+ <zeroOrMore>
125
+ <ref name="bsource"/>
126
+ </zeroOrMore>
127
+ <zeroOrMore>
128
+ <ref name="docidentifier"/>
129
+ </zeroOrMore>
130
+ <zeroOrMore>
131
+ <ref name="bdate"/>
132
+ </zeroOrMore>
133
+ <zeroOrMore>
134
+ <ref name="contributor"/>
135
+ </zeroOrMore>
136
+ <optional>
137
+ <ref name="edition"/>
138
+ </optional>
139
+ <zeroOrMore>
140
+ <ref name="biblionote"/>
141
+ </zeroOrMore>
142
+ <zeroOrMore>
143
+ <ref name="language"/>
144
+ </zeroOrMore>
145
+ <zeroOrMore>
146
+ <ref name="script"/>
147
+ </zeroOrMore>
148
+ <zeroOrMore>
149
+ <ref name="abstract"/>
150
+ </zeroOrMore>
151
+ <optional>
152
+ <ref name="status"/>
153
+ </optional>
154
+ <ref name="copyright"/>
155
+ <zeroOrMore>
156
+ <ref name="docrelation"/>
157
+ </zeroOrMore>
158
+ <ref name="editorialgroup"/>
159
+ <zeroOrMore>
160
+ <ref name="ics"/>
161
+ </zeroOrMore>
162
+ <optional>
163
+ <ref name="security"/>
164
+ </optional>
165
+ </define>
166
+ </include>
167
+ <define name="committee">
168
+ <element name="committee">
169
+ <attribute name="type">
170
+ <choice>
171
+ <value>technical</value>
172
+ <value>provisional</value>
173
+ </choice>
174
+ </attribute>
175
+ <text/>
176
+ </element>
177
+ </define>
178
+ <define name="pre">
179
+ <element name="pre">
180
+ <text/>
181
+ </element>
182
+ </define>
183
+ <define name="keyword">
184
+ <element name="keyword">
185
+ <text/>
186
+ </element>
187
+ </define>
188
+ <define name="security">
189
+ <element name="security">
190
+ <text/>
191
+ </element>
192
+ </define>
193
+ <define name="acme-standard">
194
+ <element name="acme-standard">
195
+ <ref name="bibdata"/>
196
+ <optional>
197
+ <ref name="version"/>
198
+ </optional>
199
+ <zeroOrMore>
200
+ <ref name="termdocsource"/>
201
+ </zeroOrMore>
202
+ <ref name="preface"/>
203
+ <oneOrMore>
204
+ <ref name="sections"/>
205
+ </oneOrMore>
206
+ <zeroOrMore>
207
+ <ref name="annex"/>
208
+ </zeroOrMore>
209
+ <ref name="bibliography"/>
210
+ </element>
211
+ </define>
212
+ </grammar>
@@ -0,0 +1,631 @@
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: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
+ <define name="status">
22
+ <element name="status">
23
+ <ref name="LocalizedString"/>
24
+ </element>
25
+ </define>
26
+ <define name="language">
27
+ <element name="language">
28
+ <text/>
29
+ </element>
30
+ </define>
31
+ <define name="script">
32
+ <a:documentation>ISO-639</a:documentation>
33
+ <element name="script">
34
+ <text/>
35
+ </element>
36
+ </define>
37
+ <define name="edition">
38
+ <a:documentation>ISO-15924: Latn</a:documentation>
39
+ <element name="edition">
40
+ <data type="int"/>
41
+ </element>
42
+ </define>
43
+ <define name="LocalizedString">
44
+ <optional>
45
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
46
+ <attribute name="language"/>
47
+ </optional>
48
+ <optional>
49
+ <attribute name="script"/>
50
+ </optional>
51
+ <text/>
52
+ </define>
53
+ <!--
54
+ Unlike UML, change type to format: type is overloaded
55
+ Would be need if plain were default value and could omit the attribute
56
+ Added LocalizedStringOrXsAny
57
+ -->
58
+ <define name="FormattedString">
59
+ <optional>
60
+ <!-- attribute format { ( "plain" | "html" | "docbook" | "tei" | "asciidoc" | "markdown" ) }?, -->
61
+ <attribute name="format">
62
+ <choice>
63
+ <value>text/plain</value>
64
+ <value>text/html</value>
65
+ <value>application/docbook+xml</value>
66
+ <value>application/tei+xml</value>
67
+ <value>text/x-asciidoc</value>
68
+ <value>text/markdown</value>
69
+ <value>application/x-isodoc+xml</value>
70
+ <text/>
71
+ </choice>
72
+ </attribute>
73
+ </optional>
74
+ <ref name="LocalizedStringOrXsAny"/>
75
+ </define>
76
+ <define name="LocalizedStringOrXsAny">
77
+ <optional>
78
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
79
+ <attribute name="language"/>
80
+ </optional>
81
+ <optional>
82
+ <attribute name="script"/>
83
+ </optional>
84
+ <oneOrMore>
85
+ <choice>
86
+ <text/>
87
+ <ref name="AnyElement"/>
88
+ </choice>
89
+ </oneOrMore>
90
+ </define>
91
+ <define name="contributor">
92
+ <element name="contributor">
93
+ <zeroOrMore>
94
+ <ref name="role"/>
95
+ </zeroOrMore>
96
+ <ref name="ContributorInfo"/>
97
+ </element>
98
+ </define>
99
+ <define name="role">
100
+ <element name="role">
101
+ <optional>
102
+ <attribute name="type">
103
+ <choice>
104
+ <value>author</value>
105
+ <value>edition</value>
106
+ <value>publisher</value>
107
+ <text/>
108
+ </choice>
109
+ </attribute>
110
+ </optional>
111
+ <zeroOrMore>
112
+ <ref name="roledescription"/>
113
+ </zeroOrMore>
114
+ </element>
115
+ </define>
116
+ <define name="ContributorInfo">
117
+ <choice>
118
+ <ref name="person"/>
119
+ <ref name="organization"/>
120
+ </choice>
121
+ </define>
122
+ <define name="roledescription">
123
+ <element name="description">
124
+ <ref name="FormattedString"/>
125
+ </element>
126
+ </define>
127
+ <define name="person">
128
+ <element name="person">
129
+ <optional>
130
+ <ref name="fullname"/>
131
+ </optional>
132
+ <zeroOrMore>
133
+ <ref name="affiliation"/>
134
+ </zeroOrMore>
135
+ <zeroOrMore>
136
+ <ref name="person-identifier"/>
137
+ </zeroOrMore>
138
+ <zeroOrMore>
139
+ <ref name="contact"/>
140
+ </zeroOrMore>
141
+ <optional>
142
+ <ref name="uri"/>
143
+ </optional>
144
+ </element>
145
+ </define>
146
+ <define name="fullname">
147
+ <element name="name">
148
+ <zeroOrMore>
149
+ <ref name="prefix"/>
150
+ </zeroOrMore>
151
+ <zeroOrMore>
152
+ <ref name="forename"/>
153
+ </zeroOrMore>
154
+ <zeroOrMore>
155
+ <ref name="initial"/>
156
+ </zeroOrMore>
157
+ <ref name="surname"/>
158
+ <zeroOrMore>
159
+ <ref name="addition"/>
160
+ </zeroOrMore>
161
+ </element>
162
+ </define>
163
+ <define name="prefix">
164
+ <element name="prefix">
165
+ <ref name="LocalizedString"/>
166
+ </element>
167
+ </define>
168
+ <define name="initial">
169
+ <element name="initial">
170
+ <ref name="LocalizedString"/>
171
+ </element>
172
+ </define>
173
+ <define name="addition">
174
+ <element name="addition">
175
+ <ref name="LocalizedString"/>
176
+ </element>
177
+ </define>
178
+ <define name="surname">
179
+ <element name="surname">
180
+ <ref name="LocalizedString"/>
181
+ </element>
182
+ </define>
183
+ <define name="forename">
184
+ <element name="forename">
185
+ <ref name="LocalizedString"/>
186
+ </element>
187
+ </define>
188
+ <define name="affiliation">
189
+ <element name="affiliation">
190
+ <optional>
191
+ <ref name="affiliationname"/>
192
+ </optional>
193
+ <zeroOrMore>
194
+ <ref name="affiliationdescription"/>
195
+ </zeroOrMore>
196
+ <ref name="organization"/>
197
+ </element>
198
+ </define>
199
+ <define name="affiliationname">
200
+ <element name="name">
201
+ <ref name="LocalizedString"/>
202
+ </element>
203
+ </define>
204
+ <define name="affiliationdescription">
205
+ <element name="description">
206
+ <ref name="FormattedString"/>
207
+ </element>
208
+ </define>
209
+ <define name="organization">
210
+ <element name="organization">
211
+ <ref name="orgname"/>
212
+ <optional>
213
+ <ref name="abbreviation"/>
214
+ </optional>
215
+ <optional>
216
+ <ref name="uri"/>
217
+ </optional>
218
+ <zeroOrMore>
219
+ <ref name="org-identifier"/>
220
+ </zeroOrMore>
221
+ <zeroOrMore>
222
+ <ref name="contact"/>
223
+ </zeroOrMore>
224
+ </element>
225
+ </define>
226
+ <define name="orgname">
227
+ <element name="name">
228
+ <ref name="LocalizedString"/>
229
+ </element>
230
+ </define>
231
+ <define name="abbreviation">
232
+ <element name="abbreviation">
233
+ <ref name="LocalizedString"/>
234
+ </element>
235
+ </define>
236
+ <define name="uri">
237
+ <element name="uri">
238
+ <data type="anyURI"/>
239
+ </element>
240
+ </define>
241
+ <!-- TODO may change -->
242
+ <define name="contact">
243
+ <choice>
244
+ <ref name="address"/>
245
+ <ref name="phone"/>
246
+ <ref name="email"/>
247
+ <ref name="uri"/>
248
+ </choice>
249
+ </define>
250
+ <define name="phone">
251
+ <element name="phone">
252
+ <text/>
253
+ </element>
254
+ </define>
255
+ <define name="email">
256
+ <element name="email">
257
+ <text/>
258
+ </element>
259
+ </define>
260
+ <define name="address">
261
+ <element name="address">
262
+ <oneOrMore>
263
+ <!-- iso191606 TODO -->
264
+ <ref name="street"/>
265
+ </oneOrMore>
266
+ <ref name="city"/>
267
+ <optional>
268
+ <ref name="state"/>
269
+ </optional>
270
+ <ref name="country"/>
271
+ <optional>
272
+ <ref name="postcode"/>
273
+ </optional>
274
+ </element>
275
+ </define>
276
+ <define name="street">
277
+ <element name="street">
278
+ <text/>
279
+ </element>
280
+ </define>
281
+ <define name="city">
282
+ <element name="city">
283
+ <text/>
284
+ </element>
285
+ </define>
286
+ <define name="state">
287
+ <element name="state">
288
+ <text/>
289
+ </element>
290
+ </define>
291
+ <define name="country">
292
+ <element name="country">
293
+ <text/>
294
+ </element>
295
+ </define>
296
+ <define name="postcode">
297
+ <element name="postcode">
298
+ <text/>
299
+ </element>
300
+ </define>
301
+ <define name="person-identifier">
302
+ <element name="identifier">
303
+ <attribute name="type">
304
+ <choice>
305
+ <value>isni</value>
306
+ <value>uri</value>
307
+ </choice>
308
+ </attribute>
309
+ <text/>
310
+ </element>
311
+ </define>
312
+ <define name="org-identifier">
313
+ <element name="identifier">
314
+ <attribute name="type">
315
+ <choice>
316
+ <value>orcid</value>
317
+ <value>uri</value>
318
+ </choice>
319
+ </attribute>
320
+ <text/>
321
+ </element>
322
+ </define>
323
+ <define name="citation">
324
+ <element name="citation">
325
+ <ref name="CitationType"/>
326
+ </element>
327
+ </define>
328
+ <define name="CitationType">
329
+ <attribute name="bibitemid">
330
+ <data type="IDREF"/>
331
+ </attribute>
332
+ <zeroOrMore>
333
+ <ref name="locality"/>
334
+ </zeroOrMore>
335
+ <optional>
336
+ <ref name="date"/>
337
+ </optional>
338
+ </define>
339
+ <define name="date">
340
+ <element name="date">
341
+ <choice>
342
+ <data type="gYear"/>
343
+ <data type="date"/>
344
+ </choice>
345
+ </element>
346
+ </define>
347
+ <define name="locality">
348
+ <element name="locality">
349
+ <!-- attribute type { ( "section" | "clause" | "part" | "paragraph" | "chapter" | "page" | "whole" | "table" | "annex" | "figure" | "note" | "example" | ("locality:", text) ) }, -->
350
+ <attribute name="type">
351
+ <ref name="LocalityType"/>
352
+ </attribute>
353
+ <ref name="referenceFrom"/>
354
+ <optional>
355
+ <ref name="referenceTo"/>
356
+ </optional>
357
+ </element>
358
+ </define>
359
+ <define name="LocalityType">
360
+ <data type="string">
361
+ <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|example|locality:[a-zA-Z0-9_]+</param>
362
+ </data>
363
+ </define>
364
+ <define name="referenceFrom">
365
+ <element name="referenceFrom">
366
+ <text/>
367
+ </element>
368
+ </define>
369
+ <define name="referenceTo">
370
+ <element name="referenceTo">
371
+ <text/>
372
+ </element>
373
+ </define>
374
+ <!-- unlike UML, has id attribute; that results from including bibitem in a docmodel -->
375
+ <define name="bibitem">
376
+ <element name="bibitem">
377
+ <attribute name="id">
378
+ <data type="ID"/>
379
+ </attribute>
380
+ <ref name="BibliographicItem"/>
381
+ </element>
382
+ </define>
383
+ <define name="bibitem_no_id">
384
+ <element name="bibitem">
385
+ <ref name="BibliographicItem"/>
386
+ </element>
387
+ </define>
388
+ <define name="BibItemType" combine="choice">
389
+ <choice>
390
+ <value>article</value>
391
+ <value>book</value>
392
+ <value>booklet</value>
393
+ <value>conference</value>
394
+ <value>manual</value>
395
+ <value>proceedings</value>
396
+ <value>presentation</value>
397
+ <value>thesis</value>
398
+ <value>techreport</value>
399
+ <value>standard</value>
400
+ <value>unpublished</value>
401
+ </choice>
402
+ </define>
403
+ <define name="BibliographicItem">
404
+ <optional>
405
+ <attribute name="type">
406
+ <ref name="BibItemType"/>
407
+ </attribute>
408
+ </optional>
409
+ <choice>
410
+ <oneOrMore>
411
+ <ref name="btitle"/>
412
+ </oneOrMore>
413
+ <ref name="formattedref"/>
414
+ </choice>
415
+ <zeroOrMore>
416
+ <ref name="bsource"/>
417
+ </zeroOrMore>
418
+ <zeroOrMore>
419
+ <ref name="docidentifier"/>
420
+ </zeroOrMore>
421
+ <zeroOrMore>
422
+ <ref name="bdate"/>
423
+ </zeroOrMore>
424
+ <zeroOrMore>
425
+ <ref name="contributor"/>
426
+ </zeroOrMore>
427
+ <optional>
428
+ <ref name="edition"/>
429
+ </optional>
430
+ <zeroOrMore>
431
+ <ref name="biblionote"/>
432
+ </zeroOrMore>
433
+ <zeroOrMore>
434
+ <ref name="language"/>
435
+ </zeroOrMore>
436
+ <zeroOrMore>
437
+ <ref name="script"/>
438
+ </zeroOrMore>
439
+ <optional>
440
+ <ref name="abstract"/>
441
+ </optional>
442
+ <optional>
443
+ <ref name="status"/>
444
+ </optional>
445
+ <zeroOrMore>
446
+ <ref name="copyright"/>
447
+ </zeroOrMore>
448
+ <zeroOrMore>
449
+ <ref name="docrelation"/>
450
+ </zeroOrMore>
451
+ </define>
452
+ <define name="btitle">
453
+ <element name="title">
454
+ <ref name="FormattedString"/>
455
+ </element>
456
+ </define>
457
+ <define name="bsource">
458
+ <element name="source">
459
+ <ref name="TypedUri"/>
460
+ </element>
461
+ </define>
462
+ <define name="formattedref">
463
+ <element name="formattedref">
464
+ <ref name="FormattedString"/>
465
+ </element>
466
+ </define>
467
+ <define name="link">
468
+ <element name="link">
469
+ <ref name="TypedUri"/>
470
+ </element>
471
+ </define>
472
+ <define name="TypedUri">
473
+ <optional>
474
+ <attribute name="type"/>
475
+ </optional>
476
+ <data type="anyURI"/>
477
+ </define>
478
+ <define name="bdate">
479
+ <element name="date">
480
+ <attribute name="type">
481
+ <choice>
482
+ <value>published</value>
483
+ <value>accessed</value>
484
+ <value>created</value>
485
+ <value>implemented</value>
486
+ <value>obsoleted</value>
487
+ <value>confirmed</value>
488
+ <value>updated</value>
489
+ <value>issued</value>
490
+ </choice>
491
+ </attribute>
492
+ <!-- ( ( bfrom, bto? ) | date_on ) -->
493
+ <choice>
494
+ <group>
495
+ <element name="from">
496
+ <choice>
497
+ <data type="gYear"/>
498
+ <data type="date"/>
499
+ </choice>
500
+ </element>
501
+ <optional>
502
+ <element name="to">
503
+ <choice>
504
+ <data type="gYear"/>
505
+ <data type="date"/>
506
+ </choice>
507
+ </element>
508
+ </optional>
509
+ </group>
510
+ <element name="on">
511
+ <choice>
512
+ <data type="gYear"/>
513
+ <data type="date"/>
514
+ </choice>
515
+ </element>
516
+ </choice>
517
+ </element>
518
+ </define>
519
+ <define name="bfrom">
520
+ <element name="from">
521
+ <choice>
522
+ <data type="gYear"/>
523
+ <data type="date"/>
524
+ </choice>
525
+ </element>
526
+ </define>
527
+ <define name="bto">
528
+ <element name="to">
529
+ <choice>
530
+ <data type="gYear"/>
531
+ <data type="date"/>
532
+ </choice>
533
+ </element>
534
+ </define>
535
+ <define name="date_on">
536
+ <element name="on">
537
+ <choice>
538
+ <data type="gYear"/>
539
+ <data type="date"/>
540
+ </choice>
541
+ </element>
542
+ </define>
543
+ <define name="docidentifier">
544
+ <element name="docidentifier">
545
+ <optional>
546
+ <attribute name="type"/>
547
+ </optional>
548
+ <text/>
549
+ </element>
550
+ </define>
551
+ <define name="biblionote">
552
+ <element name="note">
553
+ <ref name="FormattedString"/>
554
+ </element>
555
+ </define>
556
+ <define name="abstract">
557
+ <element name="abstract">
558
+ <ref name="FormattedString"/>
559
+ </element>
560
+ </define>
561
+ <define name="copyright">
562
+ <element name="copyright">
563
+ <ref name="from"/>
564
+ <optional>
565
+ <ref name="to"/>
566
+ </optional>
567
+ <ref name="owner"/>
568
+ </element>
569
+ </define>
570
+ <define name="from">
571
+ <element name="from">
572
+ <data type="gYear"/>
573
+ </element>
574
+ </define>
575
+ <define name="to">
576
+ <element name="to">
577
+ <data type="gYear"/>
578
+ </element>
579
+ </define>
580
+ <define name="owner">
581
+ <element name="owner">
582
+ <ref name="ContributorInfo"/>
583
+ </element>
584
+ </define>
585
+ <define name="docrelation">
586
+ <element name="relation">
587
+ <attribute name="type">
588
+ <choice>
589
+ <value>parent</value>
590
+ <value>child</value>
591
+ <value>obsoletes</value>
592
+ <value>updates</value>
593
+ <value>updatedBy</value>
594
+ <value>complements</value>
595
+ <value>derivedFrom</value>
596
+ <value>adoptedFrom</value>
597
+ <value>equivalent</value>
598
+ <value>identical</value>
599
+ <value>nonequivalent</value>
600
+ </choice>
601
+ </attribute>
602
+ <element name="bibitem">
603
+ <ref name="BibliographicItem"/>
604
+ </element>
605
+ <zeroOrMore>
606
+ <ref name="locality"/>
607
+ </zeroOrMore>
608
+ </element>
609
+ </define>
610
+ <!--
611
+ Anycontents = mixed {
612
+ https://github.com/relaxng/jing-trang/issues/211
613
+ https://lists.oasis-open.org/archives/office/200808/msg00024.html
614
+ https://lists.oasis-open.org/archives/office/200808/msg00099.html
615
+ For this to work, we will actually strip any attributes in the Anycontents before
616
+ passing it for validation. Horrible I know, but there are no good alternatives
617
+ that also allow us to do grammar inheritance
618
+ (attribute * { text } | Any)*
619
+ Any*
620
+ }
621
+ -->
622
+ <define name="AnyElement">
623
+ <element>
624
+ <anyName/>
625
+ <choice>
626
+ <text/>
627
+ <ref name="AnyElement"/>
628
+ </choice>
629
+ </element>
630
+ </define>
631
+ </grammar>