summaryrefslogtreecommitdiff
path: root/schema/mathml2/presentation/layout.xsd
blob: 80b005efd7e9b6fb0a5f82f0eb8ebfe775f792b5 (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
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema 
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns="http://www.w3.org/1998/Math/MathML"
  targetNamespace="http://www.w3.org/1998/Math/MathML"
  elementFormDefault="qualified"
 >
<xs:annotation>
  <xs:documentation>
  This is the XML schema module for the layout elements of the 
  presentation part of MathML.
  Author: St&#233;phane Dalmas, INRIA.
  </xs:documentation>
</xs:annotation>

<!-- "mrow" -->

<xs:attributeGroup name="mrow.attlist">
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="mrow.type">
  <xs:group ref="Presentation-expr.class" minOccurs="0" maxOccurs="unbounded"/>
  <xs:attributeGroup ref="mrow.attlist"/>
</xs:complexType>

<xs:element name="mrow" type="mrow.type"/>

<!-- "mfrac" -->

<xs:attributeGroup name="mfrac.attlist">
  <xs:attribute name="bevelled" type="xs:boolean"/>
  <xs:attribute name="denomalign" type="centering" default="center"/>
  <xs:attribute name="numalign" type="centering" default="center"/>
  <xs:attribute name="linethickness" default="1">
    <xs:simpleType>
      <xs:union memberTypes="length-with-optional-unit thickness"/>
    </xs:simpleType> 
  </xs:attribute>
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="mfrac.type">
  <xs:group ref="Presentation-expr.class" minOccurs="2" maxOccurs="2"/>
  <xs:attributeGroup ref="mfrac.attlist"/>
</xs:complexType>

<xs:element name="mfrac" type="mfrac.type"/>

<!-- "msqrt" -->

<xs:attributeGroup name="msqrt.attlist">
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<!-- "msqrt" has an "inferred mrow" if more than one argument -->
<xs:complexType name="msqrt.type">
  <xs:group ref="Presentation-expr.class" minOccurs="0" maxOccurs="unbounded"/>
  <xs:attributeGroup ref="msqrt.attlist"/>  
</xs:complexType>

<xs:element name="msqrt" type="msqrt.type"/>

<!-- "mroot" -->

<xs:attributeGroup name="mroot.attlist">
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="mroot.type">
  <xs:group ref="Presentation-expr.class" minOccurs="2" maxOccurs="2"/>
  <xs:attributeGroup ref="mroot.attlist"/>
</xs:complexType>

<xs:element name="mroot" type="mroot.type"/>

<!-- "mpadded" -->

<xs:simpleType name="mpadded-space">
  <xs:restriction base="xs:string">
    <xs:pattern
value="(\+|-)?([0-9]+|[0-9]*\.[0-9]+)(((%?) *(width|lspace|height|depth))|(em|ex|px|in|cm|mm|pt|pc))"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="mpadded-width-space">
  <xs:restriction base="xs:string">
    <!-- MaxF: definition from spec seems wrong, fixing to ([+|-] unsigned-number (%[pseudo-unit]|pseudo-unit|h-unit)) | namedspace | 0 -->
    <xs:pattern value="((\+|-)?([0-9]+|[0-9]*\.[0-9]+)(((%?) *(width|lspace|height|depth)?)|(width|lspace|height|depth)|(em|ex|px|in|cm|mm|pt|pc)))|((veryverythin|verythin|thin|medium|thick|verythick|veryverythick)mathspace)|0"/>
  </xs:restriction>
</xs:simpleType>

<xs:attributeGroup name="mpadded.attlist">
  <xs:attribute name="width" type="mpadded-width-space"/>
  <!-- should have default=0 below but '0' is not in value space -->
  <!-- see bug #425 -->
  <xs:attribute name="lspace" type="mpadded-space"/>
  <xs:attribute name="height" type="mpadded-space"/>
  <xs:attribute name="depth" type="mpadded-space"/>
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="mpadded.type">
  <xs:group ref="Presentation-expr.class" minOccurs="0" maxOccurs="unbounded"/>
  <xs:attributeGroup ref="mpadded.attlist"/>
</xs:complexType>

<xs:element name="mpadded" type="mpadded.type"/>

<!-- "mphantom" -->

<xs:attributeGroup name="mphantom.attlist">
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="mphantom.type">
  <xs:group ref="Presentation-expr.class" minOccurs="0" maxOccurs="unbounded"/>
  <xs:attributeGroup ref="mphantom.attlist"/>
</xs:complexType>

<xs:element name="mphantom" type="mphantom.type"/>

<!-- "mfenced" -->

<xs:attributeGroup name="mfenced.attlist">
  <xs:attribute name="open" type="xs:string" default="("/>
  <xs:attribute name="close" type="xs:string" default=")"/>
  <xs:attribute name="separators" type="xs:string" default=","/>
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="mfenced.type">
  <xs:group ref="Presentation-expr.class" minOccurs="0" maxOccurs="unbounded"/>
  <xs:attributeGroup ref="mfenced.attlist"/>
</xs:complexType>

<xs:element name="mfenced" type="mfenced.type"/>

<!-- "menclose" -->

<xs:attributeGroup name="menclose.attlist">
  <xs:attribute name="notation" default="longdiv">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="actuarial"/>
        <xs:enumeration value="longdiv"/>
        <xs:enumeration value="radical"/>
        <xs:enumeration value="box"/>
        <xs:enumeration value="roundedbox"/>
        <xs:enumeration value="circle"/>
        <xs:enumeration value="left"/>
        <xs:enumeration value="right"/>
        <xs:enumeration value="top"/>
        <xs:enumeration value="bottom"/>
        <xs:enumeration value="updiagonalstrike"/>
        <xs:enumeration value="downdiagonalstrike"/>
        <xs:enumeration value="verticalstrike"/>
        <xs:enumeration value="horizontalstrike"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:attribute>
  <xs:attributeGroup ref="Common.attrib"/>
</xs:attributeGroup>

<xs:complexType name="menclose.type">
  <xs:group ref="Presentation-expr.class" minOccurs="0" maxOccurs="unbounded"/>
  <xs:attributeGroup ref="menclose.attlist"/>
</xs:complexType>

<xs:element name="menclose" type="menclose.type"/>

<!-- And the group of everything -->

<xs:group name="Presentation-layout.class">
  <xs:choice> 
    <xs:element ref="mrow"/>
    <xs:element ref="mfrac"/>
    <xs:element ref="msqrt"/>
    <xs:element ref="mroot"/>
    <xs:element ref="mpadded"/>
    <xs:element ref="mphantom"/>
    <xs:element ref="mfenced"/>
    <xs:element ref="menclose"/>
  </xs:choice>
</xs:group>

</xs:schema>

<!--
  Copyright &#251; 2002 World Wide Web Consortium, (Massachusetts Institute
  of Technology, Institut National de Recherche en Informatique et en
  Automatique, Keio University). All Rights Reserved. See
  http://www.w3.org/Consortium/Legal/.
  -->