summaryrefslogtreecommitdiff
path: root/slides/schema/relaxng/slides.rnc
blob: 4d37f6f710cede99610b60ff91f8e5dadcc997e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
namespace db = "http://docbook.org/ns/docbook"
namespace mml = "http://www.w3.org/1998/Math/MathML"
namespace svg = "http://www.w3.org/2000/svg"
default namespace dbs = "http://docbook.org/ns/docbook-slides"

# See http://docbook.org/ns/docbook-slides

# This file is part of DocBook Slides V5.0
# 
# Copyright 2012 Gabor Kovesdan
# 
# Release: $Id$
# 
# Permission to use, copy, modify and distribute the DocBook Slides
# schema and its accompanying documentation for any purpose and without
# fee is hereby granted in perpetuity, provided that the above copyright
# notice and this paragraph appear in all copies. The copyright
# holders make no representation about the suitability of the schema
# for any purpose. It is provided "as is" without expressed or implied
# warranty.
# 
# If you modify the DocBook Slides schema in any way, label your schema
# as a variant of DocBook Slides. See the reference documentation
# (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
# for more information.
# 
# Please direct all questions, bug reports, or suggestions for changes
# to the docbook@lists.oasis-open.org mailing list. For more
# information, see http://www.oasis-open.org/docbook/.
# 
# ======================================================================

include "../../../../docbook/relaxng/docbook/docbook/docbook.rnc" inherit = db {
  start = dbs.slides
  
  # Avoid ID clashes
  db._any.attribute = attribute * - (xml:id | linkend) { text }

  db.common.attributes =
    db.xml.id.attribute?
    & db.common.base.attributes
    & db.annotations.attribute?
    & dbs.style.attributes?

  # Any element and attribute from the SVG namespace
  db._any.svg =
    element svg:* { (dbs._any.attribute | text | db._any)* }

  # Any element and attribute from the MathML namespace
  db._any.mml =
    element mml:* { (dbs._any.attribute | text | db._any)* }
}

# Any attribute from any namespace
dbs._any.attribute = attribute * { text }

dbs.all.content = db.all.blocks? &
  dbs.speakernotes &
  dbs.handoutnotes &
  db._any.svg? &
  db._any.mml? &
  dbs.block?

dbs.block =
  ## Indicates a formatting block that can have its own styling applied
  element block { dbs.block.attlist,
  dbs.all.content*
}

dbs.block.role.attribute =
  ## Role attribute for the block element
  attribute role { text }

dbs.block.status.attribute =
  ## Status attribute for the block element
  db.status.attribute

dbs.block.attlist = dbs.block.role.attribute?
  & db.common.attributes
  & db.common.linking.attributes
  & db.label.attribute?
  & dbs.block.status.attribute?

dbs.slides =
  ## Root element of a slides document
  element slides { dbs.slides.attlist,
  db._info.title.req,
  dbs.speakernotes?,
  dbs.handoutnotes?,
  (
    dbs.foil? &
    dbs.foilgroup?
  )*
}

dbs.slides.role.attribute =
  ## Role attribute for the slides element
  attribute role { text }

dbs.slides.status.attribute =
  ## Status attribute for the slides element
  db.status.attribute

dbs.slides.attlist = dbs.slides.role.attribute?
  & db.common.attributes
  & db.common.linking.attributes
  & db.label.attribute?
  & dbs.slides.status.attribute?

dbs.foilgroup = element foilgroup {
  dbs.foilgroup.attlist,
  db._info.title.req,
  dbs.all.content*,
  dbs.foil+
}

dbs.foilgroup.role.attribute =
  ## Role attribute for the foilgroup element
  attribute role { text }

dbs.foilgroup.status.attribute =
  ## Status attribute for the foilgroup element
  db.status.attribute

dbs.foilgroup.attlist = dbs.foilgroup.role.attribute?
  & db.common.attributes
  & db.common.linking.attributes
  & db.label.attribute?
  & dbs.slides.status.attribute?

dbs.foil =
  ## Indicates a foil that may have some info and content
  element foil { dbs.foil.attlist,
  db._info.title.req,
  dbs.all.content*,
  db.navigation.components*
}

dbs.foil.role.attribute =
  ## Role attribute for the foil element
  attribute role { text }

dbs.foil.status.attribute =
  ## Status attribute for the foil element
  db.status.attribute

dbs.foil.attlist = dbs.foil.role.attribute?
  & db.common.attributes
  & db.common.linking.attributes
  & db.label.attribute?
  & dbs.foil.status.attribute?

dbs.speakernotes =
  ## Indicates notes for the speaker
  element speakernotes { dbs.speakernotes.attlist,
  db.all.blocks+
}

dbs.speakernotes.role.attribute =
  ## Role attribute for the speakernotes element
  attribute role { text }

dbs.speakernotes.attlist = dbs.speakernotes.role.attribute?
  & db.common.attributes
  & db.common.linking.attributes

dbs.handoutnotes =
  ## Indicates notes that are meant for printed copies
  element handoutnotes { dbs.handoutnotes.attlist,
  db.all.blocks+
}

## Role attribute for the handoutnotes element
dbs.handoutnotes.role.attribute =
  ## Role attribute for the handoutnotes element
  attribute role { text }

dbs.handoutnotes.attlist = dbs.handoutnotes.role.attribute?
  & db.common.attributes
  & db.common.linking.attributes

dbs.style.attributes  = dbs.incremental.attribute?
  & dbs.collapsible.attribute?
  & dbs.style.attribute?

dbs.incremental.attribute =
  ## Attribute indicating an incremental part
  attribute dbs:incremental {
  ## disabled
  "0" | 
  ## enabled
  "1" }

dbs.collapsible.attribute =
  ## Attribute indicating a collapsible part
  attribute dbs:collapsible {
  ## disabled
  "0" |
  ## enabled
  "1" |
  ## enabled and expanded by default
  "expanded" }

dbs.style.attribute =
  ## Attribute indicating a formatting style class
  attribute dbs:style { text }