gnumeric.xsd 62.2 KB
Newer Older
Jody Goldberg's avatar
Jody Goldberg committed
1
<?xml version="1.0" encoding="UTF-8"?>
Jody Goldberg's avatar
Jody Goldberg committed
2
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
            xmlns:gnm="http://www.gnumeric.org/v14.dtd"
4
	    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
5
            targetNamespace="http://www.gnumeric.org/v14.dtd"
Jody Goldberg's avatar
Jody Goldberg committed
6 7 8
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

Jody Goldberg's avatar
Jody Goldberg committed
9 10
    <xs:annotation>
        <xs:documentation xml:lang="en">
Jody Goldberg's avatar
Jody Goldberg committed
11
            Schema for gnumeric spreadsheet documents
12
            Created for Gnumeric 1.2.2,
13 14 15
            Based on gnumeric source code and sample gnumeric documents
            Author: Marc Johnson (marc_johnson27591@hotmail.com)

16 17
	    updated for 1.4.2 in Feb 2005
	    updated for 1.6.0 in Sept 2005
18
	    updated for 1.7.1 in Jun 2006
19
	    updated for 1.7.11 in Jun 2007	jody@gnome.org
20
	    updated for 1.7.91 in Nov 2007	jody@gnome.org
21
	    partially updated for 1.10.17 in July 2011	aguelzow@pyrshep.ca
22
	    partially updated for 1.12.13 in March 2014	terra@gnome.org
23
	    updated for 1.12.21 in Feb 2015	terra@gnome.org
Jody Goldberg's avatar
Jody Goldberg committed
24 25
        </xs:documentation>
    </xs:annotation>
Jody Goldberg's avatar
Jody Goldberg committed
26
    
Jody Goldberg's avatar
Jody Goldberg committed
27
    <xs:element name="Workbook" type="gnm:Workbook"/>
Jody Goldberg's avatar
Jody Goldberg committed
28

Jody Goldberg's avatar
Jody Goldberg committed
29 30 31 32 33 34 35
    <xs:complexType name="Version">
	<xs:attribute name="Epoch"  type="xs:nonNegativeInteger" use="required"/>
	<xs:attribute name="Major"  type="xs:nonNegativeInteger" use="required"/>
	<xs:attribute name="Minor"  type="xs:nonNegativeInteger" use="required"/>
	<xs:attribute name="Full"   type="xs:string"	    use="required"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
36

37 38 39 40 41 42 43 44 45
    <xs:complexType name="Calculation">
	  <xs:attribute name="ManualRecalc"	  type="xs:boolean"/>
	  <xs:attribute name="EnableIteration"    type="xs:boolean"/>
	  <xs:attribute name="MaxIterations"	  type="xs:nonNegativeInteger"/>
	  <xs:attribute name="FloatRadix"	  type="xs:positiveInteger"/>
	  <xs:attribute name="FloatDigits"	  type="xs:nonNegativeInteger"/>
	  <xs:attribute name="IterationTolerance" type="xs:double"/>
	  <xs:attribute name="DateConvention"     type="gnm:DateConvention" use="optional" default="Lotus:1900"/>
	  <xs:anyAttribute namespace="##other" processContents="lax"/>
Jody Goldberg's avatar
Jody Goldberg committed
46
    </xs:complexType>
47

48 49 50 51 52 53 54 55 56 57 58 59
    <xs:group name="WorkbookContentBlockA">
      <xs:sequence>
	<!-- ancient files lack this, modern files require it -->
	<xs:element name="SheetNameIndex"	type="gnm:SheetNameIndex" minOccurs="0" maxOccurs="1"/>
	
	<xs:element name="Names"		type="gnm:Names" minOccurs="0" maxOccurs="1"/>
	
	<!-- Deprecated, moved to Calculation and expanded in 1.7.11
	     Valid value == 1904, anything else == Lotus:1900 -->
	<xs:element name="DateConvention"	type="xs:int" minOccurs="0" maxOccurs="1"/>
	
	<!-- preferred height and width -->
Morten Welinder's avatar
Morten Welinder committed
60
	<xs:element name="Geometry" minOccurs="0" maxOccurs="1">
61 62 63 64 65 66 67 68 69 70 71 72 73 74
	  <xs:complexType>
	    <xs:attribute name="Width"  type="xs:nonNegativeInteger" use="optional"/>
	    <xs:attribute name="Height" type="xs:nonNegativeInteger" use="optional"/>
	    <xs:anyAttribute namespace="##other" processContents="lax"/>
	  </xs:complexType>
	</xs:element>
	<xs:element name="Sheets"         type="gnm:Sheets"/>
	<!-- which sheet was selected when the spreadsheet was saved? -->
	<xs:element name="UIData">
	  <xs:complexType>
	    <xs:attribute name="SelectedTab" type="xs:nonNegativeInteger" use="required"/>
	    <xs:anyAttribute namespace="##other" processContents="lax"/>
	  </xs:complexType>
	</xs:element>
75 76
	<xs:element name="GODoc" form="unqualified" minOccurs="0">
	</xs:element>
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
      </xs:sequence>
    </xs:group>
    
    <xs:complexType name="Workbook">
      <xs:sequence>
	<xs:element name="Version"      type="gnm:Version" minOccurs="0" maxOccurs="1"/>
	<xs:element name="Attributes"	type="gnm:Attributes"/>
	
	<!-- ignore office:document-meta -->
	<xs:any minOccurs="0" maxOccurs="unbounded"
		namespace="##other" processContents="lax"/>

	<xs:choice>
	  <xs:sequence> <!-- In new files the Calculation element comes first, in old files last -->
	    <xs:element name="Calculation" type="gnm:Calculation" minOccurs="0" maxOccurs="1"/>
	    <xs:group ref="gnm:WorkbookContentBlockA"/>
	  </xs:sequence>
	  <xs:sequence>
	    <xs:group ref="gnm:WorkbookContentBlockA"/>
	    <xs:element name="Calculation" type="gnm:Calculation" minOccurs="0" maxOccurs="1"/>
	  </xs:sequence>
	</xs:choice>
      </xs:sequence>
      <!-- version number should be v10 - - &gt;
	   <xs:attribute name="gnm" type="gnm:namespace" use="required"/> -->
      <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
    
105
    <!-- How values are mapped to dates.   All date functions are affected -->
Jody Goldberg's avatar
Jody Goldberg committed
106
    <xs:simpleType name="DateConvention">
107 108
      <xs:restriction base="xs:string">
	<xs:enumeration value="Lotus:1900"/>
Jody Goldberg's avatar
Jody Goldberg committed
109
            <xs:enumeration value="Apple:1904"/>
110 111
	    
	    <!-- future values. currently treated as Lotus:1900 -->
Jody Goldberg's avatar
Jody Goldberg committed
112
            <xs:enumeration value="ODF:1899"/>
113
      </xs:restriction>
Jody Goldberg's avatar
Jody Goldberg committed
114 115 116 117
    </xs:simpleType>

    <xs:simpleType name="CellRef">
        <xs:restriction base="xs:string">
Morten Welinder's avatar
Morten Welinder committed
118
            <xs:pattern value="$?[A-Z]+$?\d+"/>
Jody Goldberg's avatar
Jody Goldberg committed
119 120 121 122 123 124 125 126
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Names">
        <xs:sequence>
            <xs:element name="Name" minOccurs="0" maxOccurs="unbounded">
		<xs:complexType>
		    <xs:sequence>
127 128 129
			<!-- an oversight in the sax exporter (fixed in 1.4.3)
			     leaves off the namespace.  Handle both formats.
			  -->
Jody Goldberg's avatar
Jody Goldberg committed
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
			<xs:choice>
			    <xs:element name="name"	type="xs:string"/>
			    <xs:element name="name"	type="xs:string" form="unqualified"/>
			</xs:choice>
			<xs:choice>
			    <xs:element name="value"	type="xs:string"/>
			    <xs:element name="value"	type="xs:string" form="unqualified"/>
			</xs:choice>
			<xs:choice>
			    <xs:element name="position" type="xs:string"/>
			    <xs:element name="position" type="xs:string" form="unqualified"/>
			</xs:choice>
		    </xs:sequence>
		</xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Attributes">
        <xs:sequence>
            <xs:element name="Attribute" minOccurs="0" maxOccurs="unbounded">
		<xs:complexType>
                    <xs:sequence>
			<xs:element name="type"  minOccurs="0" maxOccurs="1" type="gnm:AttributeType"/><!-- must be 4 -->
			<xs:element name="name"  minOccurs="1" maxOccurs="1" type="xs:string"/>
			<xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
                    </xs:sequence>
		</xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="AttributeType">
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="4"/>
            <xs:maxInclusive value="4"/>
        </xs:restriction>
    </xs:simpleType>

