<?xml version="1.0"?>
<!-- 
XML All-purpose Protocol

This specifies the interface publication aspect of XML distributed architecture. 
2000-04-30 - compliant with W3C Working Draft of 7 April 2000 

     Notes:
     - We use XML Schema in the simplest way (cf BookCatalogue2.xsd in Roger L. Costello's Tutorial) 
     - level of abstraction
     This schema is, in some way, meta-meta-data, since it specifies how to 
     publish on the Web XML Schemas, wich in turn refer to actual data
     exchanged in messages between server and client -->

<!-- For possible local validation of Schema itself:
<!DOCTYPE schema SYSTEM "xml-schema.dtd"[
<!ATTLIST schema xmlns:xap CDATA #IMPLIED> ]>
-->

<schema xmlns="http://www.w3.org/1999/XMLSchema" 
        targetNamespace="http://www.w3.org/2000/XAP"
        xmlns:xap=      "http://www.w3.org/2000/XAP" >
    <element name="serversDirectory">
      <complexType>
        <element name="service" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <element name="url"  type="uriReference" /> <!-- a retrievable URL -->
            <element name="vocabulary" type="uriReference" />
            <element name="keyword" type="string" minOccurs="0" maxOccurs="unbounded"/>
            <element name="query" >
              <documentation>
How to express in XML Schema that "query-element" and "result-element" are names of elements belonging to the Schema pointed to by "url" element ?
              </documentation>
             <complexType>
              <element name="query-element" type="QName" minOccurs="1" maxOccurs="unbounded"/>
              <element name="result-element" type="QName" />
              <element name="default" minOccurs="0" maxOccurs="unbounded" type="" />
              <!-- How to express in XML Schema that "default" contains an instance of element belonging to the Schema pointed to by "url" element ? -->
              <element name="keyword" type="string" minOccurs="0" maxOccurs="unbounded"/>
             </complexType>
            </element>
          </complexType>
        </element>
      </complexType>
    </element>
<!-- Example of instance : ==================== 
<serversDirectory xmlns="http://www.w3.org/2000/XAP">
  <service xmlns:myVocab="http://myCom.com/">
   <url>http://myCom.com/service.pl</url>
   <vocabulary>http://www.myCom.com/service.xs</vocabulary>
   <keyword>online shop</keyword><keyword>wine</keyword>
   <default><myVocab:myProperty>my value</myVocab:myProperty></default>
   <query>
    <query-element> myVocab:myQuery </query-element>
    == name of an XML element in this vocabulary specifying the query 
    <result-element> myVocab:myResult </result-element>
    == name of an XML element in this vocabulary
         specifying the result of the query (a priori only one
         result-element per query) 
    </query>
  </service>
</serversDirectory>
-->
</schema>
