OpenDocument-v1.2-cs01-manifest-schema.rng 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Open Document Format for Office Applications (OpenDocument) Version 1.2
  4. Committee Specification (CS) 01, 17 March 2011
  5. Manifest Relax-NG Schema
  6. Copyright (c) OASIS Open 2002-2011. All Rights Reserved.
  7. All capitalized terms in the following text have the meanings assigned to them
  8. in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
  9. full Policy may be found at the OASIS website.
  10. This document and translations of it may be copied and furnished to others, and
  11. derivative works that comment on or otherwise explain it or assist in its
  12. implementation may be prepared, copied, published, and distributed, in whole or
  13. in part, without restriction of any kind, provided that the above copyright
  14. notice and this section are included on all such copies and derivative works.
  15. However, this document itself may not be modified in any way, including by
  16. removing the copyright notice or references to OASIS, except as needed for the
  17. purpose of developing any document or deliverable produced by an OASIS
  18. Technical Committee (in which case the rules applicable to copyrights, as set
  19. forth in the OASIS IPR Policy, must be followed) or as required to translate it
  20. into languages other than English.
  21. The limited permissions granted above are perpetual and will not be revoked by
  22. OASIS or its successors or assigns.
  23. This document and the information contained herein is provided on an "AS IS"
  24. basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  25. LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
  26. INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
  27. FITNESS FOR A PARTICULAR PURPOSE.
  28. -->
  29. <grammar
  30. xmlns="http://relaxng.org/ns/structure/1.0"
  31. datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
  32. xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
  33. >
  34. <start>
  35. <choice>
  36. <ref name="manifest"/>
  37. </choice>
  38. </start>
  39. <define name="manifest">
  40. <element name="manifest:manifest">
  41. <ref name="manifest-attlist"/>
  42. <oneOrMore>
  43. <ref name="file-entry"/>
  44. </oneOrMore>
  45. </element>
  46. </define>
  47. <define name="manifest-attlist">
  48. <attribute name="manifest:version">
  49. <value>1.2</value>
  50. </attribute>
  51. </define>
  52. <define name="file-entry">
  53. <element name="manifest:file-entry">
  54. <ref name="file-entry-attlist"/>
  55. <optional>
  56. <ref name="encryption-data"/>
  57. </optional>
  58. </element>
  59. </define>
  60. <define name="file-entry-attlist">
  61. <interleave>
  62. <attribute name="manifest:full-path">
  63. <ref name="string"/>
  64. </attribute>
  65. <optional>
  66. <attribute name="manifest:size">
  67. <ref name="nonNegativeInteger"/>
  68. </attribute>
  69. </optional>
  70. <attribute name="manifest:media-type">
  71. <ref name="string"/>
  72. </attribute>
  73. <optional>
  74. <attribute name="manifest:preferred-view-mode">
  75. <choice>
  76. <value>edit</value>
  77. <value>presentation-slide-show</value>
  78. <value>read-only</value>
  79. <ref name="namespacedToken"/>
  80. </choice>
  81. </attribute>
  82. </optional>
  83. <optional>
  84. <attribute name="manifest:version">
  85. <ref name="string"/>
  86. </attribute>
  87. </optional>
  88. </interleave>
  89. </define>
  90. <define name="encryption-data">
  91. <element name="manifest:encryption-data">
  92. <ref name="encryption-data-attlist"/>
  93. <ref name="algorithm"/>
  94. <optional>
  95. <ref name="start-key-generation"/>
  96. </optional>
  97. <ref name="key-derivation"/>
  98. </element>
  99. </define>
  100. <define name="encryption-data-attlist">
  101. <interleave>
  102. <attribute name="manifest:checksum-type">
  103. <choice>
  104. <value>SHA1/1K</value>
  105. <ref name="anyURI"/>
  106. </choice>
  107. </attribute>
  108. <attribute name="manifest:checksum">
  109. <ref name="base64Binary"/>
  110. </attribute>
  111. </interleave>
  112. </define>
  113. <define name="algorithm">
  114. <element name="manifest:algorithm">
  115. <ref name="algorithm-attlist"/>
  116. <ref name="anyElements"/>
  117. </element>
  118. </define>
  119. <define name="algorithm-attlist">
  120. <interleave>
  121. <attribute name="manifest:algorithm-name">
  122. <choice>
  123. <value>Blowfish CFB</value>
  124. <ref name="anyURI"/>
  125. </choice>
  126. </attribute>
  127. <attribute name="manifest:initialisation-vector">
  128. <ref name="base64Binary"/>
  129. </attribute>
  130. </interleave>
  131. </define>
  132. <define name="anyAttListOrElements">
  133. <zeroOrMore>
  134. <attribute>
  135. <anyName/>
  136. <text/>
  137. </attribute>
  138. </zeroOrMore>
  139. <ref name="anyElements"/>
  140. </define>
  141. <define name="anyElements">
  142. <zeroOrMore>
  143. <element>
  144. <anyName/>
  145. <mixed>
  146. <ref name="anyAttListOrElements"/>
  147. </mixed>
  148. </element>
  149. </zeroOrMore>
  150. </define>
  151. <define name="key-derivation">
  152. <element name="manifest:key-derivation">
  153. <ref name="key-derivation-attlist"/>
  154. <empty/>
  155. </element>
  156. </define>
  157. <define name="key-derivation-attlist">
  158. <interleave>
  159. <attribute name="manifest:key-derivation-name">
  160. <choice>
  161. <value>PBKDF2</value>
  162. <ref name="anyURI"/>
  163. </choice>
  164. </attribute>
  165. <attribute name="manifest:salt">
  166. <ref name="base64Binary"/>
  167. </attribute>
  168. <attribute name="manifest:iteration-count">
  169. <ref name="nonNegativeInteger"/>
  170. </attribute>
  171. <optional>
  172. <attribute name="manifest:key-size">
  173. <ref name="nonNegativeInteger"/>
  174. </attribute>
  175. </optional>
  176. </interleave>
  177. </define>
  178. <define name="start-key-generation">
  179. <element name="manifest:start-key-generation">
  180. <ref name="start-key-generation-attlist"/>
  181. <empty/>
  182. </element>
  183. </define>
  184. <define name="start-key-generation-attlist">
  185. <interleave>
  186. <attribute name="manifest:start-key-generation-name">
  187. <choice>
  188. <value>SHA1</value>
  189. <ref name="anyURI"/>
  190. </choice>
  191. </attribute>
  192. <optional>
  193. <attribute name="manifest:key-size">
  194. <ref name="nonNegativeInteger"/>
  195. </attribute>
  196. </optional>
  197. </interleave>
  198. </define>
  199. <define name="base64Binary">
  200. <data type="base64Binary"/>
  201. </define>
  202. <define name="namespacedToken">
  203. <data type="QName">
  204. <param name="pattern">[^:]+:[^:]+</param>
  205. </data>
  206. </define>
  207. <define name="nonNegativeInteger">
  208. <data type="nonNegativeInteger"/>
  209. </define>
  210. <define name="string">
  211. <data type="string"/>
  212. </define>
  213. <define name="anyURI">
  214. <data type="anyURI"/>
  215. </define>
  216. </grammar>