168
   <xs:complexType name="SheetNameIndex">
Jody Goldberg's avatar
Jody Goldberg committed
169
        <xs:sequence>
170 171 172 173 174 175 176 177 178 179
            <xs:element name="SheetName" minOccurs="0" maxOccurs="unbounded">
	      <xs:complexType>
		<xs:simpleContent>
		  <xs:extension base="xs:string">
		    <xs:attribute name="Cols" type="xs:positiveInteger" form="qualified"/>
		    <xs:attribute name="Rows" type="xs:positiveInteger" form="qualified"/>
		  </xs:extension>
		</xs:simpleContent>
	      </xs:complexType>
	    </xs:element>
Jody Goldberg's avatar
Jody Goldberg committed
180 181 182 183 184 185 186 187
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Sheets">
        <xs:sequence>
            <xs:element name="Sheet" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
Jody Goldberg's avatar
Jody Goldberg committed
188
                        <!-- name of the sheet -->
Jody Goldberg's avatar
Jody Goldberg committed
189
                        <xs:element name="Name"             type="xs:string"/>
Jody Goldberg's avatar
Jody Goldberg committed
190
                        <!-- maximum column used -->
Jody Goldberg's avatar
Jody Goldberg committed
191
                        <xs:element name="MaxCol"           type="xs:integer" minOccurs="0" maxOccurs="1"/>
Jody Goldberg's avatar
Jody Goldberg committed
192
                        <!-- maximum row used -->
Jody Goldberg's avatar
Jody Goldberg committed
193
                        <xs:element name="MaxRow"           type="xs:integer" minOccurs="0" maxOccurs="1"/>
Jody Goldberg's avatar
Jody Goldberg committed
194
                        <!-- most recently used zoom factor -->
Jody Goldberg's avatar
Jody Goldberg committed
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
                        <xs:element name="Zoom"             type="xs:double"/>
			<xs:element name="Names"	    type="gnm:Names" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="PrintInformation" type="gnm:PrintInformation"/>
                        <xs:element name="Styles"           type="gnm:Styles"/>
                        <xs:element name="Cols">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="ColInfo" type="gnm:Col_Row" minOccurs="0" maxOccurs="unbounded"/>
                                </xs:sequence>
                                <xs:attribute name="DefaultSizePts" type="xs:double" use="required"/>
				<xs:anyAttribute namespace="##other" processContents="lax"/>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="Rows">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="RowInfo" type="gnm:Col_Row" minOccurs="0" maxOccurs="unbounded"/>
                                </xs:sequence>
                                <xs:attribute name="DefaultSizePts" type="xs:double" use="required"/>
				<xs:anyAttribute namespace="##other" processContents="lax"/>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="Selections"      type="gnm:Selections"/>
                        <xs:element name="Objects"         type="gnm:Objects" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="Cells"           type="gnm:Cells"/>
                        <xs:element name="MergedRegions"   type="gnm:MergedRegions" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="SheetLayout"     type="gnm:SheetLayout" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="Filters"	   type="gnm:Filters" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="Solver"          type="gnm:Solver" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="Scenarios"       type="gnm:Scenarios" minOccurs="0" maxOccurs="1"/>
                    </xs:sequence>
                        <!-- note: xs:boolean values can be true, false, 1, 0;
Jody Goldberg's avatar
Jody Goldberg committed
227 228 229
                             gnumeric, in this element, always generates 'true' or
                             'false' for its attributes
                        -->
Jody Goldberg's avatar
Jody Goldberg committed
230 231 232 233 234 235 236 237 238 239 240 241 242
                    <xs:attribute name="DisplayFormulas"     type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="HideZero"            type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="HideGrid"            type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="HideColHeader"       type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="HideRowHeader"       type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="DisplayOutlines"     type="xs:boolean" use="optional" default="true"/>
                    <xs:attribute name="OutlineSymbolsBelow" type="xs:boolean" use="optional" default="true"/>
                    <xs:attribute name="OutlineSymbolsRight" type="xs:boolean" use="optional" default="true"/>
                    <xs:attribute name="Visibility"	     type="gnm:SheetVisibility" use="optional" default="GNM_SHEET_VISIBILITY_VISIBLE"/>
                    <xs:attribute name="RTL_Layout"	     type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="Protected"	     type="xs:boolean" use="optional" default="false"/>
                    <xs:attribute name="TabColor"	     type="gnm:color"   use="optional"/>
                    <xs:attribute name="TabTextColor"	     type="gnm:color"   use="optional"/>
243
                    <xs:attribute name="GridColor"	     type="gnm:color"   use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
244 245 246 247 248 249
		    <xs:attribute name="ExprConvention"      type="gnm:ExprConvention" use="optional" default="gnumeric:A1"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
250

251
    <!-- How expressions are _displayed_ no impact on evaluation -->
Jody Goldberg's avatar
Jody Goldberg committed
252 253 254 255
    <xs:simpleType name="ExprConvention">
        <xs:restriction base="xs:string">
            <xs:enumeration value="gnumeric:A1"/>
            <xs:enumeration value="gnumeric:R1C1"/>
256 257

<!-- future values, currently displayed as gnumeric:A1 -->
Jody Goldberg's avatar
Jody Goldberg committed
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
            <xs:enumeration value="ODF:A1"/>
            <xs:enumeration value="Lotus:A1"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="PrintInformation">
        <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element name="Margins">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="top"    type="gnm:margin"/>
                        <xs:element name="bottom" type="gnm:margin"/>
                        <xs:element name="left"   type="gnm:margin" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element name="right"  type="gnm:margin" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element name="header" type="gnm:margin" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element name="footer" type="gnm:margin" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="Scale">
                <xs:complexType>
                    <xs:attribute name="type" type="xs:string" use="required"/>
		    <xs:attribute name="percentage" type="xs:double" use="optional"/>
		    <xs:attribute name="cols" type="xs:integer" />
		    <xs:attribute name="rows" type="xs:integer" />
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
286
            <!-- center vertically -->
Jody Goldberg's avatar
Jody Goldberg committed
287 288 289 290 291 292
            <xs:element name="vcenter">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
293
            <!-- center horizontally -->
Jody Goldberg's avatar
Jody Goldberg committed
294 295 296 297 298 299
            <xs:element name="hcenter">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
300
            <!-- print grid lines -->
Jody Goldberg's avatar
Jody Goldberg committed
301 302 303 304 305 306
            <xs:element name="grid">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
307
            <!-- print even if only styles -->
Jody Goldberg's avatar
Jody Goldberg committed
308 309 310 311 312 313
            <xs:element name="even_if_only_styles">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
314
            <!-- print in monochrome -->
Jody Goldberg's avatar
Jody Goldberg committed
315 316 317 318 319 320
            <xs:element name="monochrome">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
321
            <!-- print in draft mode -->
Jody Goldberg's avatar
Jody Goldberg committed
322 323 324 325 326 327
            <xs:element name="draft">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
328
            <!-- print titles -->
Jody Goldberg's avatar
Jody Goldberg committed
329 330 331 332 333 334
            <xs:element name="titles">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:boolean" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
335

Jody Goldberg's avatar
Jody Goldberg committed
336
            <!-- repeat range -->
Jody Goldberg's avatar
Jody Goldberg committed
337 338 339 340 341 342
            <xs:element name="repeat_top" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:string" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
Jody Goldberg's avatar
Jody Goldberg committed
343
            <!-- repeat range -->
Jody Goldberg's avatar
Jody Goldberg committed
344 345 346 347 348 349 350 351 352 353
            <xs:element name="repeat_left" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:attribute name="value" type="xs:string" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="order"       type="gnm:print_ordering"/>
            <xs:element name="orientation" type="gnm:print_orientation"/>
            <xs:element name="Header"	    type="gnm:HeaderFooter"/>
            <xs:element name="Footer"	    type="gnm:HeaderFooter"/>
