<?xml-stylesheet type="text/xsl" href="xml-reference.xsl"?>
<schema>
	<element name="multiple-form" 
	         description="Multiple form">
		<children>
			<child name="list-form" occurance="*"/>
			<child name="detail-form" occurance="*"/>
		</children>		
	</element>

	<element name="list-form" 
	         description="List form">
	    <attributes>
			<attribute name="table" mandatory="true"/>
			<attribute name="caption"/>
		</attributes>
		<children>
			<child name="query-panel" occurance="?"/>
			<child name="query" occurance="?"/>
			<child name="record-list-table" occurance="?"/>
			<child name="menu" occurance="*"/>
			<child name="action" occurance="*"/>
		</children>		
	</element>

	<element name="detail-form" 
	         description="Detail form">
	    <attributes>
			<attribute name="table" mandatory="true"/>
			<attribute name="caption"/>
			<attribute name="lookup"/>
		</attributes>
		<children>
			<child name="record-editor" occurance="?"/>
			<child name="menu" occurance="*"/>
			<child name="record-action" occurance="*"/>
		</children>		
	</element>

	<element name="query-panel">
		<attribute name="table"/>
		<children>
			<child name="and-filter" occurance="?"/>
			<child name="or-filter" occurance="?"/>
			<child name="like-filter" occurance="?"/>
			<child name="equals-filter" occurance="?"/>
		</children>
	</element>
	
	<element name="query">
		<attribute name="table"/>
		<children>
			<child name="column" occurance="*"/>
			<child name="and-filter" occurance="?"/>
			<child name="or-filter" occurance="?"/>
			<child name="like-filter" occurance="?"/>
			<child name="equals-filter" occurance="?"/>
		</children>
	</element>
	
	<element name="equals-filter">
		<attributes>
			<attribute name="column"/>
		</attributes>
	</element>

	<element name="like-filter">
		<attributes>
			<attribute name="column"/>
		</attributes>
	</element>
	
	<element name="and-filter">
		<children>
			<child name="like-filter"/>
			<child name="equals-filter"/>
		</children>
	</element>

	<element name="or-filter">
		<children>
			<child name="like-filter"/>
			<child name="equals-filter"/>
		</children>
	</element>
	
	<element name="record-list-table">
		<attributes>
			<attribute name="visible-row-count"/>
			<attribute name="edit-controller-class"/>
		</attributes>
		<children>
			<child name="column" occurance="*"/>
			<child name="detail-form" occurance="?"/>
		</children>
	</element>
	
	<element name="column">
		<attributes>
			<attribute name="name"/>
			<attribute name="fk"/>
			<attribute name="column"/>
			<attribute name="header"/>			
		</attributes>
	</element>
	
	<element name="record-editor">
		<attributes>
			<attribute name="table"/>
			<attribute name="lookup"/>
			<attribute name="caption"/>
		</attributes>
		<children>
			<child name="column" occurance="*"/>			
		</children>
	</element>
	
	<element name="foreign-key-editor">
		<attributes>
			<attribute name="fk"/>
		</attributes>
		<children>
			<child name="lookup-record-selector" occurance="?"/>
			<child name="combo-record-selector" occurance="?"/>
		</children>
	</element>

	<element name="lookup-record-selector">
		<attributes>
			<attribute name="table"/>
			<attribute name="description-column"/>
		</attributes>
		<children>
			<child name="list-form" occurance="?"/>
		</children>
	</element>

	<element name="combo-record-selector">
		<attributes>
			<attribute name="table"/>
			<attribute name="column"/>
		</attributes>
	</element>
	
	<element name="related-tabbed-pane">
		<children>
			<child name="record-list-table" occurance="*"/>
			<child name="record-editor" occurance="*"/>
		</children>
	</element>

	<element name="record-action">
		<attributes>
			<attribute name="command"/>
			<attribute name="class"
			           description="Implementation of butler.client.record.RecordAction"/>
		</attributes>
	</element>

	<element name="action">
		<attributes>
			<attribute name="command"/>
			<attribute name="class"
			           description="Implementation of butler.client.util.Action"/>
		</attributes>
	</element>

	<element name="menu">
		<attributes>
			<attribute name="caption"/>
			<attribute name="mnemonic"/>
		</attributes>
		<children>
			<child name="menu-item" occurance="*"/>
		</children>
	</element>

	<element name="menu-item">
		<attributes>
			<attribute name="caption"/>
			<attribute name="command"/>
		</attributes>
	</element>
	
</schema>