1 <?xml version="1.0" encoding="UTF-8" ?>
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 The canonical URL to the schema document is:
13 http://www.mediawiki.org/xml/export-0.3.xsd
16 http://www.mediawiki.org/xml/export-0.3/
18 <schema xmlns="http://www.w3.org/2001/XMLSchema"
19 xmlns:mw="http://www.mediawiki.org/xml/export-0.3/"
20 targetNamespace="http://www.mediawiki.org/xml/export-0.3/"
21 elementFormDefault="qualified">
24 <documentation xml:lang="en">
25 MediaWiki's page export format
29 <!-- Need this to reference xml:lang -->
30 <import namespace="http://www.w3.org/XML/1998/namespace"
31 schemaLocation="http://www.w3.org/2001/xml.xsd"/>
33 <!-- Our root element -->
34 <element name="mediawiki" type="mw:MediaWikiType"/>
36 <complexType name="MediaWikiType">
38 <element name="siteinfo" type="mw:SiteInfoType"
39 minOccurs="0" maxOccurs="1"/>
40 <element name="page" type="mw:PageType"
41 minOccurs="0" maxOccurs="unbounded"/>
43 <attribute name="version" type="string" use="required"/>
44 <attribute ref="xml:lang" use="required"/>
47 <complexType name="SiteInfoType">
49 <element name="sitename" type="string" minOccurs="0" />
50 <element name="base" type="anyURI" minOccurs="0" />
51 <element name="generator" type="string" minOccurs="0" />
52 <element name="case" type="mw:CaseType" minOccurs="0" />
53 <element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
57 <simpleType name="CaseType">
58 <restriction base="NMTOKEN">
59 <!-- Cannot have two titles differing only by case of first letter. -->
60 <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
61 <enumeration value="first-letter" />
63 <!-- Complete title is case-sensitive -->
64 <!-- Behavior when $wgCapitalLinks = false -->
65 <enumeration value="case-sensitive" />
67 <!-- Cannot have two titles differing only by case. -->
68 <!-- Not yet implemented as of MediaWiki 1.5 -->
69 <enumeration value="case-insensitive" />
73 <complexType name="NamespacesType">
75 <element name="namespace" type="mw:NamespaceType"
76 minOccurs="0" maxOccurs="unbounded" />
80 <complexType name="NamespaceType">
82 <extension base="string">
83 <attribute name="key" type="integer" />
88 <complexType name="PageType">
90 <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
91 <element name="title" type="string"/>
93 <!-- optional page ID number -->
94 <element name="id" type="positiveInteger" minOccurs="0"/>
96 <!-- comma-separated list of string tokens, if present -->
97 <element name="restrictions" type="string" minOccurs="0"/>
99 <!-- Zero or more sets of revision or upload data -->
100 <choice minOccurs="0" maxOccurs="unbounded">
101 <element name="revision" type="mw:RevisionType" />
102 <element name="upload" type="mw:UploadType" />
105 <choice minOccurs="0" maxOccurs="1">
106 <element name="contributors" type="mw:ContributorsType"/>
111 <complexType name="RevisionType">
113 <element name="id" type="positiveInteger" minOccurs="0"/>
114 <element name="timestamp" type="dateTime"/>
115 <element name="contributor" type="mw:ContributorType"/>
116 <element name="minor" minOccurs="0" />
117 <element name="comment" type="string" minOccurs="0"/>
118 <element name="text" type="mw:TextType" />
122 <!-- Contributors. Note the plural. For list of contributors when not dumping full article history. -->
123 <complexType name="ContributorsType">
125 <choice minOccurs="0" maxOccurs="unbounded">
126 <element name="contributor" type="mw:ContributorType"/>
131 <complexType name="TextType">
133 <extension base="string">
134 <attribute ref="xml:space" use="optional" default="preserve" />
139 <complexType name="ContributorType">
141 <element name="username" type="string" minOccurs="0"/>
142 <element name="id" type="positiveInteger" minOccurs="0" />
144 <element name="ip" type="string" minOccurs="0"/>
148 <complexType name="UploadType">
150 <!-- Revision-style data... -->
151 <element name="timestamp" type="dateTime"/>
152 <element name="contributor" type="mw:ContributorType"/>
153 <element name="comment" type="string" minOccurs="0"/>
155 <!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
156 <element name="filename" type="string"/>
158 <!-- URI at which this resource can be obtained -->
159 <element name="src" type="anyURI"/>
161 <element name="size" type="positiveInteger" />
163 <!-- TODO: add other metadata fields -->