export-0.6.xsd 7.6 KB

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