Jody Goldberg's avatar
Jody Goldberg committed
354
            <!-- typical values are A4, US-Letter -->
Jody Goldberg's avatar
Jody Goldberg committed
355
            <xs:element name="paper"       type="xs:string" minOccurs="0" maxOccurs="1"/>
356 357
            <xs:element name="comments"    type="gnm:PrintComments"/>
            <xs:element name="errors"      type="gnm:PrintErrors"/>
358
	    <!-- do not print this sheet when "all" is selected in the job -->
Jody Goldberg's avatar
Jody Goldberg committed
359 360 361 362 363
	    <xs:element name="do_not_print"	minOccurs="0" maxOccurs="1">
	        <xs:complexType>
	            <xs:attribute name="value" type="xs:boolean" use="required"/>
	        </xs:complexType>
	    </xs:element>
364
            <xs:element name="print-to-uri" type="xs:string" minOccurs="0" maxOccurs="1"/>
Jody Goldberg's avatar
Jody Goldberg committed
365 366
            <xs:element name="vPageBreaks" type="gnm:PageBreaks" minOccurs="0" maxOccurs="1"/><!-- between rows -->
            <xs:element name="hPageBreaks" type="gnm:PageBreaks" minOccurs="0" maxOccurs="1"/><!-- between cols -->
367 368 369 370
            <xs:element name="print_range" minOccurs="0" maxOccurs="1">
	        <xs:complexType>
	            <xs:attribute name="value" use="required">
		      <xs:simpleType>
371 372 373 374 375 376 377 378 379
			<xs:restriction base="xs:string">
			  <xs:enumeration value="GNM_PRINT_SAVED_INFO"/>
			  <xs:enumeration value="GNM_PRINT_ACTIVE_SHEET"/>
			  <xs:enumeration value="GNM_PRINT_ALL_SHEETS"/>
			  <xs:enumeration value="GNM_PRINT_ALL_SHEETS_INCLUDING_HIDDEN"/>
			  <xs:enumeration value="GNM_PRINT_SHEET_RANGE"/>
			  <xs:enumeration value="GNM_PRINT_SHEET_SELECTION"/>
			  <xs:enumeration value="GNM_PRINT_IGNORE_PRINTAREA"/>
			  <xs:enumeration value="GNM_PRINT_SHEET_SELECTION_IGNORE_PRINTAREA"/>
380 381 382 383 384 385
			</xs:restriction>
		      </xs:simpleType>
		    </xs:attribute>
	        </xs:complexType>
	    </xs:element>
	  </xs:choice>
Jody Goldberg's avatar
Jody Goldberg committed
386 387 388 389 390 391 392 393 394 395
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="HeaderFooter">
	<xs:attribute name="Left"   type="xs:string" use="optional"/>
	<xs:attribute name="Middle" type="xs:string" use="optional"/>
	<xs:attribute name="Right"  type="xs:string" use="optional"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

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
    <xs:complexType name="PrintComments">
	<xs:attribute name="placement" type="gnm:PrintCommentsPlacement"/>
    </xs:complexType>

    <xs:simpleType name="PrintCommentsPlacement">
	<xs:restriction base="xs:string">
	  <xs:enumeration value="GNM_PRINT_COMMENTS_NONE"/>
	  <xs:enumeration value="GNM_PRINT_COMMENTS_IN_PLACE"/>
	  <xs:enumeration value="GNM_PRINT_COMMENTS_AT_END"/>
	</xs:restriction>
    </xs:simpleType>

    <xs:complexType name="PrintErrors">
	<xs:attribute name="PrintErrorsAs" type="gnm:PrintErrorsAs"/>
    </xs:complexType>

    <xs:simpleType name="PrintErrorsAs">
	<xs:restriction base="xs:string">
	  <xs:enumeration value="GNM_PRINT_ERRORS_AS_DISPLAYED"/>
	  <xs:enumeration value="GNM_PRINT_ERRORS_AS_BLANK"/>
	  <xs:enumeration value="GNM_PRINT_ERRORS_AS_DASHES"/>
	  <xs:enumeration value="GNM_PRINT_ERRORS_AS_NA"/>
	</xs:restriction>
    </xs:simpleType>

Jody Goldberg's avatar
Jody Goldberg committed
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
    <xs:complexType name="PageBreaks">
	<xs:sequence>
	    <xs:element name="break" minOccurs="0" maxOccurs="unbounded">
		<xs:complexType>
		    <xs:attribute name="pos"   type="xs:nonNegativeInteger"	use="required"/>
		    <xs:attribute name="type"  type="gnm:PageBreakType"	use="optional"		default="auto"/>
		</xs:complexType>
	    </xs:element>
	</xs:sequence>
	<xs:attribute name="count" type="xs:nonNegativeInteger" use="optional"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:simpleType name="PageBreakType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="auto"/>
            <xs:enumeration value="manual"/>
            <xs:enumeration value="data-slice"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="margin">
        <xs:attribute name="Points"   type="xs:double"/>
        <xs:attribute name="PrefUnit" type="gnm:print_units"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
447
    
Jody Goldberg's avatar
Jody Goldberg committed
448 449 450
    <xs:simpleType name="print_units">
        <xs:restriction base="xs:string">
            <xs:enumeration value="mm"/>
451
            <xs:enumeration value="millimeter"/>
Jody Goldberg's avatar
Jody Goldberg committed
452
            <xs:enumeration value="cm"/>
453
            <xs:enumeration value="centimeter"/>
Jody Goldberg's avatar
Jody Goldberg committed
454
            <xs:enumeration value="in"/>
455 456
            <xs:enumeration value="inch"/>
            <xs:enumeration value="inches"/>
Jody Goldberg's avatar
Jody Goldberg committed
457
            <xs:enumeration value="Pt"/>
458
            <xs:enumeration value="Pts"/>
Jody Goldberg's avatar
Jody Goldberg committed
459 460 461 462 463 464
            <xs:enumeration value="points"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="print_ordering">
        <xs:restriction base="xs:string">
Jody Goldberg's avatar
Jody Goldberg committed
465
            <!-- right, then down -->
Jody Goldberg's avatar
Jody Goldberg committed
466
            <xs:enumeration value="r_then_d"/>
Jody Goldberg's avatar
Jody Goldberg committed
467
            <!-- down, then right -->
Jody Goldberg's avatar
Jody Goldberg committed
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
            <xs:enumeration value="d_then_r"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="print_orientation">
        <xs:restriction base="xs:string">
            <xs:enumeration value="landscape"/>
            <xs:enumeration value="portrait"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Styles">
        <xs:sequence>
            <xs:element name="StyleRegion" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="Style" type="gnm:Style" minOccurs="1" maxOccurs="1"/>
                    </xs:sequence>
                    <xs:attribute name="startCol" type="xs:nonNegativeInteger" use="required"/>
                    <xs:attribute name="startRow" type="xs:nonNegativeInteger" use="required"/>
                    <xs:attribute name="endCol"   type="xs:nonNegativeInteger" use="required"/>
                    <xs:attribute name="endRow"   type="xs:nonNegativeInteger" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Style">
        <xs:sequence>
            <xs:element name="Font" minOccurs="0" maxOccurs="1">
                <xs:complexType>
500 501
                    <xs:simpleContent> <!-- Since these might be conditional styles, the atributes are 
				       not required -->
Jody Goldberg's avatar
Jody Goldberg committed
502
                        <xs:extension base="xs:string">
503 504 505 506 507 508
                            <xs:attribute name="Unit"          type="xs:double"	        use="optional"/>
                            <xs:attribute name="Bold"          type="xs:boolean"	use="optional"/>
                            <xs:attribute name="Italic"        type="xs:boolean"	use="optional"/>
                            <xs:attribute name="Underline"     type="gnm:underline"	use="optional"/>
                            <xs:attribute name="StrikeThrough" type="xs:boolean"	use="optional"/>
                            <xs:attribute name="Script"        type="gnm:script"	use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
509 510 511 512 513 514 515 516 517 518 519 520 521
			    <xs:anyAttribute namespace="##other" processContents="lax"/>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="HyperLink" minOccurs="0" maxOccurs="1">
                <xs:complexType>
		    <xs:attribute name="type"          type="xs:string"  use="required"/>
		    <xs:attribute name="target"        type="xs:string"  use="optional"/>
		    <xs:attribute name="tip"		type="xs:string"  use="optional"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
