<?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"
	targetNamespace="http://agavi.org/agavi/config/global/types/1.0"
	version="$Id: _types.xsd 4227 2009-08-02 00:16:30Z david $">

	<xs:simpleType name="environment_list">
		<xs:list itemType="xs:string" />
	</xs:simpleType>

	<xs:attributeGroup name="environments">
		<xs:attribute name="environment" type="types_1_0:environment_list" use="optional" />
	</xs:attributeGroup>

	<xs:simpleType name="context_list">
		<xs:list itemType="xs:string" />
	</xs:simpleType>

	<xs:attributeGroup name="contexts">
		<xs:attribute name="context" type="types_1_0:context_list" use="optional" />
	</xs:attributeGroup>

	<xs:simpleType name="non_empty_string">
		<xs:restriction base="xs:string">
			<xs:minLength value="1" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="php_class">
		<xs:restriction base="xs:string">
			<!--
				See Ticket #1132:
				We exclude all the useless stuff from the ASCII range: we allow _a-zA-Z0-9 (and _a-zA-Z for the first character) from Unicode u00-u7E plus all the rest defined in Unicode.
				Since we're supporting PHP 5.3+, we also allow backslashes from the second character on.
				The result is that the UTF-8 representation of such a string matches the regular expression ^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$ (applied to the raw bytes), which is the pattern for a valid PHP "LABEL".
				We start at &#9;, not &#0;, because #0-#8 are invalid XMLChars.
			-->
			<xs:pattern value="[^&#9;-&#64;\&#91;\&#92;\&#93;&#94;&#96;&#123;&#124;&#125;&#126;][^&#9;-&#47;&#58;-&#64;\&#91;\&#93;&#94;&#96;&#123;&#124;&#125;&#126;]*" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="php_class_list">
		<xs:list itemType="types_1_0:php_class" />
	</xs:simpleType>

	<xs:simpleType name="php_label">
		<xs:restriction base="types_1_0:php_class">
			<!-- no \ allowed -->
			<xs:pattern value="[^\\]+" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="php_label_list">
		<xs:list itemType="types_1_0:php_label" />
	</xs:simpleType>

	<!-- for BC, should be removed after 1.1 or so -->
	<xs:simpleType name="identifier">
		<xs:restriction base="types_1_0:php_label" />
	</xs:simpleType>

	<!-- for BC, should be removed after 1.1 or so -->
	<xs:simpleType name="identifier_list">
		<xs:restriction base="types_1_0:identifier" />
	</xs:simpleType>

	<xs:simpleType name="boolean">
		<xs:restriction base="xs:string">
			<xs:pattern value="([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][fF][fF])" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="matched">
		<xs:restriction base="types_1_0:boolean" />
	</xs:simpleType>

</xs:schema>
