blob: 2d2b26db6327f54fce4371376d11046cc5fed8b3 (
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
|
# A RelaxNG for Open Mathematical documents (OMDoc 1.3) Module PRES
# $Id: omdocpres.rnc 8973 2011-09-09 12:45:16Z kohlhase $
# $HeadURL: https://svn.omdoc.org/repos/omdoc/branches/omdoc-1.3/schema/rnc/omdocpres.rnc $
# See the documentation and examples at http://www.omdoc.org
# Copyright (c) 2004-2008 Michael Kohlhase, released under the GNU Public License (GPL)
default namespace omdoc = "http://omdoc.org/ns"
omdoc.class &= notation*
## we first add the ic and ec attributes for notation contexts everywhere
ic.attrib = attribute ic {text}
ec.attrib = attribute ec {text}
idrest.attribs &= ic.attrib? & ec.attrib?
prototype.attribs = empty
prototype.model = protoexp
prototype = element prototype {tref|(prototype.attribs & prototype.model)}
protoexp = grammar {include "openmath2.rnc"
{start = omel
common.attributes = parent id.attribs}
omel |= parent proto.class
omvar |= parent proto.class
common.attributes &= parent ntn.attrib}
| grammar {include "mathml3.rnc" {start = ContExp}
ContExp |= parent proto.class
ci |= parent proto.class
CommonAtt &= parent ntn.attrib}
precedence.att = attribute precedence {xsd:integer} | attribute argprec {xsd:integer}
context.att = attribute xml:lang {text}? &
attribute context {text}? &
attribute variant {text}?
format.att = attribute format {text}?
rendering.attribs = precedence.att? & context.att & format.att
rendering.model = renderexp
rendering = element rendering {tref|(rendering.attribs & rendering.model)}
renderexp = grammar {include "mathml3-common.rnc" {start = PresentationExpression}
include "mathml3-presentation.rnc"
PresentationExpression |= parent render.class
CommonAtt &= parent ntn.attrib
mtable.content.class |= parent render.class
mtr.content.class |= parent render.class}
| (pdata|render.class)*
pdata.attribs = empty
pdata.model = text
pdata = element pdata {pdata.attribs & pdata.model}
iterexp = grammar {include "mathml3.rnc"
{start = PresentationExpression|mtr|mlabeledtr|mtd}
PresentationExpression |= parent render.class
MathML.Common.attrib &= parent ntn.attrib
mtable.content.class |= parent render.class
mtr.content.class |= parent render.class}
name.attrib = attribute name {xsd:NCName}?
triple.att = attribute cdbase {xsd:anyURI}? & name.attrib & attribute cd {xsd:NCName}?
notation.attribs = id.attribs & triple.att
notation.model = metadata.class & CMP* & prototype+ & rendering*
notation = element notation {tref|(notation.attribs & notation.model)}
# we extend the content and presentation models by metavariables
proto.class = exprlist | expr
render.class = render | iterate
ntn.attrib = attribute cr {text}? & attribute egroup {text}?
exprlist.attribs = name.attrib
exprlist.model = protoexp*
exprlist = element exprlist {exprlist.attribs & exprlist.model}
expr.attribs = name.attrib
expr.model = empty
expr = element expr {tref|(expr.attribs & expr.model)}
iterate.attribs = name.attrib & precedence.att?
iterate.model = separator & iterexp*
iterate = element iterate {tref|(iterate.attribs & iterate.model)}
render.attribs = name.attrib & precedence.att?
render.model = empty
render = element render {tref|(render.attribs & render.model)}
separator.attribs = empty
separator.model = renderexp*
separator = element separator {tref|(separator.attribs & separator.model)}
|