patrick@0
|
1 |
# $Id$
|
patrick@0
|
2 |
|
patrick@0
|
3 |
start = publidoc
|
patrick@0
|
4 |
|
patrick@0
|
5 |
|
patrick@0
|
6 |
publidoc = element publidoc {
|
patrick@0
|
7 |
publidoc.attributes,
|
patrick@0
|
8 |
publidoc.content
|
patrick@0
|
9 |
}
|
patrick@0
|
10 |
|
patrick@0
|
11 |
publidoc.attributes =
|
patrick@0
|
12 |
version.attribute
|
patrick@0
|
13 |
version.attribute = attribute version { "1.0" }
|
patrick@0
|
14 |
|
patrick@0
|
15 |
publidoc.content =
|
patrick@0
|
16 |
document
|
patrick@0
|
17 |
| top.topic
|
patrick@0
|
18 |
|
patrick@0
|
19 |
|
patrick@0
|
20 |
# =============================================================================
|
patrick@20
|
21 |
# TOP LEVEL
|
patrick@0
|
22 |
# =============================================================================
|
patrick@0
|
23 |
|
patrick@98
|
24 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
25 |
|
patrick@90
|
26 |
top.head = element head { top.head.content }
|
patrick@90
|
27 |
|
patrick@90
|
28 |
top.head.content =
|
patrick@127
|
29 |
(title, shorttitle?, subtitle?)?
|
patrick@90
|
30 |
& identifier*
|
patrick@90
|
31 |
& copyright?
|
patrick@90
|
32 |
& contributors?
|
patrick@90
|
33 |
& date?
|
patrick@90
|
34 |
& place?
|
patrick@90
|
35 |
& source*
|
patrick@90
|
36 |
& keywordset?
|
patrick@90
|
37 |
& subjectset?
|
patrick@90
|
38 |
& abstract?
|
patrick@90
|
39 |
& cover?
|
patrick@90
|
40 |
& annotation*
|
patrick@90
|
41 |
|
patrick@0
|
42 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
43 |
|
patrick@90
|
44 |
# ~~~~~~ document
|
patrick@0
|
45 |
document = element document { document.attributes, document.content }
|
patrick@0
|
46 |
|
patrick@0
|
47 |
document.attributes =
|
patrick@0
|
48 |
document.id.attribute
|
patrick@142
|
49 |
& document.type.attribute?
|
patrick@66
|
50 |
& lang.attribute?
|
patrick@117
|
51 |
document.id.attribute = attribute id { xsd:NMTOKEN }
|
patrick@142
|
52 |
document.type.attribute = attribute type { xsd:NCName }
|
patrick@66
|
53 |
lang.attribute = attribute xml:lang { xsd:language }
|
patrick@0
|
54 |
|
patrick@0
|
55 |
document.content =
|
patrick@20
|
56 |
top.head?,
|
patrick@56
|
57 |
(division | topic)+
|
patrick@0
|
58 |
|
patrick@0
|
59 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
60 |
|
patrick@18
|
61 |
top.topic = element topic { top.topic.attributes, top.topic.content }
|
patrick@0
|
62 |
|
patrick@20
|
63 |
top.topic.attributes =
|
patrick@20
|
64 |
topic.id.attribute
|
patrick@20
|
65 |
& topic.type.attribute?
|
patrick@66
|
66 |
& lang.attribute?
|
patrick@117
|
67 |
topic.id.attribute = attribute id { xsd:NMTOKEN }
|
patrick@20
|
68 |
topic.type.attribute = attribute type { xsd:NCName }
|
patrick@20
|
69 |
|
patrick@20
|
70 |
top.topic.content =
|
patrick@20
|
71 |
top.head?,
|
Patrick@137
|
72 |
header?,
|
Patrick@137
|
73 |
section+,
|
Patrick@137
|
74 |
footer?
|
patrick@0
|
75 |
|
patrick@40
|
76 |
|
patrick@0
|
77 |
# =============================================================================
|
patrick@20
|
78 |
# DIVISION LEVEL
|
patrick@0
|
79 |
# =============================================================================
|
patrick@0
|
80 |
|
patrick@70
|
81 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
82 |
|
patrick@90
|
83 |
# ~~~~~~ division
|
patrick@0
|
84 |
division = element division { division.content }
|
patrick@0
|
85 |
|
patrick@0
|
86 |
division.content =
|
patrick@20
|
87 |
division.head?,
|
patrick@56
|
88 |
(division | topic)+
|
patrick@0
|
89 |
|
patrick@90
|
90 |
# ~~~~~~ division.head
|
patrick@90
|
91 |
division.head = element head { division.head.content }
|
patrick@90
|
92 |
|
patrick@90
|
93 |
division.head.content =
|
patrick@127
|
94 |
(title, shorttitle?, subtitle?)?
|
patrick@90
|
95 |
& abstract?
|
patrick@90
|
96 |
& annotation*
|
patrick@90
|
97 |
|
patrick@0
|
98 |
|
patrick@0
|
99 |
# =============================================================================
|
patrick@90
|
100 |
# COMPONENT LEVEL
|
patrick@0
|
101 |
# =============================================================================
|
patrick@0
|
102 |
|
patrick@90
|
103 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
104 |
|
patrick@90
|
105 |
component.head = element head { component.head.content }
|
patrick@90
|
106 |
|
patrick@90
|
107 |
component.head.content =
|
patrick@127
|
108 |
(title, shorttitle?, subtitle?)?
|
patrick@90
|
109 |
& contributors?
|
patrick@90
|
110 |
& abstract?
|
patrick@90
|
111 |
& annotation*
|
patrick@90
|
112 |
|
patrick@0
|
113 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
114 |
|
patrick@0
|
115 |
topic = element topic { topic.attributes, topic.content }
|
patrick@0
|
116 |
|
patrick@0
|
117 |
topic.attributes =
|
patrick@122
|
118 |
(topic.id.attribute | topic.xmlid.attribute)?
|
patrick@0
|
119 |
& topic.type.attribute?
|
patrick@69
|
120 |
& lang.attribute?
|
patrick@122
|
121 |
topic.xmlid.attribute = attribute xml:id { xsd:ID }
|
patrick@0
|
122 |
|
patrick@0
|
123 |
topic.content =
|
patrick@20
|
124 |
component.head?,
|
Patrick@137
|
125 |
header?,
|
Patrick@137
|
126 |
section+,
|
Patrick@137
|
127 |
footer?
|
patrick@0
|
128 |
|
patrick@0
|
129 |
|
patrick@0
|
130 |
# =============================================================================
|
patrick@20
|
131 |
# SECTION LEVEL
|
patrick@0
|
132 |
# =============================================================================
|
patrick@0
|
133 |
|
Patrick@137
|
134 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@137
|
135 |
|
Patrick@137
|
136 |
header = element header { header.content }
|
Patrick@137
|
137 |
|
Patrick@137
|
138 |
header.content =
|
Patrick@137
|
139 |
block+
|
Patrick@137
|
140 |
|
patrick@20
|
141 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
142 |
|
patrick@90
|
143 |
# ~~~~~~ section
|
patrick@58
|
144 |
section = element section { section.attributes, section.content }
|
patrick@58
|
145 |
|
patrick@58
|
146 |
section.attributes =
|
patrick@58
|
147 |
section.type.attribute?
|
patrick@64
|
148 |
& lang.attribute?
|
patrick@58
|
149 |
section.type.attribute = attribute type { xsd:NCName }
|
patrick@0
|
150 |
|
patrick@0
|
151 |
section.content =
|
patrick@20
|
152 |
section.head?,
|
patrick@9
|
153 |
(section+ | block+)
|
patrick@0
|
154 |
|
patrick@90
|
155 |
# ~~~~~~ section.head
|
patrick@90
|
156 |
section.head = element head { section.head.content }
|
patrick@90
|
157 |
|
patrick@90
|
158 |
section.head.content =
|
patrick@127
|
159 |
(title, shorttitle?, subtitle?)?
|
patrick@90
|
160 |
& abstract?
|
patrick@105
|
161 |
& audio*
|
patrick@90
|
162 |
& annotation*
|
patrick@90
|
163 |
|
Patrick@137
|
164 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@137
|
165 |
|
Patrick@137
|
166 |
footer = element footer { footer.content }
|
Patrick@137
|
167 |
|
Patrick@137
|
168 |
footer.content =
|
Patrick@137
|
169 |
block+
|
Patrick@137
|
170 |
|
patrick@0
|
171 |
|
patrick@0
|
172 |
# =============================================================================
|
patrick@20
|
173 |
# BLOCK LEVEL
|
patrick@0
|
174 |
# =============================================================================
|
patrick@0
|
175 |
|
patrick@20
|
176 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@9
|
177 |
|
patrick@90
|
178 |
# ~~~~~~ block
|
patrick@44
|
179 |
block = (p | speech | \list | blockquote | table | media)
|
patrick@9
|
180 |
|
patrick@90
|
181 |
# ~~~~~~ block.head
|
patrick@90
|
182 |
block.head = element head { block.head.content }
|
patrick@90
|
183 |
|
patrick@90
|
184 |
block.head.content =
|
patrick@127
|
185 |
(title, shorttitle?, subtitle?)?
|
patrick@90
|
186 |
|
patrick@42
|
187 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
188 |
|
patrick@20
|
189 |
p = element p { p.content }
|
patrick@0
|
190 |
|
patrick@20
|
191 |
p.content =
|
patrick@0
|
192 |
inlines
|
patrick@0
|
193 |
|
patrick@18
|
194 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@18
|
195 |
|
patrick@18
|
196 |
# ~~~~~~ speech
|
patrick@18
|
197 |
speech = element speech { speech.content }
|
patrick@18
|
198 |
|
patrick@18
|
199 |
speech.content =
|
patrick@18
|
200 |
speaker?,
|
patrick@18
|
201 |
stage?,
|
patrick@20
|
202 |
p+
|
patrick@18
|
203 |
|
patrick@18
|
204 |
# ~~~~~~ speaker
|
patrick@18
|
205 |
speaker = element speaker { speaker.content }
|
patrick@18
|
206 |
|
patrick@18
|
207 |
speaker.content = inlines
|
patrick@18
|
208 |
|
patrick@18
|
209 |
# ~~~~~~ stage
|
patrick@18
|
210 |
stage = element stage { stage.content }
|
patrick@18
|
211 |
|
patrick@18
|
212 |
stage.content = inlines
|
patrick@18
|
213 |
|
patrick@17
|
214 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@9
|
215 |
|
patrick@9
|
216 |
# ~~~~~~ list
|
patrick@75
|
217 |
\list = element list {
|
patrick@20
|
218 |
block.head?,
|
patrick@71
|
219 |
( (attribute type {"ordered"}?, item, item+)
|
patrick@9
|
220 |
| (attribute type {"glossary"}, glossary.item+) )
|
patrick@75
|
221 |
}
|
patrick@9
|
222 |
|
patrick@9
|
223 |
# ~~~~~~ item
|
patrick@9
|
224 |
item = element item { item.content }
|
patrick@9
|
225 |
|
patrick@30
|
226 |
item.content =
|
patrick@73
|
227 |
inlines
|
patrick@73
|
228 |
| block+
|
patrick@9
|
229 |
|
patrick@9
|
230 |
# ~~~~~~ glossary.item
|
patrick@9
|
231 |
glossary.item = element item { glossary.item.content }
|
patrick@9
|
232 |
|
patrick@9
|
233 |
glossary.item.content =
|
patrick@9
|
234 |
label,
|
patrick@9
|
235 |
block+
|
patrick@9
|
236 |
|
patrick@44
|
237 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@44
|
238 |
|
patrick@44
|
239 |
# ~~~~~~ blockquote
|
patrick@44
|
240 |
blockquote = element blockquote { blockquote.content }
|
patrick@44
|
241 |
|
patrick@44
|
242 |
blockquote.content =
|
patrick@44
|
243 |
block.head?,
|
patrick@44
|
244 |
(p | speech | \list)+,
|
patrick@44
|
245 |
attribution?
|
patrick@44
|
246 |
|
patrick@44
|
247 |
# ~~~~~~ attribution
|
patrick@72
|
248 |
attribution = element attribution { attribution.content }
|
patrick@44
|
249 |
|
patrick@72
|
250 |
attribution.content =
|
patrick@44
|
251 |
inlines
|
patrick@44
|
252 |
|
patrick@17
|
253 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@17
|
254 |
|
patrick@73
|
255 |
# ~~~~~~ table
|
patrick@17
|
256 |
table = element table { table.content }
|
patrick@17
|
257 |
|
patrick@17
|
258 |
table.content =
|
patrick@20
|
259 |
block.head?,
|
patrick@17
|
260 |
tgroup+,
|
patrick@109
|
261 |
table.caption?
|
patrick@17
|
262 |
|
patrick@17
|
263 |
# ~~~~~~ tgroup
|
patrick@17
|
264 |
tgroup = element tgroup { tgroup.attributes, tgroup.content }
|
patrick@17
|
265 |
|
patrick@17
|
266 |
tgroup.content =
|
patrick@17
|
267 |
thead?,
|
patrick@17
|
268 |
tfoot?,
|
patrick@17
|
269 |
tbody
|
patrick@17
|
270 |
|
patrick@17
|
271 |
tgroup.attributes =
|
patrick@17
|
272 |
cols.attribute
|
patrick@17
|
273 |
& align.attribute?
|
patrick@17
|
274 |
& colsep.attribute?
|
patrick@17
|
275 |
& rowsep.attribute?
|
patrick@17
|
276 |
cols.attribute = attribute cols { xsd:positiveInteger }
|
patrick@17
|
277 |
align.attribute = attribute align { "left" | "right" | "center" | "justify" }
|
patrick@17
|
278 |
colsep.attribute = attribute colsep { "0" | "1" }
|
patrick@17
|
279 |
rowsep.attribute = attribute rowsep { "0" | "1" }
|
patrick@17
|
280 |
|
patrick@17
|
281 |
# ~~~~~~ thead, tfoot, tbody
|
patrick@22
|
282 |
thead = element thead { thead.attributes, thead.content }
|
patrick@22
|
283 |
tfoot = element tfoot { tfoot.attributes, tfoot.content }
|
patrick@22
|
284 |
tbody = element tbody { tbody.attributes, tbody.content }
|
patrick@17
|
285 |
|
patrick@22
|
286 |
thead.attributes =
|
patrick@22
|
287 |
valign.attribute?
|
patrick@22
|
288 |
tfoot.attributes =
|
patrick@22
|
289 |
valign.attribute?
|
patrick@22
|
290 |
tbody.attributes =
|
patrick@22
|
291 |
valign.attribute?
|
patrick@22
|
292 |
valign.attribute = attribute valign { "top" | "middle" | "bottom" }
|
patrick@75
|
293 |
|
patrick@17
|
294 |
thead.content =
|
patrick@17
|
295 |
row+
|
patrick@17
|
296 |
tfoot.content =
|
patrick@17
|
297 |
row+
|
patrick@17
|
298 |
tbody.content =
|
patrick@17
|
299 |
row+
|
patrick@17
|
300 |
|
patrick@17
|
301 |
# ~~~~~~ row
|
patrick@17
|
302 |
row = element row { row.attribute, row.content }
|
patrick@17
|
303 |
|
patrick@17
|
304 |
row.attribute =
|
patrick@17
|
305 |
valign.attribute?
|
patrick@17
|
306 |
|
patrick@17
|
307 |
row.content =
|
patrick@17
|
308 |
entry+
|
patrick@17
|
309 |
|
patrick@17
|
310 |
# ~~~~~~ entry
|
patrick@17
|
311 |
entry = element entry { entry.content }
|
patrick@17
|
312 |
|
patrick@17
|
313 |
entry.content =
|
patrick@17
|
314 |
inlines
|
patrick@37
|
315 |
| (p | media)+
|
patrick@17
|
316 |
|
patrick@109
|
317 |
# ~~~~~~ table.caption
|
patrick@109
|
318 |
table.caption = element caption { caption.content }
|
patrick@17
|
319 |
|
patrick@17
|
320 |
caption.content =
|
patrick@20
|
321 |
inlines
|
Patrick@138
|
322 |
| (p | speech | \list | blockquote)+
|
patrick@17
|
323 |
|
patrick@35
|
324 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
325 |
|
patrick@2
|
326 |
# ~~~~~~ media
|
patrick@0
|
327 |
media = element media { media.content }
|
patrick@0
|
328 |
|
patrick@0
|
329 |
media.content =
|
patrick@24
|
330 |
block.head?,
|
patrick@119
|
331 |
(image | audio | video)+,
|
patrick@109
|
332 |
media.caption?,
|
patrick@36
|
333 |
link?
|
patrick@0
|
334 |
|
patrick@2
|
335 |
# ~~~~~~ image
|
patrick@0
|
336 |
image = element image { image.attributes, image.content }
|
patrick@0
|
337 |
|
patrick@0
|
338 |
image.attributes =
|
patrick@104
|
339 |
media.id.attribute
|
patrick@104
|
340 |
& image.type?
|
patrick@17
|
341 |
media.id.attribute = attribute id { xsd:NMTOKEN }
|
patrick@134
|
342 |
image.type = attribute type { "cover" | "thumbnail" | "icon" }
|
patrick@0
|
343 |
|
patrick@0
|
344 |
image.content =
|
patrick@111
|
345 |
copyright?,
|
patrick@122
|
346 |
hotspot*,
|
patrick@111
|
347 |
tooltip*
|
patrick@0
|
348 |
|
patrick@45
|
349 |
# ~~~~~~ audio
|
patrick@45
|
350 |
audio = element audio { audio.attributes }
|
patrick@43
|
351 |
|
patrick@45
|
352 |
audio.attributes =
|
patrick@43
|
353 |
media.id.attribute
|
patrick@104
|
354 |
& audio.type?
|
patrick@113
|
355 |
audio.type = attribute type { "music" | "voice" | "background" | "smil" }
|
patrick@43
|
356 |
|
patrick@119
|
357 |
# ~~~~~~ video
|
patrick@119
|
358 |
video = element video { video.attributes }
|
patrick@119
|
359 |
|
patrick@119
|
360 |
video.attributes =
|
patrick@119
|
361 |
media.id.attribute
|
patrick@119
|
362 |
|
patrick@122
|
363 |
# ~~~~~~ hotspot
|
patrick@122
|
364 |
|
patrick@122
|
365 |
hotspot = element hotspot { hotspot.attributes, hotspot.content }
|
patrick@122
|
366 |
|
patrick@122
|
367 |
hotspot.attributes =
|
patrick@122
|
368 |
x.attribute
|
patrick@122
|
369 |
& y.attribute
|
patrick@122
|
370 |
& (width.attribute & height.attribute)?
|
patrick@122
|
371 |
x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d)?%"} }
|
patrick@122
|
372 |
y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d)?%"} }
|
patrick@122
|
373 |
width.attribute = attribute width { xsd:token {pattern = "\d{1,2}(\.\d)?%"} }
|
patrick@122
|
374 |
height.attribute = attribute height { xsd:token {pattern = "\d{1,2}(\.\d)?%"} }
|
patrick@122
|
375 |
|
patrick@122
|
376 |
hotspot.content =
|
patrick@122
|
377 |
(link | audio | video)
|
patrick@122
|
378 |
|
patrick@109
|
379 |
# ~~~~~~ tooltip
|
patrick@109
|
380 |
|
patrick@109
|
381 |
tooltip = element tooltip { tooltip.attributes, tooltip.content }
|
patrick@109
|
382 |
|
patrick@109
|
383 |
tooltip.attributes =
|
patrick@109
|
384 |
x.attribute
|
patrick@109
|
385 |
& y.attribute
|
patrick@109
|
386 |
& dx.attribute?
|
patrick@109
|
387 |
& dy.attribute?
|
patrick@120
|
388 |
dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d)?"} }
|
patrick@120
|
389 |
dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d)?"} }
|
patrick@109
|
390 |
|
patrick@109
|
391 |
tooltip.content =
|
patrick@122
|
392 |
(p+ | image)
|
patrick@109
|
393 |
|
patrick@109
|
394 |
# ~~~~~~ media.caption
|
patrick@109
|
395 |
media.caption = element caption { caption.attributes, caption.content }
|
patrick@109
|
396 |
|
patrick@109
|
397 |
caption.attributes =
|
patrick@109
|
398 |
x.attribute?
|
patrick@109
|
399 |
& y.attribute?
|
patrick@109
|
400 |
|
patrick@0
|
401 |
|
patrick@0
|
402 |
# =============================================================================
|
patrick@90
|
403 |
# HEAD LEVEL
|
patrick@90
|
404 |
# =============================================================================
|
patrick@90
|
405 |
|
patrick@127
|
406 |
# ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
407 |
|
patrick@90
|
408 |
title = element title { title.content }
|
patrick@127
|
409 |
shorttitle = element shorttitle { title.content }
|
patrick@90
|
410 |
subtitle = element subtitle { title.content }
|
patrick@90
|
411 |
|
patrick@90
|
412 |
title.content = inlines
|
patrick@90
|
413 |
|
patrick@90
|
414 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
415 |
|
patrick@90
|
416 |
identifier.uri = element identifier {
|
patrick@90
|
417 |
attribute type { "uri" }, xsd:anyURI
|
patrick@90
|
418 |
}
|
patrick@90
|
419 |
|
patrick@90
|
420 |
identifier.ean = element identifier {
|
patrick@90
|
421 |
attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
|
patrick@90
|
422 |
}
|
patrick@90
|
423 |
|
patrick@90
|
424 |
identifier = identifier.uri | identifier.ean
|
patrick@90
|
425 |
|
patrick@90
|
426 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
427 |
|
patrick@90
|
428 |
copyright = element copyright { copyright.content }
|
patrick@90
|
429 |
|
patrick@90
|
430 |
copyright.content = inlines
|
patrick@90
|
431 |
|
patrick@90
|
432 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
433 |
|
patrick@90
|
434 |
# ~~~~~~ contributors
|
patrick@90
|
435 |
contributors = element contributors { contributors.content }
|
patrick@90
|
436 |
|
patrick@90
|
437 |
contributors.content =
|
patrick@90
|
438 |
contributor+
|
patrick@90
|
439 |
|
patrick@90
|
440 |
# ~~~~~~ contributor
|
patrick@90
|
441 |
contributor = element contributor { contributor.content }
|
patrick@90
|
442 |
|
patrick@90
|
443 |
contributor.content =
|
patrick@90
|
444 |
(((firstname, secondname?)?, lastname) | label),
|
patrick@90
|
445 |
address?,
|
patrick@90
|
446 |
link?,
|
patrick@101
|
447 |
role+
|
patrick@90
|
448 |
|
patrick@90
|
449 |
# ~~~~~~ firstname, secondname, lastname, label
|
patrick@90
|
450 |
firstname = element firstname { firstname.content }
|
patrick@90
|
451 |
secondname = element secondname { secondname.content }
|
patrick@90
|
452 |
lastname = element lastname { lastname.content }
|
patrick@90
|
453 |
label = element label { label.content }
|
patrick@90
|
454 |
|
patrick@90
|
455 |
firstname.content = inlines
|
patrick@90
|
456 |
secondname.content = inlines
|
patrick@90
|
457 |
lastname.content = inlines
|
patrick@90
|
458 |
label.content = inlines
|
patrick@90
|
459 |
|
patrick@90
|
460 |
# ~~~~~~ address
|
patrick@90
|
461 |
address = element address { address.content }
|
patrick@90
|
462 |
|
patrick@90
|
463 |
address.content = inlines
|
patrick@90
|
464 |
|
patrick@90
|
465 |
# ~~~~~~ role
|
patrick@90
|
466 |
role = element role { role.content }
|
patrick@90
|
467 |
|
patrick@90
|
468 |
role.content = "author" | "illustrator" | "publisher" | "packager"
|
patrick@90
|
469 |
|
patrick@90
|
470 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
471 |
|
patrick@90
|
472 |
place = element place { place.content }
|
patrick@90
|
473 |
|
patrick@90
|
474 |
place.content = inlines
|
patrick@90
|
475 |
|
patrick@90
|
476 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
477 |
|
patrick@90
|
478 |
# ~~~~~~ source
|
patrick@90
|
479 |
source = element source {
|
patrick@90
|
480 |
( (attribute type { "book" }, source.content.book)
|
patrick@90
|
481 |
| (attribute type { "file" }, source.content.file)),
|
patrick@90
|
482 |
source.content
|
patrick@90
|
483 |
}
|
patrick@90
|
484 |
|
patrick@90
|
485 |
source.content.book =
|
patrick@90
|
486 |
identifier.ean,
|
patrick@90
|
487 |
title?,
|
patrick@90
|
488 |
pagenumber*
|
patrick@90
|
489 |
source.content.file =
|
patrick@90
|
490 |
identifier.uri
|
patrick@90
|
491 |
source.content =
|
patrick@90
|
492 |
annotation*
|
patrick@90
|
493 |
|
patrick@90
|
494 |
# ~~~~~~ pagenumber
|
patrick@90
|
495 |
pagenumber = element pagenumber { pagenumber.content }
|
patrick@90
|
496 |
|
patrick@90
|
497 |
pagenumber.content = xsd:positiveInteger
|
patrick@90
|
498 |
|
patrick@132
|
499 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
500 |
|
patrick@90
|
501 |
# ~~~~~~ keywordset
|
patrick@90
|
502 |
keywordset = element keywordset { keywordset.content }
|
patrick@90
|
503 |
|
patrick@90
|
504 |
keywordset.content = keyword+
|
patrick@90
|
505 |
|
patrick@90
|
506 |
# ~~~~~~ keyword
|
patrick@90
|
507 |
keyword = element keyword { keyword.content }
|
patrick@90
|
508 |
|
patrick@90
|
509 |
keyword.content = mixed { sup*, sub* }
|
patrick@90
|
510 |
|
patrick@90
|
511 |
# ~~~~~~ subjectset
|
patrick@90
|
512 |
subjectset = element subjectset { subjectset.content }
|
patrick@90
|
513 |
|
patrick@90
|
514 |
subjectset.content = subject+
|
patrick@90
|
515 |
|
patrick@90
|
516 |
# ~~~~~~ subject
|
patrick@132
|
517 |
subject = element subject { subject.content }
|
patrick@90
|
518 |
|
patrick@132
|
519 |
subject.content = xsd:NMTOKEN
|
patrick@90
|
520 |
|
patrick@90
|
521 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
522 |
|
patrick@90
|
523 |
abstract = element abstract { abstract.content }
|
patrick@90
|
524 |
|
patrick@90
|
525 |
abstract.content =
|
patrick@90
|
526 |
p+
|
patrick@90
|
527 |
|
patrick@90
|
528 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
529 |
|
patrick@90
|
530 |
cover = element cover { cover.content }
|
patrick@90
|
531 |
|
patrick@90
|
532 |
cover.content =
|
patrick@90
|
533 |
cover.image
|
patrick@90
|
534 |
|
patrick@90
|
535 |
cover.image = element image { cover.image.attributes }
|
patrick@90
|
536 |
|
patrick@90
|
537 |
cover.image.attributes =
|
patrick@90
|
538 |
cover.image.id.attribute
|
patrick@90
|
539 |
cover.image.id.attribute = attribute id { xsd:NMTOKEN }
|
patrick@105
|
540 |
|
patrick@90
|
541 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
542 |
|
patrick@90
|
543 |
annotation = element annotation { annotation.content }
|
patrick@90
|
544 |
|
patrick@90
|
545 |
annotation.content = inlines
|
patrick@90
|
546 |
|
patrick@90
|
547 |
|
patrick@90
|
548 |
# =============================================================================
|
patrick@20
|
549 |
# INLINE LEVEL
|
patrick@0
|
550 |
# =============================================================================
|
patrick@0
|
551 |
|
patrick@0
|
552 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
553 |
|
patrick@0
|
554 |
inlines = mixed {
|
patrick@0
|
555 |
sup*
|
patrick@0
|
556 |
& sub*
|
patrick@42
|
557 |
& var*
|
patrick@13
|
558 |
& number*
|
patrick@42
|
559 |
& math*
|
patrick@0
|
560 |
& date*
|
patrick@0
|
561 |
& name*
|
patrick@5
|
562 |
& note*
|
patrick@0
|
563 |
& foreign*
|
patrick@0
|
564 |
& highlight*
|
patrick@5
|
565 |
& quote*
|
patrick@8
|
566 |
& acronym*
|
Patrick@140
|
567 |
& mentioned*
|
patrick@8
|
568 |
& term*
|
Patrick@140
|
569 |
& literal*
|
patrick@25
|
570 |
& link*
|
patrick@42
|
571 |
& anchor*
|
patrick@91
|
572 |
& initial*
|
patrick@93
|
573 |
& image*
|
patrick@105
|
574 |
& smil*
|
patrick@0
|
575 |
}
|
patrick@0
|
576 |
|
patrick@42
|
577 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
578 |
|
patrick@42
|
579 |
sup = element sup { text }
|
patrick@0
|
580 |
|
patrick@42
|
581 |
sub = element sub { text }
|
patrick@42
|
582 |
|
patrick@42
|
583 |
var = element var { text }
|
patrick@42
|
584 |
|
patrick@90
|
585 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@90
|
586 |
|
patrick@90
|
587 |
number = element number {
|
patrick@90
|
588 |
( attribute type {"roman"}, number.attributes, number.roman.content )
|
patrick@90
|
589 |
| ( number.attributes, number.content)
|
patrick@90
|
590 |
}
|
patrick@90
|
591 |
|
patrick@90
|
592 |
number.attributes =
|
patrick@90
|
593 |
number.value.attribute?
|
patrick@90
|
594 |
number.value.attribute = attribute value { xsd:integer | xsd:decimal }
|
patrick@90
|
595 |
|
patrick@90
|
596 |
number.content = mixed { sup* }
|
patrick@90
|
597 |
number.roman.content = xsd:token {pattern = "[dlxvi]+"}
|
patrick@90
|
598 |
|
patrick@42
|
599 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@42
|
600 |
|
patrick@42
|
601 |
math = element math {
|
patrick@42
|
602 |
( attribute notation {"tex"}, math.attributes, math.tex.content )
|
patrick@42
|
603 |
| ( math.attributes, math.content)
|
patrick@42
|
604 |
}
|
patrick@42
|
605 |
|
patrick@42
|
606 |
math.attributes =
|
patrick@42
|
607 |
wide.attribute?
|
patrick@42
|
608 |
wide.attribute = attribute wide { xsd:boolean }
|
patrick@42
|
609 |
|
patrick@42
|
610 |
math.content = mixed { sup* & sub* & var* }
|
patrick@42
|
611 |
math.tex.content = text
|
patrick@0
|
612 |
|
patrick@36
|
613 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
614 |
|
patrick@0
|
615 |
date = element date { date.attributes, date.content }
|
patrick@0
|
616 |
|
patrick@3
|
617 |
date.attributes =
|
patrick@13
|
618 |
date.value.attribute
|
patrick@13
|
619 |
& date.of.attribute?
|
patrick@13
|
620 |
date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
|
patrick@33
|
621 |
date.of.attribute = attribute of { "birth" | "death" }
|
patrick@0
|
622 |
|
patrick@13
|
623 |
date.content = mixed { sup* }
|
patrick@0
|
624 |
|
patrick@36
|
625 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
626 |
|
patrick@0
|
627 |
name = element name { name.attributes, name.content }
|
patrick@2
|
628 |
|
patrick@2
|
629 |
name.attributes =
|
patrick@2
|
630 |
name.of.attribute?
|
patrick@33
|
631 |
name.of.attribute = attribute of
|
Patrick@135
|
632 |
{ "person" | "company" | "book" | "newspaper" | "party" | "painting" }
|
patrick@0
|
633 |
|
patrick@2
|
634 |
name.content = inlines
|
patrick@2
|
635 |
|
patrick@36
|
636 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
637 |
|
patrick@5
|
638 |
note = element note { note.attributes, note.content }
|
patrick@0
|
639 |
|
patrick@5
|
640 |
note.attributes =
|
patrick@5
|
641 |
note.label.attribute?
|
patrick@5
|
642 |
note.label.attribute = attribute label { text }
|
patrick@0
|
643 |
|
patrick@5
|
644 |
note.content =
|
patrick@91
|
645 |
(w, p+) | inlines
|
patrick@91
|
646 |
|
patrick@91
|
647 |
w = element w { inlines }
|
patrick@0
|
648 |
|
patrick@36
|
649 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
650 |
|
patrick@0
|
651 |
foreign = element foreign { foreign.attributes, foreign.content }
|
patrick@0
|
652 |
|
patrick@9
|
653 |
foreign.attributes =
|
patrick@9
|
654 |
lang.attribute?
|
patrick@0
|
655 |
|
patrick@0
|
656 |
foreign.content = inlines
|
patrick@0
|
657 |
|
patrick@36
|
658 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
659 |
|
patrick@0
|
660 |
highlight = element highlight { highlight.content }
|
patrick@0
|
661 |
|
patrick@0
|
662 |
highlight.content = inlines
|
patrick@0
|
663 |
|
patrick@36
|
664 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@5
|
665 |
|
patrick@5
|
666 |
quote = element quote { quote.content }
|
patrick@5
|
667 |
|
patrick@131
|
668 |
quote.content =
|
patrick@131
|
669 |
(phrase, attribution) | inlines
|
patrick@131
|
670 |
|
patrick@131
|
671 |
phrase = element phrase { phrase.content }
|
patrick@131
|
672 |
|
patrick@131
|
673 |
phrase.content = inlines
|
patrick@5
|
674 |
|
patrick@36
|
675 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@8
|
676 |
|
patrick@8
|
677 |
acronym = element acronym { acronym.content }
|
patrick@8
|
678 |
|
patrick@8
|
679 |
acronym.content = inlines
|
patrick@8
|
680 |
|
Patrick@140
|
681 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@140
|
682 |
|
Patrick@140
|
683 |
mentioned = element mentioned { mentioned.content }
|
Patrick@140
|
684 |
|
Patrick@140
|
685 |
mentioned.content = inlines
|
Patrick@140
|
686 |
|
patrick@36
|
687 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@8
|
688 |
|
patrick@8
|
689 |
term = element term { term.content }
|
patrick@8
|
690 |
|
patrick@8
|
691 |
term.content = inlines
|
patrick@8
|
692 |
|
Patrick@140
|
693 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ literal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@140
|
694 |
|
Patrick@140
|
695 |
literal = element literal { literal.content }
|
Patrick@140
|
696 |
|
Patrick@140
|
697 |
literal.content = text
|
Patrick@140
|
698 |
|
patrick@36
|
699 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
700 |
|
patrick@0
|
701 |
link = element link { link.attributes, link.content }
|
patrick@0
|
702 |
|
patrick@9
|
703 |
link.attributes =
|
patrick@42
|
704 |
(uri.attribute | idref.attribute)
|
patrick@9
|
705 |
uri.attribute = attribute uri { xsd:anyURI }
|
patrick@9
|
706 |
idref.attribute = attribute idref { xsd:IDREF }
|
patrick@0
|
707 |
|
patrick@0
|
708 |
link.content = inlines
|
patrick@42
|
709 |
|
patrick@42
|
710 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@42
|
711 |
|
patrick@43
|
712 |
anchor = element anchor { anchor.attributes }
|
patrick@42
|
713 |
|
patrick@42
|
714 |
anchor.attributes =
|
patrick@42
|
715 |
anchor.id.attribute
|
patrick@42
|
716 |
anchor.id.attribute = attribute xml:id { xsd:ID }
|
patrick@91
|
717 |
|
patrick@91
|
718 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@91
|
719 |
|
patrick@91
|
720 |
initial = element initial { initial.content }
|
patrick@91
|
721 |
|
patrick@91
|
722 |
initial.content =
|
patrick@91
|
723 |
c,
|
patrick@91
|
724 |
w?
|
patrick@91
|
725 |
|
patrick@91
|
726 |
c = element c { text }
|
patrick@105
|
727 |
|
patrick@105
|
728 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@105
|
729 |
|
patrick@105
|
730 |
smil = element smil { smil.attributes, smil.content }
|
patrick@105
|
731 |
|
patrick@105
|
732 |
smil.attributes =
|
patrick@105
|
733 |
begin.attribute?
|
patrick@105
|
734 |
& end.attribute?
|
patrick@105
|
735 |
begin.attribute = attribute begin { xsd:decimal }
|
patrick@105
|
736 |
end.attribute = attribute end { xsd:decimal }
|
patrick@105
|
737 |
|
patrick@105
|
738 |
smil.content = inlines
|