metanorma-standoc 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asciidoctor/standoc/base.rb +2 -2
- data/lib/asciidoctor/standoc/biblio.rng +1 -1
- data/lib/asciidoctor/standoc/blocks.rb +25 -95
- data/lib/asciidoctor/standoc/blocks_notes.rb +89 -0
- data/lib/asciidoctor/standoc/cleanup.rb +10 -6
- data/lib/asciidoctor/standoc/cleanup_inline.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +45 -0
- data/lib/asciidoctor/standoc/isodoc.rng +427 -0
- data/lib/asciidoctor/standoc/lists.rb +12 -12
- data/lib/asciidoctor/standoc/macros_yaml2text.rb +32 -15
- data/lib/asciidoctor/standoc/ref.rb +71 -29
- data/lib/asciidoctor/standoc/reqt.rb +11 -6
- data/lib/asciidoctor/standoc/reqt.rng +23 -0
- data/lib/asciidoctor/standoc/table.rb +3 -2
- data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/spec/asciidoctor-standoc/blocks_spec.rb +55 -26
- data/spec/asciidoctor-standoc/cleanup_spec.rb +1 -1
- data/spec/asciidoctor-standoc/datamodel/attributes_table_preprocessor_spec.rb +35 -0
- data/spec/asciidoctor-standoc/lists_spec.rb +7 -5
- data/spec/asciidoctor-standoc/macros_spec.rb +3 -2
- data/spec/asciidoctor-standoc/refs_spec.rb +250 -5
- data/spec/asciidoctor-standoc/table_spec.rb +2 -2
- data/spec/asciidoctor-standoc/validate_spec.rb +56 -0
- data/spec/assets/iso123.rxl +107 -0
- data/spec/examples/datamodel/blank_definition_profile.adoc +4 -0
- data/spec/examples/datamodel/models/models/{Signature copy.yml → SignatureBlankDefinition.yml} +2 -2
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +51 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec38f1dc395a1d89eb57193772856d31e40e0d4e725f449884529f794a77c341
|
4
|
+
data.tar.gz: be6615f68c933d6028ef70aad058e4ec042d7ff5eabdf489c13abe7743aa1010
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 425e48990782c8de5e70d18fb3404eebdfa9b7c0bf1e6e454e89451e4593266d80b87981162881eac9e17aa5dcf6f711e3f2c4c4d61141be15b396446163bb30
|
7
|
+
data.tar.gz: 4d534831af15ebdd19c9e81ea000a13022cd1ed2ff0e9c1bedab90a829cbb105dd454adfe72befedd3341d5a47ca6920925ea6de77266259f93a17f25287a62a
|
@@ -192,7 +192,7 @@ module Asciidoctor
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
def
|
195
|
+
def term_source_attrs(seen_xref)
|
196
196
|
{ bibitemid: seen_xref.children[0]["target"],
|
197
197
|
format: seen_xref.children[0]["format"],
|
198
198
|
type: "inline" }
|
@@ -203,7 +203,7 @@ module Asciidoctor
|
|
203
203
|
xml_t.origin { |o| o << seen_xref.children[0].to_xml }
|
204
204
|
else
|
205
205
|
xml_t.origin seen_xref.children[0].content,
|
206
|
-
**attr_code(
|
206
|
+
**attr_code(term_source_attrs(seen_xref))
|
207
207
|
end
|
208
208
|
m[:text] && xml_t.modification do |mod|
|
209
209
|
mod.p { |p| p << m[:text].sub(/^\s+/, "") }
|
@@ -532,7 +532,7 @@
|
|
532
532
|
</define>
|
533
533
|
<define name="LocalityType">
|
534
534
|
<data type="string">
|
535
|
-
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|locality:[a-zA-Z0-9_]+</param>
|
535
|
+
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
536
536
|
</data>
|
537
537
|
</define>
|
538
538
|
<define name="referenceFrom">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "htmlentities"
|
2
2
|
require "uri"
|
3
|
+
require_relative "./blocks_notes"
|
3
4
|
|
4
5
|
module Asciidoctor
|
5
6
|
module Standoc
|
@@ -8,28 +9,21 @@ module Asciidoctor
|
|
8
9
|
{ id: Utils::anchor_or_uuid(node) }
|
9
10
|
end
|
10
11
|
|
11
|
-
def
|
12
|
+
def id_unnum_attrs(node)
|
12
13
|
attr_code( id: Utils::anchor_or_uuid(node),
|
13
14
|
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
15
|
+
number: node.attr("number"),
|
14
16
|
subsequence: node.attr("subsequence") )
|
15
17
|
end
|
16
18
|
|
17
|
-
def
|
18
|
-
attr_code(
|
19
|
-
|
20
|
-
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
21
|
-
subsequence: node.attr("subsequence") )
|
22
|
-
end
|
23
|
-
|
24
|
-
def termnote_attr(node)
|
25
|
-
attr_code(id_attr(node).merge(
|
26
|
-
"keep-separate": node.attr("keep-separate")))
|
19
|
+
def formula_attrs(node)
|
20
|
+
attr_code(id_unnum_attrs(node).merge(keep_attrs(node).merge(
|
21
|
+
inequality: node.option?("inequality") ? "true" : nil)))
|
27
22
|
end
|
28
23
|
|
29
|
-
def
|
30
|
-
|
31
|
-
"keep-
|
32
|
-
beforeclauses: node.attr("beforeclauses") == "true" ? "true" : nil))
|
24
|
+
def keep_attrs(node)
|
25
|
+
{ "keep-with-next": node.attr("keep-with-next"),
|
26
|
+
"keep-lines-together": node.attr("keep-lines-together") }
|
33
27
|
end
|
34
28
|
|
35
29
|
# We append each contained block to its parent
|
@@ -44,7 +38,7 @@ module Asciidoctor
|
|
44
38
|
end
|
45
39
|
|
46
40
|
def literal_attrs(node)
|
47
|
-
attr_code(id_attr(node))
|
41
|
+
attr_code(id_attr(node).merge(keep_attrs(node)))
|
48
42
|
end
|
49
43
|
|
50
44
|
def literal(node)
|
@@ -60,80 +54,12 @@ module Asciidoctor
|
|
60
54
|
# NOTE: html escaping is performed by Nokogiri
|
61
55
|
def stem(node)
|
62
56
|
noko do |xml|
|
63
|
-
xml.formula **
|
57
|
+
xml.formula **formula_attrs(node) do |s|
|
64
58
|
stem_parse(node.lines.join("\n"), s, node.style.to_sym)
|
65
59
|
end
|
66
60
|
end
|
67
61
|
end
|
68
62
|
|
69
|
-
def sidebar_attrs(node)
|
70
|
-
todo_attrs(node).merge(attr_code(
|
71
|
-
from: node.attr("from"), to: node.attr("to") || node.attr("from") ))
|
72
|
-
end
|
73
|
-
|
74
|
-
def sidebar(node)
|
75
|
-
return unless draft?
|
76
|
-
noko do |xml|
|
77
|
-
xml.review **(sidebar_attrs(node)) do |r|
|
78
|
-
wrap_in_para(node, r)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def todo_attrs(node)
|
84
|
-
date = node.attr("date") || Date.today.iso8601.gsub(/\+.*$/, "")
|
85
|
-
date += "T00:00:00Z" unless /T/.match date
|
86
|
-
attr_code(
|
87
|
-
id: Utils::anchor_or_uuid(node),
|
88
|
-
reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
|
89
|
-
date: date )
|
90
|
-
end
|
91
|
-
|
92
|
-
def todo(node)
|
93
|
-
noko do |xml|
|
94
|
-
xml.review **(todo_attrs(node)) do |r|
|
95
|
-
wrap_in_para(node, r)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def termnote(n)
|
101
|
-
noko do |xml|
|
102
|
-
xml.termnote **termnote_attr(n) do |ex|
|
103
|
-
wrap_in_para(n, ex)
|
104
|
-
end
|
105
|
-
end.join("\n")
|
106
|
-
end
|
107
|
-
|
108
|
-
def note(n)
|
109
|
-
noko do |xml|
|
110
|
-
xml.note **note_attr(n) do |c|
|
111
|
-
wrap_in_para(n, c)
|
112
|
-
end
|
113
|
-
end.join("\n")
|
114
|
-
end
|
115
|
-
|
116
|
-
def admonition_attrs(node)
|
117
|
-
name = node.attr("name")
|
118
|
-
a = node.attr("type") and ["danger", "safety precautions"].each do |t|
|
119
|
-
name = t if a.casecmp(t).zero?
|
120
|
-
end
|
121
|
-
attr_code(id: Utils::anchor_or_uuid(node), type: name,
|
122
|
-
beforeclauses: node.attr("beforeclauses") == "true" ? "true" : nil)
|
123
|
-
end
|
124
|
-
|
125
|
-
def admonition(node)
|
126
|
-
return termnote(node) if in_terms?
|
127
|
-
return note(node) if node.attr("name") == "note"
|
128
|
-
return todo(node) if node.attr("name") == "todo"
|
129
|
-
noko do |xml|
|
130
|
-
xml.admonition **admonition_attrs(node) do |a|
|
131
|
-
node.title.nil? or a.name { |name| name << node.title }
|
132
|
-
wrap_in_para(node, a)
|
133
|
-
end
|
134
|
-
end.join("\n")
|
135
|
-
end
|
136
|
-
|
137
63
|
def term_example(node)
|
138
64
|
noko do |xml|
|
139
65
|
xml.termexample **id_attr(node) do |ex|
|
@@ -155,7 +81,7 @@ module Asciidoctor
|
|
155
81
|
# prevent A's and other subs inappropriate for pseudocode
|
156
82
|
node.blocks.each { |b| b.remove_sub(:replacements) }
|
157
83
|
noko do |xml|
|
158
|
-
xml.figure **
|
84
|
+
xml.figure **example_attrs(node).merge(class: "pseudocode") do |ex|
|
159
85
|
figure_title(node, ex)
|
160
86
|
wrap_in_para(node, ex)
|
161
87
|
end
|
@@ -163,7 +89,7 @@ module Asciidoctor
|
|
163
89
|
end
|
164
90
|
|
165
91
|
def example_attrs(node)
|
166
|
-
attr_code(
|
92
|
+
attr_code(id_unnum_attrs(node).merge(keep_attrs(node)))
|
167
93
|
end
|
168
94
|
|
169
95
|
def example_proper(node)
|
@@ -181,7 +107,7 @@ module Asciidoctor
|
|
181
107
|
end
|
182
108
|
|
183
109
|
def figure_attrs(node)
|
184
|
-
attr_code(
|
110
|
+
attr_code(id_unnum_attrs(node).merge(keep_attrs(node)))
|
185
111
|
end
|
186
112
|
|
187
113
|
def image(node)
|
@@ -194,7 +120,8 @@ module Asciidoctor
|
|
194
120
|
end
|
195
121
|
|
196
122
|
def para_attrs(node)
|
197
|
-
attr_code(align: node.attr("align"),
|
123
|
+
attr_code(keep_attrs(node).merge(align: node.attr("align"),
|
124
|
+
id: Utils::anchor_or_uuid(node)))
|
198
125
|
end
|
199
126
|
|
200
127
|
def paragraph(node)
|
@@ -207,7 +134,8 @@ module Asciidoctor
|
|
207
134
|
end
|
208
135
|
|
209
136
|
def quote_attrs(node)
|
210
|
-
attr_code(
|
137
|
+
attr_code(keep_attrs(node).merge(align: node.attr("align"),
|
138
|
+
id: Utils::anchor_or_uuid(node)))
|
211
139
|
end
|
212
140
|
|
213
141
|
def quote_attribution(node, out)
|
@@ -231,10 +159,11 @@ module Asciidoctor
|
|
231
159
|
end
|
232
160
|
|
233
161
|
def listing_attrs(node)
|
234
|
-
attr_code(lang: node.attr("language"),
|
235
|
-
|
236
|
-
|
237
|
-
|
162
|
+
attr_code(keep_attrs(node).merge(lang: node.attr("language"),
|
163
|
+
id: Utils::anchor_or_uuid(node),
|
164
|
+
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
165
|
+
number: node.attr("number"),
|
166
|
+
filename: node.attr("filename")))
|
238
167
|
end
|
239
168
|
|
240
169
|
# NOTE: html escaping is performed by Nokogiri
|
@@ -251,7 +180,8 @@ module Asciidoctor
|
|
251
180
|
|
252
181
|
def pass(node)
|
253
182
|
noko do |xml|
|
254
|
-
xml.passthrough **attr_code(formats:
|
183
|
+
xml.passthrough **attr_code(formats:
|
184
|
+
node.attr("format") || "metanorma") do |p|
|
255
185
|
p << HTMLEntities.new.encode(node.content, :basic, :hexadecimal)
|
256
186
|
end
|
257
187
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Asciidoctor
|
2
|
+
module Standoc
|
3
|
+
module Blocks
|
4
|
+
def termnote_attrs(node)
|
5
|
+
attr_code(id_attr(node).merge(
|
6
|
+
unnumbered: node.attr("unnumbered"),
|
7
|
+
number: node.attr("number"),
|
8
|
+
subsequence: node.attr("subsequence"),
|
9
|
+
"keep-with-next": node.attr("keep-with-next"),
|
10
|
+
"keep-lines-together": node.attr("keep-with-next"),
|
11
|
+
"keep-separate": node.attr("keep-separate")))
|
12
|
+
end
|
13
|
+
|
14
|
+
def note_attrs(node)
|
15
|
+
attr_code(termnote_attrs(node).merge(
|
16
|
+
type: node.attr("type"),
|
17
|
+
beforeclauses: node.attr("beforeclauses") == "true" ? "true" : nil))
|
18
|
+
end
|
19
|
+
|
20
|
+
def sidebar_attrs(node)
|
21
|
+
todo_attrs(node).merge(attr_code(
|
22
|
+
from: node.attr("from"), to: node.attr("to") || node.attr("from") ))
|
23
|
+
end
|
24
|
+
|
25
|
+
def sidebar(node)
|
26
|
+
return unless draft?
|
27
|
+
noko do |xml|
|
28
|
+
xml.review **(sidebar_attrs(node)) do |r|
|
29
|
+
wrap_in_para(node, r)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def todo_attrs(node)
|
35
|
+
date = node.attr("date") || Date.today.iso8601.gsub(/\+.*$/, "")
|
36
|
+
date += "T00:00:00Z" unless /T/.match date
|
37
|
+
attr_code(
|
38
|
+
id: Utils::anchor_or_uuid(node),
|
39
|
+
reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
|
40
|
+
date: date )
|
41
|
+
end
|
42
|
+
|
43
|
+
def todo(node)
|
44
|
+
noko do |xml|
|
45
|
+
xml.review **(todo_attrs(node)) do |r|
|
46
|
+
wrap_in_para(node, r)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def termnote(n)
|
52
|
+
noko do |xml|
|
53
|
+
xml.termnote **termnote_attrs(n) do |ex|
|
54
|
+
wrap_in_para(n, ex)
|
55
|
+
end
|
56
|
+
end.join("\n")
|
57
|
+
end
|
58
|
+
|
59
|
+
def note(n)
|
60
|
+
noko do |xml|
|
61
|
+
xml.note **note_attrs(n) do |c|
|
62
|
+
wrap_in_para(n, c)
|
63
|
+
end
|
64
|
+
end.join("\n")
|
65
|
+
end
|
66
|
+
|
67
|
+
def admonition_attrs(node)
|
68
|
+
name = node.attr("name")
|
69
|
+
a = node.attr("type") and ["danger", "safety precautions"].each do |t|
|
70
|
+
name = t if a.casecmp(t).zero?
|
71
|
+
end
|
72
|
+
attr_code(keep_attrs(node).merge(id: Utils::anchor_or_uuid(node), type: name,
|
73
|
+
beforeclauses: node.attr("beforeclauses") == "true" ? "true" : nil))
|
74
|
+
end
|
75
|
+
|
76
|
+
def admonition(node)
|
77
|
+
return termnote(node) if in_terms?
|
78
|
+
return note(node) if node.attr("name") == "note"
|
79
|
+
return todo(node) if node.attr("name") == "todo"
|
80
|
+
noko do |xml|
|
81
|
+
xml.admonition **admonition_attrs(node) do |a|
|
82
|
+
node.title.nil? or a.name { |name| name << node.title }
|
83
|
+
wrap_in_para(node, a)
|
84
|
+
end
|
85
|
+
end.join("\n")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -16,8 +16,14 @@ module Asciidoctor
|
|
16
16
|
module Cleanup
|
17
17
|
def textcleanup(result)
|
18
18
|
text = result.flatten.map { |l| l.sub(/\s*$/, "") } * "\n"
|
19
|
-
|
20
|
-
|
19
|
+
!@keepasciimath and text = asciimath2mathml(text)
|
20
|
+
text = text.gsub(/\s+<fn /, "<fn ")
|
21
|
+
text.gsub(%r{<passthrough\s+formats="metanorma">([^<]*)
|
22
|
+
</passthrough>}mx) { |m| HTMLEntities.new.decode($1) }
|
23
|
+
end
|
24
|
+
|
25
|
+
def asciimath2mathml(text)
|
26
|
+
text = text.gsub(%r{<stem type="AsciiMath">(.+?)</stem>}m) do |m|
|
21
27
|
"<amathstem>#{HTMLEntities.new.decode($1)}</amathstem>"
|
22
28
|
end
|
23
29
|
text = Html2Doc.
|
@@ -26,9 +32,7 @@ module Asciidoctor
|
|
26
32
|
x.xpath("//*[local-name() = 'math'][not(parent::stem)]").each do |y|
|
27
33
|
y.wrap("<stem type='MathML'></stem>")
|
28
34
|
end
|
29
|
-
|
30
|
-
end
|
31
|
-
text.gsub(/\s+<fn /, "<fn ")
|
35
|
+
x.to_xml
|
32
36
|
end
|
33
37
|
|
34
38
|
def cleanup(xmldoc)
|
@@ -41,7 +45,7 @@ module Asciidoctor
|
|
41
45
|
ref_cleanup(xmldoc)
|
42
46
|
note_cleanup(xmldoc)
|
43
47
|
clausebefore_cleanup(xmldoc)
|
44
|
-
|
48
|
+
bibitem_cleanup(xmldoc)
|
45
49
|
normref_cleanup(xmldoc)
|
46
50
|
biblio_cleanup(xmldoc)
|
47
51
|
reference_names(xmldoc)
|
@@ -34,7 +34,7 @@ module Asciidoctor
|
|
34
34
|
# extending localities to cover ISO referencing
|
35
35
|
LOCALITY_REGEX_STR = <<~REGEXP.freeze
|
36
36
|
^((?<locality>section|clause|part|paragraph|chapter|page|
|
37
|
-
table|annex|figure|example|note|formula|list|
|
37
|
+
table|annex|figure|example|note|formula|list|time|anchor|
|
38
38
|
locality:[^ \\t\\n\\r:,;=]+)(\\s+|=)
|
39
39
|
(?<ref>[^"][^ \\t\\n,:-]*|"[^"]+")
|
40
40
|
(-(?<to>[^"][^ \\t\\n,:-]*|"[^"]"))?|
|
@@ -122,6 +122,7 @@ module Asciidoctor
|
|
122
122
|
def ref_dl_cleanup(xmldoc)
|
123
123
|
xmldoc.xpath("//clause[@bibitem = 'true']").each do |c|
|
124
124
|
bib = dl_bib_extract(c) or next
|
125
|
+
validate_ref_dl(bib, c)
|
125
126
|
bibitemxml = RelatonBib::BibliographicItem.new(
|
126
127
|
RelatonBib::HashConverter::hash_to_bib(bib)).to_xml or next
|
127
128
|
bibitem = Nokogiri::XML(bibitemxml)
|
@@ -130,6 +131,18 @@ module Asciidoctor
|
|
130
131
|
end
|
131
132
|
end
|
132
133
|
|
134
|
+
def validate_ref_dl(bib, c)
|
135
|
+
unless bib["id"]
|
136
|
+
@log.add("Anchors", c, "The following reference is missing "\
|
137
|
+
"an anchor:\n" + c.to_xml)
|
138
|
+
return
|
139
|
+
end
|
140
|
+
bib["title"] or @log.add("Bibliography", c, "Reference #{bib['id']} "\
|
141
|
+
"is missing a title")
|
142
|
+
bib["docid"] or @log.add("Bibliography", c, "Reference #{bib['id']} "\
|
143
|
+
"is missing a document identifier (docid)")
|
144
|
+
end
|
145
|
+
|
133
146
|
def extract_from_p(tag, bib, key)
|
134
147
|
return unless bib[tag]
|
135
148
|
"<#{key}>#{bib[tag].at('p').children}</#{key}>"
|
@@ -196,6 +209,38 @@ module Asciidoctor
|
|
196
209
|
def fetch_termbase(termbase, id)
|
197
210
|
""
|
198
211
|
end
|
212
|
+
|
213
|
+
def read_local_bibitem(uri)
|
214
|
+
return nil if %r{^http[s]?://}.match(uri)
|
215
|
+
file = @localdir + uri + ".rxl"
|
216
|
+
File.file?(file) or file = @localdir + uri + ".xml"
|
217
|
+
File.file?(file) or return nil
|
218
|
+
xml = Nokogiri::XML(File.read(file, encoding: "utf-8"))
|
219
|
+
ret = xml.at("//*[local-name() = 'bibdata']") or return nil
|
220
|
+
ret = Nokogiri::XML(ret.to_xml.sub(
|
221
|
+
%r{(<bibdata[^>]*?) xmlns=("[^"]+"|'[^']+')}, "\\1")).root
|
222
|
+
ret.name = "bibitem"
|
223
|
+
ins = ret.at("./*[local-name() = 'docidentifier']") or return nil
|
224
|
+
ins.previous = %{<uri type="citation">#{uri}</uri>}
|
225
|
+
ret&.at("./*[local-name() = 'ext']")&.remove
|
226
|
+
ret
|
227
|
+
end
|
228
|
+
|
229
|
+
# if citation uri points to local file, get bibitem from it
|
230
|
+
def fetch_local_bibitem(xmldoc)
|
231
|
+
xmldoc.xpath("//bibitem[formattedref]"\
|
232
|
+
"[uri[@type = 'citation']]").each do |b|
|
233
|
+
uri = b&.at("./uri[@type = 'citation']")&.text
|
234
|
+
bibitem = read_local_bibitem(uri) or next
|
235
|
+
bibitem["id"] = b["id"]
|
236
|
+
b.replace(bibitem)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
def bibitem_cleanup(xmldoc)
|
241
|
+
ref_dl_cleanup(xmldoc)
|
242
|
+
fetch_local_bibitem(xmldoc)
|
243
|
+
end
|
199
244
|
end
|
200
245
|
end
|
201
246
|
end
|
@@ -64,6 +64,85 @@
|
|
64
64
|
<text/>
|
65
65
|
</element>
|
66
66
|
</define>
|
67
|
+
<define name="ul">
|
68
|
+
<element name="ul">
|
69
|
+
<attribute name="id">
|
70
|
+
<data type="ID"/>
|
71
|
+
</attribute>
|
72
|
+
<optional>
|
73
|
+
<attribute name="keep-with-next">
|
74
|
+
<data type="boolean"/>
|
75
|
+
</attribute>
|
76
|
+
</optional>
|
77
|
+
<optional>
|
78
|
+
<attribute name="keep-lines-together">
|
79
|
+
<data type="boolean"/>
|
80
|
+
</attribute>
|
81
|
+
</optional>
|
82
|
+
<oneOrMore>
|
83
|
+
<ref name="li"/>
|
84
|
+
</oneOrMore>
|
85
|
+
<zeroOrMore>
|
86
|
+
<ref name="note"/>
|
87
|
+
</zeroOrMore>
|
88
|
+
</element>
|
89
|
+
</define>
|
90
|
+
<define name="ol">
|
91
|
+
<element name="ol">
|
92
|
+
<attribute name="id">
|
93
|
+
<data type="ID"/>
|
94
|
+
</attribute>
|
95
|
+
<optional>
|
96
|
+
<attribute name="keep-with-next">
|
97
|
+
<data type="boolean"/>
|
98
|
+
</attribute>
|
99
|
+
</optional>
|
100
|
+
<optional>
|
101
|
+
<attribute name="keep-lines-together">
|
102
|
+
<data type="boolean"/>
|
103
|
+
</attribute>
|
104
|
+
</optional>
|
105
|
+
<attribute name="type">
|
106
|
+
<choice>
|
107
|
+
<value>roman</value>
|
108
|
+
<value>alphabet</value>
|
109
|
+
<value>arabic</value>
|
110
|
+
<value>roman_upper</value>
|
111
|
+
<value>alphabet_upper</value>
|
112
|
+
</choice>
|
113
|
+
</attribute>
|
114
|
+
<oneOrMore>
|
115
|
+
<ref name="li"/>
|
116
|
+
</oneOrMore>
|
117
|
+
<zeroOrMore>
|
118
|
+
<ref name="note"/>
|
119
|
+
</zeroOrMore>
|
120
|
+
</element>
|
121
|
+
</define>
|
122
|
+
<define name="dl">
|
123
|
+
<element name="dl">
|
124
|
+
<attribute name="id">
|
125
|
+
<data type="ID"/>
|
126
|
+
</attribute>
|
127
|
+
<optional>
|
128
|
+
<attribute name="keep-with-next">
|
129
|
+
<data type="boolean"/>
|
130
|
+
</attribute>
|
131
|
+
</optional>
|
132
|
+
<optional>
|
133
|
+
<attribute name="keep-lines-together">
|
134
|
+
<data type="boolean"/>
|
135
|
+
</attribute>
|
136
|
+
</optional>
|
137
|
+
<oneOrMore>
|
138
|
+
<ref name="dt"/>
|
139
|
+
<ref name="dd"/>
|
140
|
+
</oneOrMore>
|
141
|
+
<zeroOrMore>
|
142
|
+
<ref name="note"/>
|
143
|
+
</zeroOrMore>
|
144
|
+
</element>
|
145
|
+
</define>
|
67
146
|
<define name="example">
|
68
147
|
<element name="example">
|
69
148
|
<attribute name="id">
|
@@ -77,6 +156,19 @@
|
|
77
156
|
<optional>
|
78
157
|
<attribute name="subsequence"/>
|
79
158
|
</optional>
|
159
|
+
<optional>
|
160
|
+
<attribute name="number"/>
|
161
|
+
</optional>
|
162
|
+
<optional>
|
163
|
+
<attribute name="keep-with-next">
|
164
|
+
<data type="boolean"/>
|
165
|
+
</attribute>
|
166
|
+
</optional>
|
167
|
+
<optional>
|
168
|
+
<attribute name="keep-lines-together">
|
169
|
+
<data type="boolean"/>
|
170
|
+
</attribute>
|
171
|
+
</optional>
|
80
172
|
<optional>
|
81
173
|
<ref name="tname"/>
|
82
174
|
</optional>
|
@@ -97,6 +189,296 @@
|
|
97
189
|
</zeroOrMore>
|
98
190
|
</element>
|
99
191
|
</define>
|
192
|
+
<define name="table">
|
193
|
+
<element name="table">
|
194
|
+
<attribute name="id">
|
195
|
+
<data type="ID"/>
|
196
|
+
</attribute>
|
197
|
+
<optional>
|
198
|
+
<attribute name="unnumbered">
|
199
|
+
<data type="boolean"/>
|
200
|
+
</attribute>
|
201
|
+
</optional>
|
202
|
+
<optional>
|
203
|
+
<attribute name="number"/>
|
204
|
+
</optional>
|
205
|
+
<optional>
|
206
|
+
<attribute name="subsequence"/>
|
207
|
+
</optional>
|
208
|
+
<optional>
|
209
|
+
<attribute name="alt"/>
|
210
|
+
</optional>
|
211
|
+
<optional>
|
212
|
+
<attribute name="summary"/>
|
213
|
+
</optional>
|
214
|
+
<optional>
|
215
|
+
<attribute name="uri">
|
216
|
+
<data type="anyURI"/>
|
217
|
+
</attribute>
|
218
|
+
</optional>
|
219
|
+
<optional>
|
220
|
+
<attribute name="keep-with-next">
|
221
|
+
<data type="boolean"/>
|
222
|
+
</attribute>
|
223
|
+
</optional>
|
224
|
+
<optional>
|
225
|
+
<attribute name="keep-lines-together">
|
226
|
+
<data type="boolean"/>
|
227
|
+
</attribute>
|
228
|
+
</optional>
|
229
|
+
<optional>
|
230
|
+
<ref name="tname"/>
|
231
|
+
</optional>
|
232
|
+
<optional>
|
233
|
+
<ref name="thead"/>
|
234
|
+
</optional>
|
235
|
+
<ref name="tbody"/>
|
236
|
+
<optional>
|
237
|
+
<ref name="tfoot"/>
|
238
|
+
</optional>
|
239
|
+
<zeroOrMore>
|
240
|
+
<ref name="table-note"/>
|
241
|
+
</zeroOrMore>
|
242
|
+
<optional>
|
243
|
+
<ref name="dl"/>
|
244
|
+
</optional>
|
245
|
+
</element>
|
246
|
+
</define>
|
247
|
+
<define name="figure">
|
248
|
+
<element name="figure">
|
249
|
+
<attribute name="id">
|
250
|
+
<data type="ID"/>
|
251
|
+
</attribute>
|
252
|
+
<optional>
|
253
|
+
<attribute name="unnumbered">
|
254
|
+
<data type="boolean"/>
|
255
|
+
</attribute>
|
256
|
+
</optional>
|
257
|
+
<optional>
|
258
|
+
<attribute name="number"/>
|
259
|
+
</optional>
|
260
|
+
<optional>
|
261
|
+
<attribute name="subsequence"/>
|
262
|
+
</optional>
|
263
|
+
<optional>
|
264
|
+
<attribute name="keep-with-next">
|
265
|
+
<data type="boolean"/>
|
266
|
+
</attribute>
|
267
|
+
</optional>
|
268
|
+
<optional>
|
269
|
+
<attribute name="keep-lines-together">
|
270
|
+
<data type="boolean"/>
|
271
|
+
</attribute>
|
272
|
+
</optional>
|
273
|
+
<optional>
|
274
|
+
<attribute name="class"/>
|
275
|
+
</optional>
|
276
|
+
<optional>
|
277
|
+
<ref name="source"/>
|
278
|
+
</optional>
|
279
|
+
<optional>
|
280
|
+
<ref name="tname"/>
|
281
|
+
</optional>
|
282
|
+
<choice>
|
283
|
+
<ref name="image"/>
|
284
|
+
<ref name="video"/>
|
285
|
+
<ref name="audio"/>
|
286
|
+
<ref name="pre"/>
|
287
|
+
<oneOrMore>
|
288
|
+
<ref name="paragraph-with-footnote"/>
|
289
|
+
</oneOrMore>
|
290
|
+
<zeroOrMore>
|
291
|
+
<ref name="figure"/>
|
292
|
+
</zeroOrMore>
|
293
|
+
</choice>
|
294
|
+
<zeroOrMore>
|
295
|
+
<ref name="fn"/>
|
296
|
+
</zeroOrMore>
|
297
|
+
<optional>
|
298
|
+
<ref name="dl"/>
|
299
|
+
</optional>
|
300
|
+
<zeroOrMore>
|
301
|
+
<ref name="note"/>
|
302
|
+
</zeroOrMore>
|
303
|
+
</element>
|
304
|
+
</define>
|
305
|
+
<define name="sourcecode">
|
306
|
+
<element name="sourcecode">
|
307
|
+
<attribute name="id">
|
308
|
+
<data type="ID"/>
|
309
|
+
</attribute>
|
310
|
+
<optional>
|
311
|
+
<attribute name="unnumbered">
|
312
|
+
<data type="boolean"/>
|
313
|
+
</attribute>
|
314
|
+
</optional>
|
315
|
+
<optional>
|
316
|
+
<attribute name="number"/>
|
317
|
+
</optional>
|
318
|
+
<optional>
|
319
|
+
<attribute name="subsequence"/>
|
320
|
+
</optional>
|
321
|
+
<optional>
|
322
|
+
<attribute name="keep-with-next">
|
323
|
+
<data type="boolean"/>
|
324
|
+
</attribute>
|
325
|
+
</optional>
|
326
|
+
<optional>
|
327
|
+
<attribute name="keep-lines-together">
|
328
|
+
<data type="boolean"/>
|
329
|
+
</attribute>
|
330
|
+
</optional>
|
331
|
+
<optional>
|
332
|
+
<attribute name="lang"/>
|
333
|
+
</optional>
|
334
|
+
<optional>
|
335
|
+
<ref name="tname"/>
|
336
|
+
</optional>
|
337
|
+
<oneOrMore>
|
338
|
+
<choice>
|
339
|
+
<text/>
|
340
|
+
<ref name="callout"/>
|
341
|
+
</choice>
|
342
|
+
</oneOrMore>
|
343
|
+
<zeroOrMore>
|
344
|
+
<ref name="annotation"/>
|
345
|
+
</zeroOrMore>
|
346
|
+
<zeroOrMore>
|
347
|
+
<ref name="note"/>
|
348
|
+
</zeroOrMore>
|
349
|
+
</element>
|
350
|
+
</define>
|
351
|
+
<define name="formula">
|
352
|
+
<element name="formula">
|
353
|
+
<attribute name="id">
|
354
|
+
<data type="ID"/>
|
355
|
+
</attribute>
|
356
|
+
<optional>
|
357
|
+
<attribute name="unnumbered">
|
358
|
+
<data type="boolean"/>
|
359
|
+
</attribute>
|
360
|
+
</optional>
|
361
|
+
<optional>
|
362
|
+
<attribute name="number"/>
|
363
|
+
</optional>
|
364
|
+
<optional>
|
365
|
+
<attribute name="subsequence"/>
|
366
|
+
</optional>
|
367
|
+
<optional>
|
368
|
+
<attribute name="keep-with-next">
|
369
|
+
<data type="boolean"/>
|
370
|
+
</attribute>
|
371
|
+
</optional>
|
372
|
+
<optional>
|
373
|
+
<attribute name="keep-lines-together">
|
374
|
+
<data type="boolean"/>
|
375
|
+
</attribute>
|
376
|
+
</optional>
|
377
|
+
<optional>
|
378
|
+
<attribute name="inequality">
|
379
|
+
<data type="boolean"/>
|
380
|
+
</attribute>
|
381
|
+
</optional>
|
382
|
+
<ref name="stem"/>
|
383
|
+
<optional>
|
384
|
+
<ref name="dl"/>
|
385
|
+
</optional>
|
386
|
+
<zeroOrMore>
|
387
|
+
<ref name="note"/>
|
388
|
+
</zeroOrMore>
|
389
|
+
</element>
|
390
|
+
</define>
|
391
|
+
<define name="ParagraphType">
|
392
|
+
<attribute name="id">
|
393
|
+
<data type="ID"/>
|
394
|
+
</attribute>
|
395
|
+
<optional>
|
396
|
+
<attribute name="align">
|
397
|
+
<ref name="Alignments"/>
|
398
|
+
</attribute>
|
399
|
+
</optional>
|
400
|
+
<optional>
|
401
|
+
<attribute name="keep-with-next">
|
402
|
+
<data type="boolean"/>
|
403
|
+
</attribute>
|
404
|
+
</optional>
|
405
|
+
<optional>
|
406
|
+
<attribute name="keep-lines-together">
|
407
|
+
<data type="boolean"/>
|
408
|
+
</attribute>
|
409
|
+
</optional>
|
410
|
+
<zeroOrMore>
|
411
|
+
<ref name="TextElement"/>
|
412
|
+
</zeroOrMore>
|
413
|
+
<zeroOrMore>
|
414
|
+
<ref name="note"/>
|
415
|
+
</zeroOrMore>
|
416
|
+
</define>
|
417
|
+
<define name="paragraph-with-footnote">
|
418
|
+
<element name="p">
|
419
|
+
<attribute name="id">
|
420
|
+
<data type="ID"/>
|
421
|
+
</attribute>
|
422
|
+
<optional>
|
423
|
+
<attribute name="align">
|
424
|
+
<ref name="Alignments"/>
|
425
|
+
</attribute>
|
426
|
+
</optional>
|
427
|
+
<optional>
|
428
|
+
<attribute name="keep-with-next">
|
429
|
+
<data type="boolean"/>
|
430
|
+
</attribute>
|
431
|
+
</optional>
|
432
|
+
<optional>
|
433
|
+
<attribute name="keep-lines-together">
|
434
|
+
<data type="boolean"/>
|
435
|
+
</attribute>
|
436
|
+
</optional>
|
437
|
+
<zeroOrMore>
|
438
|
+
<choice>
|
439
|
+
<ref name="TextElement"/>
|
440
|
+
<ref name="fn"/>
|
441
|
+
</choice>
|
442
|
+
</zeroOrMore>
|
443
|
+
<zeroOrMore>
|
444
|
+
<ref name="note"/>
|
445
|
+
</zeroOrMore>
|
446
|
+
</element>
|
447
|
+
</define>
|
448
|
+
<define name="quote">
|
449
|
+
<element name="quote">
|
450
|
+
<attribute name="id">
|
451
|
+
<data type="ID"/>
|
452
|
+
</attribute>
|
453
|
+
<optional>
|
454
|
+
<attribute name="alignment">
|
455
|
+
<ref name="Alignments"/>
|
456
|
+
</attribute>
|
457
|
+
</optional>
|
458
|
+
<optional>
|
459
|
+
<attribute name="keep-with-next">
|
460
|
+
<data type="boolean"/>
|
461
|
+
</attribute>
|
462
|
+
</optional>
|
463
|
+
<optional>
|
464
|
+
<attribute name="keep-lines-together">
|
465
|
+
<data type="boolean"/>
|
466
|
+
</attribute>
|
467
|
+
</optional>
|
468
|
+
<optional>
|
469
|
+
<ref name="quote-source"/>
|
470
|
+
</optional>
|
471
|
+
<optional>
|
472
|
+
<ref name="quote-author"/>
|
473
|
+
</optional>
|
474
|
+
<oneOrMore>
|
475
|
+
<ref name="paragraph-with-footnote"/>
|
476
|
+
</oneOrMore>
|
477
|
+
<zeroOrMore>
|
478
|
+
<ref name="note"/>
|
479
|
+
</zeroOrMore>
|
480
|
+
</element>
|
481
|
+
</define>
|
100
482
|
<define name="BibDataExtensionType">
|
101
483
|
<ref name="doctype"/>
|
102
484
|
<optional>
|
@@ -165,6 +547,30 @@
|
|
165
547
|
<attribute name="id">
|
166
548
|
<data type="ID"/>
|
167
549
|
</attribute>
|
550
|
+
<optional>
|
551
|
+
<attribute name="unnumbered">
|
552
|
+
<data type="boolean"/>
|
553
|
+
</attribute>
|
554
|
+
</optional>
|
555
|
+
<optional>
|
556
|
+
<attribute name="number"/>
|
557
|
+
</optional>
|
558
|
+
<optional>
|
559
|
+
<attribute name="subsequence"/>
|
560
|
+
</optional>
|
561
|
+
<optional>
|
562
|
+
<attribute name="keep-with-next">
|
563
|
+
<data type="boolean"/>
|
564
|
+
</attribute>
|
565
|
+
</optional>
|
566
|
+
<optional>
|
567
|
+
<attribute name="keep-lines-together">
|
568
|
+
<data type="boolean"/>
|
569
|
+
</attribute>
|
570
|
+
</optional>
|
571
|
+
<optional>
|
572
|
+
<attribute name="type"/>
|
573
|
+
</optional>
|
168
574
|
<oneOrMore>
|
169
575
|
<choice>
|
170
576
|
<ref name="paragraph"/>
|
@@ -910,6 +1316,27 @@
|
|
910
1316
|
<attribute name="id">
|
911
1317
|
<data type="ID"/>
|
912
1318
|
</attribute>
|
1319
|
+
<optional>
|
1320
|
+
<attribute name="unnumbered">
|
1321
|
+
<data type="boolean"/>
|
1322
|
+
</attribute>
|
1323
|
+
</optional>
|
1324
|
+
<optional>
|
1325
|
+
<attribute name="number"/>
|
1326
|
+
</optional>
|
1327
|
+
<optional>
|
1328
|
+
<attribute name="subsequence"/>
|
1329
|
+
</optional>
|
1330
|
+
<optional>
|
1331
|
+
<attribute name="keep-with-next">
|
1332
|
+
<data type="boolean"/>
|
1333
|
+
</attribute>
|
1334
|
+
</optional>
|
1335
|
+
<optional>
|
1336
|
+
<attribute name="keep-lines-together">
|
1337
|
+
<data type="boolean"/>
|
1338
|
+
</attribute>
|
1339
|
+
</optional>
|
913
1340
|
<oneOrMore>
|
914
1341
|
<choice>
|
915
1342
|
<ref name="paragraph"/>
|