<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:types_1_0="http://agavi.org/agavi/config/global/types/1.0"
	xmlns="http://agavi.org/agavi/config/parts/caching/1.0"
	targetNamespace="http://agavi.org/agavi/config/parts/caching/1.0"
	elementFormDefault="qualified"
	version="$Id: caching.xsd 4502 2010-04-23 13:39:31Z david $">

	<xs:import namespace="http://agavi.org/agavi/config/global/types/1.0"
	           schemaLocation="../_types.xsd" />

	<!-- Request attributes -->

	<xs:complexType name="request_attribute">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="namespace" type="xs:string" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="request_attributes">
		<xs:sequence>
			<xs:element name="request_attribute" type="request_attribute"
			            maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="request_attributes">
		<xs:choice>
			<xs:element name="request_attributes" type="request_attributes"
			            minOccurs="0" />
			<xs:element name="request_attribute" type="request_attribute"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Request attribute namespaces -->

	<xs:simpleType name="request_attribute_namespace">
		<xs:restriction base="xs:string" />
	</xs:simpleType>

	<xs:complexType name="request_attribute_namespaces">
		<xs:sequence>
			<xs:element name="request_attribute_namespace" type="request_attribute_namespace"
			            minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="request_attribute_namespaces">
		<xs:choice>
			<xs:element name="request_attribute_namespaces" type="request_attribute_namespaces"
			            minOccurs="0" />
			<xs:element name="request_attribute_namespace" type="request_attribute_namespace"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Template variables -->

	<xs:simpleType name="template_variable">
		<xs:restriction base="xs:string" />
	</xs:simpleType>

	<xs:complexType name="template_variables">
		<xs:sequence>
			<xs:element name="template_variable" type="template_variable"
			            minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="template_variables">
		<xs:choice>
			<xs:element name="template_variables" type="template_variables"
			            minOccurs="0" />
			<xs:element name="template_variable" type="template_variable"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Slots -->

	<xs:simpleType name="slot">
		<xs:restriction base="xs:string" />
	</xs:simpleType>

	<xs:complexType name="slots">
		<xs:sequence>
			<xs:element name="slot" type="slot"
			            minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="slots">
		<xs:choice>
			<xs:element name="slots" type="slots"
			            minOccurs="0" />
			<xs:element name="slot" type="slot"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Layers -->

	<xs:complexType name="layer">
		<xs:sequence maxOccurs="unbounded">
			<xs:group ref="slots" />
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required" />
		<xs:attribute name="include" type="types_1_0:boolean" />
	</xs:complexType>

	<xs:complexType name="layers">
		<xs:sequence>
			<xs:element name="layer" type="layer"
			            maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="layers">
		<xs:choice>
			<xs:element name="layers" type="layers"
			            minOccurs="0" />
			<xs:element name="layer" type="layer"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Output types -->

	<xs:complexType name="output_type">
		<xs:sequence maxOccurs="unbounded">
			<xs:group ref="request_attributes" />
			<xs:group ref="request_attribute_namespaces" />
			<xs:group ref="template_variables" />
			<xs:group ref="layers" />
		</xs:sequence>
		<xs:attribute name="name" type="types_1_0:php_label_list" />
	</xs:complexType>

	<xs:complexType name="output_types">
		<xs:sequence>
			<xs:element name="output_type" type="output_type"
			            maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="output_types">
		<xs:choice>
			<xs:element name="output_types" type="output_types"
			            minOccurs="0" />
			<xs:element name="output_type" type="output_type"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Views -->

	<xs:complexType name="view">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="module" type="types_1_0:php_label" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="views">
		<xs:sequence>
			<xs:element name="view" type="view"
			            minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="views">
		<xs:choice>
			<xs:element name="views" type="views"
			            minOccurs="0" />
			<xs:element name="view" type="view"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Action attributes -->

	<xs:simpleType name="action_attribute">
		<xs:restriction base="xs:string" />
	</xs:simpleType>

	<xs:complexType name="action_attributes">
		<xs:sequence>
			<xs:element name="action_attribute" type="action_attribute"
			            minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="action_attributes">
		<xs:choice>
			<xs:element name="action_attributes" type="action_attributes"
			            minOccurs="0" maxOccurs="1" />
			<xs:element name="action_attribute" type="action_attribute"
			            minOccurs="0" maxOccurs="unbounded" />
		</xs:choice>
	</xs:group>

	<!-- Groups -->

	<xs:complexType name="group">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="source" type="xs:string" />
				<xs:attribute name="namespace" type="xs:string" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="groups">
		<xs:sequence>
			<xs:element name="group" type="group"
			            maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="groups">
		<xs:choice>
			<xs:element name="groups" type="groups"
			            minOccurs="0" />
			<xs:element name="group" type="group"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

	<!-- Configuration -->

	<xs:complexType name="caching">
		<xs:sequence maxOccurs="unbounded">
			<xs:group ref="groups" />
			<xs:group ref="views" />
			<xs:group ref="action_attributes" />
			<xs:group ref="output_types" />
		</xs:sequence>
		<xs:attribute name="method" type="types_1_0:php_label_list" />
		<xs:attribute name="enabled" type="types_1_0:boolean" />
		<xs:attribute name="lifetime" type="xs:string" />
	</xs:complexType>

	<xs:complexType name="cachings">
		<xs:sequence>
			<xs:element name="caching" type="caching"
			            maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:group name="configuration">
		<xs:choice>
			<xs:element name="cachings" type="cachings"
			            minOccurs="0" />
			<xs:element name="caching" type="caching"
			            minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

</xs:schema>
