Merge "Use local context to get messages and don't use implicit Message object to...
[lhc/web/wiklou.git] / docs / export-0.7.xsd
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3 This is an XML Schema description of the format
4 output by MediaWiki's Special:Export system.
5
6 Version 0.2 adds optional basic file upload info support,
7 which is used by our OAI export/import submodule.
8
9 Version 0.3 adds some site configuration information such
10 as a list of defined namespaces.
11
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.
15
16 Version 0.5 adds byte count per revision.
17
18 Version 0.6 adds a separate namespace tag, and resolves the
19 redirect target and adds a separate sha1 tag for each revision.
20
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
26 The canonical URL to the schema document is:
27 http://www.mediawiki.org/xml/export-0.7.xsd
28
29 Use the namespace:
30 http://www.mediawiki.org/xml/export-0.7/
31 -->
32 <schema xmlns="http://www.w3.org/2001/XMLSchema"
33 xmlns:mw="http://www.mediawiki.org/xml/export-0.7/"
34 targetNamespace="http://www.mediawiki.org/xml/export-0.7/"
35 elementFormDefault="qualified">
36
37 <annotation>
38 <documentation xml:lang="en">
39 MediaWiki's page export format
40 </documentation>
41 </annotation>
42
43 <!-- Need this to reference xml:lang -->
44 <import namespace="http://www.w3.org/XML/1998/namespace"
45 schemaLocation="http://www.w3.org/2001/xml.xsd" />
46
47 <!-- Our root element -->
48 <element name="mediawiki" type="mw:MediaWikiType">
49 <!-- Page ID contraint, see bug 4220 -->
50 <unique name="PageIDConstraint">
51 <selector xpath="mw:page" />
52 <field xpath="mw:id" />
53 </unique>
54 <!-- Revision ID contraint, see bug 4220 -->
55 <unique name="RevIDConstraint">
56 <selector xpath="mw:page/mw:revision" />
57 <field xpath="mw:id" />
58 </unique>
59 </element>
60
61 <complexType name="MediaWikiType">
62 <sequence>
63 <element name="siteinfo" type="mw:SiteInfoType"
64 minOccurs="0" maxOccurs="1" />
65 <element name="page" type="mw:PageType"
66 minOccurs="0" maxOccurs="unbounded" />
67 <element name="logitem" type="mw:LogItemType"
68 minOccurs="0" maxOccurs="unbounded" />
69 </sequence>
70 <attribute name="version" type="string" use="required" />
71 <attribute ref="xml:lang" use="required" />
72 </complexType>
73
74 <complexType name="SiteInfoType">
75 <sequence>
76 <element name="sitename" type="string" minOccurs="0" />
77 <element name="base" type="anyURI" minOccurs="0" />
78 <element name="generator" type="string" minOccurs="0" />
79 <element name="case" type="mw:CaseType" minOccurs="0" />
80 <element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
81 </sequence>
82 </complexType>
83
84 <simpleType name="CaseType">
85 <restriction base="NMTOKEN">
86 <!-- Cannot have two titles differing only by case of first letter. -->
87 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
88 <enumeration value="first-letter" />
89
90 <!-- Complete title is case-sensitive -->
91 <!-- Behavior when $wgCapitalLinks = false -->
92 <enumeration value="case-sensitive" />
93
94 <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
95 <!-- Not yet implemented as of MediaWiki 1.18 -->
96 <enumeration value="case-insensitive" />
97 </restriction>
98 </simpleType>
99
100 <simpleType name="DeletedFlagType">
101 <restriction base="NMTOKEN">
102 <enumeration value="deleted" />
103 </restriction>
104 </simpleType>
105
106 <complexType name="NamespacesType">
107 <sequence>
108 <element name="namespace" type="mw:NamespaceType"
109 minOccurs="0" maxOccurs="unbounded" />
110 </sequence>
111 </complexType>
112
113 <complexType name="NamespaceType">
114 <simpleContent>
115 <extension base="string">
116 <attribute name="key" type="integer" />
117 <attribute name="case" type="mw:CaseType" />
118 </extension>
119 </simpleContent>
120 </complexType>
121
122 <complexType name="RedirectType">
123 <simpleContent>
124 <extension base="string">
125 <attribute name="title" type="string" />
126 </extension>
127 </simpleContent>
128 </complexType>
129
130 <complexType name="PageType">
131 <sequence>
132 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
133 <element name="title" type="string" />
134
135 <!-- Namespace in canonical form -->
136 <element name="ns" type="nonNegativeInteger" />
137
138 <!-- optional page ID number -->
139 <element name="id" type="positiveInteger" />
140
141 <!-- flag if the current revision is a redirect -->
142 <element name="redirect" type="mw:RedirectType" minOccurs="0" maxOccurs="1" />
143
144 <!-- comma-separated list of string tokens, if present -->
145 <element name="restrictions" type="string" minOccurs="0" />
146
147 <!-- Zero or more sets of revision or upload data -->
148 <choice minOccurs="0" maxOccurs="unbounded">
149 <element name="revision" type="mw:RevisionType" />
150 <element name="upload" type="mw:UploadType" />
151 </choice>
152
153 <!-- Zero or One sets of discussion threading data -->
154 <element name="discussionthreadinginfo" minOccurs="0" maxOccurs="1" type="mw:DiscussionThreadingInfo" />
155 </sequence>
156 </complexType>
157
158 <complexType name="RevisionType">
159 <sequence>
160 <element name="id" type="positiveInteger" minOccurs="0" />
161 <element name="timestamp" type="dateTime" />
162 <element name="contributor" type="mw:ContributorType" />
163 <element name="minor" minOccurs="0" maxOccurs="1" />
164 <element name="comment" type="mw:CommentType" minOccurs="0" maxOccurs="1" />
165 <element name="sha1" type="string" />
166 <element name="text" type="mw:TextType" />
167 </sequence>
168 </complexType>
169
170 <complexType name="LogItemType">
171 <sequence>
172 <element name="id" type="positiveInteger" />
173 <element name="timestamp" type="dateTime" />
174 <element name="contributor" type="mw:ContributorType" />
175 <element name="comment" type="mw:CommentType" minOccurs="0" />
176 <element name="type" type="string" />
177 <element name="action" type="string" />
178 <element name="text" type="mw:LogTextType" minOccurs="0" maxOccurs="1" />
179 <element name="logtitle" type="string" minOccurs="0" maxOccurs="1" />
180 <element name="params" type="mw:LogParamsType" minOccurs="0" maxOccurs="1" />
181 </sequence>
182 </complexType>
183
184 <complexType name="CommentType">
185 <simpleContent>
186 <extension base="string">
187 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
188 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
189 </extension>
190 </simpleContent>
191 </complexType>
192
193 <complexType name="TextType">
194 <simpleContent>
195 <extension base="string">
196 <attribute ref="xml:space" use="optional" default="preserve" />
197 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
198 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
199 <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
200 <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
201 <!-- usage ([0-9]+) and with the "ID" type. -->
202 <attribute name="id" type="NMTOKEN" />
203 <attribute name="bytes" use="optional" type="nonNegativeInteger" />
204 </extension>
205 </simpleContent>
206 </complexType>
207
208 <complexType name="LogTextType">
209 <simpleContent>
210 <extension base="string">
211 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
212 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
213 </extension>
214 </simpleContent>
215 </complexType>
216
217 <complexType name="LogParamsType">
218 <simpleContent>
219 <extension base="string">
220 <attribute ref="xml:space" use="optional" default="preserve" />
221 </extension>
222 </simpleContent>
223 </complexType>
224
225 <complexType name="ContributorType">
226 <sequence>
227 <element name="username" type="string" minOccurs="0" />
228 <element name="id" type="positiveInteger" minOccurs="0" />
229
230 <element name="ip" type="string" minOccurs="0" />
231 </sequence>
232 <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
233 <attribute name="deleted" use="optional" type="mw:DeletedFlagType" />
234 </complexType>
235
236 <complexType name="UploadType">
237 <sequence>
238 <!-- Revision-style data... -->
239 <element name="timestamp" type="dateTime" />
240 <element name="contributor" type="mw:ContributorType" />
241 <element name="comment" type="string" minOccurs="0" />
242
243 <!-- Filename. (Using underscores, not spaces. No 'File:' namespace marker.) -->
244 <element name="filename" type="string" />
245
246 <!-- URI at which this resource can be obtained -->
247 <element name="src" type="anyURI" />
248
249 <element name="size" type="positiveInteger" />
250
251 <!-- TODO: add other metadata fields -->
252 </sequence>
253 </complexType>
254
255 <!-- Discussion threading data for LiquidThreads -->
256 <complexType name="DiscussionThreadingInfo">
257 <sequence>
258 <element name="ThreadSubject" type="string" />
259 <element name="ThreadParent" type="positiveInteger" />
260 <element name="ThreadAncestor" type="positiveInteger" />
261 <element name="ThreadPage" type="string" />
262 <element name="ThreadID" type="positiveInteger" />
263 <element name="ThreadAuthor" type="string" />
264 <element name="ThreadEditStatus" type="string" />
265 <element name="ThreadType" type="string" />
266 </sequence>
267 </complexType>
268
269 </schema>