Morten Welinder's avatar
Morten Welinder committed
522 523 524 525 526 527 528 529 530 531 532
            <xs:element name="Condition" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
		    <xs:sequence>
			<xs:element name="Expression0"	type="xs:string"  minOccurs="0" maxOccurs="1"/>
			<xs:element name="Expression1"	type="xs:string"  minOccurs="0" maxOccurs="1"/>
			<xs:element name="Style"	type="gnm:Style"  minOccurs="1" maxOccurs="1"/>
		    </xs:sequence>
		    <xs:attribute name="Operator"	type="gnm:CondOp" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
Jody Goldberg's avatar
Jody Goldberg committed
533 534
            <xs:element name="StyleBorder" minOccurs="0" maxOccurs="1">
                <xs:complexType>
535 536
                    <xs:choice minOccurs="0"	maxOccurs="6"> <!-- The order of the last two elements appears to be 
								    version dependent-->
Jody Goldberg's avatar
Jody Goldberg committed
537 538 539 540
                        <xs:element name="Top"          type="gnm:StyleBorderElement"	minOccurs="0"	maxOccurs="1"/>
                        <xs:element name="Bottom"       type="gnm:StyleBorderElement"	minOccurs="0"	maxOccurs="1"/>
                        <xs:element name="Left"         type="gnm:StyleBorderElement"	minOccurs="0"	maxOccurs="1"/>
                        <xs:element name="Right"        type="gnm:StyleBorderElement"	minOccurs="0"	maxOccurs="1"/>
541 542 543
			<xs:element name="Diagonal"     type="gnm:StyleBorderElement"	minOccurs="0"	maxOccurs="1"/>
			<xs:element name="Rev-Diagonal" type="gnm:StyleBorderElement"	minOccurs="0"	maxOccurs="1"/>
                    </xs:choice>
Jody Goldberg's avatar
Jody Goldberg committed
544 545 546 547 548 549 550 551
                </xs:complexType>
            </xs:element>
            <xs:element name="Validation" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
			<xs:element name="Expression0"	type="xs:string"   minOccurs="0"	maxOccurs="1"/>
			<xs:element name="Expression1"	type="xs:string"   minOccurs="0"	maxOccurs="1"/>
                    </xs:sequence>
552 553 554
		    <xs:attribute name="Style"		type="gnm:ValidationStyle"  use="required"/>
		    <xs:attribute name="Type"		type="gnm:ValidationType"  use="required"/>
		    <xs:attribute name="Operator"	type="gnm:ValidationOperator"  use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
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
		    <xs:attribute name="AllowBlank"	type="xs:boolean"  use="optional"/>
		    <xs:attribute name="UseDropdown"	type="xs:boolean"  use="optional"/>
		    <xs:attribute name="Title"		type="xs:string"   use="optional"/>
		    <xs:attribute name="Message"	type="xs:string"   use="optional"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>

            <xs:element name="InputMessage" minOccurs="0" maxOccurs="1">
                <xs:complexType>
		    <xs:attribute name="Title"          type="xs:string"  use="optional"/>
		    <xs:attribute name="Message"        type="xs:string"  use="optional"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="HAlign"	  type="gnm:horizontal_alignment"/>
        <xs:attribute name="VAlign"	  type="gnm:vertical_alignment"/>
        <xs:attribute name="WrapText"	  type="xs:boolean"	  />

	<!-- should be bool, but some files have odd truth values -->
        <xs:attribute name="ShrinkToFit"  type="xs:integer"	  />

        <xs:attribute name="Rotation"	  type="xs:integer"	use="optional"/>
        <xs:attribute name="Orient"	  type="xs:integer"	use="optional"/>
        <xs:attribute name="Shade"	  type="gnm:Stipple"	use="optional"/>
        <xs:attribute name="Indent"	  type="xs:integer"	use="optional"/>
        <xs:attribute name="Locked"	  type="xs:boolean"	use="optional"/>
        <xs:attribute name="Hidden"	  type="xs:boolean"	use="optional"/>
        <xs:attribute name="Fore"	  type="gnm:color"	use="optional"/>
        <xs:attribute name="Back"         type="gnm:color"	use="optional"/>
        <xs:attribute name="PatternColor" type="gnm:color"	use="optional"/>
        <xs:attribute name="Format"	  type="xs:string"	use="optional"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
590
    
Jody Goldberg's avatar
Jody Goldberg committed
591 592
    <xs:complexType name="StyleBorderElement">
        <xs:attribute name="Style" type="gnm:border_style" use="required"/>
Jody Goldberg's avatar
Jody Goldberg committed
593
        <!-- Color is present when Style is not 0 -->
Jody Goldberg's avatar
Jody Goldberg committed
594 595 596
        <xs:attribute name="Color" type="gnm:color"        use="optional"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
597
    
Jody Goldberg's avatar
Jody Goldberg committed
598 599
    <xs:simpleType name="border_style">
        <xs:restriction base="xs:integer">
Jody Goldberg's avatar
Jody Goldberg committed
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
            <!--  0 = NONE
                  1 = THIN
                  2 = MEDIUM
                  3 = DASHED
                  4 = DOTTED
                  5 = THICK
                  6 = DOUBLE
                  7 = HAIR
                  8 = MEDIUM_DASH
                  9 = DASH_DOT
                 10 = MEDIUM_DASH_DOT
                 11 = DASH_DOT_DOT
                 12 = MEDIUM_DASH_DOT_DOT
                 13 = SLANTED_DASH_DOT
            -->
Jody Goldberg's avatar
Jody Goldberg committed
615 616 617 618
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="13"/>
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
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
    <xs:simpleType name="ValidationStyle">
        <xs:restriction base="xs:string">
            <xs:enumeration value="GNM_VALIDATION_STYLE_NONE"/>
            <xs:enumeration value="GNM_VALIDATION_STYLE_STOP"/>
            <xs:enumeration value="GNM_VALIDATION_STYLE_WARNING"/>
            <xs:enumeration value="GNM_VALIDATION_STYLE_INFO"/>
            <xs:enumeration value="GNM_VALIDATION_STYLE_PARSE_ERROR"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ValidationType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="GNM_VALIDATION_TYPE_ANY"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_AS_INT"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_AS_NUMBER"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_IN_LIST"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_AS_DATE"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_AS_TIME"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_TEXT_LENGTH"/>
            <xs:enumeration value="GNM_VALIDATION_TYPE_CUSTOM"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ValidationOperator">
        <xs:restriction base="xs:string">
            <xs:enumeration value="GNM_VALIDATION_OP_NONE"/>
            <xs:enumeration value="GNM_VALIDATION_OP_BETWEEN"/>
            <xs:enumeration value="GNM_VALIDATION_OP_NOT_BETWEEN"/>
            <xs:enumeration value="GNM_VALIDATION_OP_EQUAL"/>
            <xs:enumeration value="GNM_VALIDATION_OP_NOT_EQUAL"/>
            <xs:enumeration value="GNM_VALIDATION_OP_GT"/>
            <xs:enumeration value="GNM_VALIDATION_OP_LT"/>
            <xs:enumeration value="GNM_VALIDATION_OP_GTE"/>
            <xs:enumeration value="GNM_VALIDATION_OP_LTE"/>
        </xs:restriction>
    </xs:simpleType>

Jody Goldberg's avatar
Jody Goldberg committed
657 658
    <xs:simpleType name="underline">
        <xs:restriction base="xs:integer">
Jody Goldberg's avatar
Jody Goldberg committed
659 660 661
            <!-- 0 = NONE
                 1 = SINGLE
                 2 = DOUBLE
662 663
                 3 = SINGLE LOW
                 4 = DOUBLE LOW
Jody Goldberg's avatar
Jody Goldberg committed
664
            -->
Jody Goldberg's avatar
Jody Goldberg committed
665
            <xs:minInclusive value="0"/>
666
            <xs:maxInclusive value="4"/>
Jody Goldberg's avatar
Jody Goldberg committed
667 668
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
669

Jody Goldberg's avatar
Jody Goldberg committed
670 671
    <xs:simpleType name="script">
        <xs:restriction base="xs:integer">
