<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="http://www.w3.org/2002/04/APPELv1" 
        xmlns="http://www.w3.org/2000/10/XMLSchema" 
	xmlns:appel="http://www.w3.org/2002/04/APPELv1" 
	elementFormDefault="qualified">
  <!-- ********* APPEL Data Types ******** -->
  <simpleType name="yes_no">
    <restriction base="string">
      <enumeration value="yes"/>
      <enumeration value="no"/>
    </restriction>
  </simpleType>
  <simpleType name="connective-value">
    <restriction base="string">
      <enumeration value="or"/>
      <enumeration value="and"/>
      <enumeration value="non-or"/>
      <enumeration value="non-and"/>
      <enumeration value="or-exact"/>
      <enumeration value="and-exact"/>
    </restriction>
  </simpleType>
  <simpleType name="behavior-value">
    <restriction base="string">
      <enumeration value="request"/>
      <enumeration value="block"/>
      <enumeration value="limited"/>
    </restriction>
  </simpleType>
  <attributeGroup name="common-attributes">
    <attribute name="crtdby" type="string" use="optional"/>
    <attribute name="crtdon" type="timeInstant" use="optional"/>
    <attribute name="description" type="string" use="optional"/>
  </attributeGroup>
  <!-- ************ RULESET ************* -->
  <element name="RULESET">
    <complexType>
      <sequence>
        <element ref="appel:RULE" maxOccurs="unbounded"/>
      </sequence>
      <attributeGroup ref="appel:common-attributes"/>
    </complexType>
  </element>
  <!-- ************** RULE ************** -->
  <element name="RULE">
    <complexType>
      <choice>
        <element ref="appel:OTHERWISE"/>
        <sequence>
          <element ref="appel:REQUEST-GROUP" minOccurs="0"/>
          <any namespace="http://www.w3.org/2000/12/P3Pv1" 
	       processContents="skip" minOccurs="0"/>
        </sequence>
      </choice>
      <attribute name="behavior" type="appel:behavior-value" use="required"/>
      <attribute name="connective" type="appel:connective-value" use="optional"/>
      <attribute name="prompt" type="appel:yes_no" use="default" value="no"/>
      <attribute name="persona" type="string" use="optional"/>
      <attribute name="promptmsg" type="string" use="optional"/>
      <attributeGroup ref="appel:common-attributes"/>
    </complexType>
  </element>
  <!-- ********* REQUEST-GROUP ********** -->
  <element name="REQUEST-GROUP">
    <complexType>
      <sequence>
        <element ref="appel:REQUEST" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="connective" type="appel:connective-value" use="optional"/>
    </complexType>
  </element>
  <!-- ************* REQUEST ************ -->
  <element name="REQUEST">
    <complexType>
      <attribute name="connective" type="appel:connective-value" use="optional"/>
      <attribute name="uri" type="string" use="required"/>
    </complexType>
  </element>
  <!-- ************* OTHERWISE ************* -->
  <element name="OTHERWISE">
    <complexType/>
  </element>
</schema>
