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 The canonical URL to the schema document is:
19 http://www.mediawiki.org/xml/export-0.5.xsd
22 http://www.mediawiki.org/xml/export-0.5/
24 <schema xmlns=
"http://www.w3.org/2001/XMLSchema"
25 xmlns:
mw=
"http://www.mediawiki.org/xml/export-0.5/"
26 targetNamespace=
"http://www.mediawiki.org/xml/export-0.5/"
27 elementFormDefault=
"qualified">
30 <documentation xml:
lang=
"en">
31 MediaWiki's page export format
35 <!-- Need this to reference xml:lang -->
36 <import namespace=
"http://www.w3.org/XML/1998/namespace"
37 schemaLocation=
"http://www.w3.org/2001/xml.xsd"/>
39 <!-- Our root element -->
40 <element name=
"mediawiki" type=
"mw:MediaWikiType"/>
42 <complexType name=
"MediaWikiType">
44 <element name=
"siteinfo" type=
"mw:SiteInfoType"
45 minOccurs=
"0" maxOccurs=
"1"/>
46 <element name=
"page" type=
"mw:PageType"
47 minOccurs=
"0" maxOccurs=
"unbounded"/>
49 <attribute name=
"version" type=
"string" use=
"required"/>
50 <attribute ref=
"xml:lang" use=
"required"/>
53 <complexType name=
"SiteInfoType">
55 <element name=
"sitename" type=
"string" minOccurs=
"0" />
56 <element name=
"base" type=
"anyURI" minOccurs=
"0" />
57 <element name=
"generator" type=
"string" minOccurs=
"0" />
58 <element name=
"case" type=
"mw:CaseType" minOccurs=
"0" />
59 <element name=
"namespaces" type=
"mw:NamespacesType" minOccurs=
"0" />
63 <simpleType name=
"CaseType">
64 <restriction base=
"NMTOKEN">
65 <!-- Cannot have two titles differing only by case of first letter. -->
66 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
67 <enumeration value=
"first-letter" />
69 <!-- Complete title is case-sensitive -->
70 <!-- Behavior when $wgCapitalLinks = false -->
71 <enumeration value=
"case-sensitive" />
73 <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
74 <!-- Not yet implemented as of MediaWiki 1.18 -->
75 <enumeration value=
"case-insensitive" />
79 <simpleType name=
"DeletedFlagType">
80 <restriction base=
"NMTOKEN">
81 <enumeration value=
"deleted"/>
85 <complexType name=
"NamespacesType">
87 <element name=
"namespace" type=
"mw:NamespaceType"
88 minOccurs=
"0" maxOccurs=
"unbounded" />
92 <complexType name=
"NamespaceType">
94 <extension base=
"string">
95 <attribute name=
"key" type=
"integer" />
96 <attribute name=
"case" type=
"mw:CaseType" />
101 <complexType name=
"PageType">
103 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
104 <element name=
"title" type=
"string"/>
106 <!-- optional page ID number -->
107 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
109 <!-- flag if the current revision is a redirect -->
110 <element name=
"redirect" minOccurs=
"0"/>
112 <!-- comma-separated list of string tokens, if present -->
113 <element name=
"restrictions" type=
"string" minOccurs=
"0"/>
115 <!-- Zero or more sets of revision or upload data -->
116 <choice minOccurs=
"0" maxOccurs=
"unbounded">
117 <element name=
"revision" type=
"mw:RevisionType" />
118 <element name=
"upload" type=
"mw:UploadType" />
119 <element name=
"logitem" type=
"mw:LogItemType" />
122 <!-- Zero or One sets of discussion threading data -->
123 <element name=
"discussionthreadinginfo" minOccurs=
"0" maxOccurs=
"1" type=
"mw:DiscussionThreadingInfo" />
127 <complexType name=
"RevisionType">
129 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
130 <element name=
"timestamp" type=
"dateTime"/>
131 <element name=
"contributor" type=
"mw:ContributorType"/>
132 <element name=
"minor" minOccurs=
"0" />
133 <element name=
"comment" type=
"mw:CommentType" minOccurs=
"0"/>
134 <element name=
"text" type=
"mw:TextType" />
138 <complexType name=
"LogItemType">
140 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
141 <element name=
"timestamp" type=
"dateTime"/>
142 <element name=
"contributor" type=
"mw:ContributorType"/>
143 <element name=
"comment" type=
"mw:CommentType" minOccurs=
"0"/>
144 <element name=
"type" type=
"string" />
145 <element name=
"action" type=
"string" />
146 <element name=
"text" type=
"mw:TextType" />
150 <complexType name=
"CommentType">
152 <extension base=
"string">
153 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
154 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
160 <complexType name=
"TextType">
162 <extension base=
"string">
163 <attribute ref=
"xml:space" use=
"optional" default=
"preserve" />
164 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
165 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
166 <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
167 <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
168 <!-- usage ([0-9]+) and with the "ID" type. -->
169 <attribute name=
"id" type=
"NMTOKEN"/>
170 <attribute name=
"bytes" use=
"optional" type=
"nonNegativeInteger"/>
175 <complexType name=
"ContributorType">
177 <element name=
"username" type=
"string" minOccurs=
"0"/>
178 <element name=
"id" type=
"positiveInteger" minOccurs=
"0" />
180 <element name=
"ip" type=
"string" minOccurs=
"0"/>
182 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
183 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
186 <complexType name=
"UploadType">
188 <!-- Revision-style data... -->
189 <element name=
"timestamp" type=
"dateTime"/>
190 <element name=
"contributor" type=
"mw:ContributorType"/>
191 <element name=
"comment" type=
"string" minOccurs=
"0"/>
193 <!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
194 <element name=
"filename" type=
"string"/>
196 <!-- URI at which this resource can be obtained -->
197 <element name=
"src" type=
"anyURI"/>
199 <element name=
"size" type=
"positiveInteger" />
201 <!-- TODO: add other metadata fields -->
205 <!-- Discussion threading data for LiquidThreads -->
206 <complexType name=
"DiscussionThreadingInfo">
208 <element name=
"ThreadSubject" type=
"string" />
209 <element name=
"ThreadParent" type=
"positiveInteger" />
210 <element name=
"ThreadAncestor" type=
"positiveInteger" />
211 <element name=
"ThreadPage" type=
"string" />
212 <element name=
"ThreadID" type=
"positiveInteger" />
213 <element name=
"ThreadAuthor" type=
"string" />
214 <element name=
"ThreadEditStatus" type=
"string" />
215 <element name=
"ThreadType" type=
"string" />