<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

	<xs:simpleType name="IDENTIFIER-TYPE">
		<xs:restriction base="xs:string">
			<xs:pattern value="[\w\d]+"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TYPE-NAME-TYPE">
		<xs:restriction base="xs:string">
			<xs:pattern value="[a-zA-Z]+[\d_a-zA-Z]*"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PATH-TYPE">
		<xs:restriction base="xs:string">
			<xs:pattern value="[a-zA-Z\d\._/]+"/>
		</xs:restriction>
	</xs:simpleType>
<!--	<xs:complexType name="ITEM-TYPE">
		<xs:choice>
			 <xs:element name="ID" type="IDENTIFIER-TYPE"/>
			 <xs:element name="ID-REF" type="IDENTIFIER-TYPE"/>
		</xs:choice>
		<xs:attribute name="TYPE" type="TYPE-NAME-TYPE" use="required"/>
	</xs:complexType>
	<xs:complexType name="EXTENSIONS-TYPE">
		<xs:sequence>
			<xs:element name="EXTENSION" type="ITEM-TYPE" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
-->
<!--	<xs:group name="EXTENSIONS">

		<xs:sequence>

			<xs:element name="EXTENSIONS" type="EXTENSIONS-TYPE" minOccurs="0">

				<xs:unique name="UNIQUE-TYPE">

					<xs:selector xpath="EXTENSION"/>

					<xs:field xpath="@TYPE"/>

				</xs:unique>

			</xs:element>

		</xs:sequence>
	</xs:group>
-->		
	<xs:complexType name="PAGE-TYPE">
<!--		<xs:complexType> -->
<!--			<xs:extension base="ITEM-TYPE"> -->
				<xs:sequence>
					<xs:element name="PATH" type="PATH-TYPE"/>
					<xs:element name="KEYWORDS" type="xs:string" minOccurs="0" maxOccurs="1"/>
					<xs:element name="DESCRIPTION" type="xs:string" minOccurs="0" maxOccurs="1"/>
					<xs:element name="PAGE" type="PAGE-TYPE" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
				<xs:attribute name="TITLE" type="xs:string" use="required"/>
				<xs:attribute name="TYPE" type="TYPE-NAME-TYPE" use="required"/>
				<xs:attribute name="NAME" type="xs:string"/>
				<xs:attribute name="ID" use="required" type="IDENTIFIER-TYPE"/>
<!--			</xs:extension> -->
<!--		</xs:complexType> -->
	</xs:complexType>

	<xs:complexType name="TEMPLATE-TYPE">
	    <xs:attribute name="CODE" type="xs:string" use="required"/> 
	    <xs:attribute name="COLOR-SCHEME" type="xs:string" use="required"/>
	    <xs:attribute name="LOGO" type="xs:string"/>
	    <xs:attribute name="BANNER" type="xs:string"/>
	    <xs:attribute name="BUTTON" type="xs:string"/>
	</xs:complexType>

	<xs:element name="SITE">
		<xs:complexType>
		    <xs:sequence>
<!-- <xs:group ref="EXTENSIONS"/> -->
		    	<xs:element name="PAGE" type="PAGE-TYPE" minOccurs="0" maxOccurs="unbounded"/>
		    	<xs:element name="TEMPLATE" type="TEMPLATE-TYPE" minOccurs="0" maxOccurs="1"/>
		    </xs:sequence>
<!--		    <xs:attribute name="xmlns:xsi" type="xs:string"/>
		    <xs:attribute name="xsi:noNamespaceSchemaLocation" type="xs:string"/>
		    -->
		</xs:complexType>
		<xs:unique name="UNIQUE-PAGE-FILE-NAME">
			<xs:selector xpath=".//PAGE"/>
			<xs:field xpath="PATH"/>
		</xs:unique>
		<xs:unique name="UNIQUE-ID">
			<xs:selector xpath=".//PAGE"/>
			<xs:field xpath="@ID"/>
		</xs:unique>
		<xs:unique name="UNIQUE-PAGE-TITLE">
			<xs:selector xpath=".//PAGE"/>
			<xs:field xpath="@TITLE"/>
		</xs:unique>
<!--		<xs:keyref name="KEYREF-ID-REF" refer="KEY-ID">

			<xs:selector xpath=".//ID-REF"/>

			<xs:field xpath="."/>

		</xs:keyref>
		<xs:key name="KEY-ID">

			<xs:selector xpath=".//ID"/>

			<xs:field xpath="."/>

		</xs:key> -->
	</xs:element>
</xs:schema>
