export-0.4.xsd 7.2 KB

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