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