672 673 674 675
            <!-- GO_FONT_SCRIPT_SUB	 = -1,
	         GO_FONT_SCRIPT_STANDARD =  0,
		 GO_FONT_SCRIPT_SUPER	 =  1
            -->
Jody Goldberg's avatar
Jody Goldberg committed
676 677 678 679
            <xs:minInclusive value="-1"/>
            <xs:maxInclusive value="1"/>
        </xs:restriction>
    </xs:simpleType>
680

Jody Goldberg's avatar
Jody Goldberg committed
681
    <xs:simpleType name="horizontal_alignment">
682 683 684 685 686 687 688 689 690
        <xs:restriction base="xs:string">
            <xs:enumeration value="GNM_HALIGN_GENERAL"/>
            <xs:enumeration value="GNM_HALIGN_LEFT"/>
            <xs:enumeration value="GNM_HALIGN_RIGHT"/>
            <xs:enumeration value="GNM_HALIGN_CENTER"/>
            <xs:enumeration value="GNM_HALIGN_FILL"/>
            <xs:enumeration value="GNM_HALIGN_JUSTIFY"/>
            <xs:enumeration value="GNM_HALIGN_CENTER_ACROSS_SELECTION"/>
            <xs:enumeration value="GNM_HALIGN_DISTRIBUTED"/>
Jody Goldberg's avatar
Jody Goldberg committed
691 692
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
693

Jody Goldberg's avatar
Jody Goldberg committed
694
    <xs:simpleType name="vertical_alignment">
695 696 697 698 699 700
        <xs:restriction base="xs:string">
            <xs:enumeration value="GNM_VALIGN_TOP"/>
            <xs:enumeration value="GNM_VALIGN_BOTTOM"/>
            <xs:enumeration value="GNM_VALIGN_CENTER"/>
            <xs:enumeration value="GNM_VALIGN_JUSTIFY"/>
            <xs:enumeration value="GNM_VALIGN_DISTRIBUTED"/>
Jody Goldberg's avatar
Jody Goldberg committed
701 702
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
703

Jody Goldberg's avatar
Jody Goldberg committed
704 705
    <xs:simpleType name="Stipple">
        <xs:restriction base="xs:integer">
Jody Goldberg's avatar
Jody Goldberg committed
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
            <!-- the values are defined as follows:
                  0 = NONE
                  1 = Solid
                  2 = 75%
                  3 = 50%
                  4 = 25%
                  5 = 12.5%
                  6 = 6.25%
                  7 = Horizontal Stripe
                  8 = Vertical Stripe
                  9 = Reverse Diagonal Stripe
                 10 = Diagonal Stripe
                 11 = Diagonal Crosshatch
                 12 = Thick Diagonal Crosshatch
                 13 = Thin Horizontal Stripe
                 14 = Thin Vertical Stripe
                 15 = Thin Reverse Diagonal Stripe
                 16 = Thin Diagonal Stripe
                 17 = Thin Crosshatch
                 18 = Thin Diagonal Crosshatch
                 19 = Applix small circle
                 20 = Applix semicircle
                 21 = Applix small thatch
                 22 = Applix round thatch
                 23 = Applix Brick
                 24 = 100%
                 25 = 87.5%
            -->
Jody Goldberg's avatar
Jody Goldberg committed
734 735 736 737
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="25"/>
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
738

Jody Goldberg's avatar
Jody Goldberg committed
739 740
    <xs:simpleType name="color">
        <xs:restriction base="xs:string">
Jody Goldberg's avatar
Jody Goldberg committed
741
            <!-- colors in hex, 16 bits red, green, then blue -->
Jody Goldberg's avatar
Jody Goldberg committed
742 743 744
            <xs:pattern value="[0-9A-F]{1,4}:[0-9A-F]{1,4}:[0-9A-F]{1,4}"/>
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
745

Jody Goldberg's avatar
Jody Goldberg committed
746
    <xs:complexType name="Col_Row">
Jody Goldberg's avatar
Jody Goldberg committed
747
        <!-- column/row number -->
Jody Goldberg's avatar
Jody Goldberg committed
748
        <xs:attribute name="No"           type="xs:nonNegativeInteger" use="required"/>
Jody Goldberg's avatar
Jody Goldberg committed
749
        <!-- size in points -->
Jody Goldberg's avatar
Jody Goldberg committed
750
        <xs:attribute name="Unit"         type="xs:double"             use="required"/>
751
        <!-- DEPRECATED in 1.7.1 : top/left margin (no unit it does not scale) -->
Jody Goldberg's avatar
Jody Goldberg committed
752
        <xs:attribute name="MarginA"      type="gnm:col_row_margin"     use="optional"/>
753
        <!-- DEPRECATED in 1.7.1 : botton/right margin (no unit it does not scale) -->
Jody Goldberg's avatar
Jody Goldberg committed
754
        <xs:attribute name="MarginB"      type="gnm:col_row_margin"     use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
755
        <!-- true if size is explicitly set -->
Jody Goldberg's avatar
Jody Goldberg committed
756 757 758 759
        <xs:attribute name="HardSize"     type="xs:boolean"            use="optional" default="0"/>
        <xs:attribute name="Hidden"       type="xs:boolean"            use="optional" default="0"/>
        <xs:attribute name="Collapsed"    type="xs:boolean"            use="optional" default="0"/>
        <xs:attribute name="OutlineLevel" type="xs:integer"            use="optional" default="0"/>
760
        <!-- The number of consequitive identically sized cols/rows -->
Jody Goldberg's avatar
Jody Goldberg committed
761 762 763
        <xs:attribute name="Count"        type="xs:integer"            use="optional" default="1"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
764
    
Jody Goldberg's avatar
Jody Goldberg committed
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787
    <xs:simpleType name="col_row_margin">
        <xs:restriction base="xs:integer">
            <xs:minInclusive value="0"/>
            <xs:maxInclusive value="7"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Selections">
        <xs:sequence>
            <xs:element name="Selection" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="startCol" type="xs:nonNegativeInteger" use="required"/>
                    <xs:attribute name="startRow" type="xs:nonNegativeInteger" use="required"/>
                    <xs:attribute name="endCol"   type="xs:nonNegativeInteger" use="required"/>
                    <xs:attribute name="endRow"   type="xs:nonNegativeInteger" use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="CursorCol" type="xs:nonNegativeInteger" use="required"/>
        <xs:attribute name="CursorRow" type="xs:nonNegativeInteger" use="required"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
788
    
Jody Goldberg's avatar
Jody Goldberg committed
789 790 791 792 793 794 795 796
    <xs:attributeGroup name="ObjectAnchor">
	<xs:attribute name="ObjectBound"      type="xs:string"	use="required"/>
	<xs:attribute name="ObjectOffset"     type="gnm:offsets"	use="required"/>
	<xs:attribute name="ObjectAnchorType" type="gnm:anchor_type"	use="optional"/>
	<xs:attribute name="Direction"        type="gnm:direction"	use="required"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:attributeGroup>

797 798 799 800 801
    <xs:attributeGroup name="ObjectProperties">
      <xs:attribute name="Print" type="xs:boolean" use="optional"/>
      <xs:attribute name="Name" type="xs:string" use="optional"/>
    </xs:attributeGroup>

Jody Goldberg's avatar
Jody Goldberg committed
802 803 804 805 806 807
    <xs:attributeGroup name="ObjectAdjustmentProps">
	<xs:attribute name="Min"	type="xs:double"	use="required"/>
	<xs:attribute name="Max"	type="xs:double"	use="required"/>
	<xs:attribute name="Inc"	type="xs:double"	use="required"/>
	<xs:attribute name="Page"	type="xs:double"	use="required"/>
	<xs:attribute name="Value"	type="xs:double"	use="required"/>
808
	<xs:attribute name="Input"	type="xs:string"	use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
809 810 811 812 813 814 815 816
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:attributeGroup>

    <xs:complexType name="Objects">
        <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element name="CellComment">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
817 818
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
                    <xs:attribute name="Author"           type="xs:string"  use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
819
                    <xs:attribute name="Text"             type="xs:string"  use="required"/>
820
                    <xs:attribute name="TextFormat"       type="xs:string"  use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
821 822 823 824 825
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetObjectFilled">
                <xs:complexType>
