Merge "Speed up ApiQuerySiteinfoTest:testContinuation"
[lhc/web/wiklou.git] / docs / export-0.11.xsd
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3 This is an XML Schema description of the format
4 output by MediaWiki's Special:Export system.
5
6 Version 0.2 adds optional basic file upload info support,
7 which is used by our OAI export/import submodule.
8
9 Version 0.3 adds some site configuration information such
10 as a list of defined namespaces.
11
12 Version 0.4 adds per-revision delete flags, log exports,
13 discussion threading data, a per-page redirect flag, and
14 per-namespace capitalization.
15
16 Version 0.5 adds byte count per revision.
17
18 Version 0.6 adds a separate namespace tag, and resolves the
19 redirect target and adds a separate sha1 tag for each revision.
20
21 Version 0.7 adds a unique identity constraint for both page and
22 revision identifiers. See also bug 4220.
23 Fix type for <ns> from "positiveInteger" to "nonNegativeInteger" to allow 0
24 Moves <logitem> to its right location.
25 Add parentid to revision.
26 Fix type for <id> within <contributor> to "nonNegativeInteger"
27
28 Version 0.8 adds support for a <model> and a <format> tag for
29 each revision. See contenthandler.txt.
30
31 Version 0.9 adds the database name to the site information.
32
33 Version 0.10 moved the <model> and <format> tags before the <text> tag.
34
35 Version 0.11 introduced <content> tag.
36
37 The canonical URL to the schema document is:
38 http://www.mediawiki.org/xml/export-0.11.xsd
39
40 Use the namespace:
41 http://www.mediawiki.org/xml/export-0.11/
42 -->
43 <schema xmlns="http://www.w3.org/2001/XMLSchema"
44 xmlns:mw="http://www.mediawiki.org/xml/export-0.11/"
45 targetNamespace="http://www.mediawiki.org/xml/export-0.11/"
46 elementFormDefault="qualified">
47
48 <annotation>
49 <documentation xml:lang="en">
50 MediaWiki's page export format
51 </documentation>
52 </annotation>
53
54 <!-- Need this to reference xml:lang -->
55 <import namespace="http://www.w3.org/XML/1998/namespace"
56 schemaLocation="http://www.w3.org/2001/xml.xsd" />
57
58 <!-- Our root element -->
59 <element name="mediawiki" type="mw:MediaWikiType">
60 <!-- Page ID contraint, see bug 4220 -->
61 <unique name="PageIDConstraint">
62 <selector xpath="mw:page" />
63 <field xpath="mw:id" />
64 </unique>
65 <!-- Revision ID contraint, see bug 4220 -->
66 <unique name="RevIDConstraint">
67 <selector xpath="mw:page/mw:revision" />
68 <field xpath="mw:id" />
69 </unique>
70 </element>
71
72 <complexType name="MediaWikiType">
73 <sequence>
74 <element name="siteinfo" type="mw:SiteInfoType"
75 minOccurs="0" maxOccurs="1" />
76 <element name="page" type="mw:PageType"
77 minOccurs="0" maxOccurs="unbounded" />
78 <element name="logitem" type="mw:LogItemType"
79 minOccurs="0" maxOccurs="unbounded" />
80 </sequence>
81 <attribute name="version" type="string" use="required" />
82 <attribute ref="xml:lang" use="required" />
83 </complexType>
84
85 <complexType name="SiteInfoType">
86 <sequence>
87 <element name="sitename" type="string" minOccurs="0" />
88 <element name="dbname" type="string" minOccurs="0" />
89 <element name="base" type="anyURI" minOccurs="0" />
90 <element name="generator" type="string" minOccurs="0" />
91 <element name="case" type="mw:CaseType" minOccurs="0" />
92 <element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
93 </sequence>
94 </complexType>
95
96 <simpleType name="CaseType">
97 <restriction base="NMTOKEN">
98 <!-- Cannot have two titles differing only by case of first letter. -->
99 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
100 <enumeration value="first-letter" />
101
102 <!-- Complete title is case-sensitive -->
103 <!-- Behavior when $wgCapitalLinks = false -->
104 <enumeration value="case-sensitive" />
105
106 <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
107 <!-- Not yet implemented as of MediaWiki 1.18 -->
108 <enumeration value="case-insensitive" />
109 </restriction>
110 </simpleType>
111
112 <simpleType name="DeletedFlagType">
113 <restriction base="NMTOKEN">
114 <enumeration value="deleted" />
115 </restriction>
116 </simpleType>
117
118 <complexType name="NamespacesType">
119 <sequence>
120 <element name="namespace" type="mw:NamespaceType"
121 minOccurs="0" maxOccurs="unbounded" />
122 </sequence>
123 </complexType>
124
125 <complexType name="NamespaceType">
126 <simpleContent>
127 <extension base="string">
128 <attribute name="key" type="integer" />
129 <attribute name="case" type="mw:CaseType" />
130 </extension>
131 </simpleContent>
132 </complexType>
133
134 <complexType name="RedirectType">
135 <simpleContent>
136 <extension base="string">
137 <attribute name="title" type="string" />
138 </extension>
139 </simpleContent>
140 </complexType>
141
142 <simpleType name="ContentModelType">
143 <restriction base="string">
144 <pattern value="[a-zA-Z][-+./a-zA-Z0-9]*" />
145 </restriction>
146 </simpleType>
147
148 <simpleType name="ContentFormatType">
149 <restriction base="string">
150 <pattern value="[a-zA-Z][-+.a-zA-Z0-9]*/[a-zA-Z][-+.a-zA-Z0-9]*" />
151 </restriction>
152 </simpleType>
153
154 <complexType name="PageType">
155 <sequence>
156 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
157 <element name="title" type="string" />
158
159 <!-- Namespace in canonical form -->
160 <element name="ns" type="nonNegativeInteger" />
161
162 <!-- optional page ID number -->
163 <element name="id" type="positiveInteger" />
164
165 <!-- flag if the current revision is a redirect -->
166 <element name="redirect" type="mw:RedirectType" minOccurs="0" maxOccurs="1" />
167
168 <!-- comma-separated list of string tokens, if present -->
169 <element name="restrictions" type="string" minOccurs="0" />
170
171 <!-- Zero or more sets of revision or upload data -->
172 <choice minOccurs="0" maxOccurs="unbounded">
173 <element name="revision" type="mw:RevisionType" />
174 <element name="upload" type="mw:UploadType" />
175 </choice>
176
177 <!-- Zero or One sets of discussion threading data -->
178 <element name="discussionthreadinginfo" minOccurs="0" maxOccurs="1" type="mw:DiscussionThreadingInfo" />
179 </sequence>
180 </complexType>
181
182 <complexType name="RevisionType">
183 <sequence>
184 <element name="id" type="positiveInteger" />
185 <element name="parentid" type="positiveInteger" minOccurs="0" maxOccurs="1"/>
186 <element name="timestamp" type="dateTime" />
187 <element name="contributor" type="mw:ContributorType" />
188 <element name="minor" minOccurs="0" maxOccurs="1"/>
189 <element name="comment" type="mw:CommentType"/>
190 <!-- corresponds to slot origin for the main slot -->
191 <element name="origin" type="positiveInteger" />
192 <!-- the main slot's content model -->
193 <element name="model" type="mw:ContentModelType" />
194 <!-- the main slot's serialization format -->
195 <element name="format" type="mw:ContentFormatType" />
196 <!-- the main slot's serialized content -->
197 <element name="text" type="mw:TextType"/>
198 <element name="content" type="mw:ContentType" minOccurs="0" maxOccurs="unbounded"/>
199 <!-- sha1 of the revision, a combined sha1 of content in all slots -->
200 <element name="sha1" type="string" />
201 </sequence>
202 </complexType>
203
204 <complexType name="ContentType">
205 <sequence>
206 <!-- corresponds to slot role_name -->
207 <element name="role" type="mw:SlotRoleType" />
208 <!-- corresponds to slot origin -->
209 <element name="origin" type="positiveInteger" />
210 <element name="model" type="mw:ContentModelType" />
211 <element name="format" type="mw:ContentFormatType" />
212 <element name="text" type="mw:ContentTextType" />
213 </sequence>
214 </complexType>
215
216 <simpleType name="SlotRoleType">
217 <restriction base="string">
218 <pattern value="[a-zA-Z][-+./a-zA-Z0-9]*" />
219 </restriction>
220 </simpleType>
221
222 <complexType name="ContentTextType">
223 <simpleContent>
224 <extension base="string">
225 <attribute ref="xml:space" default="preserve" />
226 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
227 <attribute name="deleted" type="mw:DeletedFlagType" />
228 <attribute name="location" type="anyURI" />
229 <attribute name="bytes" type="nonNegativeInteger" />
230 </extension>
231 </simpleContent>
232 </complexType>
233
234 <complexType name="LogItemType">
235 <sequence>
236 <element name="id" type="positiveInteger" />
237 <element name="timestamp" type="dateTime" />
238 <element name="contributor" type="mw:ContributorType" />
239 <element name="comment" type="mw:CommentType" minOccurs="0" />
240 <element name="type" type="string" />
241 <element name="action" type="string" />
242 <element name="text" type="mw:LogTextType" minOccurs="0" maxOccurs="1" />
243 <element name="logtitle" type="string" minOccurs="0" maxOccurs="1" />
244 <element name="params" type="mw:LogParamsType" minOccurs="0" maxOccurs="1" />
245 </sequence>
246 </complexType>
247
248 <complexType name="CommentType">
249 <simpleContent>
250 <extension base="string">
251 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
252 <attribute name="deleted" type="mw:DeletedFlagType" />
253 </extension>
254 </simpleContent>
255 </complexType>
256
257 <complexType name="TextType">
258 <simpleContent>
259 <extension base="string">
260 <attribute ref="xml:space" default="preserve" />
261 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
262 <attribute name="deleted" type="mw:DeletedFlagType" />
263 <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
264 <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
265 <!-- usage ([0-9]+) and with the "ID" type. -->
266 <attribute name="id" type="NMTOKEN" />
267 <attribute name="location" type="anyURI" />
268 <attribute name="sha1" type="string"/>
269 <attribute name="bytes" type="nonNegativeInteger" />
270 </extension>
271 </simpleContent>
272 </complexType>
273
274 <complexType name="LogTextType">
275 <simpleContent>
276 <extension base="string">
277 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
278 <attribute name="deleted" type="mw:DeletedFlagType" />
279 </extension>
280 </simpleContent>
281 </complexType>
282
283 <complexType name="LogParamsType">
284 <simpleContent>
285 <extension base="string">
286 <attribute ref="xml:space" default="preserve" />
287 </extension>
288 </simpleContent>
289 </complexType>
290
291 <complexType name="ContributorType">
292 <sequence>
293 <element name="username" type="string" minOccurs="0" />
294 <element name="id" type="nonNegativeInteger" minOccurs="0" />
295
296 <element name="ip" type="string" minOccurs="0" />
297 </sequence>
298 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
299 <attribute name="deleted" type="mw:DeletedFlagType" />
300 </complexType>
301
302 <complexType name="UploadType">
303 <sequence>
304 <!-- Revision-style data... -->
305 <element name="timestamp" type="dateTime" />
306 <element name="contributor" type="mw:ContributorType" />
307 <element name="comment" type="string" minOccurs="0" />
308
309 <!-- Filename. (Using underscores, not spaces. No 'File:' namespace marker.) -->
310 <element name="filename" type="string" />
311
312 <!-- URI at which this resource can be obtained -->
313 <element name="src" type="anyURI" />
314
315 <element name="size" type="positiveInteger" />
316
317 <!-- TODO: add other metadata fields -->
318 </sequence>
319 </complexType>
320
321 <!-- Discussion threading data for LiquidThreads -->
322 <complexType name="DiscussionThreadingInfo">
323 <sequence>
324 <element name="ThreadSubject" type="string" />
325 <element name="ThreadParent" type="positiveInteger" />
326 <element name="ThreadAncestor" type="positiveInteger" />
327 <element name="ThreadPage" type="string" />
328 <element name="ThreadID" type="positiveInteger" />
329 <element name="ThreadAuthor" type="string" />
330 <element name="ThreadEditStatus" type="string" />
331 <element name="ThreadType" type="string" />
332 </sequence>
333 </complexType>
334
335 </schema>