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

<!--
Portable Structured Information
Version: 0.41
Created: 2.21.2002
Updated: 7.15.2002
 
Copyright (c) 1999 by L.C. Rees. 
 
Permission to use, copy, modify, and distribute this schema for 
any purpose with or without fee is hereby granted, provided 
that the above copyright notice and this permission notice 
appear in all copies. 
 
THIS SCHEMA IS PROVIDED  "AS IS" AND  L.C. REES  DISCLAIMS ALL
WARRANTIES  WITH  REGARD TO THIS SCHEMA  INCLUDING ALL IMPLIED 
WARRANTIES OF  MERCHANTABILITY AND  FITNESS. IN NO EVENT SHALL 
L.C. REES BE LIABLE  FOR  ANY  SPECIAL,  DIRECT,  INDIRECT, OR 
CONSEQUENTIAL  DAMAGES  OR  ANY DAMAGES  WHATSOEVER  RESULTING 
FROM LOSS OF USE, DATA, OR PROFITS, WHETHER  IN  AN  ACTION OF
CONTRACT, NEGLIGENCE OR  OTHER  TORTIOUS  ACTION, ARISING  OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SCHEMA.
-->

<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 <element name="psi">
  <complexType>
   <sequence>
    <element ref="collection" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="xmlns" type="string" fixed="urn:psilib:PSI:0:4:1:core"/>
  </complexType>
 </element>
 <element name="collection">
  <complexType>
    <sequence>
     <element ref="metadata" minOccurs="0"/>
     <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
     <element ref="collection" minOccurs="0" maxOccurs="unbounded"/>
     <choice minOccurs="0" maxOccurs="unbounded">
      <element ref="field"/>
      <element ref="link"/>
      <element ref="include"/>
      <element ref="resource"/>
     </choice>
    </sequence>
    <attribute name="name" type="string"/>
    <attribute name="class" type="string"/>
    <attribute name="ref" type="string"/>
   </complexType>
  </element>
  <element name="resource">
   <complexType>
    <sequence>
     <element ref="metadata" minOccurs="0"/>
     <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
     <choice minOccurs="0" maxOccurs="unbounded">
      <element ref="field"/>
      <element ref="link"/>
      <element ref="include"/>
      <element ref="text"/>
      <element ref="fragment"/>
     </choice>
     <element ref="param" minOccurs="0" maxOccurs="unbounded"/>
     <element ref="result" minOccurs="0"/>
    <element ref="exception" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
   <attribute name="name" type="string"/>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="fragment">
  <complexType>
   <sequence>
    <element ref="metadata" minOccurs="0"/>
    <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
    <choice minOccurs="0" maxOccurs="unbounded">
     <element ref="field"/>
     <element ref="link"/>
     <element ref="include"/>
     <element ref="text"/>
    </choice>
   </sequence>
   <attribute name="name" type="string"/>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="text">
  <complexType mixed="true">
   <attribute name="name" type="string"/>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
   <attribute name="xml:space">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="default"/>
      <enumeration value="preserve"/>
     </restriction>
    </simpleType>
   </attribute>
  </complexType>
 </element>
 <element name="parameter">
  <complexType>
   <element ref="metadata" minOccurs="0"/>
   <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
   <choice>
    <element name="field" ref="field"/>
    <element name="link" ref="link"/>
    <element name="include" ref="include"/>
    <element name="text" ref="text"/>
   </choice>
   <attribute name="name" type="string"/>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
   <attribute name="required" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="true"/>
      <enumeration value="false"/>
      <enumeration value="optional"/>
     </restriction>
    </simpleType>
   </attribute>
  </complexType>
 </element>
 <element name="result">
  <complexType>
   <element ref="metadata" minOccurs="0"/>
   <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
   <choice>
    <element name="field" ref="field"/>
    <element name="link" ref="link"/>
    <element name="include" ref="include"/>
    <element name="text" ref="text"/>
   </choice>
   <attribute name="name" type="string"/>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="exception">
  <complexType>
   <element ref="metadata" minOccurs="0"/>
   <element ref="filter" minOccurs="0" maxOccurs="unbounded"/>
  <choice>
    <element name="field" ref="field"/>
    <element name="link" ref="link"/>
    <element name="include" ref="include"/>
    <element name="text" ref="text"/>
   </choice>
   <attribute name="name" type="string"/>
   <attribute name="class" type="strings"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="link">
  <complexType mixed="true">
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="field">
  <complexType>
   <attribute name="name" type="string"/>
  </complexType>
 </element>
 <element name="include">
  <complexType>
   <attribute name="class" type="string"/>
  </complexType>
 </element>
 <element name="metadata">
  <complexType>
   <sequence>
    <element name="log" ref="log" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="state">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="planned"/>
      <enumeration value="readlock"/>
      <enumeration value="writelock"/>
      <enumeration value="nolock"/>
     </restriction>
    </simpleType>
   </attribute>
  </complexType>
 </element>
 <element name="log">
  <complexType>
   <attribute name="type" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="read"/>
      <enumeration value="write"/>
      <enumeration value="create"/>
      <enumeration value="delete"/>
      <enumeration value="acl"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="state">
    <simpleType>
     <restriction base="NMTOKEN">
       <enumeration value="planned"/>
       <enumeration value="readlock"/>
       <enumeration value="writelock"/>
       <enumeration value="nolock"/>
      </restriction>
     </simpleType>
   </attribute>
   <attribute name="start" type="string"/>
   <attribute name="end" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="filter">
  <complexType>
   <sequence>
    <element name="access" ref="access" minOccurs="0" maxOccurs="unbounded"/>
    <element name="sort" ref="sort" minOccurs="0" maxOccurs="unbounded"/>
    <element name="action" ref="time" minOccurs="0" maxOccurs="unbounded"/>
    <element name="version" ref="version" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="name" type="string"/>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="access">
  <complexType>
   <sequence>
    <element name="right" ref="right" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="type" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="grant"/>
      <enumeration value="deny"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="right">
  <complexType>
   <attribute name="type" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="all"/>
      <enumeration value="read"/>
      <enumeration value="write"/>
      <enumeration value="create"/>
      <enumeration value="delete"/>
      <enumeration value="acl"/>
     </restriction>
    </simpleType>
   </attribute>
  </complexType>
 </element>
 <element name="sort">
  <complexType>
   <sequence>
    <element name="if" ref="if" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="type" type="string"/>
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="root"/>
      <enumeration value="seq"/>
      <enumeration value="choice"/>
      <enumeration value="par"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="ref" type="string"/>  
  </complexType>
 </element>
 <element name="if">
  <complexType>
   <attribute name="value" type="string" use="required"/>
   <attribute name="match" type="string" use="required"/>
  </complexType>
 </element>
 <element name="action">
  <complexType>
   <sequence>
    <element name="if" ref="if" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="action" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="read"/>
      <enumeration value="write"/>
      <enumeration value="create"/>
      <enumeration value="delete"/>
      <enumeration value="jump"/>
      <enumeration value="pass"/>
      <enumeration value="pause"/>
      <enumeration value="stop"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="class" type="string"/>
   <attribute name="ref" type="string"/>
  </complexType>
 </element>
 <element name="time">
  <complexType>
   <attribute name="type">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="month"/>
      <enumeration value="week"/>
      <enumeration value="day"/>
      <enumeration value="hour"/>
      <enumeration value="min"/>
      <enumeration value="sec"/>
      <enumeration value="mil"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="length" type="string"/>
   <attribute name="start" type="string"/>
   <attribute name="end" type="string"/>
   <attribute name="loop" type="string"/>
  </complexType>
 </element>
 <element name="version">
  <complexType>
   <attribute name="type" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="replace"/>
      <enumeration value="fork"/>
      <enumeration value="archive"/>
      <enumeration value="stop"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="mark">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="seq"/>
      <enumeration value="start"/>
      <enumeration value="end"/>
     </restriction>
    </simpleType>
   </attribute>
  </complexType>
 </element>
 <element name="change">
  <complexType>
   <attribute name="type" use="required">
    <simpleType>
     <restriction base="NMTOKEN">
      <enumeration value="name"/>
      <enumeration value="class"/>
      <enumeration value="ref"/>
      <enumeration value="state"/>
      <enumeration value="action"/>
      <enumeration value="start"/>
      <enumeration value="end"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="match" type="string" use="required"/>
  </complexType>
 </element>
</schema>