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, and a per-page redirect flag.
15 The canonical URL to the schema document is:
16 http://www.mediawiki.org/xml/export-0.4.xsd
19 http://www.mediawiki.org/xml/export-0.4/
21 <schema xmlns=
"http://www.w3.org/2001/XMLSchema"
22 xmlns:
mw=
"http://www.mediawiki.org/xml/export-0.4/"
23 targetNamespace=
"http://www.mediawiki.org/xml/export-0.4/"
24 elementFormDefault=
"qualified">
27 <documentation xml:
lang=
"en">
28 MediaWiki's page export format
32 <!-- Need this to reference xml:lang -->
33 <import namespace=
"http://www.w3.org/XML/1998/namespace"
34 schemaLocation=
"http://www.w3.org/2001/xml.xsd"/>
36 <!-- Our root element -->
37 <element name=
"mediawiki" type=
"mw:MediaWikiType"/>
39 <complexType name=
"MediaWikiType">
41 <element name=
"siteinfo" type=
"mw:SiteInfoType"
42 minOccurs=
"0" maxOccurs=
"1"/>
43 <element name=
"page" type=
"mw:PageType"
44 minOccurs=
"0" maxOccurs=
"unbounded"/>
46 <attribute name=
"version" type=
"string" use=
"required"/>
47 <attribute ref=
"xml:lang" use=
"required"/>
50 <complexType name=
"SiteInfoType">
52 <element name=
"sitename" type=
"string" minOccurs=
"0" />
53 <element name=
"base" type=
"anyURI" minOccurs=
"0" />
54 <element name=
"generator" type=
"string" minOccurs=
"0" />
55 <element name=
"case" type=
"mw:CaseType" minOccurs=
"0" />
56 <element name=
"namespaces" type=
"mw:NamespacesType" minOccurs=
"0" />
60 <simpleType name=
"CaseType">
61 <restriction base=
"NMTOKEN">
62 <!-- Cannot have two titles differing only by case of first letter. -->
63 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
64 <enumeration value=
"first-letter" />
66 <!-- Complete title is case-sensitive -->
67 <!-- Behavior when $wgCapitalLinks = false -->
68 <enumeration value=
"case-sensitive" />
70 <!-- Cannot have two titles differing only by case. -->
71 <!-- Not yet implemented as of MediaWiki 1.5 -->
72 <enumeration value=
"case-insensitive" />
76 <simpleType name=
"DeletedFlagType">
77 <restriction base=
"NMTOKEN">
78 <enumeration value=
"deleted"/>
82 <complexType name=
"NamespacesType">
84 <element name=
"namespace" type=
"mw:NamespaceType"
85 minOccurs=
"0" maxOccurs=
"unbounded" />
89 <complexType name=
"NamespaceType">
91 <extension base=
"string">
92 <attribute name=
"key" type=
"integer" />
97 <complexType name=
"PageType">
99 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
100 <element name=
"title" type=
"string"/>
102 <!-- optional page ID number -->
103 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
105 <!-- flag if the current revision is a redirect -->
106 <element name=
"redirect" minOccurs=
"0"/>
108 <!-- comma-separated list of string tokens, if present -->
109 <element name=
"restrictions" type=
"string" minOccurs=
"0"/>
111 <!-- Zero or more sets of revision or upload data -->
112 <choice minOccurs=
"0" maxOccurs=
"unbounded">
113 <element name=
"revision" type=
"mw:RevisionType" />
114 <element name=
"upload" type=
"mw:UploadType" />
115 <element name=
"logitem" type=
"mw:LogItemType" />
118 <!-- Zero or One sets of discussion threading data -->
119 <element minOccurs=
"0" maxOccurs=
"1" type=
"mw:DiscussionThreadingInfo" />
123 <complexType name=
"RevisionType">
125 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
126 <element name=
"timestamp" type=
"dateTime"/>
127 <element name=
"contributor" type=
"mw:ContributorType"/>
128 <element name=
"minor" minOccurs=
"0" />
129 <element name=
"comment" type=
"mw:CommentType" minOccurs=
"0"/>
130 <element name=
"text" type=
"mw:TextType" />
134 <complexType name=
"LogItemType">
136 <element name=
"id" type=
"positiveInteger" minOccurs=
"0"/>
137 <element name=
"timestamp" type=
"dateTime"/>
138 <element name=
"contributor" type=
"mw:ContributorType"/>
139 <element name=
"comment" type=
"mw:CommentType" minOccurs=
"0"/>
140 <element name=
"type" type=
"string" />
141 <element name=
"action" type=
"string" />
142 <element name=
"text" type=
"mw:TextType" />
146 <complexType name=
"CommentType">
148 <extension base=
"string">
149 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
150 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
156 <complexType name=
"TextType">
158 <extension base=
"string">
159 <attribute ref=
"xml:space" use=
"optional" default=
"preserve" />
160 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
161 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
166 <complexType name=
"ContributorType">
168 <element name=
"username" type=
"string" minOccurs=
"0"/>
169 <element name=
"id" type=
"positiveInteger" minOccurs=
"0" />
171 <element name=
"ip" type=
"string" minOccurs=
"0"/>
173 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
174 <attribute name=
"deleted" use=
"optional" type=
"mw:DeletedFlagType"/>
177 <complexType name=
"UploadType">
179 <!-- Revision-style data... -->
180 <element name=
"timestamp" type=
"dateTime"/>
181 <element name=
"contributor" type=
"mw:ContributorType"/>
182 <element name=
"comment" type=
"string" minOccurs=
"0"/>
184 <!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
185 <element name=
"filename" type=
"string"/>
187 <!-- URI at which this resource can be obtained -->
188 <element name=
"src" type=
"anyURI"/>
190 <element name=
"size" type=
"positiveInteger" />
192 <!-- TODO: add other metadata fields -->
196 <!-- Discussion threading data for LiquidThreads -->
197 <complexType name=
"DiscussionThreadingInfo">
199 <element name=
"ThreadSubject" type=
"string" />
200 <element name=
"ThreadParent" type=
"positiveInteger" />
201 <element name=
"ThreadAncestor" type=
"positiveInteger" />
202 <element name=
"ThreadPage" type=
"string" />
203 <element name=
"ThreadID" type=
"positiveInteger" />
204 <element name=
"ThreadAuthor" type=
"string" />
205 <element name=
"ThreadEditStatus" type=
"string" />
206 <element name=
"ThreadType" type=
"string" />