summaryrefslogtreecommitdiff
path: root/schema/odf1.4/OpenDocument-v1.4-manifest-schema.rng
blob: 5e3e5df9ea36b2f9d3acf5c1f3271191e10b99a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?xml version="1.0" encoding="UTF-8"?>
<!--
     Open Document Format for Office Applications (OpenDocument) Version 1.4
     OASIS Standard
     11 March 2024
     Copyright (c) OASIS Open 2024. All Rights Reserved.
     Source: https://docs.oasis-open.org/office/OpenDocument/v1.4/csd01/schemas/
     Latest stage of specification: https://docs.oasis-open.org/office/OpenDocument/v1.4/OpenDocument-v1.4-part1-introduction.html
     TC IPR Statement: https://www.oasis-open.org/committees/office/ipr.php 

        Open Document Format for Office Applications (OpenDocument) Version 1.4
        Manifest Relax-NG Schema
        OpenDocument-v1.4-manifest-schema.rng
-->
<!-- https://issues.oasis-open.org/browse/OFFICE-2153 -->

<rng:grammar xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <rng:start>
    <rng:choice>
      <rng:ref name="manifest"/>
    </rng:choice>
  </rng:start>
  <rng:define name="algorithm">
    <rng:element name="manifest:algorithm">
      <rng:ref name="algorithm-attlist"/>
      <rng:ref name="anyElements"/>
    </rng:element>
  </rng:define>
  <rng:define name="algorithm-attlist">
    <rng:interleave>
      <rng:attribute name="manifest:algorithm-name">
        <rng:choice>
          <rng:value>Blowfish CFB</rng:value>
          <rng:ref name="anyURI"/>
        </rng:choice>
      </rng:attribute>
      <rng:attribute name="manifest:initialisation-vector">
        <rng:ref name="base64Binary"/>
      </rng:attribute>
    </rng:interleave>
  </rng:define>
  <rng:define name="anyAttListOrElements">
    <rng:zeroOrMore>
      <rng:attribute>
        <rng:anyName/>
        <rng:text/>
      </rng:attribute>
    </rng:zeroOrMore>
    <rng:ref name="anyElements"/>
  </rng:define>
  <rng:define name="anyElements">
    <rng:zeroOrMore>
      <rng:element>
        <rng:anyName/>
        <rng:mixed>
          <rng:ref name="anyAttListOrElements"/>
        </rng:mixed>
      </rng:element>
    </rng:zeroOrMore>
  </rng:define>
  <rng:define name="anyURI">
    <rng:data type="anyURI"/>
  </rng:define>
  <rng:define name="base64Binary">
    <rng:data type="base64Binary"/>
  </rng:define>
  <rng:define name="encrypted-key">
    <rng:element name="manifest:encrypted-key">
      <rng:optional>
        <rng:element name="manifest:encryption-method">
          <rng:attribute name="manifest:PGPAlgorithm">
            <rng:ref name="anyURI"/>
          </rng:attribute>
        </rng:element>
      </rng:optional>
      <rng:element name="manifest:keyinfo">
        <rng:element name="manifest:PGPData">
          <rng:element name="manifest:PGPKeyID">
            <rng:ref name="base64Binary"/>
          </rng:element>
          <rng:optional>
            <rng:element name="manifest:PGPKeyPacket">
              <rng:ref name="base64Binary"/>
            </rng:element>
          </rng:optional>
        </rng:element>
      </rng:element>
      <rng:element name="manifest:CipherData">
        <rng:element name="manifest:CipherValue">
          <rng:ref name="base64Binary"/>
        </rng:element>
      </rng:element>
    </rng:element>
  </rng:define>
  <rng:define name="encryption-data">
    <rng:element name="manifest:encryption-data">
      <rng:ref name="encryption-data-attlist"/>
      <rng:ref name="algorithm"/>
      <rng:optional>
        <rng:ref name="start-key-generation"/>
      </rng:optional>
      <rng:ref name="key-derivation"/>
    </rng:element>
  </rng:define>
  <rng:define name="encryption-data-attlist">
    <rng:interleave>
      <rng:attribute name="manifest:checksum-type">
        <rng:choice>
          <rng:value>SHA1/1K</rng:value>
          <rng:ref name="anyURI"/>
        </rng:choice>
      </rng:attribute>
      <rng:attribute name="manifest:checksum">
        <rng:ref name="base64Binary"/>
      </rng:attribute>
    </rng:interleave>
  </rng:define>
  <rng:define name="file-entry">
    <rng:element name="manifest:file-entry">
      <rng:ref name="file-entry-attlist"/>
      <rng:optional>
        <rng:ref name="encryption-data"/>
      </rng:optional>
    </rng:element>
  </rng:define>
  <rng:define name="file-entry-attlist">
    <rng:interleave>
      <rng:attribute name="manifest:full-path">
        <rng:ref name="string"/>
      </rng:attribute>
      <rng:optional>
        <rng:attribute name="manifest:size">
          <rng:ref name="nonNegativeInteger"/>
        </rng:attribute>
      </rng:optional>
      <rng:attribute name="manifest:media-type">
        <rng:ref name="string"/>
      </rng:attribute>
      <rng:optional>
        <rng:attribute name="manifest:preferred-view-mode">
          <rng:choice>
            <rng:value>edit</rng:value>
            <rng:value>presentation-slide-show</rng:value>
            <rng:value>read-only</rng:value>
            <rng:ref name="namespacedToken"/>
          </rng:choice>
        </rng:attribute>
      </rng:optional>
      <rng:optional>
        <rng:attribute name="manifest:version">
          <rng:ref name="string"/>
        </rng:attribute>
      </rng:optional>
    </rng:interleave>
  </rng:define>
  <rng:define name="key-derivation">
    <rng:element name="manifest:key-derivation">
      <rng:ref name="key-derivation-attlist"/>
      <rng:empty/>
    </rng:element>
  </rng:define>
  <rng:define name="key-derivation-attlist">
    <rng:choice>
      <rng:attribute name="manifest:key-derivation-name">
        <rng:value>PGP</rng:value>
      </rng:attribute>
      <rng:interleave>
        <rng:attribute name="manifest:key-derivation-name">
          <rng:choice>
            <rng:value>PBKDF2</rng:value>
            <rng:ref name="anyURI"/>
          </rng:choice>
        </rng:attribute>
        <rng:attribute name="manifest:salt">
          <rng:ref name="base64Binary"/>
        </rng:attribute>
        <rng:attribute name="manifest:iteration-count">
          <rng:ref name="nonNegativeInteger"/>
        </rng:attribute>
        <rng:optional>
          <rng:attribute name="manifest:key-size">
            <rng:ref name="nonNegativeInteger"/>
          </rng:attribute>
        </rng:optional>
      </rng:interleave>
    </rng:choice>
  </rng:define>
  <rng:define name="manifest">
    <rng:element name="manifest:manifest">
      <rng:ref name="manifest-attlist"/>
      <rng:zeroOrMore>
        <rng:ref name="encrypted-key"/>
      </rng:zeroOrMore>
      <!-- https://issues.oasis-open.org/browse/OFFICE-3940 -->
      <rng:oneOrMore>
        <rng:ref name="file-entry"/>
      </rng:oneOrMore>
    </rng:element>
  </rng:define>
  <rng:define name="manifest-attlist">
    <rng:attribute name="manifest:version">
      <rng:value>1.4</rng:value>
    </rng:attribute>
  </rng:define>
  <rng:define name="namespacedToken">
    <rng:data type="QName">
      <rng:param name="pattern">[^:]+:[^:]+</rng:param>
    </rng:data>
  </rng:define>
  <rng:define name="nonNegativeInteger">
    <rng:data type="nonNegativeInteger"/>
  </rng:define>
  <rng:define name="start-key-generation">
    <rng:element name="manifest:start-key-generation">
      <rng:ref name="start-key-generation-attlist"/>
      <rng:empty/>
    </rng:element>
  </rng:define>
  <rng:define name="start-key-generation-attlist">
    <rng:interleave>
      <rng:attribute name="manifest:start-key-generation-name">
        <rng:choice>
          <rng:value>SHA1</rng:value>
          <rng:ref name="anyURI"/>
        </rng:choice>
      </rng:attribute>
      <rng:optional>
        <rng:attribute name="manifest:key-size">
          <rng:ref name="nonNegativeInteger"/>
        </rng:attribute>
      </rng:optional>
    </rng:interleave>
  </rng:define>
  <rng:define name="string">
    <rng:data type="string"/>
  </rng:define>
</rng:grammar>