r79877 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79876‎ | r79877 | r79878 >
Date:02:27, 9 January 2011
Author:robla
Status:ok
Tags:
Comment:
Creating export-0.5.xsd as part of followup to r79856
Modified paths:
  • /trunk/phase3/docs/export-0.5.xsd (added) (history)

Diff [purge]

Index: trunk/phase3/docs/export-0.5.xsd
@@ -0,0 +1,216 @@
 2+<?xml version="1.0" encoding="UTF-8" ?>
 3+<!--
 4+ This is an XML Schema description of the format
 5+ output by MediaWiki's Special:Export system.
 6+
 7+ Version 0.2 adds optional basic file upload info support,
 8+ which is used by our OAI export/import submodule.
 9+
 10+ Version 0.3 adds some site configuration information such
 11+ as a list of defined namespaces.
 12+
 13+ Version 0.4 adds per-revision delete flags, log exports,
 14+ discussion threading data, a per-page redirect flag, and
 15+ per-namespace capitalization.
 16+
 17+ The canonical URL to the schema document is:
 18+ http://www.mediawiki.org/xml/export-0.4.xsd
 19+
 20+ Use the namespace:
 21+ http://www.mediawiki.org/xml/export-0.4/
 22+-->
 23+<schema xmlns="http://www.w3.org/2001/XMLSchema"
 24+ xmlns:mw="http://www.mediawiki.org/xml/export-0.4/"
 25+ targetNamespace="http://www.mediawiki.org/xml/export-0.4/"
 26+ elementFormDefault="qualified">
 27+
 28+ <annotation>
 29+ <documentation xml:lang="en">
 30+ MediaWiki's page export format
 31+ </documentation>
 32+ </annotation>
 33+
 34+ <!-- Need this to reference xml:lang -->
 35+ <import namespace="http://www.w3.org/XML/1998/namespace"
 36+ schemaLocation="http://www.w3.org/2001/xml.xsd"/>
 37+
 38+ <!-- Our root element -->
 39+ <element name="mediawiki" type="mw:MediaWikiType"/>
 40+
 41+ <complexType name="MediaWikiType">
 42+ <sequence>
 43+ <element name="siteinfo" type="mw:SiteInfoType"
 44+ minOccurs="0" maxOccurs="1"/>
 45+ <element name="page" type="mw:PageType"
 46+ minOccurs="0" maxOccurs="unbounded"/>
 47+ </sequence>
 48+ <attribute name="version" type="string" use="required"/>
 49+ <attribute ref="xml:lang" use="required"/>
 50+ </complexType>
 51+
 52+ <complexType name="SiteInfoType">
 53+ <sequence>
 54+ <element name="sitename" type="string" minOccurs="0" />
 55+ <element name="base" type="anyURI" minOccurs="0" />
 56+ <element name="generator" type="string" minOccurs="0" />
 57+ <element name="case" type="mw:CaseType" minOccurs="0" />
 58+ <element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
 59+ </sequence>
 60+ </complexType>
 61+
 62+ <simpleType name="CaseType">
 63+ <restriction base="NMTOKEN">
 64+ <!-- Cannot have two titles differing only by case of first letter. -->
 65+ <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
 66+ <enumeration value="first-letter" />
 67+
 68+ <!-- Complete title is case-sensitive -->
 69+ <!-- Behavior when $wgCapitalLinks = false -->
 70+ <enumeration value="case-sensitive" />
 71+
 72+ <!-- Cannot have non-case senstitive titles eg [[FOO]] == [[Foo]] -->
 73+ <!-- Not yet implemented as of MediaWiki 1.18 -->
 74+ <enumeration value="case-insensitive" />
 75+ </restriction>
 76+ </simpleType>
 77+
 78+ <simpleType name="DeletedFlagType">
 79+ <restriction base="NMTOKEN">
 80+ <enumeration value="deleted"/>
 81+ </restriction>
 82+ </simpleType>
 83+
 84+ <complexType name="NamespacesType">
 85+ <sequence>
 86+ <element name="namespace" type="mw:NamespaceType"
 87+ minOccurs="0" maxOccurs="unbounded" />
 88+ </sequence>
 89+ </complexType>
 90+
 91+ <complexType name="NamespaceType">
 92+ <simpleContent>
 93+ <extension base="string">
 94+ <attribute name="key" type="integer" />
 95+ <attribute name="case" type="mw:CaseType" />
 96+ </extension>
 97+ </simpleContent>
 98+ </complexType>
 99+
 100+ <complexType name="PageType">
 101+ <sequence>
 102+ <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
 103+ <element name="title" type="string"/>
 104+
 105+ <!-- optional page ID number -->
 106+ <element name="id" type="positiveInteger" minOccurs="0"/>
 107+
 108+ <!-- flag if the current revision is a redirect -->
 109+ <element name="redirect" minOccurs="0"/>
 110+
 111+ <!-- comma-separated list of string tokens, if present -->
 112+ <element name="restrictions" type="string" minOccurs="0"/>
 113+
 114+ <!-- Zero or more sets of revision or upload data -->
 115+ <choice minOccurs="0" maxOccurs="unbounded">
 116+ <element name="revision" type="mw:RevisionType" />
 117+ <element name="upload" type="mw:UploadType" />
 118+ <element name="logitem" type="mw:LogItemType" />
 119+ </choice>
 120+
 121+ <!-- Zero or One sets of discussion threading data -->
 122+ <element name="discussionthreadinginfo" minOccurs="0" maxOccurs="1" type="mw:DiscussionThreadingInfo" />
 123+ </sequence>
 124+ </complexType>
 125+
 126+ <complexType name="RevisionType">
 127+ <sequence>
 128+ <element name="id" type="positiveInteger" minOccurs="0"/>
 129+ <element name="timestamp" type="dateTime"/>
 130+ <element name="contributor" type="mw:ContributorType"/>
 131+ <element name="minor" minOccurs="0" />
 132+ <element name="comment" type="mw:CommentType" minOccurs="0"/>
 133+ <element name="text" type="mw:TextType" />
 134+ </sequence>
 135+ </complexType>
 136+
 137+ <complexType name="LogItemType">
 138+ <sequence>
 139+ <element name="id" type="positiveInteger" minOccurs="0"/>
 140+ <element name="timestamp" type="dateTime"/>
 141+ <element name="contributor" type="mw:ContributorType"/>
 142+ <element name="comment" type="mw:CommentType" minOccurs="0"/>
 143+ <element name="type" type="string" />
 144+ <element name="action" type="string" />
 145+ <element name="text" type="mw:TextType" />
 146+ </sequence>
 147+ </complexType>
 148+
 149+ <complexType name="CommentType">
 150+ <simpleContent>
 151+ <extension base="string">
 152+ <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
 153+ <attribute name="deleted" use="optional" type="mw:DeletedFlagType"/>
 154+ </extension>
 155+ </simpleContent>
 156+ </complexType>
 157+
 158+
 159+ <complexType name="TextType">
 160+ <simpleContent>
 161+ <extension base="string">
 162+ <attribute ref="xml:space" use="optional" default="preserve" />
 163+ <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
 164+ <attribute name="deleted" use="optional" type="mw:DeletedFlagType"/>
 165+ <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
 166+ <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
 167+ <!-- usage ([0-9]+) and with the "ID" type. -->
 168+ <attribute name="id" type="NMTOKEN"/>
 169+ </extension>
 170+ </simpleContent>
 171+ </complexType>
 172+
 173+ <complexType name="ContributorType">
 174+ <sequence>
 175+ <element name="username" type="string" minOccurs="0"/>
 176+ <element name="id" type="positiveInteger" minOccurs="0" />
 177+
 178+ <element name="ip" type="string" minOccurs="0"/>
 179+ </sequence>
 180+ <!-- This allows deleted=deleted on non-empty elements, but XSD is not omnipotent -->
 181+ <attribute name="deleted" use="optional" type="mw:DeletedFlagType"/>
 182+ </complexType>
 183+
 184+ <complexType name="UploadType">
 185+ <sequence>
 186+ <!-- Revision-style data... -->
 187+ <element name="timestamp" type="dateTime"/>
 188+ <element name="contributor" type="mw:ContributorType"/>
 189+ <element name="comment" type="string" minOccurs="0"/>
 190+
 191+ <!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
 192+ <element name="filename" type="string"/>
 193+
 194+ <!-- URI at which this resource can be obtained -->
 195+ <element name="src" type="anyURI"/>
 196+
 197+ <element name="size" type="positiveInteger" />
 198+
 199+ <!-- TODO: add other metadata fields -->
 200+ </sequence>
 201+ </complexType>
 202+
 203+ <!-- Discussion threading data for LiquidThreads -->
 204+ <complexType name="DiscussionThreadingInfo">
 205+ <sequence>
 206+ <element name="ThreadSubject" type="string" />
 207+ <element name="ThreadParent" type="positiveInteger" />
 208+ <element name="ThreadAncestor" type="positiveInteger" />
 209+ <element name="ThreadPage" type="string" />
 210+ <element name="ThreadID" type="positiveInteger" />
 211+ <element name="ThreadAuthor" type="string" />
 212+ <element name="ThreadEditStatus" type="string" />
 213+ <element name="ThreadType" type="string" />
 214+ </sequence>
 215+ </complexType>
 216+
 217+</schema>
Property changes on: trunk/phase3/docs/export-0.5.xsd
___________________________________________________________________
Added: svn:eol-style
1218 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r809751.17: MFT r79856, r79877, r79878, r79885, r79924, r79926, r79952catrope18:07, 25 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79856Bug 26563: Add bytes changed per revision for stub and full article dumpsrobla03:11, 8 January 2011

Status & tagging log