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