relaton-ieee 1.1.0

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: a252f5c48b132561dca8f5ff3095f495c64455d349f3db3cbe0c171be5ab1c3f
4
+ data.tar.gz: a6ecad35fdfd190f4146fb00209d08c49a117abd8fafc8a1ce0418824fa0831e
5
+ SHA512:
6
+ metadata.gz: 80506c976e17d33a61353b64de42aca3ac85a1ba3cd3d67033232097866d265a9ea0619f9070234ea580bfc472b3c01a5c4cc34f9d8ab7ec0c53299f4a86ff51
7
+ data.tar.gz: 53c28859aa4eb6ecc11323f8f6df1a9b8a18d9ea7d3c760c50f2d583c454fbbdebbad46de6c5ba24be2c81d5eb04f625c1e1b47f3f89b550efa0a9e695f1ebcb
@@ -0,0 +1,38 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: macos
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ '**' ]
10
+
11
+ jobs:
12
+ test-macos:
13
+ name: Test on Ruby ${{ matrix.ruby }} macOS
14
+ runs-on: macos-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.5', '2.4' ]
19
+ steps:
20
+ - uses: actions/checkout@master
21
+ - name: Checkout submodules
22
+ shell: bash
23
+ run: |
24
+ auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
+ git submodule sync --recursive
26
+ git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
+ - name: Use Ruby
28
+ uses: actions/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ architecture: 'x64'
32
+ - name: Update gems
33
+ run: |
34
+ sudo gem install bundler --force
35
+ bundle install --jobs 4 --retry 3
36
+ - name: Run specs
37
+ run: |
38
+ bundle exec rake
@@ -0,0 +1,38 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: ubuntu
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ '**' ]
10
+
11
+ jobs:
12
+ test-linux:
13
+ name: Test on Ruby ${{ matrix.ruby }} Ubuntu
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.5', '2.4' ]
19
+ steps:
20
+ - uses: actions/checkout@master
21
+ - name: Checkout submodules
22
+ shell: bash
23
+ run: |
24
+ auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
+ git submodule sync --recursive
26
+ git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
+ - name: Use Ruby
28
+ uses: actions/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ architecture: 'x64'
32
+ - name: Update gems
33
+ run: |
34
+ gem install bundler
35
+ bundle install --jobs 4 --retry 3
36
+ - name: Run specs
37
+ run: |
38
+ bundle exec rake
@@ -0,0 +1,41 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: windows
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ '**' ]
10
+
11
+ jobs:
12
+ test-windows:
13
+ name: Test on Ruby ${{ matrix.ruby }} Windows
14
+ runs-on: windows-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.5', '2.4' ]
19
+ steps:
20
+ - uses: actions/checkout@master
21
+ - name: Checkout submodules
22
+ shell: bash
23
+ run: |
24
+ auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
+ git submodule sync --recursive
26
+ git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
+ - name: Use Ruby
28
+ uses: actions/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ architecture: 'x64'
32
+ - name: Update gems
33
+ shell: pwsh
34
+ run: |
35
+ gem install bundler
36
+ bundle config --local path vendor/bundle
37
+ bundle update
38
+ bundle install --jobs 4 --retry 3
39
+ - name: Run specs
40
+ run: |
41
+ bundle exec rake
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ .rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-master-ci-rubocop-yml
13
+ .vscode/
14
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,10 @@
1
+ # This project follows the Ribose OSS style guide.
2
+ # https://github.com/riboseinc/oss-guides
3
+ # All project-specific additions and overrides should be specified in this file.
4
+
5
+ inherit_from:
6
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
+ AllCops:
8
+ TargetRubyVersion: 2.3
9
+ Rails:
10
+ Enabled: true
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in relaton_ieee.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Andrei Kislichenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,172 @@
1
+ = RelatonIeee
2
+
3
+ RelatonIeee is a Ruby gem that implements the https://github.com/relaton/relaton-model-ieee#ieee-bibliographic-item-model[IeeeBibliographicItem model].
4
+
5
+ You can use it to retrieve metadata of IEEE Standards from standards.ieee.org, and access such metadata through the `IeeeBibliographicItem` object.
6
+
7
+ == Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ [sourse,ruby]
12
+ ----
13
+ gem 'relaton-ieee'
14
+ ----
15
+
16
+ And then execute:
17
+
18
+ $ bundle install
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install relaton-ieee
23
+
24
+ == Usage
25
+
26
+ === Search for a standard using keywords
27
+
28
+ ----
29
+ > require 'relaton_ieee'
30
+ => true
31
+
32
+ > hits = RelatonIeee::IeeeBibliography.search("IEEE 528-2019")
33
+ => <RelatonIeee::HitCollection:0x007f84c0085308 @ref=IEEE 528-2019 @fetched=false>
34
+
35
+ > item = hits[0].fetch
36
+ => #<RelatonIeee::IeeeBibliographicItem:0x007f84bf839c30
37
+ ...
38
+ ----
39
+
40
+ === XML serialization
41
+
42
+ ----
43
+ > item.to_xml
44
+ => "<bibitem id=\"528-2019\">
45
+ <fetched>2020-06-01</fetched>
46
+ <title type=\"main\" format=\"text/plain\" language=\"en\" script=\"Latn\">528-2019 - IEEE Standard for Inertial Sensor Terminology</title>
47
+ <uri type=\"src\">https://standards.ieee.org/content/ieee-standards/en/standard/528-2019.html</uri>
48
+ <docidentifier type=\"IEEE\">528-2019</docidentifier>
49
+ <date type=\"issued\">
50
+ <on>2019</on>
51
+ </date>
52
+ <date type=\"published\">
53
+ <on>2019</on>
54
+ </date>
55
+ <contributor>
56
+ <role type=\"author\"/>
57
+ <person>
58
+ <name>
59
+ <completename>Ashley Moran</completename>
60
+ </name>
61
+ </person>
62
+ </contributor>
63
+ <language>en</language>
64
+ <script>Latn</script>
65
+ <abstract format=\"text/plain\" language=\"en\" script=\"Latn\">Terms and definitions relating to inertial sensors are presented in this standard. Usage as understood by the inertial sensor community is given preference over general technical usage of the terms herein. The criterion for inclusion of a term and its definition in this standard is usefulness as related to inertial sensor technology.</abstract>
66
+ <status>
67
+ <stage>Active</stage>
68
+ </status>
69
+ </bibitem>"
70
+ ----
71
+
72
+ With argument `bibdata: true` it ouputs XML wrapped by `bibdata` element and adds flavour `ext` element.
73
+
74
+ ----
75
+ > item.to_xml bibdata: true
76
+ => "<bibdata>
77
+ <fetched>2020-06-01</fetched>
78
+ <title type="main" format="text/plain" language="en" script="Latn">528-2019 - IEEE Standard for Inertial Sensor Terminology</title>
79
+ <uri type="src">https://standards.ieee.org/content/ieee-standards/en/standard/528-2019.html</uri>
80
+ <docidentifier type="IEEE">528-2019</docidentifier>
81
+ <date type="issued">
82
+ <on>2019</on>
83
+ </date>
84
+ <date type="published">
85
+ <on>2019</on>
86
+ </date>
87
+ <contributor>
88
+ <role type="author"/>
89
+ <person>
90
+ <name>
91
+ <completename>Ashley Moran</completename>
92
+ </name>
93
+ </person>
94
+ </contributor>
95
+ <language>en</language>
96
+ <script>Latn</script>
97
+ <abstract format="text/plain" language="en" script="Latn">Terms and definitions relating to inertial sensors are presented in this standard. Usage as understood by the inertial sensor community is given preference over general technical usage of the terms herein. The criterion for inclusion of a term and its definition in this standard is usefulness as related to inertial sensor technology.</abstract>
98
+ <status>
99
+ <stage>Active</stage>
100
+ </status>
101
+ <ext>
102
+ <committee type="sponsor">
103
+ <name>AES/GA - Gyro Accelerometer Panel</name>
104
+ </committee>
105
+ <committee type="working">
106
+ <name>SENSR_WG - Sensors Working Group</name>
107
+ <chair>Harry Davis</chair>
108
+ </committee>
109
+ <committee type="society">
110
+ <name>IEEE Aerospace and Electronic Systems Society</name>
111
+ </committee>
112
+ </ext>
113
+ </bibdata>"
114
+ ----
115
+
116
+ === Get document by reference
117
+ ----
118
+ > RelatonIeee::IeeeBibliography.get("IEEE 528-2019")
119
+ [relaton-ieee] ("IEEE 528-2019") fetching...
120
+ [relaton-ieee] ("IEEE 528-2019") found 528-2019
121
+ => #<RelatonIeee::IeeeBibliographicItem:0x007fceb52a6e40
122
+ ...
123
+
124
+ > RelatonIeee::IeeeBibliography.get("IEEE 528", "2019")
125
+ [relaton-ieee] ("IEEE 528") fetching...
126
+ [relaton-ieee] ("IEEE 528") found 528-2019
127
+ => #<RelatonIeee::IeeeBibliographicItem:0x007fceb54af7f0
128
+ ...
129
+
130
+ > RelatonIeee::IeeeBibliography.get("IEEE 528")
131
+ [relaton-ieee] ("IEEE 528") fetching...
132
+ [relaton-ieee] ("IEEE 528") found 528-2019
133
+ => #<RelatonIeee::IeeeBibliographicItem:0x007fceb512c510
134
+ ...
135
+ ----
136
+
137
+ === Create bibliographic item from XML
138
+ ----
139
+ > RelatonIeee::XMLParser.from_xml File.read "spec/fixtures/ieee_528_2019.xml"
140
+ => #<RelatonIeee::IeeeBibliographicItem:0x007fceb550c978
141
+ ...
142
+ ----
143
+
144
+ === Create bibliographic item from YAML
145
+ ----
146
+ > hash = YAML.load_file 'spec/fixtures/ieee_528_2019.yaml'
147
+ => {"id"=>"528-2019", "title"=>{
148
+ ...
149
+
150
+ > bib_hash = RelatonIeee::HashConverter.hash_to_bib hash
151
+ => {:id=>"528-2019", :title=>[{
152
+ ...
153
+
154
+ > RelatonIeee::IeeeBibliographicItem.new bib_hash
155
+ => #<RelatonIeee::IeeeBibliographicItem:0x007fce940b3eb0
156
+ ...
157
+ ----
158
+
159
+ == Development
160
+
161
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
162
+
163
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
164
+
165
+ == Contributing
166
+
167
+ Bug reports and pull requests are welcome on GitHub at https://github.com/relaton/relaton_ieee.
168
+
169
+
170
+ == License
171
+
172
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -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 "relaton_ieee"
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,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ 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,986 @@
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
+ <include href="biblio.rng"/>
4
+ <start>
5
+ <ref name="document"/>
6
+ </start>
7
+ <define name="document">
8
+ <element name="document">
9
+ <optional>
10
+ <attribute name="identifier"/>
11
+ </optional>
12
+ <ref name="bibdata"/>
13
+ <ref name="sections"/>
14
+ <zeroOrMore>
15
+ <ref name="references"/>
16
+ </zeroOrMore>
17
+ </element>
18
+ </define>
19
+ <define name="bibdata">
20
+ <element name="bibdata">
21
+ <ref name="BibData"/>
22
+ </element>
23
+ </define>
24
+ <define name="sections">
25
+ <element name="sections">
26
+ <oneOrMore>
27
+ <ref name="section"/>
28
+ </oneOrMore>
29
+ </element>
30
+ </define>
31
+ <define name="section">
32
+ <element name="section">
33
+ <ref name="Basic-Section"/>
34
+ <zeroOrMore>
35
+ <ref name="section"/>
36
+ </zeroOrMore>
37
+ </element>
38
+ </define>
39
+ <define name="Basic-Section">
40
+ <optional>
41
+ <attribute name="id">
42
+ <data type="ID"/>
43
+ </attribute>
44
+ </optional>
45
+ <optional>
46
+ <ref name="section-title"/>
47
+ </optional>
48
+ <optional>
49
+ <ref name="BasicBlock"/>
50
+ </optional>
51
+ <zeroOrMore>
52
+ <ref name="note"/>
53
+ </zeroOrMore>
54
+ </define>
55
+ <define name="references">
56
+ <element name="references">
57
+ <optional>
58
+ <attribute name="id">
59
+ <data type="ID"/>
60
+ </attribute>
61
+ </optional>
62
+ <optional>
63
+ <ref name="section-title"/>
64
+ </optional>
65
+ <zeroOrMore>
66
+ <ref name="BasicBlock"/>
67
+ </zeroOrMore>
68
+ <zeroOrMore>
69
+ <ref name="bibitem"/>
70
+ </zeroOrMore>
71
+ </element>
72
+ </define>
73
+ <define name="section-title">
74
+ <element name="title">
75
+ <zeroOrMore>
76
+ <ref name="TextElement"/>
77
+ </zeroOrMore>
78
+ </element>
79
+ </define>
80
+ <define name="BasicBlock">
81
+ <choice>
82
+ <ref name="paragraph-with-footnote"/>
83
+ <ref name="table"/>
84
+ <ref name="formula"/>
85
+ <ref name="admonition"/>
86
+ <ref name="ol"/>
87
+ <ref name="ul"/>
88
+ <ref name="dl"/>
89
+ <ref name="figure"/>
90
+ <ref name="quote"/>
91
+ <ref name="sourcecode"/>
92
+ <ref name="example"/>
93
+ <ref name="review"/>
94
+ <ref name="pre"/>
95
+ </choice>
96
+ </define>
97
+ <define name="paragraph">
98
+ <element name="p">
99
+ <ref name="ParagraphType"/>
100
+ </element>
101
+ </define>
102
+ <define name="Alignments">
103
+ <choice>
104
+ <value>left</value>
105
+ <value>right</value>
106
+ <value>center</value>
107
+ <value>justified</value>
108
+ </choice>
109
+ </define>
110
+ <define name="ParagraphType">
111
+ <attribute name="id">
112
+ <data type="ID"/>
113
+ </attribute>
114
+ <optional>
115
+ <attribute name="align">
116
+ <ref name="Alignments"/>
117
+ </attribute>
118
+ </optional>
119
+ <zeroOrMore>
120
+ <ref name="TextElement"/>
121
+ </zeroOrMore>
122
+ <zeroOrMore>
123
+ <ref name="note"/>
124
+ </zeroOrMore>
125
+ </define>
126
+ <define name="paragraph-with-footnote">
127
+ <element name="p">
128
+ <attribute name="id">
129
+ <data type="ID"/>
130
+ </attribute>
131
+ <optional>
132
+ <attribute name="align">
133
+ <ref name="Alignments"/>
134
+ </attribute>
135
+ </optional>
136
+ <zeroOrMore>
137
+ <choice>
138
+ <ref name="TextElement"/>
139
+ <ref name="fn"/>
140
+ </choice>
141
+ </zeroOrMore>
142
+ <zeroOrMore>
143
+ <ref name="note"/>
144
+ </zeroOrMore>
145
+ </element>
146
+ </define>
147
+ <define name="note">
148
+ <element name="note">
149
+ <attribute name="id">
150
+ <data type="ID"/>
151
+ </attribute>
152
+ <oneOrMore>
153
+ <ref name="paragraph"/>
154
+ </oneOrMore>
155
+ </element>
156
+ </define>
157
+ <define name="review">
158
+ <element name="review">
159
+ <attribute name="id">
160
+ <data type="ID"/>
161
+ </attribute>
162
+ <attribute name="reviewer"/>
163
+ <optional>
164
+ <attribute name="date">
165
+ <data type="dateTime"/>
166
+ </attribute>
167
+ </optional>
168
+ <attribute name="from">
169
+ <data type="IDREF"/>
170
+ </attribute>
171
+ <optional>
172
+ <attribute name="to">
173
+ <data type="IDREF"/>
174
+ </attribute>
175
+ </optional>
176
+ <oneOrMore>
177
+ <ref name="paragraph"/>
178
+ </oneOrMore>
179
+ </element>
180
+ </define>
181
+ <define name="formula">
182
+ <element name="formula">
183
+ <attribute name="id">
184
+ <data type="ID"/>
185
+ </attribute>
186
+ <optional>
187
+ <attribute name="unnumbered">
188
+ <data type="boolean"/>
189
+ </attribute>
190
+ </optional>
191
+ <ref name="stem"/>
192
+ <optional>
193
+ <ref name="dl"/>
194
+ </optional>
195
+ <zeroOrMore>
196
+ <ref name="note"/>
197
+ </zeroOrMore>
198
+ </element>
199
+ </define>
200
+ <define name="quote">
201
+ <element name="quote">
202
+ <attribute name="id">
203
+ <data type="ID"/>
204
+ </attribute>
205
+ <optional>
206
+ <attribute name="alignment">
207
+ <ref name="Alignments"/>
208
+ </attribute>
209
+ </optional>
210
+ <optional>
211
+ <ref name="quote-source"/>
212
+ </optional>
213
+ <optional>
214
+ <ref name="quote-author"/>
215
+ </optional>
216
+ <oneOrMore>
217
+ <ref name="paragraph-with-footnote"/>
218
+ </oneOrMore>
219
+ <zeroOrMore>
220
+ <ref name="note"/>
221
+ </zeroOrMore>
222
+ </element>
223
+ </define>
224
+ <define name="quote-source">
225
+ <element name="source">
226
+ <ref name="erefType"/>
227
+ </element>
228
+ </define>
229
+ <define name="quote-author">
230
+ <element name="author">
231
+ <text/>
232
+ </element>
233
+ </define>
234
+ <define name="sourcecode">
235
+ <element name="sourcecode">
236
+ <attribute name="id">
237
+ <data type="ID"/>
238
+ </attribute>
239
+ <optional>
240
+ <attribute name="unnumbered">
241
+ <data type="boolean"/>
242
+ </attribute>
243
+ </optional>
244
+ <optional>
245
+ <attribute name="lang"/>
246
+ </optional>
247
+ <optional>
248
+ <ref name="tname"/>
249
+ </optional>
250
+ <oneOrMore>
251
+ <choice>
252
+ <text/>
253
+ <ref name="callout"/>
254
+ </choice>
255
+ </oneOrMore>
256
+ <zeroOrMore>
257
+ <ref name="annotation"/>
258
+ </zeroOrMore>
259
+ <zeroOrMore>
260
+ <ref name="note"/>
261
+ </zeroOrMore>
262
+ </element>
263
+ </define>
264
+ <define name="pre">
265
+ <element name="pre">
266
+ <attribute name="id">
267
+ <data type="ID"/>
268
+ </attribute>
269
+ <optional>
270
+ <ref name="tname"/>
271
+ </optional>
272
+ <text/>
273
+ <zeroOrMore>
274
+ <ref name="note"/>
275
+ </zeroOrMore>
276
+ </element>
277
+ </define>
278
+ <define name="table">
279
+ <element name="table">
280
+ <attribute name="id">
281
+ <data type="ID"/>
282
+ </attribute>
283
+ <optional>
284
+ <attribute name="unnumbered">
285
+ <data type="boolean"/>
286
+ </attribute>
287
+ </optional>
288
+ <optional>
289
+ <attribute name="alt"/>
290
+ </optional>
291
+ <optional>
292
+ <attribute name="uri">
293
+ <data type="anyURI"/>
294
+ </attribute>
295
+ </optional>
296
+ <optional>
297
+ <ref name="tname"/>
298
+ </optional>
299
+ <optional>
300
+ <ref name="thead"/>
301
+ </optional>
302
+ <ref name="tbody"/>
303
+ <optional>
304
+ <ref name="tfoot"/>
305
+ </optional>
306
+ <zeroOrMore>
307
+ <ref name="table-note"/>
308
+ </zeroOrMore>
309
+ <optional>
310
+ <ref name="dl"/>
311
+ </optional>
312
+ </element>
313
+ </define>
314
+ <define name="tname">
315
+ <element name="name">
316
+ <text/>
317
+ </element>
318
+ </define>
319
+ <define name="tclass">
320
+ <element name="name">
321
+ <text/>
322
+ </element>
323
+ </define>
324
+ <define name="thead">
325
+ <element name="thead">
326
+ <ref name="tr"/>
327
+ </element>
328
+ </define>
329
+ <define name="tfoot">
330
+ <element name="tfoot">
331
+ <ref name="tr"/>
332
+ </element>
333
+ </define>
334
+ <define name="tbody">
335
+ <element name="tbody">
336
+ <oneOrMore>
337
+ <ref name="tr"/>
338
+ </oneOrMore>
339
+ </element>
340
+ </define>
341
+ <define name="table-note">
342
+ <element name="note">
343
+ <ref name="paragraph"/>
344
+ </element>
345
+ </define>
346
+ <define name="tr">
347
+ <element name="tr">
348
+ <oneOrMore>
349
+ <choice>
350
+ <ref name="td"/>
351
+ <ref name="th"/>
352
+ </choice>
353
+ </oneOrMore>
354
+ </element>
355
+ </define>
356
+ <define name="td">
357
+ <element name="td">
358
+ <optional>
359
+ <attribute name="colspan"/>
360
+ </optional>
361
+ <optional>
362
+ <attribute name="rowspan"/>
363
+ </optional>
364
+ <optional>
365
+ <attribute name="align">
366
+ <choice>
367
+ <value>left</value>
368
+ <value>right</value>
369
+ <value>center</value>
370
+ </choice>
371
+ </attribute>
372
+ </optional>
373
+ <choice>
374
+ <zeroOrMore>
375
+ <ref name="TextElement"/>
376
+ </zeroOrMore>
377
+ <oneOrMore>
378
+ <ref name="paragraph-with-footnote"/>
379
+ </oneOrMore>
380
+ </choice>
381
+ </element>
382
+ </define>
383
+ <define name="th">
384
+ <element name="th">
385
+ <optional>
386
+ <attribute name="colspan"/>
387
+ </optional>
388
+ <optional>
389
+ <attribute name="rowspan"/>
390
+ </optional>
391
+ <optional>
392
+ <attribute name="align">
393
+ <choice>
394
+ <value>left</value>
395
+ <value>right</value>
396
+ <value>center</value>
397
+ </choice>
398
+ </attribute>
399
+ </optional>
400
+ <choice>
401
+ <zeroOrMore>
402
+ <ref name="TextElement"/>
403
+ </zeroOrMore>
404
+ <oneOrMore>
405
+ <ref name="paragraph-with-footnote"/>
406
+ </oneOrMore>
407
+ </choice>
408
+ </element>
409
+ </define>
410
+ <define name="example">
411
+ <element name="example">
412
+ <attribute name="id">
413
+ <data type="ID"/>
414
+ </attribute>
415
+ <optional>
416
+ <attribute name="unnumbered">
417
+ <data type="boolean"/>
418
+ </attribute>
419
+ </optional>
420
+ <oneOrMore>
421
+ <choice>
422
+ <ref name="formula"/>
423
+ <ref name="ul"/>
424
+ <ref name="ol"/>
425
+ <ref name="dl"/>
426
+ <ref name="quote"/>
427
+ <ref name="sourcecode"/>
428
+ <ref name="paragraph-with-footnote"/>
429
+ </choice>
430
+ </oneOrMore>
431
+ <zeroOrMore>
432
+ <ref name="note"/>
433
+ </zeroOrMore>
434
+ </element>
435
+ </define>
436
+ <define name="admonition">
437
+ <element name="admonition">
438
+ <attribute name="type">
439
+ <ref name="AdmonitionType"/>
440
+ </attribute>
441
+ <optional>
442
+ <attribute name="class"/>
443
+ </optional>
444
+ <attribute name="id">
445
+ <data type="ID"/>
446
+ </attribute>
447
+ <optional>
448
+ <attribute name="uri">
449
+ <data type="anyURI"/>
450
+ </attribute>
451
+ </optional>
452
+ <optional>
453
+ <ref name="tname"/>
454
+ </optional>
455
+ <zeroOrMore>
456
+ <ref name="paragraph-with-footnote"/>
457
+ </zeroOrMore>
458
+ <zeroOrMore>
459
+ <ref name="note"/>
460
+ </zeroOrMore>
461
+ </element>
462
+ </define>
463
+ <define name="AdmonitionType">
464
+ <choice>
465
+ <value>warning</value>
466
+ <value>note</value>
467
+ <value>tip</value>
468
+ <value>important</value>
469
+ <value>caution</value>
470
+ <value>statement</value>
471
+ </choice>
472
+ </define>
473
+ <define name="figure">
474
+ <element name="figure">
475
+ <attribute name="id">
476
+ <data type="ID"/>
477
+ </attribute>
478
+ <optional>
479
+ <attribute name="unnumbered">
480
+ <data type="boolean"/>
481
+ </attribute>
482
+ </optional>
483
+ <optional>
484
+ <ref name="source"/>
485
+ </optional>
486
+ <optional>
487
+ <ref name="tname"/>
488
+ </optional>
489
+ <optional>
490
+ <ref name="tclass"/>
491
+ </optional>
492
+ <choice>
493
+ <ref name="image"/>
494
+ <ref name="pre"/>
495
+ <zeroOrMore>
496
+ <ref name="figure"/>
497
+ </zeroOrMore>
498
+ </choice>
499
+ <zeroOrMore>
500
+ <ref name="fn"/>
501
+ </zeroOrMore>
502
+ <optional>
503
+ <ref name="dl"/>
504
+ </optional>
505
+ <zeroOrMore>
506
+ <ref name="note"/>
507
+ </zeroOrMore>
508
+ </element>
509
+ </define>
510
+ <define name="TextElement">
511
+ <choice>
512
+ <text/>
513
+ <ref name="em"/>
514
+ <ref name="eref"/>
515
+ <ref name="strong"/>
516
+ <ref name="stem"/>
517
+ <ref name="sub"/>
518
+ <ref name="sup"/>
519
+ <ref name="tt"/>
520
+ <ref name="underline"/>
521
+ <ref name="keyword"/>
522
+ <ref name="ruby"/>
523
+ <ref name="strike"/>
524
+ <ref name="smallcap"/>
525
+ <ref name="xref"/>
526
+ <ref name="br"/>
527
+ <ref name="hyperlink"/>
528
+ <ref name="hr"/>
529
+ <ref name="pagebreak"/>
530
+ <ref name="bookmark"/>
531
+ <ref name="image"/>
532
+ </choice>
533
+ </define>
534
+ <define name="PureTextElement">
535
+ <choice>
536
+ <text/>
537
+ <ref name="em"/>
538
+ <ref name="strong"/>
539
+ <ref name="sub"/>
540
+ <ref name="sup"/>
541
+ <ref name="tt"/>
542
+ <ref name="underline"/>
543
+ <ref name="strike"/>
544
+ <ref name="smallcap"/>
545
+ <ref name="br"/>
546
+ </choice>
547
+ </define>
548
+ <define name="source">
549
+ <element name="source">
550
+ <ref name="TypedUri"/>
551
+ </element>
552
+ </define>
553
+ <define name="em">
554
+ <element name="em">
555
+ <zeroOrMore>
556
+ <ref name="PureTextElement"/>
557
+ </zeroOrMore>
558
+ </element>
559
+ </define>
560
+ <define name="strong">
561
+ <element name="strong">
562
+ <zeroOrMore>
563
+ <ref name="PureTextElement"/>
564
+ </zeroOrMore>
565
+ </element>
566
+ </define>
567
+ <define name="tt">
568
+ <element name="tt">
569
+ <zeroOrMore>
570
+ <ref name="PureTextElement"/>
571
+ </zeroOrMore>
572
+ </element>
573
+ </define>
574
+ <define name="keyword">
575
+ <element name="keyword">
576
+ <zeroOrMore>
577
+ <ref name="PureTextElement"/>
578
+ </zeroOrMore>
579
+ </element>
580
+ </define>
581
+ <define name="sub">
582
+ <element name="sub">
583
+ <zeroOrMore>
584
+ <ref name="PureTextElement"/>
585
+ </zeroOrMore>
586
+ </element>
587
+ </define>
588
+ <define name="sup">
589
+ <element name="sup">
590
+ <zeroOrMore>
591
+ <ref name="PureTextElement"/>
592
+ </zeroOrMore>
593
+ </element>
594
+ </define>
595
+ <define name="strike">
596
+ <element name="strike">
597
+ <zeroOrMore>
598
+ <ref name="PureTextElement"/>
599
+ </zeroOrMore>
600
+ </element>
601
+ </define>
602
+ <define name="underline">
603
+ <element name="underline">
604
+ <zeroOrMore>
605
+ <ref name="PureTextElement"/>
606
+ </zeroOrMore>
607
+ </element>
608
+ </define>
609
+ <define name="smallcap">
610
+ <element name="smallcap">
611
+ <zeroOrMore>
612
+ <ref name="PureTextElement"/>
613
+ </zeroOrMore>
614
+ </element>
615
+ </define>
616
+ <define name="ruby">
617
+ <element name="ruby">
618
+ <zeroOrMore>
619
+ <choice>
620
+ <ref name="PureTextElement"/>
621
+ <ref name="rp"/>
622
+ <ref name="rt"/>
623
+ </choice>
624
+ </zeroOrMore>
625
+ </element>
626
+ </define>
627
+ <define name="rp">
628
+ <element name="rp">
629
+ <zeroOrMore>
630
+ <ref name="PureTextElement"/>
631
+ </zeroOrMore>
632
+ </element>
633
+ </define>
634
+ <define name="rt">
635
+ <element name="rt">
636
+ <zeroOrMore>
637
+ <ref name="PureTextElement"/>
638
+ </zeroOrMore>
639
+ </element>
640
+ </define>
641
+ <define name="br">
642
+ <element name="br">
643
+ <empty/>
644
+ </element>
645
+ </define>
646
+ <define name="hr">
647
+ <element name="hr">
648
+ <empty/>
649
+ </element>
650
+ </define>
651
+ <define name="pagebreak">
652
+ <element name="pagebreak">
653
+ <empty/>
654
+ </element>
655
+ </define>
656
+ <!-- bare ID element, used for referencing arbitrary spans of text -->
657
+ <define name="bookmark">
658
+ <element name="bookmark">
659
+ <attribute name="id">
660
+ <data type="ID"/>
661
+ </attribute>
662
+ <empty/>
663
+ </element>
664
+ </define>
665
+ <define name="ReferenceFormat">
666
+ <choice>
667
+ <value>external</value>
668
+ <value>inline</value>
669
+ <value>footnote</value>
670
+ <value>callout</value>
671
+ </choice>
672
+ </define>
673
+ <define name="eref">
674
+ <element name="eref">
675
+ <ref name="erefType"/>
676
+ </element>
677
+ </define>
678
+ <define name="erefType">
679
+ <optional>
680
+ <attribute name="normative">
681
+ <data type="boolean"/>
682
+ </attribute>
683
+ </optional>
684
+ <attribute name="citeas"/>
685
+ <attribute name="type">
686
+ <ref name="ReferenceFormat"/>
687
+ </attribute>
688
+ <optional>
689
+ <attribute name="alt"/>
690
+ </optional>
691
+ <ref name="CitationType"/>
692
+ <text/>
693
+ </define>
694
+ <define name="hyperlink">
695
+ <element name="link">
696
+ <attribute name="target">
697
+ <data type="anyURI"/>
698
+ </attribute>
699
+ <attribute name="type">
700
+ <ref name="ReferenceFormat"/>
701
+ </attribute>
702
+ <optional>
703
+ <attribute name="alt"/>
704
+ </optional>
705
+ <text/>
706
+ </element>
707
+ </define>
708
+ <define name="xref">
709
+ <element name="xref">
710
+ <attribute name="target">
711
+ <data type="IDREF"/>
712
+ </attribute>
713
+ <attribute name="type">
714
+ <ref name="ReferenceFormat"/>
715
+ </attribute>
716
+ <optional>
717
+ <attribute name="alt"/>
718
+ </optional>
719
+ <text/>
720
+ </element>
721
+ </define>
722
+ <define name="fn">
723
+ <element name="fn">
724
+ <attribute name="reference"/>
725
+ <oneOrMore>
726
+ <ref name="paragraph"/>
727
+ </oneOrMore>
728
+ </element>
729
+ </define>
730
+ <!--
731
+ This is xref with fixed @type="footnote", and @target built in as paragraph+
732
+ @reference replaces ReferenceElement/text
733
+ so <fn reference="2"><p>This is a footnote</p></fn>
734
+ corresponds to
735
+ <eref type="footnote" target="fn2">2</xref> <p id="fn2">This is a footnote</p>
736
+ -->
737
+ <define name="callout">
738
+ <element name="callout">
739
+ <attribute name="target">
740
+ <data type="IDREF"/>
741
+ </attribute>
742
+ <text/>
743
+ </element>
744
+ </define>
745
+ <!--
746
+ This is xref with fixed @type="callout"; the target by convention is in an annotation in the same source code snippet
747
+ so <callout target="xyz">1</callout>
748
+ corresponds to <xref type="callout" target="xyz">1</xref>
749
+ -->
750
+ <define name="image">
751
+ <element name="image">
752
+ <attribute name="id">
753
+ <data type="ID"/>
754
+ </attribute>
755
+ <attribute name="src">
756
+ <data type="anyURI"/>
757
+ </attribute>
758
+ <attribute name="mimetype"/>
759
+ <optional>
760
+ <attribute name="filename"/>
761
+ </optional>
762
+ <optional>
763
+ <attribute name="width">
764
+ <choice>
765
+ <data type="int"/>
766
+ <value>auto</value>
767
+ </choice>
768
+ </attribute>
769
+ </optional>
770
+ <optional>
771
+ <attribute name="height">
772
+ <choice>
773
+ <data type="int"/>
774
+ <value>auto</value>
775
+ </choice>
776
+ </attribute>
777
+ </optional>
778
+ <optional>
779
+ <attribute name="alt"/>
780
+ </optional>
781
+ <optional>
782
+ <attribute name="longdesc">
783
+ <data type="anyURI"/>
784
+ </attribute>
785
+ </optional>
786
+ </element>
787
+ </define>
788
+ <define name="video">
789
+ <element name="image">
790
+ <attribute name="id">
791
+ <data type="ID"/>
792
+ </attribute>
793
+ <attribute name="src">
794
+ <data type="anyURI"/>
795
+ </attribute>
796
+ <attribute name="mimetype"/>
797
+ <optional>
798
+ <attribute name="filename"/>
799
+ </optional>
800
+ <optional>
801
+ <attribute name="width">
802
+ <choice>
803
+ <data type="int"/>
804
+ <value>auto</value>
805
+ </choice>
806
+ </attribute>
807
+ </optional>
808
+ <optional>
809
+ <attribute name="height">
810
+ <choice>
811
+ <data type="int"/>
812
+ <value>auto</value>
813
+ </choice>
814
+ </attribute>
815
+ </optional>
816
+ <optional>
817
+ <attribute name="alt"/>
818
+ </optional>
819
+ <optional>
820
+ <attribute name="longdesc">
821
+ <data type="anyURI"/>
822
+ </attribute>
823
+ </optional>
824
+ <zeroOrMore>
825
+ <ref name="altsource"/>
826
+ </zeroOrMore>
827
+ </element>
828
+ </define>
829
+ <define name="audio">
830
+ <element name="image">
831
+ <attribute name="id">
832
+ <data type="ID"/>
833
+ </attribute>
834
+ <attribute name="src">
835
+ <data type="anyURI"/>
836
+ </attribute>
837
+ <attribute name="mimetype"/>
838
+ <optional>
839
+ <attribute name="filename"/>
840
+ </optional>
841
+ <optional>
842
+ <attribute name="alt"/>
843
+ </optional>
844
+ <optional>
845
+ <attribute name="longdesc">
846
+ <data type="anyURI"/>
847
+ </attribute>
848
+ </optional>
849
+ <zeroOrMore>
850
+ <ref name="altsource"/>
851
+ </zeroOrMore>
852
+ </element>
853
+ </define>
854
+ <define name="altsource">
855
+ <element name="altsource">
856
+ <attribute name="src">
857
+ <data type="anyURI"/>
858
+ </attribute>
859
+ <attribute name="mimetype"/>
860
+ <optional>
861
+ <attribute name="filename"/>
862
+ </optional>
863
+ </element>
864
+ </define>
865
+ <define name="stem">
866
+ <element name="stem">
867
+ <attribute name="type">
868
+ <choice>
869
+ <value>MathML</value>
870
+ <value>AsciiMath</value>
871
+ </choice>
872
+ </attribute>
873
+ <oneOrMore>
874
+ <choice>
875
+ <text/>
876
+ <ref name="AnyElement"/>
877
+ </choice>
878
+ </oneOrMore>
879
+ </element>
880
+ </define>
881
+ <define name="annotation">
882
+ <element name="annotation">
883
+ <attribute name="id">
884
+ <data type="ID"/>
885
+ </attribute>
886
+ <ref name="paragraph"/>
887
+ </element>
888
+ </define>
889
+ <define name="ul">
890
+ <element name="ul">
891
+ <attribute name="id">
892
+ <data type="ID"/>
893
+ </attribute>
894
+ <oneOrMore>
895
+ <ref name="li"/>
896
+ </oneOrMore>
897
+ <zeroOrMore>
898
+ <ref name="note"/>
899
+ </zeroOrMore>
900
+ </element>
901
+ </define>
902
+ <define name="li">
903
+ <element name="li">
904
+ <optional>
905
+ <attribute name="id">
906
+ <data type="ID"/>
907
+ </attribute>
908
+ </optional>
909
+ <oneOrMore>
910
+ <ref name="paragraph-with-footnote"/>
911
+ </oneOrMore>
912
+ </element>
913
+ </define>
914
+ <define name="ol">
915
+ <element name="ol">
916
+ <attribute name="id">
917
+ <data type="ID"/>
918
+ </attribute>
919
+ <attribute name="type">
920
+ <choice>
921
+ <value>roman</value>
922
+ <value>alphabet</value>
923
+ <value>arabic</value>
924
+ <value>roman_upper</value>
925
+ <value>alphabet_upper</value>
926
+ </choice>
927
+ </attribute>
928
+ <oneOrMore>
929
+ <ref name="li"/>
930
+ </oneOrMore>
931
+ <zeroOrMore>
932
+ <ref name="note"/>
933
+ </zeroOrMore>
934
+ </element>
935
+ </define>
936
+ <define name="dl">
937
+ <element name="dl">
938
+ <attribute name="id">
939
+ <data type="ID"/>
940
+ </attribute>
941
+ <oneOrMore>
942
+ <ref name="dt"/>
943
+ <ref name="dd"/>
944
+ </oneOrMore>
945
+ <zeroOrMore>
946
+ <ref name="note"/>
947
+ </zeroOrMore>
948
+ </element>
949
+ </define>
950
+ <define name="dt">
951
+ <element name="dt">
952
+ <zeroOrMore>
953
+ <ref name="TextElement"/>
954
+ </zeroOrMore>
955
+ </element>
956
+ </define>
957
+ <define name="dd">
958
+ <element name="dd">
959
+ <zeroOrMore>
960
+ <ref name="paragraph-with-footnote"/>
961
+ </zeroOrMore>
962
+ </element>
963
+ </define>
964
+ <define name="ext">
965
+ <element name="ext">
966
+ <ref name="BibDataExtensionType"/>
967
+ </element>
968
+ </define>
969
+ <define name="BibDataExtensionType">
970
+ <ref name="doctype"/>
971
+ </define>
972
+ <define name="doctype">
973
+ <element name="doctype">
974
+ <ref name="DocumentType"/>
975
+ </element>
976
+ </define>
977
+ <define name="DocumentType">
978
+ <value>document</value>
979
+ </define>
980
+ <define name="BibData">
981
+ <ref name="BibliographicItem"/>
982
+ <optional>
983
+ <ref name="ext"/>
984
+ </optional>
985
+ </define>
986
+ </grammar>