-
Notifications
You must be signed in to change notification settings - Fork 5
/
omstd20.rnc
340 lines (272 loc) · 6.47 KB
/
omstd20.rnc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# Custom Relax NG schems for omstd20.xml
# The markup is docbook+MathML but constrained
# to validate just the markup used here and supported by
# the conversions to TeX and HTML in the stylesheets in this
# repository.
#
# If additional markup is required and the document is DTD-valid
# (which uses the full docbook DTD) and the conversions to html
# and TeX work, feel free to extend this schema as needed.
# The current schema is intentionally over-restrictive to limit the
# choices when editing the document in nxml-mode or other schema aware
# editing environments.
# David Carlisle September 2017
start = book
book =element book{
attribute xml:space{"preserve"}?,
title,
bookinfo,
toc,
lot,
chapter*,
appendix*,
bibliography?
}
# frontmatter
title = element title {(text|phrase|xref|filename|math|emphasis|acronym)*,
attribute revisionflag{"added"|"changed"|"deleted"}?}
bookinfo = element bookinfo {
releaseinfo,
author*,
editor*,
date,
copyright,
abstract
}
releaseinfo= element releaseinfo {text}
date = element date {text}
copyright = element copyright{year,holder}
year = element year {text}
holder = element holder {text}
abstract = element abstract {
para+
}
toc = element toc{title?}
lot = element lot{title?}
# sectional elements
chapter = element chapter{
id,
attribute revisionflag{"added"|"changed"|"deleted"}?,
title,
(blocks)*
}
appendix = element appendix{
id,
attribute revisionflag{"added"|"changed"|"deleted"}?,
title,
(blocks)*
}
section = element section{
id,
attribute revisionflag{"added"|"changed"|"deleted"}?,
title,
(blocks)*
}
# block level elements
blocks = (para|formalpara|figure|section|literallayout|variablelist|itemizedlist|orderedlist|blockquote)
formalpara = element formalpara {
id?,
title,
para+
}
blockquote = element blockquote {
(para|informaltable)+
}
literallayout= element literallayout{
attribute revisionflag{"added"|"changed"|"deleted"}?,
((attribute role {"rnc"|"dtd"|"rng"|"xsd"|"xml"}, attribute file {text}) | anywf*)
}
anywf = (text |element * {
attribute * {text}*,
(anywf|text)*
}
)
comment = element comment {(text|comment|\token|\string)*}
\token = element token {text}
\string = element string {(\token|text)*}
# bibliographic elements
bibliography = element bibliography {
id,
title,
biblioentry*
}
biblioentry = element biblioentry {
id,
attribute revisionflag{"added"|"changed"|"deleted"}?,
attribute role {"finaledit"|
"book"|"Article"|"misc"|"Manual"|"InProceedings"|"InCollection"|"TechReport"|"PhdThesis"|
"unpublished"}?,
author*,
b-title*,
b-subtitle?,
(pubdate*&publisher?&edition?&isbn?&
editor?&
biblioset*&
pagenums?&seriesvolnums?&bibliomisc*&address?)
}
b-title = element title {
attribute role {"book"}?,
(text|phrase|emphasis)*
}
b-subtitle = element subtitle {
(text|phrase|emphasis)*
}
publisher = element publisher {publishername}
publishername = element publishername {
(text|phrase|emphasis)*
}
edition = element edition {
(text|phrase|emphasis)*
}
address = element address{
(text|phrase|emphasis)*
}
seriesvolnums = element seriesvolnums {text}
pagenums = element pagenums {text}
author = element author {
(firstname|othername|surname)*
}
editor = element editor {
(firstname|othername|surname)*,
attribute revisionflag{"added"|"changed"|"deleted"}?}
}
othername = element othername {(text|emphasis)*}
firstname = element firstname {(text|emphasis)*}
surname = element surname {
attribute role{"finaledit"}?,
(text|emphasis)*
}
pubdate = element pubdate {
attribute role {"month"}?,
text}
bibliomisc = element bibliomisc {
attribute role {"finaledit"|
"keywords"|"year"|"volume"|"series"|"number"|"pages"|"key"|
"organization"|"school"|"journal"|"booktitle"}?,
(text|emphasis)*
}
isbn = element isbn {text}
biblioset = element biblioset {
attribute relation{"series"|"article"},
(b-title&
volumenum?&
pagenums?&
pubdate?)
}
volumenum = element volumenum {text}
# end of bibliographic elements
id = attribute id {text}
phrasetext = (text|xref|term|ulink|citation|varname|filename|acronym|systemitem|quote|phrase|emphasis|math)*
para = element para {
id?,
attribute revisionflag{"added"|"changed"|"deleted"}?,
(phrasetext|orderedlist|variablelist|itemizedlist|literallayout|blockquote|footnote)*
}
footnote = element footnote {
id,
para+
}
# inline text elements
phrase = element phrase {
attribute role{"sl"|"finaledit"}?,
attribute revisionflag{"added"|"changed"|"deleted"}?,
phrasetext
}
xref = element xref {
attribute linkend {text}
}
varname = element varname {text}
filename = element filename {text}
citation = element citation {text}
acronym = element acronym{text}
systemitem = element systemitem {
attribute revisionflag{"added"|"changed"|"deleted"}?,
text}
ulink = element ulink {
attribute url {text},
text}
quote = element quote {(text|math|phrase)*}
emphasis = element emphasis {
attribute role{"bold"|"finaledit"}?,
(text|math|phrase)*}
# docbook figures
figure = element figure{
id,
attribute role {"finaledit"}?,
title,
(graphic|informaltable|literallayout)
}
graphic = element graphic {
attribute fileref{text},
attribute depth {text}?,
attribute width {text}?
}
itemizedlist = element itemizedlist{listitem*}
orderedlist = element orderedlist{
attribute numeration {"lowerroman"}?,
listitem*
}
listitem = element listitem {(para|figure|blockquote)+}
variablelist = element variablelist{varlistentry*}
varlistentry = element varlistentry{
(term+,listitem)*
}
term = element term {
id?,
phrasetext
}
# docbook tables
informaltable = element informaltable{
attribute role{"finaledit"}?,
tgroup
}
tgroup = element tgroup {
attribute cols {text},
thead?,
tbody
}
thead = element thead{
row+
}
tbody = element tbody{
row+
}
row = element row {
attribute revisionflag{"added"|"changed"|"deleted"}?,
entry+
}
entry = element entry{
attribute revisionflag{"added"|"changed"|"deleted"}?,
phrasetext
}
# MathML (somewhat simplified)
mel = mspace|mn|mo|mi|mtext|mrow|mfenced|msub|msup|mfrac|mover
math = element math {
id?,
attribute display {"block"}?,
attribute revisionflag{"added"|"changed"|"deleted"}?,
(mel)*
}
mrow = element mrow {
(mel)*
}
mfenced = element mfenced {
(mel)*
}
mspace = element mspace {
attribute width {text}
}
mtext = element mtext {text}
mn = element mn {text}
mo = element mo {
attribute fence {"true"}?,
attribute separator {"true"}?,
text}
mi = element mi {
attribute mathvariant{"bold"}?,
attribute mathcolor{text}?,
text}
msub = element msub {mel,mel}
msup = element msup {mel,mel}
mfrac = element mfrac {mel,mel}
mover = element mover {mel,element mo {"\x{2192}"}}