1 <?xml version=
"1.0" encoding=
"UTF-8" ?>
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
39 http://www.mediawiki.org/xml/export-0.10/
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">
47 <documentation xml:
lang=
"en">
48 MediaWiki's page export format
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" />
63 <!-- Revision ID contraint, see bug 4220 -->
64 <unique name=
"RevIDConstraint">
65 <selector xpath=
"mw:page/mw:revision" />
66 <field xpath=
"mw:id" />
70 <complexType name=
"MediaWikiType">
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" />
79 <attribute name=
"version" type=
"string" use=
"required" />
80 <attribute ref=
"xml:lang" use=
"required" />
83 <complexType name=
"SiteInfoType">
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" />
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" />
110 <simpleType name=
"DeletedFlagType">
111 <restriction base=
"NMTOKEN">
112 <enumeration value=
"deleted" />
116 <complexType name=
"NamespacesType">
118 <element name=
"namespace" type=
"mw:NamespaceType"
119 minOccurs=
"0" maxOccurs=
"unbounded" />
123 <complexType name=
"NamespaceType">
125 <extension base=
"string">
126 <attribute name=
"key" type=
"integer" />
127 <attribute name=
"case" type=
"mw:CaseType" />
132 <complexType name=
"RedirectType">
134 <extension base=
"string">
135 <attribute name=
"title" type=
"string" />
140 <simpleType name=
"ContentModelType">
141 <restriction base=
"string">
142 <pattern value=
"[a-zA-Z][-+./a-zA-Z0-9]*" />
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]*" />
152 <complexType name=
"PageType">
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" />
175 <!-- Zero or One sets of discussion threading data -->
176 <element name=
"discussionthreadinginfo" minOccurs=
"0" maxOccurs=
"1" type=
"mw:DiscussionThreadingInfo" />
180 <complexType name=
"RevisionType">
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" />
195 <complexType name=
"LogItemType">
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" />
209 <complexType name=
"CommentType">
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" />
218 <complexType name=
"TextType">
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" />
233 <complexType name=
"LogTextType">
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" />
242 <complexType name=
"LogParamsType">
244 <extension base=
"string">
245 <attribute ref=
"xml:space" use=
"optional" default=
"preserve" />
250 <complexType name=
"ContributorType">
252 <element name=
"username" type=
"string" minOccurs=
"0" />
253 <element name=
"id" type=
"nonNegativeInteger" minOccurs=
"0" />
255 <element name=
"ip" type=
"string" minOccurs=
"0" />
257 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
258 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType" />
261 <complexType name=
"UploadType">
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 -->
280 <!-- Discussion threading data for LiquidThreads -->
281 <complexType name=
"DiscussionThreadingInfo">
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" />