Update Muse XML schema.
[muse-el.git] / examples / muse.rnc
blob9c976d0e70c9abb87ec9e4481bfb7455a5ef41cf
1 namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
2 namespace rng = "http://relaxng.org/ns/structure/1.0"
4 #   Emacs Muse RELAX NG Schema v. 0.3
5 #   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
7 #   Author: Brad Collins (brad AT chenla DOT org)
8 #   Maintainer: Michael Olson (mwolson AT gnu DOT org)
10 #   This is free software; you can redistribute it and/or modify it
11 #   under the terms of the GNU General Public License as published by
12 #   the Free Software Foundation; either version 2 of the License, or
13 #   (at your option) any later version. This material is distributed in
14 #   the hope that it will be useful, but WITHOUT ANY WARRANTY; without
15 #   even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16 #   PARTICULAR PURPOSE. See the GNU General Public License for more
17 #   details.You should have received a copy of the GNU General Public
18 #   License along with this file; if not, write to the Free Software
19 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 #   02111-1307, USA.
22 # Commentary:
24 #   RelaxNG Compact syntax can be converted into RelaxNG XML Syntax,
25 #   DTD format and XML Schema language using free tools.
27 #   Emacs users are encouraged to use James Clarke's nxml-mode for
28 #   editing and validating XML files.  If you are in nxml-mode use the
29 #   command C-c C-s C-f to point to this schema file, say yes if you
30 #   are asked if you want to copy the file to your location, and then
31 #   C-c C-s C-a can be used to reload the schema if you make changes
32 #   to the file.
34 # History:
36 #   Version 0.1:
37 #    - Original version by Brad Collins.
39 #   Version 0.2:
40 #    - Hacked it to the point of working with Muse's QuickStart
41 #      document.
43 #   Version 0.3:
44 #    - Permit lists to be nested.
46 # Contributors:
48 # Schema:
50 start = MUSE
52    ## root element
53 MUSE =
54    element MUSE {
55       muse.element.pageinfo?
56       & muse.element.section*
57       & muse.element.p*
58       & muse.element.blockquote*
59       & muse.element.table*
60       & muse.element.list*
61       & muse.element.hr*
62       & muse.element.image*
63       & muse.element.example*
64       & muse.element.verse*
65   }
67 # ------------------------------------------------
68 #  Pageinfo elements
69 # ------------------------------------------------
70     ## pageinfo element used for metadata
71     ## for the page
72 muse.element.pageinfo = element pageinfo {
73    muse.element.title?
74    & muse.element.author?
75    & muse.element.maintainer?
76    & muse.element.pubdate? }?
78    ## page title element
79 muse.element.title = element title { text }?
81    ## page author element
82 muse.element.author = element author { text }?
84    ## page maintainer element
85 muse.element.maintainer = element maintainer  { text }?
87   ## page publication date element
88 muse.element.pubdate = element pubdate { text }?
90 # ------------------------------------------------
91 #  Block elements
92 # ------------------------------------------------
94 muse.element.section = element section {
95    muse.attribute.type?
96    & muse.attribute.level?
97    & muse.element.section*
98    & muse.element.title*
99    & muse.element.p*
100    & muse.element.blockquote*
101    & muse.element.table*
102    & muse.element.list*
103    & muse.element.hr*
104    & muse.element.image*
105    & muse.element.example*
106    & muse.element.verse*
107    & text }?
109   ## blockquote element
110 muse.element.blockquote = element blockquote {
111    muse.element.title?
112    & muse.element.p* }?
114    ## paragraph element
115 muse.element.p = element p {
116    muse.element.code*
117    & muse.element.format*
118    & muse.element.image*
119    & muse.element.link*
120    & muse.element.image*
121    & muse.element.anchor*
122    & muse.element.footnote*
123    & text }?
125    ## example element
126 muse.element.example = element example { text }?
128   ## verse element
129 muse.element.verse = element verse {
130    muse.element.line* }?
132   ## verse line element
133 muse.element.line = element line {
134    muse.element.code*
135    & muse.element.format*
136    & muse.element.image*
137    & muse.element.link*
138    & muse.element.image*
139    & muse.element.anchor*
140    & muse.element.footnote*
141    & text }?
143 # ------------------------------------------------
144 #  Unordered list elements
145 # ------------------------------------------------
147 muse.element.list = element list {
148    muse.attribute.type?
149    & muse.element.item* }?
151 muse.element.item = element item {
152    muse.element.term?
153    & muse.element.definition?
154    & muse.element.code*
155    & muse.element.format*
156    & muse.element.image*
157    & muse.element.link*
158    & muse.element.p*
159    & muse.element.blockquote*
160    & muse.element.table*
161    & muse.element.example*
162    & muse.element.verse*
163    & muse.element.list*
164    & text }?
166 # ------------------------------------------------
167 #  Definition list elements
168 # ------------------------------------------------
170 muse.element.term = element term {
171    muse.element.code*
172    & muse.element.format*
173    & muse.element.image*
174    & muse.element.link*
175    & muse.element.image*
176    & text }?
178    ## def
179 muse.element.definition = element definition {
180    muse.element.code*
181    & muse.element.format*
182    & muse.element.image*
183    & muse.element.link*
184    & muse.element.image*
185    & text }?
187 # ------------------------------------------------
188 #   Inline elements
189 # ------------------------------------------------
191   ## format element
192   ## used for emphasis, underlining, and centering paragraphs
193 muse.element.format = element format {
194    muse.attribute.type?
195    & muse.attribute.level?
196    & text }?
198   ## code element
199   ## used for small pieces of monospace text, like commands
200 muse.element.code = element code { text }?
202 muse.element.image = element image { muse.attribute.href? }?
204    ## horizontal rule element
205 muse.element.hr = element hr { empty }?
207    ## footnote element
208 muse.element.footnote = element footnote { text }?
210    ## anchor element
211 muse.element.anchor = element anchor { muse.attribute.id }?
213    ## link element
214 muse.element.link = element link {
215    muse.attribute.type?
216    & muse.attribute.href
217    & text }?
219 # ------------------------------------------------
220 #   Attributes
221 # ------------------------------------------------
223    ## type attribute
224 muse.attribute.type = attribute type { text }?
226    ## level attribute
227 muse.attribute.level = attribute level { text }?
229    ## href attribute -- must have valid URI
230 muse.attribute.href = attribute href { xsd:anyURI }?
232   ## id attribute
233 muse.attribute.id = attribute id { text }?
235 # ------------------------------------------------
236 #  Table elements
237 # ------------------------------------------------
239   ## table element
240 muse.element.table = element table {
241    muse.element.tbody*
242    & muse.element.thead*
243    & muse.element.tfoot* }?
245   ## table body element
246 muse.element.tbody = element tbody { muse.element.tr* }?
248   ## table header element
249 muse.element.thead = element thead { muse.element.tr* }?
251   ## table footer element
252 muse.element.tfoot = element tfoot { muse.element.tr* }?
254   ## table row element
255 muse.element.tr = element tr {
256    muse.element.td*
257  & muse.element.th*}?
259   ## td element
260 muse.element.td = element td { text }?
262   ## th element
263 muse.element.th = element th { text }?