patrick@0
|
1 |
# $Id$
|
patrick@0
|
2 |
|
patrick@0
|
3 |
start = publiset
|
patrick@0
|
4 |
|
patrick@0
|
5 |
|
patrick@0
|
6 |
publiset = element publiset {
|
patrick@0
|
7 |
publiset.attributes,
|
patrick@0
|
8 |
publiset.content
|
patrick@0
|
9 |
}
|
patrick@0
|
10 |
|
patrick@0
|
11 |
publiset.attributes =
|
patrick@0
|
12 |
version.attribute
|
patrick@0
|
13 |
version.attribute = attribute version { "1.0" }
|
patrick@0
|
14 |
|
patrick@0
|
15 |
publiset.content =
|
patrick@0
|
16 |
(composition | selection)+
|
patrick@0
|
17 |
|
patrick@0
|
18 |
|
patrick@0
|
19 |
# =============================================================================
|
patrick@20
|
20 |
# TOP LEVEL
|
patrick@0
|
21 |
# =============================================================================
|
patrick@0
|
22 |
|
patrick@0
|
23 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
24 |
|
patrick@0
|
25 |
composition = element composition {
|
patrick@0
|
26 |
composition.attributes,
|
patrick@0
|
27 |
composition.content
|
patrick@0
|
28 |
}
|
patrick@0
|
29 |
|
patrick@0
|
30 |
composition.attributes =
|
patrick@0
|
31 |
composition.id.attribute
|
patrick@0
|
32 |
& remap.attributes
|
patrick@0
|
33 |
composition.id.attribute = attribute xml:id { xsd:ID }
|
patrick@0
|
34 |
|
patrick@0
|
35 |
composition.content =
|
patrick@20
|
36 |
composition.head?,
|
patrick@0
|
37 |
(composition.file | composition.division)+
|
patrick@0
|
38 |
|
patrick@0
|
39 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ selection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
40 |
|
patrick@0
|
41 |
selection = element selection {
|
patrick@0
|
42 |
selection.attributes,
|
patrick@0
|
43 |
selection.content
|
patrick@0
|
44 |
}
|
patrick@0
|
45 |
|
patrick@0
|
46 |
selection.attributes =
|
patrick@0
|
47 |
base.attribute?
|
patrick@0
|
48 |
selection.id.attribute = attribute xml:id { xsd:ID }
|
patrick@0
|
49 |
|
patrick@0
|
50 |
selection.content =
|
patrick@20
|
51 |
selection.head?,
|
patrick@0
|
52 |
(selection.file | selection.division)+
|
patrick@0
|
53 |
|
patrick@0
|
54 |
|
patrick@0
|
55 |
# =============================================================================
|
patrick@20
|
56 |
# HEAD LEVEL
|
patrick@0
|
57 |
# =============================================================================
|
patrick@0
|
58 |
|
patrick@20
|
59 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
60 |
|
patrick@20
|
61 |
composition.head = element head { head.attributes, top.head.content }
|
patrick@20
|
62 |
selection.head = element head { top.head.content }
|
patrick@20
|
63 |
division.head = element head { division.head.content }
|
patrick@0
|
64 |
|
patrick@20
|
65 |
head.attributes =
|
patrick@0
|
66 |
remap.attributes
|
patrick@0
|
67 |
|
patrick@20
|
68 |
top.head.content =
|
patrick@18
|
69 |
(title, subtitle?)?
|
patrick@18
|
70 |
& language?
|
patrick@5
|
71 |
& author*
|
patrick@5
|
72 |
& publisher?
|
patrick@5
|
73 |
& source?
|
patrick@20
|
74 |
division.head.content =
|
patrick@20
|
75 |
(title, subtitle?)?
|
patrick@20
|
76 |
& language?
|
patrick@0
|
77 |
|
patrick@0
|
78 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
79 |
|
patrick@0
|
80 |
title = element title { title.content }
|
patrick@18
|
81 |
subtitle = element subtitle { title.content }
|
patrick@2
|
82 |
|
patrick@0
|
83 |
title.content = inlines
|
patrick@0
|
84 |
|
patrick@18
|
85 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@18
|
86 |
|
patrick@18
|
87 |
language = element language { language.attributes }
|
patrick@18
|
88 |
|
patrick@18
|
89 |
language.attributes = lang.attribute
|
patrick@18
|
90 |
lang.attribute = attribute xml:lang { xsd:language }
|
patrick@0
|
91 |
|
patrick@5
|
92 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@5
|
93 |
|
patrick@5
|
94 |
# ~~~~~~ author
|
patrick@5
|
95 |
author = element author { author.content }
|
patrick@5
|
96 |
|
patrick@5
|
97 |
author.content =
|
patrick@5
|
98 |
firstname?,
|
patrick@5
|
99 |
lastname
|
patrick@5
|
100 |
|
patrick@5
|
101 |
# ~~~~~~ publisher
|
patrick@5
|
102 |
publisher = element publisher { publisher.content }
|
patrick@5
|
103 |
|
patrick@5
|
104 |
publisher.content = inlines
|
patrick@5
|
105 |
|
patrick@5
|
106 |
# ~~~~~~ firstname
|
patrick@5
|
107 |
firstname = element firstname { firstname.content }
|
patrick@5
|
108 |
|
patrick@5
|
109 |
firstname.content = inlines
|
patrick@5
|
110 |
|
patrick@5
|
111 |
# ~~~~~~ lastname
|
patrick@5
|
112 |
lastname = element lastname { lastname.content }
|
patrick@5
|
113 |
|
patrick@5
|
114 |
lastname.content = inlines
|
patrick@5
|
115 |
|
patrick@0
|
116 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
117 |
|
patrick@2
|
118 |
# ~~~~~~ source
|
patrick@0
|
119 |
source = element source {
|
patrick@0
|
120 |
source.attributes,
|
patrick@0
|
121 |
( (attribute type { "book" }, source.content.book)
|
patrick@0
|
122 |
| (attribute type { "file" }))
|
patrick@0
|
123 |
}
|
patrick@0
|
124 |
|
patrick@0
|
125 |
source.attributes =
|
patrick@0
|
126 |
source.id.attribute?
|
patrick@0
|
127 |
& remap.attributes
|
patrick@0
|
128 |
source.id.attribute = attribute id { xsd:NMTOKEN }
|
patrick@0
|
129 |
|
patrick@0
|
130 |
source.content.book =
|
patrick@0
|
131 |
title?,
|
patrick@0
|
132 |
pagenumber?
|
patrick@0
|
133 |
|
patrick@2
|
134 |
# ~~~~~~ pagenumber
|
patrick@0
|
135 |
pagenumber = element pagenumber { pagenumber.attributes }
|
patrick@2
|
136 |
|
patrick@0
|
137 |
pagenumber.attributes =
|
patrick@0
|
138 |
pagenumber.value.attribute
|
patrick@0
|
139 |
pagenumber.value.attribute = attribute value { pagenumber.value.enumeration }
|
patrick@0
|
140 |
pagenumber.value.enumeration = xsd:positiveInteger
|
patrick@0
|
141 |
|
patrick@0
|
142 |
|
patrick@0
|
143 |
# =============================================================================
|
patrick@20
|
144 |
# DIVISION LEVEL
|
patrick@0
|
145 |
# =============================================================================
|
patrick@0
|
146 |
|
patrick@0
|
147 |
composition.division = element division {
|
patrick@0
|
148 |
composition.division.attributes,
|
patrick@0
|
149 |
composition.division.content
|
patrick@0
|
150 |
}
|
patrick@0
|
151 |
selection.division = element division {
|
patrick@0
|
152 |
selection.division.attributes,
|
patrick@0
|
153 |
selection.division.content
|
patrick@0
|
154 |
}
|
patrick@0
|
155 |
|
patrick@0
|
156 |
composition.division.attributes =
|
patrick@26
|
157 |
path.attribute?
|
patrick@23
|
158 |
& xslt.attribute?
|
patrick@23
|
159 |
& xpath.attribute?
|
patrick@0
|
160 |
& remap.attributes
|
patrick@0
|
161 |
selection.division.attributes =
|
patrick@26
|
162 |
path.attribute?
|
patrick@26
|
163 |
path.attribute = attribute path { xsd:anyURI }
|
patrick@23
|
164 |
xslt.attribute = attribute xslt { xsd:anyURI }
|
patrick@23
|
165 |
xpath.attribute = attribute xpath { text }
|
patrick@0
|
166 |
|
patrick@0
|
167 |
composition.division.content =
|
patrick@20
|
168 |
composition.head?,
|
patrick@20
|
169 |
(composition.division | composition.file)+
|
patrick@0
|
170 |
selection.division.content =
|
patrick@20
|
171 |
selection.head?,
|
patrick@20
|
172 |
(selection.division | selection.file)+
|
patrick@0
|
173 |
|
patrick@0
|
174 |
|
patrick@0
|
175 |
# =============================================================================
|
patrick@20
|
176 |
# FILE LEVEL
|
patrick@0
|
177 |
# =============================================================================
|
patrick@0
|
178 |
|
patrick@0
|
179 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
180 |
|
patrick@2
|
181 |
composition.file = element file { composition.file.attributes, file.content }
|
patrick@2
|
182 |
selection.file = element file { selection.file.attributes, file.content }
|
patrick@0
|
183 |
|
patrick@0
|
184 |
composition.file.attributes =
|
patrick@23
|
185 |
xslt.attribute?
|
patrick@23
|
186 |
& xpath.attribute?
|
patrick@0
|
187 |
& remap.attributes
|
patrick@0
|
188 |
selection.file.attributes =
|
patrick@2
|
189 |
xpath.attribute?
|
patrick@23
|
190 |
& xslt.attribute?
|
patrick@0
|
191 |
|
patrick@2
|
192 |
file.content = xsd:anyURI
|
patrick@2
|
193 |
|
patrick@0
|
194 |
# =============================================================================
|
patrick@20
|
195 |
# INLINE LEVEL
|
patrick@0
|
196 |
# =============================================================================
|
patrick@0
|
197 |
|
patrick@0
|
198 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
199 |
|
patrick@0
|
200 |
inlines = mixed {
|
patrick@0
|
201 |
sup*
|
patrick@0
|
202 |
& sub*
|
patrick@0
|
203 |
}
|
patrick@0
|
204 |
|
patrick@0
|
205 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@0
|
206 |
|
patrick@0
|
207 |
sup = element sup { inlines }
|
patrick@0
|
208 |
|
patrick@0
|
209 |
sub = element sub { inlines }
|
patrick@0
|
210 |
|
patrick@0
|
211 |
|
patrick@0
|
212 |
# =============================================================================
|
patrick@20
|
213 |
# REMAP ATTRIBUTES
|
patrick@0
|
214 |
# =============================================================================
|
patrick@0
|
215 |
|
patrick@0
|
216 |
remap.attributes =
|
patrick@0
|
217 |
as.attribute?
|
patrick@0
|
218 |
& attributes.attribute?
|
patrick@0
|
219 |
as.attribute = attribute as { xsd:QName }
|
patrick@0
|
220 |
attributes.attribute =
|
patrick@0
|
221 |
attribute attributes {list { (xsd:token {pattern = "\c+=\S+"})+ }}
|