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