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