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