export-0.3.xsd 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. The canonical URL to the schema document is:
  10. http://www.mediawiki.org/xml/export-0.3.xsd
  11. Use the namespace:
  12. http://www.mediawiki.org/xml/export-0.3/
  13. -->
  14. <schema xmlns="http://www.w3.org/2001/XMLSchema"
  15. xmlns:mw="http://www.mediawiki.org/xml/export-0.3/"
  16. targetNamespace="http://www.mediawiki.org/xml/export-0.3/"
  17. elementFormDefault="qualified">
  18. <annotation>
  19. <documentation xml:lang="en">
  20. MediaWiki's page export format
  21. </documentation>
  22. </annotation>
  23. <!-- Need this to reference xml:lang -->
  24. <import namespace="http://www.w3.org/XML/1998/namespace"
  25. schemaLocation="http://www.w3.org/2001/xml.xsd"/>
  26. <!-- Our root element -->
  27. <element name="mediawiki" type="mw:MediaWikiType"/>
  28. <complexType name="MediaWikiType">
  29. <sequence>
  30. <element name="siteinfo" type="mw:SiteInfoType"
  31. minOccurs="0" maxOccurs="1"/>
  32. <element name="page" type="mw:PageType"
  33. minOccurs="0" maxOccurs="unbounded"/>
  34. </sequence>
  35. <attribute name="version" type="string" use="required"/>
  36. <attribute ref="xml:lang" use="required"/>
  37. </complexType>
  38. <complexType name="SiteInfoType">
  39. <sequence>
  40. <element name="sitename" type="string" minOccurs="0" />
  41. <element name="base" type="anyURI" minOccurs="0" />
  42. <element name="generator" type="string" minOccurs="0" />
  43. <element name="case" type="mw:CaseType" minOccurs="0" />
  44. <element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
  45. </sequence>
  46. </complexType>
  47. <simpleType name="CaseType">
  48. <restriction base="NMTOKEN">
  49. <!-- Cannot have two titles differing only by case of first letter. -->
  50. <!-- Default behavior through 1.5, $wgCapitalLinks = true -->
  51. <enumeration value="first-letter" />
  52. <!-- Complete title is case-sensitive -->
  53. <!-- Behavior when $wgCapitalLinks = false -->
  54. <enumeration value="case-sensitive" />
  55. <!-- Cannot have two titles differing only by case. -->
  56. <!-- Not yet implemented as of MediaWiki 1.5 -->
  57. <enumeration value="case-insensitive" />
  58. </restriction>
  59. </simpleType>
  60. <complexType name="NamespacesType">
  61. <sequence>
  62. <element name="namespace" type="mw:NamespaceType"
  63. minOccurs="0" maxOccurs="unbounded" />
  64. </sequence>
  65. </complexType>
  66. <complexType name="NamespaceType">
  67. <simpleContent>
  68. <extension base="string">
  69. <attribute name="key" type="integer" />
  70. </extension>
  71. </simpleContent>
  72. </complexType>
  73. <complexType name="PageType">
  74. <sequence>
  75. <!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
  76. <element name="title" type="string"/>
  77. <!-- optional page ID number -->
  78. <element name="id" type="positiveInteger" minOccurs="0"/>
  79. <!-- comma-separated list of string tokens, if present -->
  80. <element name="restrictions" type="string" minOccurs="0"/>
  81. <!-- Zero or more sets of revision or upload data -->
  82. <choice minOccurs="0" maxOccurs="unbounded">
  83. <element name="revision" type="mw:RevisionType" />
  84. <element name="upload" type="mw:UploadType" />
  85. </choice>
  86. </sequence>
  87. </complexType>
  88. <complexType name="RevisionType">
  89. <sequence>
  90. <element name="id" type="positiveInteger" minOccurs="0"/>
  91. <element name="timestamp" type="dateTime"/>
  92. <element name="contributor" type="mw:ContributorType"/>
  93. <element name="minor" minOccurs="0" />
  94. <element name="comment" type="string" minOccurs="0"/>
  95. <element name="text" type="mw:TextType" />
  96. </sequence>
  97. </complexType>
  98. <complexType name="TextType">
  99. <simpleContent>
  100. <extension base="string">
  101. <attribute ref="xml:space" use="optional" default="preserve" />
  102. </extension>
  103. </simpleContent>
  104. </complexType>
  105. <complexType name="ContributorType">
  106. <sequence>
  107. <element name="username" type="string" minOccurs="0"/>
  108. <element name="id" type="positiveInteger" minOccurs="0" />
  109. <element name="ip" type="string" minOccurs="0"/>
  110. </sequence>
  111. </complexType>
  112. <complexType name="UploadType">
  113. <sequence>
  114. <!-- Revision-style data... -->
  115. <element name="timestamp" type="dateTime"/>
  116. <element name="contributor" type="mw:ContributorType"/>
  117. <element name="comment" type="string" minOccurs="0"/>
  118. <!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
  119. <element name="filename" type="string"/>
  120. <!-- URI at which this resource can be obtained -->
  121. <element name="src" type="anyURI"/>
  122. <element name="size" type="positiveInteger" />
  123. <!-- TODO: add other metadata fields -->
  124. </sequence>
  125. </complexType>
  126. </schema>