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