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.
27 The canonical URL to the schema document is:
28 http://www.mediawiki.org/xml/export-0.7.xsd
31 http://www.mediawiki.org/xml/export-0.7/
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">
39 <documentation xml:
lang=
"en">
40 MediaWiki's page export format
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" />
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" />
55 <!-- Revision ID contraint, see bug 4220 -->
56 <unique name=
"RevIDConstraint">
57 <selector xpath=
"mw:page/mw:revision" />
58 <field xpath=
"mw:id" />
62 <complexType name=
"MediaWikiType">
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" />
71 <attribute name=
"version" type=
"string" use=
"required" />
72 <attribute ref=
"xml:lang" use=
"required" />
75 <complexType name=
"SiteInfoType">
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" />
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" />
91 <!-- Complete title is case-sensitive -->
92 <!-- Behavior when $wgCapitalLinks = false -->
93 <enumeration value=
"case-sensitive" />
95 <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
96 <!-- Not yet implemented as of MediaWiki 1.18 -->
97 <enumeration value=
"case-insensitive" />
101 <simpleType name=
"DeletedFlagType">
102 <restriction base=
"NMTOKEN">
103 <enumeration value=
"deleted" />
107 <complexType name=
"NamespacesType">
109 <element name=
"namespace" type=
"mw:NamespaceType"
110 minOccurs=
"0" maxOccurs=
"unbounded" />
114 <complexType name=
"NamespaceType">
116 <extension base=
"string">
117 <attribute name=
"key" type=
"integer" />
118 <attribute name=
"case" type=
"mw:CaseType" />
123 <complexType name=
"RedirectType">
125 <extension base=
"string">
126 <attribute name=
"title" type=
"string" />
131 <complexType name=
"PageType">
133 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
134 <element name=
"title" type=
"string" />
136 <!-- Namespace in canonical form -->
137 <element name=
"ns" type=
"nonNegativeInteger" />
139 <!-- optional page ID number -->
140 <element name=
"id" type=
"positiveInteger" />
142 <!-- flag if the current revision is a redirect -->
143 <element name=
"redirect" type=
"mw:RedirectType" minOccurs=
"0" maxOccurs=
"1" />
145 <!-- comma-separated list of string tokens, if present -->
146 <element name=
"restrictions" type=
"string" minOccurs=
"0" />
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" />
154 <!-- Zero or One sets of discussion threading data -->
155 <element name=
"discussionthreadinginfo" minOccurs=
"0" maxOccurs=
"1" type=
"mw:DiscussionThreadingInfo" />
159 <complexType name=
"RevisionType">
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" />
172 <complexType name=
"LogItemType">
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" />
186 <complexType name=
"CommentType">
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" />
195 <complexType name=
"TextType">
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" />
210 <complexType name=
"LogTextType">
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" />
219 <complexType name=
"LogParamsType">
221 <extension base=
"string">
222 <attribute ref=
"xml:space" use=
"optional" default=
"preserve" />
227 <complexType name=
"ContributorType">
229 <element name=
"username" type=
"string" minOccurs=
"0" />
230 <element name=
"id" type=
"positiveInteger" minOccurs=
"0" />
232 <element name=
"ip" type=
"string" minOccurs=
"0" />
234 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
235 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType" />
238 <complexType name=
"UploadType">
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" />
245 <!-- Filename. (Using underscores, not spaces. No 'File:' namespace marker.) -->
246 <element name=
"filename" type=
"string" />
248 <!-- URI at which this resource can be obtained -->
249 <element name=
"src" type=
"anyURI" />
251 <element name=
"size" type=
"positiveInteger" />
253 <!-- TODO: add other metadata fields -->
257 <!-- Discussion threading data for LiquidThreads -->
258 <complexType name=
"DiscussionThreadingInfo">
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" />