summaryrefslogtreecommitdiff
path: root/etc/schema/OpenDocument-schema-v1.3+libreoffice.rnc
blob: 5239c84cb502c3243abc35d7fd657eb640dae7fd (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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# Open Document Format for Office Applications (OpenDocument) Version 1.3
# OASIS Standard, In progress
# Relax-NG Schema
# Source: https://tools.oasis-open.org/version-control/svn/office/
# Copyright (c) OASIS Open 2002-2015. All Rights Reserved.
#
# All capitalized terms in the following text have the meanings assigned to them
# in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
# full Policy may be found at the OASIS website.
#
# This document and translations of it may be copied and furnished to others, and
# derivative works that comment on or otherwise explain it or assist in its
# implementation may be prepared, copied, published, and distributed, in whole or
# in part, without restriction of any kind, provided that the above copyright
# notice and this section are included on all such copies and derivative works.
# However, this document itself may not be modified in any way, including by
# removing the copyright notice or references to OASIS, except as needed for the
# purpose of developing any document or deliverable produced by an OASIS
# Technical Committee (in which case the rules applicable to copyrights, as set
# forth in the OASIS IPR Policy, must be followed) or as required to translate it
# into languages other than English.
#
# The limited permissions granted above are perpetual and will not be revoked by
# OASIS or its successors or assigns.
#
# This document and the information contained herein is provided on an "AS IS"
# basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
# INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
# FITNESS FOR A PARTICULAR PURPOSE.

namespace anim = "urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
namespace calcext =
  "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
namespace chart = "urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
namespace chartooo = "http://openoffice.org/2010/chart"
namespace config = "urn:oasis:names:tc:opendocument:xmlns:config:1.0"
namespace css3t = "http://www.w3.org/TR/css3-text/"
namespace db = "urn:oasis:names:tc:opendocument:xmlns:database:1.0"
namespace dc = "http://purl.org/dc/elements/1.1/"
namespace dr3d = "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
namespace draw = "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
namespace drawooo = "http://openoffice.org/2010/draw"
namespace field =
  "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
namespace fo =
  "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
namespace form = "urn:oasis:names:tc:opendocument:xmlns:form:1.0"
namespace grddl = "http://www.w3.org/2003/g/data-view#"
namespace loext =
  "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
namespace math = "http://www.w3.org/1998/Math/MathML"
namespace meta = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
namespace number = "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
namespace office = "urn:oasis:names:tc:opendocument:xmlns:office:1.0"
namespace officeooo = "http://openoffice.org/2009/office"
namespace presentation =
  "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace script = "urn:oasis:names:tc:opendocument:xmlns:script:1.0"
namespace smil =
  "urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
namespace style = "urn:oasis:names:tc:opendocument:xmlns:style:1.0"
namespace svg =
  "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
namespace table = "urn:oasis:names:tc:opendocument:xmlns:table:1.0"
namespace tableooo = "http://openoffice.org/2009/table"
namespace text = "urn:oasis:names:tc:opendocument:xmlns:text:1.0"
namespace xforms = "http://www.w3.org/2002/xforms"
namespace xhtml = "http://www.w3.org/1999/xhtml"
namespace xlink = "http://www.w3.org/1999/xlink"

include "OpenDocument-schema-v1.3.rnc" {
  office-document-common-attrs =
    attribute office:version {
      # FIXME remove this hack once we write 1.3
      "1.3" | "1.2"
    }
    & attribute grddl:transformation {
        list { anyIRI* }
      }?
  style-graphic-properties-attlist =
    attribute draw:stroke { "none" | "dash" | "solid" }?
    & attribute draw:stroke-dash { styleNameRef }?
    & attribute draw:stroke-dash-names { styleNameRefs }?
    & attribute svg:stroke-width { length }?
    & attribute svg:stroke-color { color }?
    & attribute draw:marker-start { styleNameRef }?
    & attribute draw:marker-end { styleNameRef }?
    & attribute draw:marker-start-width { length }?
    & attribute draw:marker-end-width { length }?
    & attribute draw:marker-start-center { boolean }?
    & attribute draw:marker-end-center { boolean }?
    & attribute svg:stroke-opacity {
        xsd:double { minInclusive = "0" maxInclusive = "1" }
        | zeroToHundredPercent
      }?
    & attribute draw:stroke-linejoin {
        "miter" | "round" | "bevel" | "middle" | "none"
      }?
    & attribute svg:stroke-linecap { "butt" | "square" | "round" }?
    & attribute draw:symbol-color { color }?
    & attribute text:animation {
        "none" | "scroll" | "alternate" | "slide"
      }?
    & attribute text:animation-direction {
        "left" | "right" | "up" | "down"
      }?
    & attribute text:animation-start-inside { boolean }?
    & attribute text:animation-stop-inside { boolean }?
    & attribute text:animation-repeat { nonNegativeInteger }?
    & attribute text:animation-delay { duration }?
    & attribute text:animation-steps { length }?
    & attribute draw:auto-grow-width { boolean }?
    & attribute draw:auto-grow-height { boolean }?
    & # FIXME remove this once the export bug is fixed
      attribute draw:fit-to-size {
        "true" | "false" | "all" | "shrink-to-fit"
      }?
    & attribute draw:fit-to-contour { boolean }?
    & attribute draw:textarea-vertical-align {
        "top" | "middle" | "bottom" | "justify"
      }?
    & attribute draw:textarea-horizontal-align {
        "left" | "center" | "right" | "justify"
      }?
    & attribute fo:wrap-option { "no-wrap" | "wrap" }?
    & attribute style:shrink-to-fit { boolean }?
    & attribute draw:color-mode {
        "greyscale" | "mono" | "watermark" | "standard"
      }?
    & attribute draw:color-inversion { boolean }?
    & attribute draw:luminance { signedZeroToHundredPercent }
      # https://issues.oasis-open.org/browse/OFFICE-3821
      ?
    & attribute draw:contrast { percent }?
    & attribute draw:gamma { percent }?
    & attribute draw:red { signedZeroToHundredPercent }?
    & attribute draw:green { signedZeroToHundredPercent }?
    & attribute draw:blue { signedZeroToHundredPercent }?
    & attribute draw:image-opacity { zeroToHundredPercent }?
    & attribute draw:shadow { "visible" | "hidden" }?
    & attribute draw:shadow-offset-x { length }?
    & attribute draw:shadow-offset-y { length }?
    & attribute draw:shadow-color { color }?
    & attribute draw:shadow-opacity { zeroToHundredPercent }?
    & # TODO: no proposal for loext:shadow-blur
      attribute loext:shadow-blur { length }?
    & attribute draw:start-line-spacing-horizontal { distance }?
    & attribute draw:start-line-spacing-vertical { distance }?
    & attribute draw:end-line-spacing-horizontal { distance }?
    & attribute draw:end-line-spacing-vertical { distance }?
    & attribute draw:line-distance { distance }?
    & attribute draw:guide-overhang { length }?
    & attribute draw:guide-distance { distance }?
    & attribute draw:start-guide { length }?
    & attribute draw:end-guide { length }?
    & attribute draw:placing { "below" | "above" }?
    & attribute draw:parallel { boolean }?
    & attribute draw:measure-align {
        "automatic" | "left-outside" | "inside" | "right-outside"
      }?
    & attribute draw:measure-vertical-align {
        "automatic" | "above" | "below" | "center"
      }?
    & attribute draw:unit {
        "automatic"
        | "mm"
        | "cm"
        | "m"
        | "km"
        | "pt"
        | "pc"
        | "inch"
        | "ft"
        | "mi"
      }?
    & attribute draw:show-unit { boolean }?
    & attribute draw:decimal-places { nonNegativeInteger }?
    & attribute draw:caption-type {
        "straight-line" | "angled-line" | "angled-connector-line"
      }?
    & attribute draw:caption-angle-type { "fixed" | "free" }?
    & attribute draw:caption-angle { angle }?
    & attribute draw:caption-gap { distance }?
    & attribute draw:caption-escape-direction {
        "horizontal" | "vertical" | "auto"
      }?
    & attribute draw:caption-escape { length | percent }?
    & attribute draw:caption-line-length { length }?
    & attribute draw:caption-fit-line-length { boolean }?
    & attribute dr3d:horizontal-segments { nonNegativeInteger }?
    & attribute dr3d:vertical-segments { nonNegativeInteger }?
    & attribute dr3d:edge-rounding { percent }?
    & attribute dr3d:edge-rounding-mode { "correct" | "attractive" }?
    & attribute dr3d:back-scale { percent }?
    & attribute dr3d:depth { length }?
    & attribute dr3d:backface-culling { "enabled" | "disabled" }?
    & attribute dr3d:end-angle { angle }?
    & attribute dr3d:close-front { boolean }?
    & attribute dr3d:close-back { boolean }?
    & attribute dr3d:lighting-mode { "standard" | "double-sided" }?
    & attribute dr3d:normals-kind { "object" | "flat" | "sphere" }?
    & attribute dr3d:normals-direction { "normal" | "inverse" }?
    & attribute dr3d:texture-generation-mode-x {
        "object" | "parallel" | "sphere"
      }?
    & attribute dr3d:texture-generation-mode-y {
        "object" | "parallel" | "sphere"
      }?
    & attribute dr3d:texture-kind {
        "luminance" | "intensity" | "color"
      }?
    & attribute dr3d:texture-filter { "enabled" | "disabled" }?
    & attribute dr3d:texture-mode { "replace" | "modulate" | "blend" }?
    & attribute dr3d:ambient-color { color }?
    & attribute dr3d:emissive-color { color }?
    & attribute dr3d:specular-color { color }?
    & attribute dr3d:diffuse-color { color }?
    & attribute dr3d:shininess { percent }?
    & attribute dr3d:shadow { "visible" | "hidden" }?
    & common-draw-rel-size-attlist
    & attribute fo:min-width { length | percent }?
    & attribute fo:min-height { length | percent }?
    & attribute fo:max-height { length | percent }?
    & attribute fo:max-width { length | percent }?
    & common-horizontal-margin-attlist
    & common-vertical-margin-attlist
    & common-margin-attlist
    & attribute style:print-content { boolean }?
    & attribute style:protect {
        "none"
        | list { ("content" | "position" | "size")+ }
      }?
    & attribute style:horizontal-pos {
        "left"
        | "center"
        | "right"
        | "from-left"
        | "inside"
        | "outside"
        | "from-inside"
      }?
    & attribute svg:x { coordinate }?
    & attribute style:horizontal-rel {
        "page"
        | "page-content"
        | "page-start-margin"
        | "page-end-margin"
        | "frame"
        | "frame-content"
        | "frame-start-margin"
        | "frame-end-margin"
        | "paragraph"
        | "paragraph-content"
        | "paragraph-start-margin"
        | "paragraph-end-margin"
        | "char"
      }?
    & common-vertical-pos-attlist
    & common-vertical-rel-attlist
    & common-text-anchor-attlist
    & common-border-attlist
    & common-border-line-width-attlist
    & common-padding-attlist
    & common-shadow-attlist
    & common-background-color-attlist
    & common-background-transparency-attlist
    & common-editable-attlist
    & attribute style:wrap {
        "none"
        | "left"
        | "right"
        | "parallel"
        | "dynamic"
        | "run-through"
        | "biggest"
      }?
    & attribute style:wrap-dynamic-threshold { nonNegativeLength }?
    & attribute style:number-wrapped-paragraphs {
        "no-limit" | positiveInteger
      }?
    & attribute style:wrap-contour { boolean }?
    & attribute style:wrap-contour-mode { "full" | "outside" }?
    & attribute style:run-through { "foreground" | "background" }?
    & attribute style:flow-with-text { boolean }?
    & attribute style:overflow-behavior {
        "clip" | "auto-create-new-frame"
      }?
    & attribute style:mirror {
        "none"
        | "vertical"
        | horizontal-mirror
        | list { "vertical", horizontal-mirror }
        | list { horizontal-mirror, "vertical" }
      }?
    & attribute fo:clip { "auto" | clipShape }?
    & attribute draw:wrap-influence-on-position {
        "iterative" | "once-concurrent" | "once-successive"
      }?
    & common-writing-mode-attlist
    & attribute draw:frame-display-scrollbar { boolean }?
    & attribute draw:frame-display-border { boolean }?
    & attribute draw:frame-margin-horizontal { nonNegativePixelLength }?
    & attribute draw:frame-margin-vertical { nonNegativePixelLength }?
    & attribute draw:visible-area-left { nonNegativeLength }?
    & attribute draw:visible-area-top { nonNegativeLength }?
    & attribute draw:visible-area-width { positiveLength }?
    & attribute draw:visible-area-height { positiveLength }?
    & attribute draw:draw-aspect {
        "content" | "thumbnail" | "icon" | "print-view"
      }?
    & attribute draw:ole-draw-aspect { nonNegativeInteger }?
    & # https://issues.oasis-open.org/browse/OFFICE-4047
      attribute loext:allow-overlap { boolean }?
    & # TODO: no proposal for loext:glow*
      attribute loext:glow-radius { length }?
    & attribute loext:glow-color { color }?
    & attribute loext:glow-transparency { zeroToHundredPercent }?
    & # TODO: no proposal for loext:softedge-radius
      attribute loext:softedge-radius { length }?
  draw-text =
    (text-p
     | text-list
     | # https://issues.oasis-open.org/browse/OFFICE-3761
       loext-table)*
  office-annotation-attlist &=
    attribute office:display { boolean }?
    & common-office-annotation-name-attlist?
    & attribute loext:resolved { boolean }?
  style-style-content =
    (attribute style:family { "text" },
     style-text-properties?)
    | (attribute style:family { "paragraph" },
       # TODO no proposal
       loext-graphic-properties?,
       style-paragraph-properties?,
       style-text-properties?)
    | (attribute style:family { "section" },
       style-section-properties?)
    | (attribute style:family { "ruby" },
       style-ruby-properties?)
    | (attribute style:family { "table" },
       style-table-properties?)
    | (attribute style:family { "table-column" },
       style-table-column-properties?)
    | (attribute style:family { "table-row" },
       style-table-row-properties?)
    | (attribute style:family { "table-cell" },
       # TODO no proposal
       loext-graphic-properties?,
       style-table-cell-properties?,
       style-paragraph-properties?,
       style-text-properties?)
    | (attribute style:family { "graphic" | "presentation" },
       style-graphic-properties?,
       style-paragraph-properties?,
       style-text-properties?)
    | (attribute style:family { "drawing-page" },
       style-drawing-page-properties?)
    | (attribute style:family { "chart" },
       style-chart-properties?,
       style-graphic-properties?,
       style-paragraph-properties?,
       style-text-properties?)
  table-table-template =
    element table:table-template {
      table-table-template-attlist,
      table-first-row?,
      table-last-row?,
      table-first-column?,
      table-last-column?,
      table-body,
      table-even-rows?,
      table-odd-rows?,
      table-even-columns?,
      table-odd-columns?,
      table-background?,
      # TODO no proposal
      table-first-row-even-column?,
      table-last-row-even-column?,
      table-first-row-end-column?,
      table-first-row-start-column?,
      table-last-row-end-column?,
      table-last-row-start-column?
    }
  draw-frame =
    element draw:frame {
      common-draw-shape-with-text-and-styles-attlist,
      common-draw-position-attlist,
      common-draw-rel-size-attlist,
      common-draw-caption-id-attlist,
      presentation-shape-attlist,
      draw-frame-attlist,
      (draw-text-box
       | draw-image
       | draw-object
       | draw-object-ole
       | draw-applet
       | draw-floating-frame
       | draw-plugin
       | table-table)*,
      office-event-listeners?,
      draw-glue-point*,
      draw-image-map?,
      svg-title?,
      svg-desc?,
      (draw-contour-polygon | draw-contour-path)?,
      # TODO no proposal
      loext-signatureline?,
      loext-qrcode?
    }
  common-value-and-type-attlist =
    (attribute office:value-type { "float" },
     attribute calcext:value-type { "float" }?,
     attribute office:value { double })
    | (attribute office:value-type { "percentage" },
       attribute calcext:value-type { "percentage" }?,
       attribute office:value { double })
    | (attribute office:value-type { "currency" },
       attribute calcext:value-type { "currency" }?,
       attribute office:value { double },
       attribute office:currency { \string }?)
    | (attribute office:value-type { "date" },
       attribute calcext:value-type { "date" }?,
       attribute office:date-value { dateOrDateTime })
    | (attribute office:value-type { "time" },
       attribute calcext:value-type { "time" }?,
       attribute office:time-value { duration })
    | (attribute office:value-type { "boolean" },
       attribute calcext:value-type { "boolean" }?,
       attribute office:boolean-value { boolean })
    | (attribute office:value-type { "string" },
       # OFFICE-3759
       attribute calcext:value-type { "string" | "error" }?,
       attribute office:string-value { \string }?)
  chart-axis =
    element chart:axis {
      chart-axis-attlist,
      # OFFICE-2119
      ((attribute chartooo:axis-type { "auto" },
        chartooo-date-scale?)
       | (attribute chartooo:axis-type { "date" },
          chartooo-date-scale)
       | attribute chartooo:axis-type { "text" })?,
      chart-title?,
      chart-categories?,
      chart-grid*
    }
  table-table =
    element table:table {
      table-table-attlist,
      table-title?,
      table-desc?,
      # TODO add to proposal, OFFICE-2112
      table-table-protection?,
      table-table-source?,
      office-dde-source?,
      table-scenario?,
      office-forms?,
      table-shapes?,
      table-columns-and-groups,
      table-rows-and-groups,
      table-named-expressions?,
      # TODO no proposal, this is wild guessing, OFFICE-3785
      element calcext:conditional-formats {
        element calcext:conditional-format {
          attribute calcext:target-range-address { cellRangeAddress },
          (element calcext:condition {
             attribute calcext:apply-style-name { styleNameRef },
             attribute calcext:value { \string },
             attribute calcext:base-cell-address { cellAddress }
           }+
           | element calcext:data-bar {
               attribute calcext:max-length { \string },
               attribute calcext:negative-color { color },
               attribute calcext:positive-color { color },
               attribute calcext:axis-color { color },
               attribute calcext:axis-position { "middle" }?,
               element calcext:formatting-entry {
                 attribute calcext:value { \string },
                 attribute calcext:type {
                   "auto-minimum"
                   | "auto-maximum"
                   | "minimum"
                   | "maximum"
                   | "percent"
                   | "percentile"
                   | "number"
                   | "formula"
                 }
               },
               element calcext:formatting-entry {
                 attribute calcext:value { \string },
                 attribute calcext:type {
                   "auto-minimum"
                   | "auto-maximum"
                   | "minimum"
                   | "maximum"
                   | "percent"
                   | "percentile"
                   | "number"
                   | "formula"
                 }
               }
             }
           | element calcext:color-scale {
               element calcext:color-scale-entry {
                 attribute calcext:value { \string },
                 attribute calcext:type {
                   "minimum"
                   | "maximum"
                   | "percent"
                   | "percentile"
                   | "number"
                   | "formula"
                 },
                 attribute calcext:color { color }
               },
               element calcext:color-scale-entry {
                 attribute calcext:value { \string },
                 attribute calcext:type {
                   "minimum"
                   | "maximum"
                   | "percent"
                   | "percentile"
                   | "number"
                   | "formula"
                 },
                 attribute calcext:color { color }
               },
               element calcext:color-scale-entry {
                 attribute calcext:value { \string },
                 attribute calcext:type {
                   "minimum"
                   | "maximum"
                   | "percent"
                   | "percentile"
                   | "number"
                   | "formula"
                 },
                 attribute calcext:color { color }
               }?
             })
        }+
      }?
    }
  # TODO no proposal
  draw-object =
    element draw:object {
      draw-object-attlist,
      loext-text,
      (common-draw-data-attlist | office-document | math-math)
    }
  draw-object-ole =
    element draw:object-ole {
      draw-object-ole-attlist,
      loext-text,
      (common-draw-data-attlist | office-binary-data)
    }
  # FIXME: one test exports 250 here, which is probably a bug
  fontWeight =
    "normal"
    | "bold"
    | "100"
    | "200"
    | "250"
    | "300"
    | "400"
    | "500"
    | "600"
    | "700"
    | "800"
    | "900"
}
# TODO no proposal
loext-p =
  element loext:p { paragraph-attrs, paragraph-content-or-hyperlink* }
loext-text = (loext-p | text-list | loext-table)*
# OFFICE-2119
chartooo-date-scale =
  element chartooo:date-scale {
    attribute chart:base-time-unit { chart-time-unit }?
    & (attribute chart:major-interval-value { positiveInteger },
       attribute chart:major-interval-unit { chart-time-unit })?
    & (attribute chart:minor-interval-value { positiveInteger },
       attribute chart:minor-interval-unit { chart-time-unit })?
  }
chart-time-unit = "days" | "months" | "years"
# TODO no proposal
loext-signatureline =
  element loext:signatureline {
    attribute loext:id { \string },
    attribute loext:suggested-signer-name { \string },
    attribute loext:suggested-signer-title { \string },
    attribute loext:suggested-signer-email { \string },
    attribute loext:signing-instructions { \string },
    attribute loext:show-sign-date { boolean },
    attribute loext:can-add-comment { boolean }
  }
loext-qrcode =
  element loext:qrcode {
    attribute office:string-value { \string },
    attribute loext:qrcode-errorcorrection {
      "low" | "medium" | "quartile" | "high"
    },
    attribute loext:qrcode-border { nonNegativeInteger }
  }
# https://issues.oasis-open.org/browse/OFFICE-3761
loext-table =
  element loext:table {
    table-table-attlist,
    table-title?,
    table-desc?,
    table-table-source?,
    office-dde-source?,
    table-scenario?,
    office-forms?,
    table-shapes?,
    loext-columns-and-groups,
    loext-rows-and-groups,
    table-named-expressions?
  }
loext-rows-and-groups = (table-table-row-group | loext-rows-no-group)+
loext-rows-no-group =
  (loext-rows, (table-table-header-rows, loext-rows?)?)
  | (table-table-header-rows, loext-rows?)
loext-rows =
  table-table-rows | (text-soft-page-break?, loext-table-row)+
loext-table-row =
  element loext:table-row {
    table-table-row-attlist,
    (loext-table-cell | loext-covered-table-cell)+
  }
loext-table-cell =
  element loext:table-cell {
    table-table-cell-attlist,
    table-table-cell-attlist-extra,
    table-table-cell-content
  }
loext-covered-table-cell =
  element loext:covered-table-cell {
    table-table-cell-attlist, table-table-cell-content
  }
loext-columns-and-groups =
  (table-table-column-group | loext-columns-no-group)+
loext-columns-no-group =
  (loext-columns, (table-table-header-columns, loext-columns?)?)
  | (table-table-header-columns, loext-columns?)
loext-columns = loext-table-columns | loext-table-column+
loext-table-columns =
  element loext:table-columns { loext-table-column+ }
loext-table-column =
  element loext:table-column { table-table-column-attlist, empty }
loext-graphic-properties =
  element loext:graphic-properties {
    style-graphic-properties-content-strict
  }
table-first-row-even-column =
  element loext:first-row-even-column {
    common-table-template-attlist, empty
  }
table-last-row-even-column =
  element loext:last-row-even-column {
    common-table-template-attlist, empty
  }
table-first-row-end-column =
  element loext:first-row-end-column {
    common-table-template-attlist, empty
  }
table-first-row-start-column =
  element loext:first-row-start-column {
    common-table-template-attlist, empty
  }
table-last-row-end-column =
  element loext:last-row-end-column {
    common-table-template-attlist, empty
  }
table-last-row-start-column =
  element loext:last-row-start-column {
    common-table-template-attlist, empty
  }
common-draw-rel-size-attlist &=
  # OFFICE-3854
  attribute loext:rel-width-rel {
    "page"
    | [
        # TODO layout-environment ?

      ]
      "paragraph"
  }?,
  attribute loext:rel-height-rel { "page" | "paragraph" }?
common-svg-font-face-xlink-attlist &=
  # TODO no proposal
  attribute loext:font-style { fontStyle }?,
  attribute loext:font-weight { fontWeight }?
# TODO no proposal

# there's no ref-attrs so add it here
text-common-ref-content &=
  attribute loext:reference-language { language }?
style-list-level-label-alignment-attlist &=
  # TODO no proposal
  attribute loext:label-followed-by {
    "listtab" | "space" | "nothing" | "newline"
  }?
style-ruby-properties-attlist &=
  # TODO proposal, OFFICE-3944
  attribute loext:ruby-position {
    "above" | "below" | "inter-character"
  }?
style-text-properties-attlist &=
  # TODO no proposal
  attribute officeooo:rsid { \string }?,
  attribute officeooo:paragraph-rsid { \string }?,
  # https://issues.oasis-open.org/browse/OFFICE-4049
  attribute loext:opacity { zeroToHundredPercent }?
style-text-properties-attlist &=
  # OFFICE-3843
  attribute loext:padding { nonNegativeLength }?,
  attribute loext:padding-left { nonNegativeLength }?,
  attribute loext:padding-right { nonNegativeLength }?,
  attribute loext:padding-top { nonNegativeLength }?,
  attribute loext:padding-bottom { nonNegativeLength }?,
  attribute loext:border { \string }?,
  attribute loext:border-left { \string }?,
  attribute loext:border-right { \string }?,
  attribute loext:border-top { \string }?,
  attribute loext:border-bottom { \string }?,
  attribute loext:shadow { shadowType }?
# TODO no proposal
style-chart-properties-attlist &=
  attribute loext:try-staggering-first { boolean }?
# TODO no proposal
style-chart-properties-attlist &=
  attribute loext:std-weight { \string }?
# TODO no proposal
chart-series-attlist &= attribute loext:label-string { \string }?
# OFFICE-1148
style-chart-properties-attlist &=
  attribute loext:regression-max-degree { positiveInteger }?,
  attribute loext:regression-force-intercept { boolean }?,
  attribute loext:regression-intercept-value { double }?,
  attribute loext:regression-name { \string }?,
  attribute loext:regression-period { \string }?,
  attribute loext:regression-extrapolate-forward { \string }?,
  attribute loext:regression-extrapolate-backward { \string }?
# TODO no proposal
table-data-pilot-field-attlist &=
  attribute tableooo:display-name { \string }?
# TODO no proposal, 9009663d
chart-chart-attlist &= attribute loext:data-pilot-source { \string }?
# OFFICE-2112, TODO half of this missing in proposal
table-table-protection =
  element loext:table-protection {
    attribute loext:select-protected-cells { boolean }?,
    attribute loext:select-unprotected-cells { boolean }?,
    attribute loext:insert-columns { boolean }?,
    attribute loext:insert-rows { boolean }?,
    attribute loext:delete-columns { boolean }?,
    attribute loext:delete-rows { boolean }?
  }
office-spreadsheet-attlist &=
  attribute loext:protection-key-digest-algorithm-2 { anyURI }?
table-table-attlist &=
  attribute loext:protection-key-digest-algorithm-2 { anyURI }?
# https://issues.oasis-open.org/browse/OFFICE-2317
vertJustifyValues = "auto" | "distribute"
common-text-justify =
  attribute css3t:text-justify { vertJustifyValues }?
style-vertical-justify =
  attribute loext:vertical-justify { vertJustifyValues }?,
  attribute style:vertical-justify { vertJustifyValues }?
style-paragraph-properties-attlist &=
  (common-text-justify, style-vertical-justify)?
style-table-cell-properties-attlist &=
  (common-text-justify, style-vertical-justify)?
number-fraction-attlist &=
  # OFFICE-3695

  # TODO no proposal, 1544a26ac9f7dd60605dd21e9cbe29d490aafdce
  attribute loext:max-numerator-digits { positiveInteger }?
# TODO no proposal
table-data-pilot-level-attlist &=
  attribute calcext:repeat-item-labels { boolean }?
# TODO no proposal
draw-enhanced-geometry-attlist &=
  attribute drawooo:sub-view-size { \string }?,
  attribute drawooo:enhanced-path { \string }?
# TODO no proposal
draw-custom-shape-attlist &= common-draw-rel-size-attlist
# TODO no proposal
style-page-layout-properties-attlist &=
  style-graphic-fill-properties-attlist
style-header-footer-properties-attlist &=
  style-graphic-fill-properties-attlist
# TODO no proposal
text-index-entry-tab-stop-attrs &= attribute style:with-tab { boolean }?
# TODO no proposal
style-text-properties-attlist &=
  attribute loext:char-shading-value { \string }?
# TODO no proposal
text-bookmark-start-attlist &=
  (attribute loext:hidden { boolean },
   attribute loext:condition { \string }?)?
# TODO no proposal; see 7a5d79f2297a43d0a854e304b0792164272edfe0

# FIXME this is almost certainly incomplete: need to figure out which elements can have this and which named pattern can be extended with it to get exactly these elements
form-checkbox-attlist &= attribute form:input-required { boolean }?
# https://issues.oasis-open.org/browse/OFFICE-4030
common-writing-mode-attlist &= attribute loext:writing-mode { "bt-lr" }?
# https://issues.oasis-open.org/browse/OFFICE-4073
common-vertical-rel-attlist &=
  attribute loext:vertical-rel {
    "page-content-top" | "page-content-bottom"
  }?
# https://issues.oasis-open.org/browse/OFFICE-4105
style-page-layout-properties-attlist &=
  attribute loext:margin-gutter { length }?
# just a test-case for user-defined attributes, move along, nothing to see here...
style-table-cell-properties-attlist &= attribute proName { \string }?
# TODO no proposal
chart-data-point-attlist &=
  attribute loext:custom-label-field { \string }?
# TODO no proposal
style-text-properties-attlist &=
  attribute loext:hyphenation-no-caps { boolean }?
# TODO no proposal
chart-data-point-attlist &=
  (attribute loext:custom-label-pos-x { double },
   attribute loext:custom-label-pos-y { double })?
# TODO no proposal
chart-legend-attlist &= attribute loext:overlay { boolean }?
# https://issues.oasis-open.org/browse/OFFICE-3936
style-chart-properties-attlist &=
  attribute loext:major-origin { double }?
# TODO no proposal
text-index-entry-chapter-attrs &=
  attribute loext:outline-content-visible { boolean }?
# https://issues.oasis-open.org/browse/OFFICE-2096
paragraph-content |=
  element field:fieldmark-start {
    attribute text:name { \string },
    attribute field:type {
      # TODO <rng:ref name="namespacedToken"/>
      \string
    },
    element field:param {
      attribute field:name { \string },
      attribute field:value { \string }
    }*
  }
paragraph-content |= element field:fieldmark-end { empty }
paragraph-content |=
  element field:fieldmark {
    attribute text:name { \string },
    attribute field:type {
      # TODO <rng:ref name="namespacedToken"/>
      \string
    },
    element field:param {
      attribute field:name { \string },
      attribute field:value { \string }
    }*
  }
# TODO no proposal
animation-element |=
  element loext:animatePhysics {
    common-anim-target-attlist,
    common-timing-attlist,
    animate-physics-attlist
  }
animate-physics-attlist =
  # default value: 0
  attribute loext:velocity-x { double }?,
  # default value: 0
  attribute loext:velocity-y { double }?,
  # default value: 0.1
  attribute loext:bounciness {
    xsd:double { minInclusive = "0" maxInclusive = "1" }
  }?,
  # default value: 1
  attribute loext:density {
    xsd:double { minInclusive = "0" }
  }?
# TODO no proposal
style-chart-properties-attlist &=
  attribute loext:custom-leader-lines { boolean }?
# TODO no proposal
style-chart-properties-attlist &=
  attribute loext:external-data { \string }?