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 The canonical URL to the schema document is:
17 http://www.mediawiki.org/xml/export-0.4.xsd
20 http://www.mediawiki.org/xml/export-0.4/
22 <schema xmlns=
"http://www.w3.org/2001/XMLSchema"
23 xmlns:
mw=
"http://www.mediawiki.org/xml/export-0.4/"
24 targetNamespace=
"http://www.mediawiki.org/xml/export-0.4/"
25 elementFormDefault=
"qualified">
28 <documentation xml:
lang=
"en">
29 MediaWiki's page export format
33 <!-- Need this to reference xml:lang -->
34 <import namespace=
"http://www.w3.org/XML/1998/namespace"
35 schemaLocation=
"http://www.w3.org/2001/xml.xsd"/>
37 <!-- Our root element -->
38 <element name=
"mediawiki" type=
"mw:MediaWikiType"/>
40 <complexType name=
"MediaWikiType">
42 <element name=
"siteinfo" type=
"mw:SiteInfoType"
43 minOccurs=
"0" maxOccurs=
"1"/>
44 <element name=
"page" type=
"mw:PageType"
45 minOccurs=
"0" maxOccurs=
"unbounded"/>
47 <attribute name=
"version" type=
"string" use=
"required"/>
48 <attribute ref=
"xml:lang" use=
"required"/>
51 <complexType name=
"SiteInfoType">
53 <element name=
"sitename" type=
"string" minOccurs=
"0" />
54 <element name=
"base" type=
"anyURI" minOccurs=
"0" />
55 <element name=
"generator" type=
"string" minOccurs=
"0" />
56 <element name=
"case" type=
"mw:CaseType" minOccurs=
"0" />
57 <element name=
"namespaces" type=
"mw:NamespacesType" minOccurs=
"0" />
61 <simpleType name=
"CaseType">
62 <restriction base=
"NMTOKEN">
63 <!-- Cannot have two titles differing only by case of first letter. -->
64 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
65 <enumeration value=
"first-letter" />
67 <!-- Complete title is case-sensitive -->
68 <!-- Behavior when $wgCapitalLinks = false -->
69 <enumeration value=
"case-sensitive" />
71 <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
72 <!-- Not yet implemented as of MediaWiki 1.18 -->
73 <enumeration value=
"case-insensitive" />
77 <simpleType name=
"DeletedFlagType">
78 <restriction base=
"NMTOKEN">
79 <enumeration value=
"deleted"/>
83 <complexType name=
"NamespacesType">
85 <element name=
"namespace" type=
"mw:NamespaceType"
86 minOccurs=
"0" maxOccurs=
"unbounded" />
90 <complexType name=
"NamespaceType">
92 <extension base=
"string">
93 <attribute name=
"key" type=
"integer" />
94 <attribute name=
"case" type=
"mw:CaseType" />
99 <complexType name=
"PageType">
101 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
102 <element name=
"title" type=
"string"/>
104 <!-- optional page ID number -->
105 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
107 <!-- flag if the current revision is a redirect -->
108 <element name=
"redirect" minOccurs=
"0"/>
110 <!-- comma-separated list of string tokens, if present -->
111 <element name=
"restrictions" type=
"string" minOccurs=
"0"/>
113 <!-- Zero or more sets of revision or upload data -->
114 <choice minOccurs=
"0" maxOccurs=
"unbounded">
115 <element name=
"revision" type=
"mw:RevisionType" />
116 <element name=
"upload" type=
"mw:UploadType" />
117 <element name=
"logitem" type=
"mw:LogItemType" />
120 <!-- Zero or One sets of discussion threading data -->
121 <element name=
"discussionthreadinginfo" minOccurs=
"0" maxOccurs=
"1" type=
"mw:DiscussionThreadingInfo" />
125 <complexType name=
"RevisionType">
127 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
128 <element name=
"timestamp" type=
"dateTime"/>
129 <element name=
"contributor" type=
"mw:ContributorType"/>
130 <element name=
"minor" minOccurs=
"0" />
131 <element name=
"comment" type=
"mw:CommentType" minOccurs=
"0"/>
132 <element name=
"text" type=
"mw:TextType" />
136 <complexType name=
"LogItemType">
138 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
139 <element name=
"timestamp" type=
"dateTime"/>
140 <element name=
"contributor" type=
"mw:ContributorType"/>
141 <element name=
"comment" type=
"mw:CommentType" minOccurs=
"0"/>
142 <element name=
"type" type=
"string" />
143 <element name=
"action" type=
"string" />
144 <element name=
"text" type=
"mw:TextType" />
148 <complexType name=
"CommentType">
150 <extension base=
"string">
151 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
152 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
158 <complexType name=
"TextType">
160 <extension base=
"string">
161 <attribute ref=
"xml:space" use=
"optional" default=
"preserve" />
162 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
163 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
164 <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
165 <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
166 <!-- usage ([0-9]+) and with the "ID" type. -->
167 <attribute name=
"id" type=
"NMTOKEN"/>
172 <complexType name=
"ContributorType">
174 <element name=
"username" type=
"string" minOccurs=
"0"/>
175 <element name=
"id" type=
"positiveInteger" minOccurs=
"0" />
177 <element name=
"ip" type=
"string" minOccurs=
"0"/>
179 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
180 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
183 <complexType name=
"UploadType">
185 <!-- Revision-style data... -->
186 <element name=
"timestamp" type=
"dateTime"/>
187 <element name=
"contributor" type=
"mw:ContributorType"/>
188 <element name=
"comment" type=
"string" minOccurs=
"0"/>
190 <!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
191 <element name=
"filename" type=
"string"/>
193 <!-- URI at which this resource can be obtained -->
194 <element name=
"src" type=
"anyURI"/>
196 <element name=
"size" type=
"positiveInteger" />
198 <!-- TODO: add other metadata fields -->
202 <!-- Discussion threading data for LiquidThreads -->
203 <complexType name=
"DiscussionThreadingInfo">
205 <element name=
"ThreadSubject" type=
"string" />
206 <element name=
"ThreadParent" type=
"positiveInteger" />
207 <element name=
"ThreadAncestor" type=
"positiveInteger" />
208 <element name=
"ThreadPage" type=
"string" />
209 <element name=
"ThreadID" type=
"positiveInteger" />
210 <element name=
"ThreadAuthor" type=
"string" />
211 <element name=
"ThreadEditStatus" type=
"string" />
212 <element name=
"ThreadType" type=
"string" />