export-0.5.xsd 7.3 KB

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