<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://projets.admisource.gouv.fr/xemelios/technical/schemas/xsd2html.xsl"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:include schemaLocation="TPseudoXPath.xsd" />
  <xs:include schemaLocation="TListeResultat.xsd" />
  <xs:include schemaLocation="TCritere.xsd" />
  <xs:include schemaLocation="TPlugin.xsd" />
  
  <xs:complexType name="TElement">
    <xs:sequence>
      <xs:element name="path" type="TPseudoXPath">
        <xs:annotation>
          <xs:documentation>
            Le chemin d'acces a cet element. Ce chemin doit etre un veritable XPath sans conditions. C'est le chemin qui est
            utilise pour construire les requetes XPath dans les recherches
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="environment" type="TEnvironment" minOccurs="0" maxOccurs="1"/>
      <xs:element name="liste-resultat" type="TListeResultat" minOccurs="0" maxOccurs="1"/>
      <xs:element name="parent" type="TParent" minOccurs="0" maxOccurs="1"/>
      <xs:element name="enfants" type="TEnfants" minOccurs="0" maxOccurs="1"/>
      <xs:element name="critere" minOccurs="0" maxOccurs="unbounded" type="TCritere" />
      <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="TPlugin" />
    </xs:sequence>
    <xs:attribute name="balise" use="required" type="xs:NCName">
      <xs:annotation>
        <xs:documentation>
          La balise de cet element
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="id" use="required" type="xs:NCName" />
    <xs:attribute name="max-display" use="required" type="xs:integer">
      <xs:annotation>
        <xs:documentation>
          Le nombre maximal d'elements a afficher en resultat de recherche
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="titre" use="required">
      <xs:annotation>
        <xs:documentation>
          Le titre de cet element. Ce titre est presente a l'utilisateur par Xemelios et doit donc etre intelligible
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="searchable" type="xs:boolean" default="true" use="optional">
        <xs:annotation>
            <xs:documentation>
                Permet d'indiquer que les recherches sur cet élément sont interdites
            </xs:documentation>
        </xs:annotation>
    </xs:attribute>
      <xs:attribute name="browsable" type="xs:boolean" default="false"/>
  </xs:complexType>
  
  <xs:complexType name="TEnvironment">
    <xs:sequence>
      <xs:element name="variable" maxOccurs="unbounded">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="libelle" type="xs:string"/>
            <xs:element name="reference" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:documentation>references an existing variable or configuration. See http://projets.admisource.gouv.fr/xemelios/technical/environment for further details.</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="name" type="xs:string"/>
              </xs:complexType>
            </xs:element>
            <xs:choice minOccurs="0">
              <xs:element name="input">
                <xs:complexType>
                  <xs:attribute name="id" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="select" type="TSelect"/>
            </xs:choice>
          </xs:sequence>
          <xs:attribute name="name" type="xs:string"/>
          <xs:attribute name="type">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="integer"/>
                <xs:enumeration value="boolean"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="domain">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="documents"/>
                <xs:enumeration value="element"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="TParent">
    <xs:attribute name="element" type="xs:NCName"/>
    <xs:attribute name="path" type="TPseudoXPath"/>
  </xs:complexType>
  
  <xs:complexType name="TEnfants">
    <xs:sequence>
      <xs:element name="enfant" minOccurs="1" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="element" type="xs:NCName"/>
          <xs:attribute name="path" type="TPseudoXPath"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

</xs:schema>
