summaryrefslogtreecommitdiff
path: root/doc/rtfx.xsd
blob: 922b0a6cff80c29bacee187861a5266cb24f4fd1 (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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://memberwebs.com/ns/rtfx/"
    xmlns="http://memberwebs.com/ns/rtfx/" elementFormDefault="qualified">

    <!--
         Copyright (c) 2004, Nate Nielsen
         All rights reserved.

         Redistribution and use in source and binary forms, with or without
         modification, are permitted provided that the following conditions
         are met:

             * Redistributions of source code must retain the above
               copyright notice, this list of conditions and the
               following disclaimer.
             * Redistributions in binary form must reproduce the
               above copyright notice, this list of conditions and
               the following disclaimer in the documentation and/or
               other materials provided with the distribution.
             * The names of contributors to this software may not be
               used to endorse or promote products derived from this
               software without specific prior written permission.

         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
         "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
         LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
         FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
         COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
         INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
         BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
         OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
         AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
         OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
         THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
         DAMAGE.

          CONTRIBUTORS
              Nate Nielsen <nielsen@memberwebs.com>
    -->

    <xs:element name="document">
        <xs:annotation>
            <xs:documentation>The entire RTF document.</xs:documentation>
        </xs:annotation>

        <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="meta"/>
                <xs:group ref="section"/>
                <xs:group ref="block"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>


    <!-- ##################################################################
            DOCUMENT META INFO
    -->

    <xs:group name="meta">
        <xs:annotation>
            <xs:documentation>Tags that that contain data about the document and general formatting.</xs:documentation>
        </xs:annotation>

        <xs:choice>
            <xs:element ref="info" maxOccurs="1"/>
            <xs:element ref="stylesheet" maxOccurs="1"/>
            <xs:element ref="options" maxOccurs="1"/>
        </xs:choice>
    </xs:group>

    <xs:element name="stylesheet">
        <xs:annotation>
            <xs:documentation>Contains a list of all the paragraph styles in the document, and their various formatting attributes.</xs:documentation>
        </xs:annotation>

        <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="style"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

    <xs:element name="style">
        <xs:annotation>
            <xs:documentation>Represents a paragraph style used in the document.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="name" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The style name.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="bold" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation>Style text bold.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="hide" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation>Style text hidden.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="italic" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation>Style text italicized.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="strike" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation>Style text striken out.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="underline" type="xs:boolean" default="false">
                <xs:annotation>
                    <xs:documentation>Style text underlined.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="color" type="xs:integer" default="0">
                <xs:annotation>
                    <xs:documentation>Style text color [NOTE: This attribute is only generated in 'presentation' mode].</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="face" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Style font face [NOTE: This attribute is only generated in 'presentation' mode].</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="size" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Style font size [NOTE: This attribute is only generated in 'presentation' mode].</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="info">
        <xs:annotation>
            <xs:documentation>Document meta information.</xs:documentation>
        </xs:annotation>

        <xs:complexType>
            <xs:all>
                   <xs:element name="title" type="xs:string" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>The document title.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="author" type="xs:string" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>The document author.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="operator" type="xs:string" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>The document operator.</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:element name="options">
        <xs:annotation>
            <xs:documentation>Document options and defaults.</xs:documentation>
        </xs:annotation>

        <xs:complexType>
            <xs:all>
                <xs:element ref="font" minOccurs="0"/>
            </xs:all>
        </xs:complexType>
    </xs:element>


    <!-- ##################################################################
            SECTION CONTENT
    -->

    <xs:group name="section">
        <xs:annotation>
            <xs:documentation>Tags that break a document into various sections.</xs:documentation>
        </xs:annotation>

        <xs:choice>
            <xs:element ref="sect"/>
            <xs:element ref="page"/>
            <xs:element ref="footnote"/>
        </xs:choice>
    </xs:group>

    <xs:element name="sect">
        <xs:annotation>
            <xs:documentation>A section break.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="page">
        <xs:annotation>
            <xs:documentation>A 'hard' page break.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="footnote">
        <xs:annotation>
            <xs:documentation>A footnote. Footnotes are all usually grouped together at the end of the document.</xs:documentation>
        </xs:annotation>

        <xs:complexType mixed="true">
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="block"/>
            </xs:choice>
            <xs:attribute name="id" type="xs:integer">
                <xs:annotation>
                    <xs:documentation>The footnote number.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>


    <!-- ##################################################################
            BLOCK CONTENT
    -->

    <xs:group name="block">
        <xs:annotation>
            <xs:documentation>Block type elements.</xs:documentation>
        </xs:annotation>

        <xs:choice>
            <xs:element ref="para"/>
            <xs:element ref="list"/>
            <xs:element ref="table"/>
        </xs:choice>
    </xs:group>

    <xs:element name="para">
        <xs:annotation>
            <xs:documentation>A paragraph. One of the main basic building blocks of the document. Basically all text and other 'inline' elements are contained in paragraphs.</xs:documentation>
        </xs:annotation>

        <xs:complexType mixed="true">
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="inline"/>
            </xs:choice>
            <xs:attribute name="style" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The paragraph style name.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="list">
        <xs:annotation>
            <xs:documentation>A list. Lists contain paragraphs each of which is an item in the list.</xs:documentation>
        </xs:annotation>

        <xs:complexType mixed="true">
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="block"/>
            </xs:choice>

            <xs:attribute name="ordered" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>Whether a numbered list or not.</xs:documentation>
                </xs:annotation>
            </xs:attribute>

            <xs:attribute name="start" type="xs:integer">
                <xs:annotation>
                    <xs:documentation>For numbered lists the number to start at.</xs:documentation>
                </xs:annotation>
            </xs:attribute>

            <xs:attribute name="type" default="disc">
                <xs:annotation>
                    <xs:documentation>The type of bullet or number on a list.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="arabic"/>
                        <xs:enumeration value="upper-roman"/>
                        <xs:enumeration value="lower-roman"/>
                        <xs:enumeration value="upper-alpha"/>
                        <xs:enumeration value="lower-alpha"/>
                        <xs:enumeration value="disc"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>

        </xs:complexType>
    </xs:element>


    <!-- ##################################################################
            TABLE STRUCTURE
    -->

    <xs:element name="table">
        <xs:annotation>
            <xs:documentation>A table.</xs:documentation>
        </xs:annotation>

        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">

                <xs:element name="row">
                    <xs:annotation>
                        <xs:documentation>A row in a table.</xs:documentation>
                    </xs:annotation>

                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">

                            <xs:element name="cell">
                                <xs:annotation>
                                    <xs:documentation>A cell in a table. Each cell can contain multiple paragraphs or other block elements.</xs:documentation>
                                </xs:annotation>

                                <xs:complexType>
                                    <xs:choice minOccurs="0" maxOccurs="unbounded">
                                        <xs:group ref="block"/>
                                    </xs:choice>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>


    <!-- ##################################################################
            INLINE CONTENT
    -->

    <xs:complexType name="inline" mixed="true">
        <xs:annotation>
            <xs:documentation>Inline elements flow with the text and/or change attributes in the text.</xs:documentation>
        </xs:annotation>

        <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:group ref="inline"/>
        </xs:choice>
    </xs:complexType>

    <xs:group name="inline">
        <xs:annotation>
            <xs:documentation>Inline elements flow with the text and/or change attributes in the text.</xs:documentation>
        </xs:annotation>

        <xs:choice>
            <xs:element ref="b"/>
            <xs:element ref="tab"/>
            <xs:element ref="line"/>
            <xs:element ref="hide"/>
            <xs:element ref="i"/>
            <xs:element ref="strike"/>
            <xs:element ref="u"/>
            <xs:element ref="super"/>
            <xs:element ref="sub"/>
            <xs:element ref="ref"/>
            <xs:element ref="font"/>
        </xs:choice>
    </xs:group>

    <xs:element name="line">
        <xs:annotation>
            <xs:documentation>A 'hard' line break.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="tab">
        <xs:annotation>
            <xs:documentation>A tab.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="b" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is bold.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="i" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is italic.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="u" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is underlined.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="strike" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is striken out.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="super" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is superscript.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="sub" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is subscript.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="hide" type="inline">
        <xs:annotation>
            <xs:documentation>Contained text is hidden.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ref">
        <xs:annotation>
            <xs:documentation>A reference to another part of the document such as a footnote.</xs:documentation>
        </xs:annotation>

        <xs:complexType mixed="true">
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="inline"/>
            </xs:choice>

            <xs:attribute name="type" fixed="footnote">
                <xs:annotation>
                    <xs:documentation>The type of object this reference is pointing to. Currently only footnotes are supported.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="footnote"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>

            <xs:attribute name="to" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The identifier of the object this reference is pointing to.</xs:documentation>
                </xs:annotation>
            </xs:attribute>

        </xs:complexType>
    </xs:element>

    <xs:element name="font">
        <xs:annotation>
            <xs:documentation>Font information for contained text [NOTE: This tag is only generated in 'presentation' mode].</xs:documentation>
        </xs:annotation>

        <xs:complexType mixed="true">
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:group ref="inline"/>
            </xs:choice>
            <xs:attribute name="name" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The name of the font.</xs:documentation>
                </xs:annotation>
            </xs:attribute>

            <xs:attribute name="size" type="xs:integer">
                <xs:annotation>
                    <xs:documentation>The size of the font.</xs:documentation>
                </xs:annotation>
            </xs:attribute>

            <xs:attribute name="color" type="xs:integer">
                <xs:annotation>
                    <xs:documentation>The color of the text.</xs:documentation>
                </xs:annotation>
            </xs:attribute>

        </xs:complexType>
    </xs:element>


</xs:schema>