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

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

	<!-- Renderers -->

	<xs:complexType name="renderer">
		<xs:sequence>
			<xs:group ref="envelope_1_0:parameters" />
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required" />
		<xs:attribute name="class" type="types_1_0:php_class" use="required" />
	</xs:complexType>

	<xs:complexType name="renderers">
		<xs:sequence>
			<xs:element name="renderer" type="renderer"
			            maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="default" type="xs:string" use="required" />
	</xs:complexType>

	<!-- Slots -->

	<xs:complexType name="slot">
		<xs:sequence>
			<xs:group ref="envelope_1_0:parameters" />
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required" />
		<xs:attribute name="module" type="types_1_0:php_label" use="required" />
		<xs:attribute name="action" type="xs:string" use="required" />
		<xs:attribute name="output_type" type="types_1_0:php_label" />
		<xs:attribute name="method" type="types_1_0:php_label" />
	</xs:complexType>

	<xs:complexType name="slots">
		<xs:sequence>
			<xs:element name="slot" type="slot"
			            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="envelope_1_0:parameters" />
			<xs:group ref="slots" />
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required" />
		<xs:attribute name="class" type="types_1_0:php_class" />
		<xs:attribute name="renderer" type="xs:string" />
	</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>

	<!-- Layouts -->

	<xs:complexType name="layout">
		<xs:sequence maxOccurs="unbounded">
			<xs:group ref="envelope_1_0:parameters" />
			<xs:group ref="layers" />
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required" />
	</xs:complexType>

	<xs:complexType name="layouts">
		<xs:sequence>
			<xs:element name="layout" type="layout"
			            maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="default" type="xs:string" use="required" />
	</xs:complexType>

	<!-- Output types -->

	<xs:complexType name="output_type">
		<xs:sequence maxOccurs="unbounded">
			<xs:group ref="envelope_1_0:parameters" />
			<xs:element name="renderers" type="renderers"
			            minOccurs="0" />
			<xs:element name="layouts" type="layouts"
			            minOccurs="0" />
		</xs:sequence>
		<xs:attribute name="name" type="types_1_0:php_label" use="required" />
		<xs:attribute name="exception_template" type="xs:string" />
	</xs:complexType>

	<xs:complexType name="output_types">
		<xs:sequence>
			<xs:element name="output_type" type="output_type"
			            maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="default" type="types_1_0:php_label" use="required" />
	</xs:complexType>

	<xs:group name="configuration">
		<xs:sequence>
			<xs:element name="output_types" type="output_types" />
		</xs:sequence>
	</xs:group>

</xs:schema>
