metanorma-itu 1.2.14 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -12
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +7 -1
  5. data/lib/asciidoctor/itu/biblio.rng +4 -6
  6. data/lib/asciidoctor/itu/cleanup.rb +9 -6
  7. data/lib/asciidoctor/itu/converter.rb +31 -27
  8. data/lib/asciidoctor/itu/front.rb +35 -23
  9. data/lib/asciidoctor/itu/isodoc.rng +327 -2
  10. data/lib/asciidoctor/itu/itu.rng +0 -30
  11. data/lib/isodoc/itu/base_convert.rb +25 -37
  12. data/lib/isodoc/itu/html/_coverpage.css +7 -0
  13. data/lib/isodoc/itu/html/header.html +8 -8
  14. data/lib/isodoc/itu/html/htmlstyle.css +14 -7
  15. data/lib/isodoc/itu/html/htmlstyle.scss +0 -9
  16. data/lib/isodoc/itu/html/itu.css +0 -7
  17. data/lib/isodoc/itu/html/itu.scss +0 -7
  18. data/lib/isodoc/itu/html_convert.rb +0 -1
  19. data/lib/isodoc/itu/i18n-ar.yaml +87 -0
  20. data/lib/isodoc/itu/i18n-de.yaml +88 -0
  21. data/lib/isodoc/itu/i18n-en.yaml +1 -0
  22. data/lib/isodoc/itu/i18n-es.yaml +88 -0
  23. data/lib/isodoc/itu/i18n-fr.yaml +88 -0
  24. data/lib/isodoc/itu/i18n-ru.yaml +88 -0
  25. data/lib/isodoc/itu/i18n-zh-Hans.yaml +81 -0
  26. data/lib/isodoc/itu/i18n.rb +14 -4
  27. data/lib/isodoc/itu/itu.implementers-guide.xsl +962 -392
  28. data/lib/isodoc/itu/itu.in-force.xsl +962 -392
  29. data/lib/isodoc/itu/itu.recommendation-annex.xsl +962 -392
  30. data/lib/isodoc/itu/itu.recommendation-supplement.xsl +962 -392
  31. data/lib/isodoc/itu/itu.recommendation.xsl +962 -392
  32. data/lib/isodoc/itu/itu.resolution.xsl +962 -392
  33. data/lib/isodoc/itu/itu.technical-paper.xsl +962 -392
  34. data/lib/isodoc/itu/itu.technical-report.xsl +962 -392
  35. data/lib/isodoc/itu/metadata.rb +3 -3
  36. data/lib/isodoc/itu/presentation_xml_convert.rb +1 -1
  37. data/lib/isodoc/itu/xref.rb +1 -2
  38. data/lib/metanorma/itu/version.rb +1 -1
  39. data/metanorma-itu.gemspec +6 -6
  40. metadata +38 -33
  41. data/lib/asciidoctor/itu/macros.rb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb90a7538cd02f6e27fb05a6315dcb7d4e346c366207a9a592e7c3cd0452ccea
4
- data.tar.gz: 9ebf7d79f72c347f6d8e552fb052c9d6136d8e318703bff1b480d0b4475a9d4b
3
+ metadata.gz: be8a108bcea630f0b812a6c99fd6856768f7bb31441f2dcfe95f8ea69580e7e0
4
+ data.tar.gz: ef418557eb4ac1de9ee734564f211f553dae4846702da54cf529e2e7f6e31c67
5
5
  SHA512:
6
- metadata.gz: dd679ec6c5e2cd43a01b1ade453faaa224159e10f2e14e8bb7c94c4f22d86eeb7b8d37350d48c8fb8c5e5a4076ac734ee8725b031c8d82f89c60e7a9f8bd8a83
7
- data.tar.gz: f7075597cb2b0bca44adfce25e6982781beb2d04d1b91d206e9807b218d1a6f106df7ce21dde2002bcb5e2265c594630b22a16b235c428431303231513900cc3
6
+ metadata.gz: 0d463ab638c7ceea4a7931ee659533ec5bd56dbdf9081b2043eb1ab2d697b95676dd0f61a812f23e024b60461d673de4e059dedf9a45ca104adb469077f35ed4
7
+ data.tar.gz: a03396267cf45da78de575a0fa12b7b94ecea9c81f45693bd5bb9e523e7dfb4f2e8ab0ebf9dbdcd63035412e1d7d05fd49f1be00127a1a80141b3b6f3c4c2a6b
@@ -30,7 +30,9 @@ jobs:
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
33
- - uses: actions/checkout@master
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
34
36
 