826 827 828
                    <xs:choice minOccurs="0" maxOccurs="1">
                        <xs:any namespace="##local" processContents="lax"/>
                    </xs:choice>
Jody Goldberg's avatar
Jody Goldberg committed
829
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
830
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
831 832
                    <xs:attribute name="OutlineColor"     type="gnm:color"               use="optional"/>
                    <xs:attribute name="FillColor"        type="gnm:color"               use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
833
                    <xs:attribute name="Type"             type="gnm:objectfilled"        use="required"/>
834
                    <xs:attribute name="Width"            type="xs:nonNegativeInteger" use="optional"/>
835 836 837
                    <xs:attribute name="Label"            type="xs:string"  use="optional"/>
                    <xs:attribute name="LabelFormat"      type="xs:string"  use="optional"/>

Jody Goldberg's avatar
Jody Goldberg committed
838
                    <!-- the arrow shape attributes are only used if the type is
839
                         arrow (type="gnm:2")
Jody Goldberg's avatar
Jody Goldberg committed
840
                    -->
Jody Goldberg's avatar
Jody Goldberg committed
841 842 843 844 845 846
                    <xs:attribute name="ArrowShapeA"      type="xs:double"          use="optional"/>
                    <xs:attribute name="ArrowShapeB"      type="xs:double"          use="optional"/>
                    <xs:attribute name="ArrowShapeC"      type="xs:double"          use="optional"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
847 848

<!-- widgets -->
Jody Goldberg's avatar
Jody Goldberg committed
849 850 851
            <xs:element name="SheetWidgetButton">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
852
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
853
                    <xs:attribute name="Label"            type="xs:string"  use="required"/>
854 855
                    <xs:attribute name="Value"            type="xs:integer" />
                    <xs:attribute name="Input"            type="xs:string"  />
Jody Goldberg's avatar
Jody Goldberg committed
856 857 858 859 860 861
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetCheckbox">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
862
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
863 864
                    <xs:attribute name="Label"            type="xs:string"  use="required"/>
                    <xs:attribute name="Value"            type="xs:integer" use="required"/>
865
                    <xs:attribute name="Input"            type="xs:string" />
Jody Goldberg's avatar
Jody Goldberg committed
866 867 868
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
Morten Welinder's avatar
Morten Welinder committed
869
            <xs:element name="SheetWidgetRadioButton">
Jody Goldberg's avatar
Jody Goldberg committed
870 871
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
872
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
873
                    <xs:attribute name="Label"            type="xs:string"  use="required"/>
Morten Welinder's avatar
Morten Welinder committed
874 875 876 877
                    <xs:attribute name="Value"            type="xs:string" use="required"/>
                    <xs:attribute name="ValueType"        type="gnm:ValueType" use="required"/>
                    <xs:attribute name="Active"           type="xs:boolean"  use="required"/>
                    <xs:attribute name="Input"            type="xs:string"  use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
878 879 880 881 882 883 884 885
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>

            <xs:element name="SheetWidgetScrollbar">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
		    <xs:attributeGroup ref="gnm:ObjectAdjustmentProps"/>
886
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
887
                    <xs:attribute name="Horizontal" type="xs:boolean"  use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
888 889 890 891 892 893 894
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetSpinbutton">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
		    <xs:attributeGroup ref="gnm:ObjectAdjustmentProps"/>
895
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
896 897 898 899 900 901 902
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetSlider"		minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
		    <xs:attributeGroup ref="gnm:ObjectAdjustmentProps"/>
903
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
904 905 906 907 908 909 910 911 912 913
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>

            <xs:element name="SheetObjectImage">
                <xs:complexType>
		    <xs:sequence>
			<xs:element name="Content" form="unqualified">
			    <xs:complexType mixed="true">
				<xs:attribute name="image-type" type="xs:string"	use="required"/>
914
				<xs:attribute name="name" type="xs:string"	use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
915 916 917 918 919 920
				<xs:attribute name="size-bytes" type="xs:int"		use="optional"/>
				<xs:anyAttribute namespace="##other" processContents="lax"/>
			    </xs:complexType>
			</xs:element>
		    </xs:sequence>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
921
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
922 923 924 925 926 927 928 929 930 931 932 933 934 935
		    <xs:attribute name="crop-top"	type="xs:double"  use="required"/>
		    <xs:attribute name="crop-bottom"	type="xs:double"  use="required"/>
		    <xs:attribute name="crop-left"	type="xs:double"  use="required"/>
		    <xs:attribute name="crop-right"	type="xs:double"  use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetObjectGraph">
                <xs:complexType>
		    <xs:choice minOccurs="1" maxOccurs="1">
			<xs:element name="GogObject"	type="gnm:GogObject"/>
			<xs:element name="GogObject"	type="gnm:GogObject" form="unqualified"/>
		    </xs:choice>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
936
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
Jody Goldberg's avatar
Jody Goldberg committed
937 938 939 940 941 942
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetFrame">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
943
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
944
                    <xs:attribute name="Label" type="xs:string" use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
945 946 947 948 949 950
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetLabel">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
951 952 953 954 955 956 957 958 959 960
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetList">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
		    <xs:attribute name="Content"	type="xs:string"  use="required"/>
		    <xs:attribute name="Output"	        type="xs:string"  use="required"/>
Morten Welinder's avatar
Morten Welinder committed
961
		    <xs:attribute name="OutputAsIndex"	type="xs:boolean"  use="required"/>
962 963 964 965 966 967 968 969 970
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="SheetWidgetCombo">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
		    <xs:attribute name="Content"	type="xs:string"  use="required"/>
		    <xs:attribute name="Output"	        type="xs:string"  use="required"/>
Morten Welinder's avatar
Morten Welinder committed
971 972 973 974 975 976 977
		    <xs:attribute name="OutputAsIndex"	type="xs:boolean"  use="required"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>

            <xs:element name="SheetObjectGraphic">
                <xs:complexType>
978 979 980
		    <xs:sequence>
		      <xs:element name="Style" type="gnm:GOStyle" form="unqualified"/>
		    </xs:sequence>
Morten Welinder's avatar
Morten Welinder committed
981 982 983 984 985 986 987 988 989 990 991
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
		    <xs:attributeGroup ref="gnm:ObjectProperties"/>
		    <xs:attribute name="Type"	type="xs:integer"  use="required"/>
		    <xs:attribute name="StartArrowType"	type="xs:string"  use="optional"/>
		    <xs:attribute name="StartArrowShapeA" type="xs:double"  use="optional"/>
		    <xs:attribute name="StartArrowShapeB" type="xs:double"  use="optional"/>
		    <xs:attribute name="StartArrowShapeC" type="xs:double"  use="optional"/>
		    <xs:attribute name="EndArrowType"	type="xs:string"  use="optional"/>
		    <xs:attribute name="EndArrowShapeA" type="xs:double"  use="optional"/>
		    <xs:attribute name="EndArrowShapeB" type="xs:double"  use="optional"/>
		    <xs:attribute name="EndArrowShapeC" type="xs:double"  use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
                </xs:complexType>
            </xs:element>

	    <!-- no longer supported -->
            <xs:element name="SheetObjectBonobo">
                <xs:complexType>
		    <xs:attributeGroup ref="gnm:ObjectAnchor"/>
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:complexType>

1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
    <xs:complexType name="GOStyle">
      <xs:sequence>
	<xs:element name="line" type="gnm:GOLine" form="unqualified"/>
      </xs:sequence>
      <xs:attribute name="type"	type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="GOLine">
      <!-- Lazy: -->
      <xs:anyAttribute processContents="skip"/>
    </xs:complexType>

Jody Goldberg's avatar
Jody Goldberg committed
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028
    <xs:complexType name="GogObject">
	<xs:choice minOccurs="0" maxOccurs="unbounded">
	    <xs:element name="property" type="gnm:GogProperty"/>
	    <xs:element name="property" type="gnm:GogProperty" form="unqualified"/>
	    <xs:element name="data" type="gnm:GOData"/>
	    <xs:element name="data" type="gnm:GOData" form="unqualified"/>
	    <xs:element name="GogObject" type="gnm:GogObject"/>
	    <xs:element name="GogObject" type="gnm:GogObject" form="unqualified"/>
       </xs:choice>
	<xs:attribute name="type" type="xs:string" use="optional"/>
	<xs:attribute name="role" type="xs:string" use="optional"/>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
