Move remaining LoadBalancer classes to Rdbms
[mediawiki.git] / docs / export-0.10.xsd
blob9d5d49e08e0fd034b340883a17721b349934fd3b
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.
6 Version 0.2 adds optional basic file upload info support,
7 which is used by our OAI export/import submodule.
9 Version 0.3 adds some site configuration information such
10 as a list of defined namespaces.
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.
16 Version 0.5 adds byte count per revision.
18 Version 0.6 adds a separate namespace tag, and resolves the
19 redirect target and adds a separate sha1 tag for each revision.
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"
28 Version 0.8 adds support for a <model> and a <format> tag for
29 each revision. See contenthandler.txt.
31 Version 0.9 adds the database name to the site information.
33 Version 0.10 moved the <model> and <format> tags before the <text> tag.
35 The canonical URL to the schema document is:
36 http://www.mediawiki.org/xml/export-0.10.xsd
38 Use the namespace:
39 http://www.mediawiki.org/xml/export-0.10/
40 -->
41 <schema xmlns="http://www.w3.org/2001/XMLSchema"
42 xmlns:mw="http://www.mediawiki.org/xml/export-0.10/"
43 targetNamespace="http://www.mediawiki.org/xml/export-0.10/"
44 elementFormDefault="qualified">
46 <annotation>
47 <documentation xml:lang="en">
48 MediaWiki's page export format
49 </documentation>
50 </annotation>
52 <!-- Need this to reference xml:lang -->
53 <import namespace="http://www.w3.org/XML/1998/namespace"
54 schemaLocation="http://www.w3.org/2001/xml.xsd" />
56 <!-- Our root element -->
57 <element name="mediawiki" type="mw:MediaWikiType">
58 <!-- Page ID contraint, see bug 4220 -->
59 <unique name="PageIDConstraint">
60 <selector xpath="mw:page" />
61 <field xpath="mw:id" />
62 </unique>
63 <!-- Revision ID contraint, see bug 4220 -->
64 <unique name="RevIDConstraint">
65 <selector xpath="mw:page/mw:revision" />
66 <field xpath="mw:id" />
67 </unique>
68 </element>
70 <complexType name="MediaWikiType">
71 <sequence>
72 <element name="siteinfo" type="mw:SiteInfoType"
73 minOccurs="0" maxOccurs="1" />
74 <element name="page" type="mw:PageType"
75 minOccurs="0" maxOccurs="unbounded" />
76 <element name="logitem" type="mw:LogItemType"
77 minOccurs="0" maxOccurs="unbounded" />
78 </sequence>
79 <attribute name="version" type="string" use="required" />
80 <attribute ref="xml:lang" use="required" />
81 </complexType>
83 <complexType name="SiteInfoType">
84 <sequence>
85 <element name="sitename" type="string" minOccurs="0" />
86 <element name="dbname" type="string" minOccurs="0" />
87 <element name="base" type="anyURI" minOccurs="0" />
88 <element name="generator" type="string" minOccurs="0" />
89 <element name="case" type="mw:CaseType" minOccurs="0" />
90 <element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
91 </sequence>
92 </complexType>
94 <simpleType name="CaseType">
95 <restriction base="NMTOKEN">
96 <!-- Cannot have two titles differing only by case of first letter. -->
97 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
98 <enumeration value="first-letter" />
100 <!-- Complete title is case-sensitive -->
101 <!-- Behavior when $wgCapitalLinks = false -->
102 <enumeration value="case-sensitive" />
104 <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
105 <!-- Not yet implemented as of MediaWiki 1.18 -->
106 <enumeration value="case-insensitive" />
107 </restriction>
108 </simpleType>
110 <simpleType name="DeletedFlagType">
111 <restriction base="NMTOKEN">
112 <enumeration value="deleted" />
113 </restriction>
114 </simpleType>
116 <complexType name="NamespacesType">
117 <sequence>
118 <element name="namespace" type="mw:NamespaceType"
119 minOccurs="0" maxOccurs="unbounded" />
120 </sequence>
121 </complexType>
123 <complexType name="NamespaceType">
124 <simpleContent>
125 <extension base="string">
126 <attribute name="key" type="integer" />
127 <attribute name="case" type="mw:CaseType" />
128 </extension>
129 </simpleContent>
130 </complexType>
132 <complexType name="RedirectType">
133 <simpleContent>
134 <extension base="string">
135 <attribute name="title" type="string" />
136 </extension>
137 </simpleContent>
138 </complexType>
140 <simpleType name="ContentModelType">
141 <restriction base="string">
142 <pattern value="[a-zA-Z][-+./a-zA-Z0-9]*" />
143 </restriction>
144 </simpleType>
146 <simpleType name="ContentFormatType">
147 <restriction base="string">
148 <pattern value="[a-zA-Z][-+.a-zA-Z0-9]*/[a-zA-Z][-+.a-zA-Z0-9]*" />
149 </restriction>
150 </simpleType>
152 <complexType name="PageType">
153 <sequence>
154 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
155 <element name="title" type="string" />
157 <!-- Namespace in canonical form -->
158 <element name="ns" type="nonNegativeInteger" />
160 <!-- optional page ID number -->
161 <element name="id" type="positiveInteger" />
163 <!-- flag if the current revision is a redirect -->
164 <element name="redirect" type="mw:RedirectType" minOccurs="0" maxOccurs="1" />
166 <!-- comma-separated list of string tokens, if present -->
167 <element name="restrictions" type="string" minOccurs="0" />
169 <!-- Zero or more sets of revision or upload data -->
170 <choice minOccurs="0" maxOccurs="unbounded">
171 <element name="revision" type="mw:RevisionType" />
172 <element name="upload" type="mw:UploadType" />
173 </choice>
175 <!-- Zero or One sets of discussion threading data -->
176 <element name="discussionthreadinginfo" minOccurs="0" maxOccurs="1" type="mw:DiscussionThreadingInfo" />
177 </sequence>
178 </complexType>
180 <complexType name="RevisionType">
181 <sequence>
182 <element name="id" type="positiveInteger" />
183 <element name="parentid" type="positiveInteger" minOccurs="0" />
184 <element name="timestamp" type="dateTime" />
185 <element name="contributor" type="mw:ContributorType" />
186 <element name="minor" minOccurs="0" maxOccurs="1" />
187 <element name="comment" type="mw:CommentType" minOccurs="0" maxOccurs="1" />
188 <element name="model" type="mw:ContentModelType" />
189 <element name="format" type="mw:ContentFormatType" />
190 <element name="text" type="mw:TextType" />
191 <element name="sha1" type="string" />
192 </sequence>
193 </complexType>
195 <complexType name="LogItemType">
196 <sequence>
197 <element name="id" type="positiveInteger" />
198 <element name="timestamp" type="dateTime" />
199 <element name="contributor" type="mw:ContributorType" />
200 <element name="comment" type="mw:CommentType" minOccurs="0" />
201 <element name="type" type="string" />
202 <element name="action" type="string" />
203 <element name="text" type="mw:LogTextType" minOccurs="0" maxOccurs="1" />
204 <element name="logtitle" type="string" minOccurs="0" maxOccurs="1" />
205 <element name="params" type="mw:LogParamsType" minOccurs="0" maxOccurs="1" />
206 </sequence>
207 </complexType>
209 <complexType name="CommentType">
210 <simpleContent>
211 <extension base="string">
212 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
213 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
214 </extension>
215 </simpleContent>
216 </complexType>
218 <complexType name="TextType">
219 <simpleContent>
220 <extension base="string">
221 <attribute ref="xml:space" use="optional" default="preserve" />
222 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
223 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
224 <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
225 <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
226 <!-- usage ([0-9]+) and with the "ID" type. -->
227 <attribute name="id" type="NMTOKEN" />
228 <attribute name="bytes" use="optional" type="nonNegativeInteger" />
229 </extension>
230 </simpleContent>
231 </complexType>
233 <complexType name="LogTextType">
234 <simpleContent>
235 <extension base="string">
236 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
237 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
238 </extension>
239 </simpleContent>
240 </complexType>
242 <complexType name="LogParamsType">
243 <simpleContent>
244 <extension base="string">
245 <attribute ref="xml:space" use="optional" default="preserve" />
246 </extension>
247 </simpleContent>
248 </complexType>
250 <complexType name="ContributorType">
251 <sequence>
252 <element name="username" type="string" minOccurs="0" />
253 <element name="id" type="nonNegativeInteger" minOccurs="0" />
255 <element name="ip" type="string" minOccurs="0" />
256 </sequence>
257 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
258 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
259 </complexType>
261 <complexType name="UploadType">
262 <sequence>
263 <!-- Revision-style data... -->
264 <element name="timestamp" type="dateTime" />
265 <element name="contributor" type="mw:ContributorType" />
266 <element name="comment" type="string" minOccurs="0" />
268 <!-- Filename. (Using underscores, not spaces. No 'File:' namespace marker.) -->
269 <element name="filename" type="string" />
271 <!-- URI at which this resource can be obtained -->
272 <element name="src" type="anyURI" />
274 <element name="size" type="positiveInteger" />
276 <!-- TODO: add other metadata fields -->
277 </sequence>
278 </complexType>
280 <!-- Discussion threading data for LiquidThreads -->
281 <complexType name="DiscussionThreadingInfo">
282 <sequence>
283 <element name="ThreadSubject" type="string" />
284 <element name="ThreadParent" type="positiveInteger" />
285 <element name="ThreadAncestor" type="positiveInteger" />
286 <element name="ThreadPage" type="string" />
287 <element name="ThreadID" type="positiveInteger" />
288 <element name="ThreadAuthor" type="string" />
289 <element name="ThreadEditStatus" type="string" />
290 <element name="ThreadType" type="string" />
291 </sequence>
292 </complexType>
294 </schema>