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