35
37
  - uses: ruby/setup-ruby@v1
36
38
  with:
@@ -38,14 +40,3 @@ jobs:
38
40
  bundler-cache: true
39
41
 
40
42
  - run: bundle exec rake
41
-
42
- tests-passed:
43
- needs: rake
44
- runs-on: ubuntu-latest
45
- steps:
46
- - uses: peter-evans/repository-dispatch@v1
47
- with:
48
- token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
49
- repository: ${{ github.repository }}
50
- event-type: notify
51
- client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  .byebug_history
3
3
  .rspec_status
4
4
  coverage/
5
+
6
+ .rubocop-https--*
data/.rubocop.yml CHANGED
@@ -1,6 +1,12 @@
1
1
  # This project follows the Ribose OSS style guide.
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
-
5
4
  inherit_from:
6
5
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+
7
+ # local repo-specific modifications
8
+
9
+ AllCops:
10
+ DisplayCopNames: false
11
+ StyleGuideCopsOnly: false
12
+ TargetRubyVersion: 2.4
@@ -124,7 +124,7 @@
124
124
  <value>application/tei+xml</value>
125
125
  <value>text/x-asciidoc</value>
126
126
  <value>text/markdown</value>
127
- <value>application/x-isodoc+xml</value>
127
+ <value>application/x-metanorma+xml</value>
128
128
  <text/>
129
129
  </choice>
130
130
  </attribute>
@@ -452,6 +452,7 @@
452
452
  <attribute name="type">
453
453
  <choice>
454
454
  <value>isni</value>
455
+ <value>orcid</value>
455
456
  <value>uri</value>
456
457
  </choice>
457
458
  </attribute>
@@ -461,10 +462,7 @@
461
462
  <define name="org-identifier">
462
463
  <element name="identifier">
463
464
  <attribute name="type">
464
- <choice>
465
- <value>orcid</value>
466
- <value>uri</value>
467
- </choice>
465
+ <data type="string" datatypeLibrary=""/>
468
466
  </attribute>
469
467
  <text/>
470
468
  </element>
@@ -1106,7 +1104,7 @@
1106
1104
  <value>complementOf</value>
1107
1105
  <value>obsoletes</value>
1108
1106
  <value>obsoletedBy</value>
1109
- <value>cited</value>
1107
+ <value>cites</value>
1110
1108
  <value>isCitedIn</value>
1111
1109
  </choice>
1112
1110
  </define>
@@ -24,12 +24,12 @@ module Asciidoctor
24
24
  end
25
25
  end
26
26
 
27
- def insert_missing_sections(x)
28
- insert_scope(x)
29
- insert_norm_ref(x)
30
- insert_terms(x)
31
- insert_symbols(x)
32
- insert_conventions(x)
27
+ def insert_missing_sections(xml)
28
+ insert_scope(xml)
29
+ insert_norm_ref(xml)
30
+ insert_terms(xml)
31
+ insert_symbols(xml)
32
+ insert_conventions(xml)
33
33
  end
34
34
 
35
35
  def add_id
@@ -109,8 +109,10 @@ module Asciidoctor
109
109
 
110
110
  def smartquotes_cleanup(xmldoc)
111
111
  return super if @smartquotes
112
+
112
113
  xmldoc.traverse do |n|
113
114
  next unless n.text?
115
+
114
116
  n.replace(HTMLEntities.new.encode(
115
117
  n.text.gsub(/\u2019|\u2018|\u201a|\u201b/, "'").
116
118
  gsub(/\u201c|\u201d|\u201e|\u201f/, '"'), :basic))
@@ -175,6 +177,7 @@ module Asciidoctor
175
177
  return 4 if bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
176
178
  "@type = 'metanorma' or @type = 'ISSN' or @type = "\
177
179
  "'ISBN')]")
180
+
178
181
  5
179
182
  end
180
183
 
