Merged from muse--main--1.0 (patch 278, 281-283)
[muse-el.git] / examples / muse.rnc
blob360e511b06080b1901c4a09b9839788efb4a075b
1 namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
2 namespace rng = "http://relaxng.org/ns/structure/1.0"
4 #   Muse-Mode RELAX NG Schema ver. alpha 0.1 
5 #   Copyright (C) 2005  Free Software Foundation, Inc.
7 #   This is free software; you can redistribute it and/or modify it
8 #   under the terms of the GNU General Public License as published by
9 #   the Free Software Foundation; either version 2 of the License, or
10 #   (at your option) any later version. This material is distributed in
11 #   the hope that it will be useful, but WITHOUT ANY WARRANTY; without
12 #   even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 #   PARTICULAR PURPOSE. See the GNU General Public License for more
14 #   details.You should have received a copy of the GNU General Public
15 #   License along with this file; if not, write to the Free Software
16 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 #   02111-1307, USA.
19 # Commentary:
21 #   RelaxNG Compact syntax can be converted into RelaxNG XML Syntax,
22 #   DTD format and XML Schema language using free tools.
24 #   Emacs users are encouraged to use James Clarke's nxml-mode for
25 #   editing editing and validating XML files.  If you are in nxml-mode
26 #   use the command C-c C-s to point to this schema file, say yes if
27 #   you are asked if you want to copy the file to your location, and
28 #   then C-c C-a can be used to reload the schema if you make changes
29 #   to the file.
31 # Contributors:
32
33 # Brad Collins (brad AT chenla DOT org) wrote the initial file.
35 start = page
37    ## root element
38 page = 
39    element page { 
40       muse.attribute.type
41       & muse.element.pageinfo?
42       & muse.element.section*  }
43 # ------------------------------------------------
44 #  Pageinfo elements
45 # ------------------------------------------------
46     ## pageinfo element used for metadata 
47     ## for the page
48 muse.element.pageinfo = element pageinfo { 
49    muse.element.title?
50    & muse.element.author?
51    & muse.element.maintainer?
52    & muse.element.pubdate? }?
54    ## page title element
55 muse.element.title = element title { text }?
57    ## page author element
58 muse.element.author = element author { text }?
60    ## page maintainer element
61 muse.element.maintainer = element maintainer  { text }?
63   ## page publication date element
64 muse.element.pubdate = element pubdate { text }?
66 # ------------------------------------------------
67 #  Block elements
68 # ------------------------------------------------
70 muse.element.section = element section { 
71    muse.attribute.type?
72    & muse.attribute.level?
73    & muse.element.section*
74    & muse.element.title*
75    & muse.element.p*
76    & muse.attribute.blockquote*
77    & muse.element.table*
78    & muse.element.list*
79    & muse.element.hr*
80    & muse.element.image*
81    & muse.element.example*
82    & muse.element.format*  # for centering paragraphs
83    & muse.element.verse*
84    & text }?
86   ## blockquote element
87 muse.attribute.blockquote = element blockquote { 
88    muse.element.title?
89    & muse.element.p* }?
91    ## paragraph element
92 muse.element.p = element p { 
93    muse.element.format*
94    & muse.element.image*
95    & muse.element.link*
96    & muse.element.image*
97    & muse.element.anchor*
98    & muse.element.footnote*
99    & text }?
101    ## example element
102 muse.element.example = element example { text }?
104    ## verse element
105 muse.element.verse = element verse { text }?
107 # ------------------------------------------------
108 #  Unordered list elements
109 # ------------------------------------------------
111 muse.element.list = element list { 
112    muse.attribute.type?
113    & muse.element.item* }?
115 muse.element.item = element item { 
116    muse.element.term?
117    & muse.element.definition?
118    & muse.element.format*
119    & muse.element.image*
120    & muse.element.link*
121    & muse.element.image*
122    & text }?
124 # ------------------------------------------------
125 #  Definition list elements
126 # ------------------------------------------------
128 muse.element.term = element term { 
129    muse.element.format*
130    & muse.element.image*
131    & muse.element.link*
132    & muse.element.image*
133    & text }?
135    ## def
136 muse.element.definition = element definition { 
137    muse.element.format*
138    & muse.element.image*
139    & muse.element.link*
140    & muse.element.image*
141    & text }?
143 # ------------------------------------------------
144 #   Inline elements
145 # ------------------------------------------------
147   ## format element
148   ## used for 
149 muse.element.format = element format { 
150    muse.attribute.type?
151    & muse.attribute.level?
152    & muse.element.p?
153    & text }?
155 muse.element.image = element image { muse.attribute.href? }?
157    ## horizontal rule element
158 muse.element.hr = element hr { empty }?
160    ## footnote element
161 muse.element.footnote = element footnote { text }?
163    ## anchor element
164 muse.element.anchor = element anchor { muse.attribute.id }?
165   
166    ## link element
167 muse.element.link = element link {
168    muse.attribute.type?
169    & muse.attribute.href
170    & text }?
172 # ------------------------------------------------
173 #   Attributes
174 # ------------------------------------------------
176    ## type attribute
177 muse.attribute.type = attribute type { text }?
179    ## level attribute
180 muse.attribute.level = attribute level { text }?
182    ## href attribute -- must have valid URI
183 muse.attribute.href = attribute href { xsd:anyURI }?
185   ## id attribute
186 muse.attribute.id = attribute id { text }?
188 # ------------------------------------------------
189 #  Table elements
190 # ------------------------------------------------
192   ## table element
193 muse.element.table = element table { 
194    muse.element.tbody* 
195    & muse.element.thead* 
196    & muse.element.tfoot* }?
198   ## table body element
199 muse.element.tbody = element tbody { muse.element.tr* }?
201   ## table header element
202 muse.element.thead = element thead { muse.element.tr* }?
204   ## table footer element
205 muse.element.tfoot = element tfoot { muse.element.tr* }?
207   ## table row element
208 muse.element.tr = element tr { 
209    muse.element.td* 
210  & muse.element.th*}?
212   ## td element
213 muse.element.td = element td { text }?
215   ## th element 
216 muse.element.th = element th { text }?