1029
    
Jody Goldberg's avatar
Jody Goldberg committed
1030 1031 1032 1033 1034 1035 1036
    <xs:complexType name="GogProperty" mixed="true">
	<xs:sequence>
	    <!-- children are unstructured -->
	    <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
	</xs:sequence>
	<xs:attribute name="name" type="xs:string" use="required"/>
	<xs:attribute name="type" type="xs:string" use="optional"/>
1037 1038
	<xs:attribute name="error_type" type="xs:string" use="optional"/>
	<xs:attribute name="width" type="xs:integer" use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
    </xs:complexType>

    <xs:complexType name="GOData">
	<xs:choice minOccurs="0" maxOccurs="unbounded">
           <xs:element name="dimension" type="gnm:GODimension"/>
           <xs:element name="dimension" type="gnm:GODimension" form="unqualified"/>
	</xs:choice>
    </xs:complexType>
    <xs:complexType name="GODimension">
	<xs:simpleContent>
	    <xs:extension base="xs:string">
		<xs:attribute name="id" type="xs:integer" use="required"/>
		<xs:attribute name="type" type="xs:string" use="required"/>
	    </xs:extension>
	</xs:simpleContent>
    </xs:complexType>

    <xs:simpleType name="offsets">
        <xs:restriction base="xs:string">
Jody Goldberg's avatar
Jody Goldberg committed
1058 1059 1060
            <!-- if this seems hard to read, it purportedly describes 4
                 space-separated doubles
            -->
Jody Goldberg's avatar
Jody Goldberg committed
1061 1062 1063
            <xs:pattern value="[+\-]?\d+(.\d+)?([Ee]([+\-])?\d+)? [+\-]?\d+(.\d+)?([Ee]([+\-])?\d+)? [+\-]?\d+(.\d+)?([Ee]([+\-])?\d+)? [+\-]?\d+(.\d+)?([Ee]([+\-])?\d+)?"/>
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
1064

1065
    <!-- As of 1.7.7 this is deprecated -->
Jody Goldberg's avatar
Jody Goldberg committed
1066 1067
    <xs:simpleType name="anchor_type">
        <xs:restriction base="xs:string">
Jody Goldberg's avatar
Jody Goldberg committed
1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
            <!-- if this seems hard to read, it purportedly describes 4
                 space-separated positive numbers

                 each number needs to be one of the following:
                  0 = UNKNOWN
                 16 = PERCENTAGE_FROM_COLROW_START
                 32 = PTS_FROM_COLROW_START
                 33 = PTS_FROM_COLROW_END
                 48 = PTS_ABSOLUTE
            -->
Jody Goldberg's avatar
Jody Goldberg committed
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104
            <xs:pattern value="\d+ \d+ \d+ \d+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="direction">
        <xs:restriction base="xs:string">
            <xs:enumeration value="-1"/>	<!-- unknown    -->
            <xs:enumeration value="0"/>	<!-- up right   -->
            <xs:enumeration value="1"/>	<!-- up left    -->
            <xs:enumeration value="16"/>	<!-- down right -->
            <xs:enumeration value="17"/>	<!-- down left  -->
            <xs:enumeration value="255"/>	<!-- unknown    -->
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="objectfilled">
        <xs:restriction base="xs:string">
            <xs:enumeration value="1"/>   <!-- line  -->
            <xs:enumeration value="2"/>   <!-- arrow -->
            <xs:enumeration value="101"/> <!-- box   -->
            <xs:enumeration value="102"/> <!-- oval  -->
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Cells">
       <xs:sequence>
           <xs:element name="Cell" minOccurs="0" maxOccurs="unbounded">
1105 1106 1107 1108 1109 1110
	       <!-- expressions are stored as entered, with a leading '='.
		    Once a shared expression has been defined, subsequent
		    Cell elements using that same shared expression simply
		    use the "ExprID" attribute to indicate which shared
		    expression is used, and no Content element is included
	       -->
Jody Goldberg's avatar
Jody Goldberg committed
1111
		<xs:complexType mixed="true">
1112
		<!-- Compatibility for ancient 0.x format -->
Jody Goldberg's avatar
Jody Goldberg committed
1113 1114 1115
		    <xs:sequence>
			<xs:element name="Content"	     type="xs:string" minOccurs="0" maxOccurs="1"/>
		    </xs:sequence>
1116 1117 1118

		    <!-- Col and Row are sufficient for a cell that is an element of
		         an array of cells as long as it's not the top left cell -->
Jody Goldberg's avatar
Jody Goldberg committed
1119 1120
		    <xs:attribute name="Col"         type="xs:nonNegativeInteger" use="required"/>
		    <xs:attribute name="Row"         type="xs:nonNegativeInteger" use="required"/>
1121
		    <!-- ExprID is only used to refer to a shared expression -->
Jody Goldberg's avatar
Jody Goldberg committed
1122
		    <xs:attribute name="ExprID"      type="xs:nonNegativeInteger" use="optional"/>
1123
		    <!-- ValueType is not used if the cell contains an expression -->
Jody Goldberg's avatar
Jody Goldberg committed
1124
		    <xs:attribute name="ValueType"   type="gnm:ValueType"           use="optional"/>
1125
		    <!-- ValueFormat is apparently used only for cell-by-cell format overrides -->
Jody Goldberg's avatar
Jody Goldberg committed
1126
		    <xs:attribute name="ValueFormat" type="xs:string"          use="optional"/>
1127
		    <!-- Cols and Rows are used to define an array of cells -->
Jody Goldberg's avatar
Jody Goldberg committed
1128 1129 1130 1131 1132 1133 1134
		    <xs:attribute name="Cols"        type="xs:positiveInteger" use="optional"/>
		    <xs:attribute name="Rows"        type="xs:positiveInteger" use="optional"/>
		    <xs:anyAttribute namespace="##other" processContents="lax"/>
		</xs:complexType>
	    </xs:element>
       </xs:sequence>
    </xs:complexType>
Jody Goldberg's avatar
Jody Goldberg committed
1135
    