@@ -1,10 +1,9 @@
1
1
  require "asciidoctor"
2
2
  require "asciidoctor/standoc/converter"
3
3
  require "fileutils"
4
- require_relative "./front.rb"
5
- require_relative "./validate.rb"
6
- require_relative "./cleanup.rb"
7
- require_relative "./macros.rb"
4
+ require_relative "./front"
5
+ require_relative "./validate"
6
+ require_relative "./cleanup"
8
7
 
9
8
  module Asciidoctor
10
9
  module ITU
@@ -17,12 +16,7 @@ module Asciidoctor
17
16
 
18
17
  register_for "itu"
19
18
 
20
- Asciidoctor::Extensions.register do
21
- inline_macro AddMacro
22
- inline_macro DelMacro
23
- end
24
-
25
- def title_validate(root)
19
+ def title_validate(_root)
26
20
  nil
27
21
  end
28
22
 
@@ -54,14 +48,14 @@ module Asciidoctor
54
48
  end
55
49
 
56
50
  def outputs(node, ret)
57
- File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
58
- presentation_xml_converter(node).convert(@filename + ".xml")
59
- html_converter(node).convert(@filename + ".presentation.xml",
51
+ File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
52
+ presentation_xml_converter(node).convert("#{@filename}.xml")
53
+ html_converter(node).convert("#{@filename}.presentation.xml",
60
54
  nil, false, "#{@filename}.html")
61
- doc_converter(node).convert(@filename + ".presentation.xml",
55
+ doc_converter(node).convert("#{@filename}.presentation.xml",
62
56
  nil, false, "#{@filename}.doc")
63
57
  node.attr("no-pdf") or
64
- pdf_converter(node)&.convert(@filename + ".presentation.xml",
58
+ pdf_converter(node)&.convert("#{@filename}.presentation.xml",
65
59
  nil, false, "#{@filename}.pdf")
66
60
  end
67
61
 
@@ -71,8 +65,8 @@ module Asciidoctor
71
65
  File.join(File.dirname(__FILE__), "itu.rng"))
72
66
  end
73
67
 
74
- def style(n, t)
75
- return
68
+ def style(_node, _text)
69
+ nil
76
70
  end
77
71
 
78
72
  def sectiontype_streamline(ret)
@@ -90,15 +84,16 @@ module Asciidoctor
90
84
  def sectiontype(node, level = true)
91
85
  ret = super
92
86
  hdr = sectiontype_streamline(node&.attr("heading")&.downcase)
93
- return nil if ret == "terms and definitions" &&
87
+ return nil if ret == "terms and definitions" &&
94
88
  hdr != "terms and definitions" && node.level > 1
95
- return nil if ret == "symbols and abbreviated terms" &&
89
+ return nil if ret == "symbols and abbreviated terms" &&
96
90
  hdr != "symbols and abbreviated terms" && node.level > 1
91
+
97
92
  ret
98
93
  end
99
94
 
100
95
  def term_def_subclause_parse(attrs, xml, node)
101
- case clausetype = sectiontype1(node)
96
+ case sectiontype1(node)
102
97
  when "terms defined in this recommendation"
103
98
  term_def_parse(attrs.merge(type: "internal"), xml, node, false)
104
99
  when "terms defined elsewhere"
@@ -110,29 +105,38 @@ module Asciidoctor
110
105
 
111
106
  def metadata_keywords(node, xml)
112
107
  return unless node.attr("keywords")
113
- node.attr("keywords").split(/,[ ]*/).sort.each_with_index do |kw, i|
114
- xml.keyword (i == 0 ? kw.capitalize : kw)
108
+
109
+ node.attr("keywords").split(/, */).sort.each_with_index do |kw, i|
110
+ xml.keyword (i.zero? ? strict_capitalize(kw) : kw)
115
111
  end
116
112
  end
117
113
 
114
+ def strict_capitalize(str)
115
+ letters = str.split("")
116
+ letters.first.upcase!
117
+ letters.join
118
+ end
119
+
118
120
  def clause_parse(attrs, xml, node)
119
121
  node.option?("unnumbered") and attrs[:unnumbered] = true
120
- case clausetype = sectiontype1(node)
122
+ case sectiontype1(node)
121
123
  when "conventions" then attrs = attrs.merge(type: "conventions")
122
- when "history"
124
+ when "history"
123
125
  attrs[:preface] and attrs = attrs.merge(type: "history")
124
- when "source"
126
+ when "source"
125
127
  attrs[:preface] and attrs = attrs.merge(type: "source")
126
128
  end
127
129
  super
128
130
  end
129
131
 
130
132
  def html_extract_attributes(node)
131
- super.merge(hierarchical_assets: node.attr("hierarchical-object-numbering"))
133
+ super.merge(hierarchical_assets:
134
+ node.attr("hierarchical-object-numbering"))
132
135
  end
133
136
 
134
137
  def doc_extract_attributes(node)
135
- super.merge(hierarchical_assets: node.attr("hierarchical-object-numbering"))
138
+ super.merge(hierarchical_assets:
139
+ node.attr("hierarchical-object-numbering"))
136
140
  end
137
141
 
138
142
  def presentation_xml_converter(node)
@@ -6,21 +6,24 @@ module Asciidoctor
6
6
  module ITU
7
7
  class Converter < Standoc::Converter
8
8
  def metadata_status(node, xml)
9
+ stage = (node.attr("status") || node.attr("docstage") || "published")
10
+ stage = "draft" if node.attributes.has_key?("draft")
9
11
  xml.status do |s|
10
- s.stage (node.attributes.has_key?("draft") ? "draft" :
11
- (node.attr("status") || node.attr("docstage") || "published" ))
12
+ s.stage stage
12
13
  end
13
14
  end
14
15
 
16
+ def title_attr(type, lang = "en")
17
+ { language: lang, format: "text/plain", type: type }
18
+ end
19
+
15
20
  def title_english(node, xml)
16
- at = { language: "en", format: "text/plain", type: "main" }
17
21
  a = node.attr("title") || node.attr("title-en")
18
- xml.title **attr_code(at) do |t|
22
+ xml.title **attr_code(title_attr("main")) do |t|
19
23
  t << (Metanorma::Utils::asciidoc_sub(a) || node.title)
20
24
  end
21
25
  if a = node.attr("annextitle") || node.attr("annextitle-en")
22
- at[:type] = "annex"
23
- xml.title **attr_code(at) do |t|
26
+ xml.title **attr_code(title_attr("annex")) do |t|
24
27
  t << Metanorma::Utils::asciidoc_sub(a)
25
28
  end
26
29
  end
@@ -30,8 +33,9 @@ module Asciidoctor
30
33
  node.attributes.each do |k, v|
31
34
  next unless /^(annex)?title-(?<lang>.+)$/ =~ k
32
35
  next if lang == "en"
33
- type = /^annex/.match(k) ? "annex" : "main"
34
- xml.title **attr_code(language: lang, format: "text/plain", type: type) do |t|
36
+
37
+ type = /^annex/.match?(k) ? "annex" : "main"
38
+ xml.title **attr_code(title_attr(type, lang)) do |t|
35
39
  t << Metanorma::Utils::asciidoc_sub(v)
36
40
  end
37
41
  end
@@ -40,15 +44,14 @@ module Asciidoctor
40
44
  def title(node, xml)
41
45
  super
42
46
  %w(subtitle amendment-title corrigendum-title).each do |t|
43
- other_title_english(node, xml, t)
44
- other_title_otherlangs(node, xml, t)
47
+ other_title_english(node, xml, t)
48
+ other_title_otherlangs(node, xml, t)
45
49
  end
46
50
  end
47
51
 
48
52
  def other_title_english(node, xml, type)
49
- at = { language: "en", format: "text/plain", type: type.sub(/-title/, "") }
50
53
  a = node.attr(type) || node.attr("#{type}-en")
51
- xml.title **attr_code(at) do |t|
54
+ xml.title **attr_code(title_attr(type.sub(/-title/, ""))) do |t|
52
55
  t << Metanorma::Utils::asciidoc_sub(a)
53
56
  end
54
57
  end
@@ -57,8 +60,9 @@ module Asciidoctor
57
60
  node.attributes.each do |k, v|
58
61
  next unless m = /^#{type}-(?<lang>.+)$/.match(k)
59
62
  next if m[:lang] == "en"
60
- xml.title **attr_code(language: m[:lang], format: "text/plain",
61
- type: type.sub(/-title/, "")) do |t|
63
+
64
+ xml.title **attr_code(title_attr(type.sub(/-title/, ""),
65
+ m[:lang])) do |t|
62
66
  t << Metanorma::Utils::asciidoc_sub(v)
63
67
  end
64
68
  end
@@ -79,7 +83,7 @@ module Asciidoctor
79
83
 
80
84
  def metadata_committee1(node, xml, suffix)
81
85
  xml.editorialgroup do |a|
82
- a.bureau ( node.attr("bureau#{suffix}") || "T" )
86
+ a.bureau ( node.attr("bureau#{suffix}") || "T")
83
87
  if node.attr("group#{suffix}")
84
88
  a.group **attr_code(type: node.attr("grouptype#{suffix}")) do |g|
85
89
  metadata_committee2(node, g, suffix, "")
@@ -119,27 +123,30 @@ module Asciidoctor
119
123
 
120
124
  def provisional_id(node, xml)
121
125
  return unless node.attr("provisional-name")
122
- xml.docidentifier **{type: "ITU-provisional"} do |i|
126
+
127
+ xml.docidentifier **{ type: "ITU-provisional" } do |i|
123
128
  i << node.attr("provisional-name")
124
129
  end
125
130
  end
126
131
 
127
- ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S", "zh" => "C", "ru" => "R" }.freeze
132
+ ITULANG = { "en" => "E", "fr" => "F", "ar" => "A", "es" => "S",
133
+ "zh" => "C", "ru" => "R" }.freeze
128
134
 
129
135
  def itu_id1(node, lang)
130
136
  bureau = node.attr("bureau") || "T"
131
137
  id = doctype(node) == "service-publication" ?
132
138
  @i18n.annex_to_itu_ob_abbrev.sub(/%/, node.attr("docnumber")) :
133
- "ITU-#{bureau} #{node.attr("docnumber")}"
139
+ "ITU-#{bureau} #{node.attr('docnumber')}"
134
140
  id + (lang ? "-#{ITULANG[@lang]}" : "")
135
141
  end
136
142
 
137
143
  def itu_id(node, xml)
138
144
  return unless node.attr("docnumber")
139
- xml.docidentifier **{type: "ITU"} do |i|
145
+
146
+ xml.docidentifier **{ type: "ITU" } do |i|
140
147
  i << itu_id1(node, false)
141
148
  end
142
- xml.docidentifier **{type: "ITU-lang"} do |i|
149
+ xml.docidentifier **{ type: "ITU-lang" } do |i|
143
150
  i << itu_id1(node, true)
144
151
  end
145
152
  xml.docnumber { |i| i << node.attr("docnumber") }
@@ -147,8 +154,9 @@ module Asciidoctor
147
154
 
148
155
  def recommendation_id(node, xml)
149
156
  return unless node.attr("recommendationnumber")
157
+
150
158
  node.attr("recommendationnumber").split("/").each do |s|
151
- xml.docidentifier **{type: "ITU-Recommendation"} do |i|
159
+ xml.docidentifier **{ type: "ITU-Recommendation" } do |i|
152
160
  i << s
153
161
  end
154
162
  end
@@ -171,11 +179,12 @@ module Asciidoctor
171
179
 
172
180
  def metadata_recommendationstatus(node, xml)
173
181
  return unless node.attr("recommendation-from")
182
+
174
183
  xml.recommendationstatus do |s|
175
184
  s.from node.attr("recommendation-from")
176
185
  s.to node.attr("recommendation-to") if node.attr("recommendation-to")
177
186
  if node.attr("approval-process")
178
- s.approvalstage **{process: node.attr("approval-process")} do |a|
187
+ s.approvalstage **{ process: node.attr("approval-process") } do |a|
179
188
  a << node.attr("approval-status")
180
189
  end
181
190
  end
@@ -188,6 +197,7 @@ module Asciidoctor
188
197
 
189
198
  def structured_id(node, xml)
190
199
  return unless node.attr("docnumber")
200
+
191
201
  xml.structuredidentifier do |i|
192
202
  i.bureau node.attr("bureau") || "T"
193
203
  i.docnumber node.attr("docnumber")
@@ -198,7 +208,8 @@ module Asciidoctor
198
208
  end
199
209
 
200
210
  def metadata_techreport(node, xml)
201
- a = node.attr("meeting") and metadata_meeting(a, node.attr("meeting-acronym"), xml)
211
+ a = node.attr("meeting") and
212
+ metadata_meeting(a, node.attr("meeting-acronym"), xml)
202
213
  a = node.attr("meeting-place") and xml.meeting_place a
203
214
  a = node.attr("meeting-date") and metadata_meeting_date(a, xml)
204
215
  a = node.attr("intended-type") and xml.intended_type a
@@ -233,6 +244,7 @@ module Asciidoctor
233
244
 
234
245
  def metadata_ext(node, xml)
235
246
  metadata_doctype(node, xml)
247
+ metadata_subdoctype(node, xml)
236
248
  metadata_committee(node, xml)
237
249
  metadata_ics(node, xml)
238
250
  metadata_recommendationstatus(node, xml)
@@ -86,6 +86,35 @@
86
86
  <text/>
87
87
  </element>
88
88
  </define>
89
+ <define name="erefType">
90
+ <optional>
91
+ <attribute name="normative">
92
+ <data type="boolean"/>
93
+ </attribute>
94
+ </optional>
95
+ <attribute name="citeas"/>
96
+ <attribute name="type">
97
+ <ref name="ReferenceFormat"/>
98
+ </attribute>
99
+ <optional>
100
+ <attribute name="alt"/>
101
+ </optional>
102
+ <optional>
103
+ <attribute name="case">
104
+ <choice>
105
+ <value>capital</value>
106
+ <value>lowercase</value>
107
+ </choice>
108
+ </attribute>
109
+ </optional>
110
+ <optional>
111
+ <attribute name="droploc">
112
+ <data type="boolean"/>
113
+ </attribute>
114
+ </optional>
115
+ <ref name="CitationType"/>
116
+ <text/>
117
+ </define>
89
118
  <define name="ul">
90
119
  <element name="ul">
91
120
  <attribute name="id">
@@ -102,7 +131,7 @@
102
131
  </attribute>
103
132
  </optional>
104
133
  <oneOrMore>
105
- <ref name="li"/>
134
+ <ref name="ul_li"/>
106
135
  </oneOrMore>
107
136
  <zeroOrMore>
108
137
  <ref name="note"/>
@@ -775,6 +804,90 @@
775
804
  <ref name="paragraph"/>
776
805
  </element>
777
806
  </define>
807
+ <define name="em">
808
+ <element name="em">
809
+ <zeroOrMore>
810
+ <choice>
811
+ <ref name="PureTextElement"/>
812
+ <ref name="stem"/>
813
+ <ref name="index"/>
814
+ </choice>
815
+ </zeroOrMore>
816
+ </element>
817
+ </define>
818
+ <define name="strong">
819
+ <element name="strong">
820
+ <zeroOrMore>
821
+ <choice>
822
+ <ref name="PureTextElement"/>
823
+ <ref name="stem"/>
824
+ <ref name="index"/>
825
+ </choice>
826
+ </zeroOrMore>
827
+ </element>
828
+ </define>
829
+ <define name="tt">
830
+ <element name="tt">
831
+ <zeroOrMore>
832
+ <choice>
833
+ <ref name="PureTextElement"/>
834
+ <ref name="index"/>
835
+ </choice>
836
+ </zeroOrMore>
837
+ </element>
838
+ </define>
839
+ <define name="keyword">
840
+ <element name="keyword">
841
+ <zeroOrMore>
842
+ <choice>
843
+ <ref name="PureTextElement"/>
844
+ <ref name="index"/>
845
+ </choice>
846
+ </zeroOrMore>
847
+ </element>
848
+ </define>
849
+ <define name="strike">
850
+ <element name="strike">
851
+ <zeroOrMore>
852
+ <choice>
853
+ <ref name="PureTextElement"/>
854
+ <ref name="index"/>
855
+ </choice>
856
+ </zeroOrMore>
857
+ </element>
858
+ </define>
859
+ <define name="underline">
860
+ <element name="underline">
861
+ <zeroOrMore>
862
+ <choice>
863
+ <ref name="PureTextElement"/>
864
+ <ref name="index"/>
865
+ </choice>
866
+ </zeroOrMore>
867
+ </element>
868
+ </define>
869
+ <define name="smallcap">
870
+ <element name="smallcap">
871
+ <zeroOrMore>
872
+ <choice>
873
+ <ref name="PureTextElement"/>
874
+ <ref name="index"/>
875
+ </choice>
876
+ </zeroOrMore>
877
+ </element>
878
+ </define>
879
+ <define name="pagebreak">
880
+ <element name="pagebreak">
881
+ <optional>
882
+ <attribute name="orientation">
883
+ <choice>
884
+ <value>landscape</value>
885
+ <value>portrait</value>
886
+ </choice>
887
+ </attribute>
888
+ </optional>
889
+ </element>
890
+ </define>
778
891
  </include>
779
892
  <!-- end overrides -->
780
893
  <define name="colgroup">
@@ -793,7 +906,35 @@
793
906
  <value>internal</value>
794
907
  </define>
795
908
  <define name="TextElement" combine="choice">
796
- <ref name="concept"/>
909
+ <choice>
910
+ <ref name="concept"/>
911
+ <ref name="add"/>
912
+ <ref name="del"/>
913
+ </choice>
914
+ </define>
915
+ <define name="add">
916
+ <element name="add">
917
+ <choice>
918
+ <ref name="PureTextElement"/>
919
+ <ref name="eref"/>
920
+ <ref name="stem"/>
921
+ <ref name="keyword"/>
922
+ <ref name="xref"/>
923
+ <ref name="hyperlink"/>
924
+ </choice>
925
+ </element>
926
+ </define>
927
+ <define name="del">
928
+ <element name="del">
929
+ <choice>
930
+ <ref name="PureTextElement"/>
931
+ <ref name="eref"/>
932
+ <ref name="stem"/>
933
+ <ref name="keyword"/>
934
+ <ref name="xref"/>
935
+ <ref name="hyperlink"/>
936
+ </choice>
937
+ </element>
797
938
  </define>
798
939
  <define name="concept">
799
940
  <element name="concept">
@@ -814,8 +955,170 @@
814
955
  <ref name="permission"/>
815
956
  <ref name="imagemap"/>
816
957
  <ref name="svgmap"/>
958
+ <ref name="inputform"/>
959
+ </choice>
960
+ </define>
961
+ <define name="inputform">
962
+ <element name="form">
963
+ <attribute name="id">
964
+ <data type="ID"/>
965
+ </attribute>
966
+ <attribute name="name"/>
967
+ <attribute name="action"/>
968
+ <zeroOrMore>
969
+ <choice>
970
+ <ref name="TextElement"/>
971
+ <ref name="FormInput"/>
972
+ </choice>
973
+ </zeroOrMore>
974
+ </element>
975
+ </define>
976
+ <define name="FormInput">
977
+ <choice>
978
+ <ref name="input"/>
979
+ <ref name="formlabel"/>
980
+ <ref name="select"/>
981
+ <ref name="textarea"/>
982
+ </choice>
983
+ </define>
984
+ <define name="InputType">
985
+ <choice>
986
+ <value>button</value>
987
+ <value>checkbox</value>
988
+ <value>date</value>
989
+ <value>file</value>
990
+ <value>password</value>
991
+ <value>radio</value>
992
+ <value>submit</value>
993
+ <value>text</value>
817
994
  </choice>
818
995
  </define>
996
+ <define name="input">
997
+ <element name="input">
998
+ <attribute name="type">
999
+ <ref name="InputType"/>
1000
+ </attribute>
1001
+ <optional>
1002
+ <attribute name="checked">
1003
+ <data type="boolean"/>
1004
+ </attribute>
1005
+ </optional>
1006
+ <optional>
1007
+ <attribute name="disabled">
1008
+ <data type="boolean"/>
1009
+ </attribute>
1010
+ </optional>
1011
+ <optional>
1012
+ <attribute name="readonly">
1013
+ <data type="boolean"/>
1014
+ </attribute>
1015
+ </optional>
1016
+ <optional>
1017
+ <attribute name="maxlength">
1018
+ <data type="int"/>
1019
+ </attribute>
1020
+ </optional>
1021
+ <optional>
1022
+ <attribute name="minlength">
1023
+ <data type="int"/>
1024
+ </attribute>
1025
+ </optional>
1026
+ <optional>
1027
+ <attribute name="name"/>
1028
+ </optional>
1029
+ <optional>
1030
+ <attribute name="value"/>
1031
+ </optional>
1032
+ <optional>
1033
+ <attribute name="id">
1034
+ <data type="ID"/>
1035
+ </attribute>
1036
+ </optional>
1037
+ </element>
1038
+ </define>
1039
+ <define name="formlabel">
1040
+ <element name="label">
1041
+ <attribute name="for">
1042
+ <data type="IDREF"/>
1043
+ </attribute>
1044
+ <zeroOrMore>
1045
+ <ref name="PureTextElement"/>
1046
+ </zeroOrMore>
1047
+ </element>
1048
+ </define>
1049
+ <define name="select">
1050
+ <element name="select">
1051
+ <optional>
1052
+ <attribute name="name"/>
1053
+ </optional>
1054
+ <optional>
1055
+ <attribute name="value"/>
1056
+ </optional>
1057
+ <optional>
1058
+ <attribute name="id">
1059
+ <data type="ID"/>
1060
+ </attribute>
1061
+ </optional>
1062
+ <optional>
1063
+ <attribute name="disabled">
1064
+ <data type="boolean"/>
1065
+ </attribute>
1066
+ </optional>
1067
+ <optional>
1068
+ <attribute name="multiple">
1069
+ <data type="boolean"/>
1070
+ </attribute>
1071
+ </optional>
1072
+ <optional>
1073
+ <attribute name="size">
1074
+ <data type="int"/>
1075
+ </attribute>
1076
+ </optional>
1077
+ <oneOrMore>
1078
+ <ref name="option"/>
1079
+ </oneOrMore>
1080
+ </element>
1081
+ </define>
1082
+ <define name="option">
1083
+ <element name="option">
1084
+ <optional>
1085
+ <attribute name="disabled">
1086
+ <data type="boolean"/>
1087
+ </attribute>
1088
+ </optional>
1089
+ <optional>
1090
+ <attribute name="value"/>
1091
+ </optional>
1092
+ <zeroOrMore>
1093
+ <ref name="PureTextElement"/>
1094
+ </zeroOrMore>
1095
+ </element>
1096
+ </define>
1097
+ <define name="textarea">
1098
+ <element name="textarea">
1099
+ <optional>
1100
+ <attribute name="name"/>
1101
+ </optional>
1102
+ <optional>
1103
+ <attribute name="value"/>
1104
+ </optional>
1105
+ <optional>
1106
+ <attribute name="id">
1107
+ <data type="ID"/>
1108
+ </attribute>
1109
+ </optional>
1110
+ <optional>
1111
+ <attribute name="rows">
1112
+ <data type="int"/>
1113
+ </attribute>
1114
+ </optional>
1115
+ <optional>
1116
+ <attribute name="cols">
1117
+ <data type="int"/>
1118
+ </attribute>
1119
+ </optional>
1120
+ </element>
1121
+ </define>
819
1122
  <define name="bibliography">
820
1123
  <element name="bibliography">
821
1124
  <oneOrMore>
@@ -1716,4 +2019,26 @@
1716
2019
  </zeroOrMore>
1717
2020
  </element>
1718
2021
  </define>
2022
+ <define name="ul_li">
2023
+ <element name="li">
2024
+ <optional>
2025
+ <attribute name="id">
2026
+ <data type="ID"/>
2027
+ </attribute>
2028
+ </optional>
2029
+ <optional>
2030
+ <attribute name="uncheckedcheckbox">
2031
+ <data type="boolean"/>
2032
+ </attribute>
2033
+ </optional>
2034
+ <optional>
2035
+ <attribute name="checkedcheckbox">
2036
+ <data type="boolean"/>
2037
+ </attribute>
2038
+ </optional>
2039
+ <oneOrMore>
2040
+ <ref name="BasicBlock"/>
2041
+ </oneOrMore>
2042
+ </element>
2043
+ </define>
1719
2044
  </grammar>