|
1 # $Id$ |
|
2 |
|
3 start = publidoc |
|
4 |
|
5 |
|
6 publidoc = element publidoc { |
|
7 publidoc.attributes, |
|
8 publidoc.content |
|
9 } |
|
10 |
|
11 # ~~~~~~ attributes |
|
12 publidoc.attributes = |
|
13 version.attribute |
|
14 |
|
15 version.attribute = attribute version { "1.0" } |
|
16 |
|
17 # ~~~~~~ content |
|
18 publidoc.content = |
|
19 document |
|
20 | top.topic |
|
21 |
|
22 |
|
23 # ============================================================================= |
|
24 # Top level |
|
25 # ============================================================================= |
|
26 |
|
27 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
28 |
|
29 document = element document { document.attributes, document.content } |
|
30 |
|
31 # ~~~~~~ attributes |
|
32 document.attributes = |
|
33 document.id.attribute |
|
34 |
|
35 document.id.attribute = attribute xml:id { xsd:ID } |
|
36 |
|
37 # ~~~~~~ content |
|
38 document.content = |
|
39 metadata?, |
|
40 (division+ | topic+) |
|
41 |
|
42 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
43 |
|
44 top.topic = element topic { top.topic.attributes, topic.content } |
|
45 |
|
46 |
|
47 # ============================================================================= |
|
48 # Metadata level |
|
49 # ============================================================================= |
|
50 |
|
51 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
52 |
|
53 metadata = element metadata { metadata.content } |
|
54 |
|
55 metadata.content = |
|
56 title |
|
57 & subtitle? |
|
58 & author* |
|
59 & publisher? |
|
60 & language? |
|
61 & date? |
|
62 & place? |
|
63 & source* |
|
64 & subjectset? |
|
65 & abstract? |
|
66 & annotation* |
|
67 |
|
68 language = element language { language.attributes } |
|
69 language.attributes = lang.attribute |
|
70 lang.attribute = attribute xml:lang { xsd:language } |
|
71 |
|
72 place = element place { place.content } |
|
73 place.content = inlines |
|
74 |
|
75 abstract = element abstract { abstract.content } |
|
76 abstract.content = parag+ |
|
77 |
|
78 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
79 |
|
80 title = element title { title.content } |
|
81 title.content = inlines |
|
82 |
|
83 subtitle = element subtitle { title.content } |
|
84 |
|
85 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
86 |
|
87 author = element author { author.content } |
|
88 |
|
89 author.content = |
|
90 firstname?, |
|
91 lastname |
|
92 |
|
93 publisher = element publisher { publisher.content } |
|
94 |
|
95 publisher.content = inlines |
|
96 |
|
97 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
98 |
|
99 source = element source { |
|
100 source.attributes, |
|
101 ( (attribute type { "book" }, source.content.book) |
|
102 | (attribute type { "file" })), |
|
103 source.content |
|
104 } |
|
105 |
|
106 # ~~~~~~ Attributes |
|
107 source.attributes = |
|
108 source.id.attribute |
|
109 |
|
110 source.id.attribute = attribute id { xsd:NMTOKEN } |
|
111 |
|
112 # ~~~~~~ Content |
|
113 source.content.book = |
|
114 title, |
|
115 pagenumber* |
|
116 |
|
117 source.content = |
|
118 annotation* |
|
119 |
|
120 pagenumber = element pagenumber { pagenumber.attributes } |
|
121 pagenumber.attributes = |
|
122 pagenumber.value.attribute |
|
123 pagenumber.value.attribute = attribute value { pagenumber.value.enumeration } |
|
124 pagenumber.value.enumeration = xsd:positiveInteger |
|
125 |
|
126 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
127 |
|
128 subjectset = element subjectset { subjectset.content } |
|
129 |
|
130 subjectset.content = subject+ |
|
131 |
|
132 subject = element subject { subject.attributes } |
|
133 subject.attributes = |
|
134 subject.id.attribute |
|
135 subject.id.attribute = attribute id { xsd:NMTOKEN } |
|
136 |
|
137 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
138 |
|
139 annotation = element annotation { annotation.content } |
|
140 |
|
141 annotation.content = inlines |
|
142 |
|
143 |
|
144 # ============================================================================= |
|
145 # Division level |
|
146 # ============================================================================= |
|
147 |
|
148 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
149 |
|
150 division = element division { division.content } |
|
151 |
|
152 division.content = |
|
153 metadata?, |
|
154 (division+ | topic+) |
|
155 |
|
156 |
|
157 # ============================================================================= |
|
158 # Component level |
|
159 # ============================================================================= |
|
160 |
|
161 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
162 |
|
163 topic = element topic { topic.attributes, topic.content } |
|
164 |
|
165 # ~~~~~~ attributes |
|
166 top.topic.attributes = |
|
167 topic.id.attribute |
|
168 & topic.type.attribute? |
|
169 |
|
170 topic.attributes = |
|
171 topic.id.attribute? |
|
172 & topic.type.attribute? |
|
173 |
|
174 topic.id.attribute = attribute xml:id { xsd:ID } |
|
175 |
|
176 topic.type.attribute = attribute type { xsd:NCName } |
|
177 |
|
178 # ~~~~~~ content |
|
179 topic.content = |
|
180 metadata?, |
|
181 section+ |
|
182 |
|
183 |
|
184 # ============================================================================= |
|
185 # Section level |
|
186 # ============================================================================= |
|
187 |
|
188 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
189 |
|
190 section = element section { section.content, section.attributes } |
|
191 |
|
192 section.content = |
|
193 metadata?, |
|
194 (section+ |
|
195 | (parag | media)+) |
|
196 |
|
197 section.attributes = |
|
198 status.attribute? |
|
199 status.attribute = attribute status { xsd:NCName } |
|
200 |
|
201 |
|
202 # ============================================================================= |
|
203 # Block level |
|
204 # ============================================================================= |
|
205 |
|
206 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
207 |
|
208 parag = element parag { parag.content } |
|
209 |
|
210 parag.content = |
|
211 inlines |
|
212 & link* |
|
213 |
|
214 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
215 |
|
216 media = element media { media.content } |
|
217 |
|
218 media.content = |
|
219 image+, |
|
220 media.caption? |
|
221 |
|
222 media.id.attribute = attribute id { xsd:NMTOKEN } |
|
223 |
|
224 media.caption = element caption { media.caption.content } |
|
225 media.caption.content = parag+ |
|
226 |
|
227 # ~~~~~~ Image |
|
228 image = element image { image.attributes, image.content } |
|
229 |
|
230 image.attributes = |
|
231 media.id.attribute |
|
232 |
|
233 image.content = |
|
234 copyright? |
|
235 |
|
236 copyright = element copyright { copyright.content } |
|
237 copyright.content = inlines |
|
238 |
|
239 |
|
240 # ============================================================================= |
|
241 # Inline level |
|
242 # ============================================================================= |
|
243 |
|
244 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
245 |
|
246 inlines = mixed { |
|
247 sup* |
|
248 & sub* |
|
249 & romannum* |
|
250 & date* |
|
251 & name* |
|
252 & footnote* |
|
253 & foreign* |
|
254 & highlight* |
|
255 } |
|
256 |
|
257 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
258 |
|
259 sup = element sup { inlines } |
|
260 |
|
261 sub = element sub { inlines } |
|
262 |
|
263 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ romannum ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
264 |
|
265 romannum = element romannum { xsd:token {pattern = "([dlxvi]+)"} } |
|
266 |
|
267 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
268 |
|
269 date = element date { date.attributes, date.content } |
|
270 |
|
271 date.attributes = date.of.attribute |
|
272 |
|
273 date.of.attribute = attribute of { date.of.enumeration } |
|
274 date.of.enumeration = "event" | "birth" | "death" |
|
275 |
|
276 date.content = xsd:date | xsd:gYearMonth | xsd:gYear |
|
277 |
|
278 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
279 |
|
280 firstname = element firstname { inlines } |
|
281 |
|
282 lastname = element lastname { inlines } |
|
283 |
|
284 name = element name { name.attributes, name.content } |
|
285 name.attributes = name.of.attribute? |
|
286 name.content = inlines |
|
287 name.of.attribute = attribute of { name.of.enumeration } |
|
288 name.of.enumeration = "person" | "company" | "book" | "newspaper" | "party" |
|
289 |
|
290 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footnote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
291 |
|
292 footnote = element footnote { footnote.attributes, footnote.content } |
|
293 |
|
294 footnote.attributes = footnote.label.attribute? |
|
295 |
|
296 footnote.label.attribute = attribute label { text } |
|
297 |
|
298 footnote.content = parag+ |
|
299 |
|
300 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
301 |
|
302 foreign = element foreign { foreign.attributes, foreign.content } |
|
303 |
|
304 foreign.attributes = lang.attribute? |
|
305 |
|
306 foreign.content = inlines |
|
307 |
|
308 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
309 |
|
310 highlight = element highlight { highlight.content } |
|
311 |
|
312 highlight.content = inlines |
|
313 |
|
314 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
315 |
|
316 link = element link { link.attributes, link.content } |
|
317 |
|
318 link.attributes = empty |
|
319 |
|
320 link.content = inlines |