Jody Goldberg's avatar
Jody Goldberg committed
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243
    <xs:simpleType name="ValueType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="10"/> <!-- empty     -->
            <xs:enumeration value="20"/> <!-- boolean   -->
            <xs:enumeration value="30"/> <!-- integer   -->
            <xs:enumeration value="40"/> <!-- float     -->
            <xs:enumeration value="50"/> <!-- error     -->
            <xs:enumeration value="60"/> <!-- string    -->
            <xs:enumeration value="70"/> <!-- cellrange -->
            <xs:enumeration value="80"/> <!-- array     -->
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="CondOp">
        <xs:restriction base="xs:nonNegativeInteger">
	    <xs:enumeration value="0"/> <!-- GNM_STYLE_COND_BETWEEN -->
	    <xs:enumeration value="1"/> <!-- GNM_STYLE_COND_NOT_BETWEEN -->
	    <xs:enumeration value="2"/> <!-- GNM_STYLE_COND_EQUAL -->
	    <xs:enumeration value="3"/> <!-- GNM_STYLE_COND_NOT_EQUAL -->
	    <xs:enumeration value="4"/> <!-- GNM_STYLE_COND_GT -->
	    <xs:enumeration value="5"/> <!-- GNM_STYLE_COND_LT -->
	    <xs:enumeration value="6"/> <!-- GNM_STYLE_COND_GTE -->
	    <xs:enumeration value="7"/> <!-- GNM_STYLE_COND_LTE -->

	    <!-- Arbitrary expr evaluated at EvalPos -->
	    <xs:enumeration value="8"/> <!-- GNM_STYLE_COND_CUSTOM -->

	    <!-- New in Gnumeric 1.8 -->
	    <xs:enumeration value="16"/> <!-- GNM_STYLE_COND_CONTAINS_STR -->
	    <xs:enumeration value="17"/> <!-- GNM_STYLE_COND_NOT_CONTAINS_STR -->
	    <xs:enumeration value="18"/> <!-- GNM_STYLE_COND_BEGINS_WITH_STR -->
	    <xs:enumeration value="19"/> <!-- GNM_STYLE_COND_NOT_BEGINS_WITH_STR -->
	    <xs:enumeration value="20"/> <!-- GNM_STYLE_COND_ENDS_WITH_STR -->
	    <xs:enumeration value="21"/> <!-- GNM_STYLE_COND_NOT_ENDS_WITH_STR -->

	    <xs:enumeration value="22"/> <!-- GNM_STYLE_COND_CONTAINS_ERR -->
	    <xs:enumeration value="23"/> <!-- GNM_STYLE_COND_NOT_CONTAINS_ERR -->

	    <xs:enumeration value="24"/> <!-- GNM_STYLE_COND_CONTAINS_BLANKS -->
	    <xs:enumeration value="25"/> <!-- GNM_STYLE_COND_NOT_CONTAINS_BLANK -->
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="FilterFieldType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="expr"/>
            <xs:enumeration value="blanks"/>
            <xs:enumeration value="nonblanks"/>
            <xs:enumeration value="bucket"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="FilterFieldOp">
        <xs:restriction base="xs:string">
            <xs:enumeration value="eq"/>
            <xs:enumeration value="gt"/>
            <xs:enumeration value="lt"/>
            <xs:enumeration value="gte"/>
            <xs:enumeration value="lte"/>
            <xs:enumeration value="ne"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="FilterField">
	<xs:attribute name="Index" type="xs:nonNegativeInteger" use="required"/>
	<xs:attribute name="Type"  type="gnm:FilterFieldType" use="required"/>

	<!-- WARNING WARNING WARNING
		Value and ValueType have their senses
		reversed due to an old typo -->
	<!-- Only valid for Type=expr -->
	<xs:attribute name="Value0"     type="gnm:ValueType"	  use="optional"/>
	<xs:attribute name="ValueType0" type="xs:string"	  use="optional"/>
	<xs:attribute name="Op0"	 type="gnm:FilterFieldOp" use="optional"/>
	<xs:attribute name="Value1"	 type="gnm:ValueType"	  use="optional"/>
	<xs:attribute name="ValueType1" type="xs:string"	  use="optional"/>
	<xs:attribute name="Op1"	 type="gnm:FilterFieldOp" use="optional"/>

	<!-- Only valid for Type=bucket -->
	<xs:attribute name="top"   type="xs:boolean" use="optional"/> <!-- top vs bottom -->
	<xs:attribute name="items" type="xs:boolean" use="optional"/> <!-- top n vs top n% -->
	<xs:attribute name="count" type="xs:double"  use="optional"/> <!-- top COUNT -->

	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="Filters">
       <xs:sequence>
           <xs:element name="Filter" minOccurs="0" maxOccurs="unbounded">
		<xs:complexType>
		    <xs:sequence>
			<xs:element name="Field" type="gnm:FilterField" minOccurs="0" maxOccurs="unbounded"/>
		    </xs:sequence>
		    <xs:attribute name="Area"   type="xs:string" use="required"/>
		</xs:complexType>
            </xs:element>
       </xs:sequence>
    </xs:complexType>

    <xs:complexType name="MergedRegions">
       <xs:sequence>
           <xs:element name="Merge" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
       </xs:sequence>
       <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:complexType name="Solver">
        <xs:sequence>
	    <xs:element name="Constr" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
Morten Welinder's avatar
Morten Welinder committed
1244 1245
                    <xs:attribute name="lhs" type="gnm:SolverSide" use="required"/>
                    <xs:attribute name="rhs" type="gnm:SolverSide" use="required"/>
Jody Goldberg's avatar
Jody Goldberg committed
1246 1247 1248 1249
                    <xs:attribute name="Type" type="gnm:solver_constraint_t"    use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
Morten Welinder's avatar
Morten Welinder committed
1250
        <xs:attribute name="Target"      type="gnm:CellRef"		use="optional"/>
Jody Goldberg's avatar
Jody Goldberg committed
1251
        <xs:attribute name="ProblemType" type="gnm:solver_problem_t"	use="required"/>
1252 1253
        <xs:attribute name="ModelType"   type="gnm:model_type_t"/>
        <xs:attribute name="Inputs"      type="xs:string"/>
Jody Goldberg's avatar
Jody Goldberg committed
1254 1255 1256 1257 1258
        <xs:attribute name="MaxTime"	  type="xs:integer"		use="required"/>
        <xs:attribute name="MaxIter"	  type="xs:integer"		use="required"/>
        <xs:attribute name="NonNeg"	  type="xs:boolean"		use="required"/>
        <xs:attribute name="Discr"	  type="xs:boolean"		use="required"/>
        <xs:attribute name="AutoScale"	  type="xs:boolean"		use="required"/>
1259 1260 1261 1262 1263
        <xs:attribute name="ShowIter"	  type="xs:boolean"/>
        <xs:attribute name="AnswerR"	  type="xs:boolean"/>
        <xs:attribute name="SensitivityR" type="xs:boolean"/>
        <xs:attribute name="LimitsR"	  type="xs:boolean"/>
        <xs:attribute name="PerformR"	  type="xs:boolean"/>
Jody Goldberg's avatar
Jody Goldberg committed
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277
        <xs:attribute name="ProgramR"	  type="xs:boolean"		use="required"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:simpleType name="solver_constraint_t">
        <xs:restriction base="xs:integer">
            <xs:enumeration value="0" /> <!-- none -->
            <xs:enumeration value="1" /> <!-- &lt;= -->
            <xs:enumeration value="2" /> <!-- &gt;= -->
            <xs:enumeration value="4" /> <!-- = -->
            <xs:enumeration value="8" /> <!-- Int -->
            <xs:enumeration value="16"/> <!-- boolean -->
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
1278
    
Morten Welinder's avatar
Morten Welinder committed
1279 1280 1281 1282 1283 1284
    <xs:simpleType name="SolverSide">
        <xs:restriction base="xs:string">
            <xs:pattern value="$?[A-Z]+$?\d+"/>
        </xs:restriction>
    </xs:simpleType>

Jody Goldberg's avatar
Jody Goldberg committed
1285 1286 1287 1288 1289 1290 1291
    <xs:simpleType name="solver_problem_t">
        <xs:restriction base="xs:integer">
            <xs:enumeration value="0" /> <!-- SolverMinimize -->
            <xs:enumeration value="1" /> <!-- SolverMaximize -->
            <xs:enumeration value="2" /> <!-- SolverEqualTo -->
        </xs:restriction>
    </xs:simpleType>
1292 1293 1294 1295 1296 1297 1298
    <xs:simpleType name="model_type_t">
        <xs:restriction base="xs:integer">
            <xs:enumeration value="0" /> <!-- GNM_SOLVER_LP -->
            <xs:enumeration value="1" /> <!-- GNM_SOLVER_QP -->
            <xs:enumeration value="2" /> <!-- GNM_SOLVER_NLP -->
        </xs:restriction>
    </xs:simpleType>
Jody Goldberg's avatar
Jody Goldberg committed
1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333
    <xs:simpleType name="SheetVisibility">
        <xs:restriction base="xs:string">
            <xs:enumeration value="GNM_SHEET_VISIBILITY_VISIBLE"/>
            <xs:enumeration value="GNM_SHEET_VISIBILITY_HIDDEN"/>
            <xs:enumeration value="GNM_SHEET_VISIBILITY_VERY_HIDDEN"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="Scenarios">
	<xs:sequence>
            <xs:element name="Scenario" minOccurs="0" maxOccurs="unbounded">
		<xs:complexType>
		    <xs:sequence>
		       <xs:element name="Name" type="xs:string"/>
		       <xs:element name="Comment" type="xs:string"/>
		       <xs:element name="CellsStr" type="xs:string"/>
		    </xs:sequence>
		</xs:complexType>
            </xs:element>
	</xs:sequence>
    </xs:complexType>

    <xs:complexType name="SheetLayout">
	<xs:sequence>
	    <xs:element name="FreezePanes" minOccurs="0" maxOccurs="1">
		<xs:complexType>
		    <xs:attribute name="FrozenTopLeft"   type="xs:string" use="required"/>
		    <xs:attribute name="UnfrozenTopLeft" type="xs:string" use="required"/>
		</xs:complexType>
	    </xs:element>
	</xs:sequence>
	<xs:attribute name="TopLeft"   type="xs:string" use="required"/>
	<xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
</xs:schema>