<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fox="http://www.og.dti.gov/fox" xmlns:fm="http://www.og.dti.gov/fox_module" xmlns:widget="http://www.og.dti.gov/fox" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sort-spreadsheet="http://www.og.dti.gov/fox" xmlns:sort="http://www.og.dti.gov/fox" elementFormDefault="qualified" attributeFormDefault="unqualified" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
C:\pvcswork\Fox\source\altova_xmlspy\schema\fox_schema.xsd">
	<xs:import schemaLocation="C:\pvcswork\Fox\source\altova_xmlspy\schema\fox_import.xsd"/>
	<xs:annotation>
		<xs:appinfo>
			<fm:module>
				<fm:header>
					<fm:name>DEMO_GEN_SPREADSHEET</fm:name>
					<fm:title>FOX Demo Generate Spreadsheet</fm:title>
					<fm:application-title>FOX Demo Generate Spreadsheet</fm:application-title>
					<fm:version-no>$Revision:   1.0  $</fm:version-no>
					<fm:version-desc/>
					<fm:history/>
					<fm:description/>
					<fm:build-notes/>
					<fm:help-text/>
				</fm:header>
				<fm:control>
					<fm:transaction-mode>read-committed</fm:transaction-mode>
					<fm:authentication>not-required</fm:authentication>
				</fm:control>
				<fm:security-list/>
				<fm:library-list>
					<fm:library>LAYOUT1</fm:library>
				</fm:library-list>
				<fm:storage-location-list>
					<fm:storage-location name="main">
						<fm:cache-key string="DEMO_GEN_SPREADSHEET:1">
							<fm:using using-type="UNIQUE"/>
						</fm:cache-key>
						<fm:new-document>
							<fm:root-element>ROOT</fm:root-element>
						</fm:new-document>
					</fm:storage-location>
				</fm:storage-location-list>
				<fm:entry-theme-list>
					<fm:entry-theme name="new">
						<fm:storage-location>main</fm:storage-location>
						<fm:state>state-main</fm:state>
						<fm:attach>/*</fm:attach>
						<fm:do>
							<fm:call action="action-initialise-demo"/>
						</fm:do>
					</fm:entry-theme>
				</fm:entry-theme-list>
				<fm:action-list>
					<fm:action name="action-initialise-demo">
						<fm:do>
							<fm:init target=":{theme}" for-schema="/DOCUMENT_GENERATION/*"/>
							<fm:init target=":{theme}/SORTABLE_COLS" template="temp-sortable-cols"/>
						</fm:do>
					</fm:action>
					<fm:action name="action-download-spreadsheet" sort:run="." fox:widget="link" fox:prompt="Download as Spreadsheet">
						<fm:do>
							<fm:generate method="preview" output-type="CSV">
								<fm:generate-sheet row-expr=":{theme}/SORTABLE_COLS/ORDER_ITEM_LIST/ORDER_ITEM">
									<fm:generate-column name="Order Number" column-expr="ORDER_NO"/>
									<fm:generate-column name="Quantity" column-expr="QTY"/>
									<fm:generate-column name="Price" column-expr="PRICE"/>
								</fm:generate-sheet>
							</fm:generate>
						</fm:do>
					</fm:action>
				</fm:action-list>
				<fm:presentation/>
				<fm:state-list>
					<fm:state name="state-main">
						<fm:action-list/>
						<fm:presentation>
							<!-- Override buffers within LAYOUT1LIB to remove images -->
							<fm:set-buffer name="buffer-top-left-logo"/>
							<fm:set-buffer name="buffer-mid-left-logo"/>
							<!-- Override topNav and bottomNav to remove -->
							<fm:set-buffer name="buffer-topNav"/>
							<fm:set-buffer name="buffer-bottomNav"/>
							<fm:set-buffer name="buffer-sortable-cols-instructions">
            						Check that you can download this table as a spreadsheet using the link below the table
          						</fm:set-buffer>
							<fm:set-buffer name="buffer-content">
								<fm:include name="buffer-sortable-cols-instructions"/>
								<br/>
								<br/>
								<table width="50%">
									<tr>
										<td>
											<fm:set-out match=":{theme}/SORTABLE_COLS/ORDER_ITEM_LIST" sort:mode="."/>
										</td>
									</tr>
								</table>
								<fm:include name="buffer-spreadsheet-download"/>
								<br/>
								<fm:set-out match=":{theme}/SORTABLE_COLS" sort:mode="."/>
							</fm:set-buffer>
							<!-- Spreadsheet buffer, to allow this feature to be removed if necessary -->
							<fm:set-buffer name="buffer-spreadsheet-download">
								<br/>
								<fm:action-out action="action-download-spreadsheet" sort:mode="."/>
								<br/>
							</fm:set-buffer>
						</fm:presentation>
					</fm:state>
				</fm:state-list>
				<fm:template-list>
					<fm:template name="temp-sortable-cols">
						<ORDER_ITEM_LIST>
							<ORDER_ITEM>
								<ORDER_NO>1001</ORDER_NO>
								<QTY>2</QTY>
								<PRICE>1129.98</PRICE>
							</ORDER_ITEM>
							<ORDER_ITEM>
								<ORDER_NO>1002</ORDER_NO>
								<QTY>6</QTY>
								<PRICE>328.94</PRICE>
							</ORDER_ITEM>
							<ORDER_ITEM>
								<ORDER_NO>1003</ORDER_NO>
								<QTY>1</QTY>
								<PRICE>100</PRICE>
							</ORDER_ITEM>
						</ORDER_ITEM_LIST>
					</fm:template>
				</fm:template-list>
				<fm:map-set-list/>
			</fm:module>
		</xs:appinfo>
	</xs:annotation>
	<xs:element name="ROOT"/>
	<xs:element name="theme">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="SORTABLE_COLS" sort:ro="." sort-spreadsheet:ro=".">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="ORDER_ITEM_LIST" sort:ro="." fox:prompt="">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="ORDER_ITEM" minOccurs="0" maxOccurs="unbounded" sort:ro=".">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="ORDER_NO" type="xs:integer" sort:ro="."/>
													<xs:element name="QTY" type="xs:integer" sort:ro="."/>
													<xs:element name="PRICE" type="xs:decimal" sort:ro="."/>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

