<?xml version="1.0" encoding="UTF-8"?>
<!-- -*- rnc -*- # RELAX NG Compact Syntax Grammar for the Atom Protocol -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <xsd:import schemaLocation="local.xsd"/>
  <xsd:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml.xsd"/>
  <xsd:import namespace="http://www.w3.org/2005/Atom" schemaLocation="atom.xsd"/>
  <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
  <!-- common:attrs -->
  <xsd:attributeGroup name="appCommonAttributes">
    <xsd:attribute ref="xml:base"/>
    <xsd:attribute ref="xml:lang"/>
    <xsd:attribute ref="xml:space"/>
    <xsd:attributeGroup ref="app:undefinedAttribute"/>
  </xsd:attributeGroup>
  <xsd:attributeGroup name="atomCommonAttributes">
    <xsd:attributeGroup ref="app:appCommonAttributes"/>
  </xsd:attributeGroup>
  <xsd:attributeGroup name="undefinedAttribute">
    <xsd:attributeGroup ref="local"/>
  </xsd:attributeGroup>
  <xsd:simpleType name="atomLanguageTag">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="([A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*)?"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="atomDateConstruct">
    <xsd:restriction base="xsd:dateTime"/>
  </xsd:simpleType>
  <xsd:attributeGroup name="atomDateConstruct">
    <xsd:attributeGroup ref="app:appCommonAttributes"/>
  </xsd:attributeGroup>
  <!-- app:service -->
  <xsd:element name="service">
    <xsd:complexType>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="app:workspace"/>
        <xsd:group ref="app:extensionElement"/>
      </xsd:choice>
      <xsd:attributeGroup ref="app:appCommonAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <!-- app:workspace -->
  <xsd:element name="workspace">
    <xsd:complexType>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="atom:title"/>
        <xsd:element ref="app:collection"/>
        <xsd:group ref="app:extensionSansTitleElement"/>
      </xsd:choice>
      <xsd:attributeGroup ref="app:appCommonAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <!-- app:collection -->
  <xsd:element name="collection">
    <xsd:complexType>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="atom:title"/>
        <xsd:element ref="app:accept"/>
        <xsd:group ref="app:appCategories"/>
        <xsd:group ref="app:extensionSansTitleElement"/>
      </xsd:choice>
      <xsd:attributeGroup ref="app:appCommonAttributes"/>
      <xsd:attribute name="href" use="required"/>
    </xsd:complexType>
  </xsd:element>
  <!-- app:categories -->
  <xsd:group name="appInlineCategories">
    <xsd:sequence>
      <xsd:element name="categories">
        <xsd:complexType mixed="true">
          <xsd:sequence>
            <xsd:element minOccurs="0" maxOccurs="unbounded" ref="atom:category"/>
            <xsd:group ref="app:undefinedContent"/>
          </xsd:sequence>
          <xsd:attribute name="fixed">
            <xsd:simpleType>
              <xsd:restriction base="xsd:token">
                <xsd:enumeration value="yes"/>
                <xsd:enumeration value="no"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:attribute>
          <xsd:attribute name="scheme"/>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:group>
  <xsd:group name="appOutOfLineCategories">
    <xsd:sequence>
      <xsd:element name="categories">
        <xsd:complexType mixed="true">
          <xsd:group ref="app:undefinedContent"/>
          <xsd:attribute name="href" use="required"/>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:group>
  <xsd:group name="appCategories">
    <xsd:choice>
      <xsd:group ref="app:appInlineCategories"/>
      <xsd:group ref="app:appOutOfLineCategories"/>
    </xsd:choice>
  </xsd:group>
  <!-- app:accept -->
  <xsd:element name="accept">
    <xsd:complexType mixed="true">
      <xsd:attributeGroup ref="app:appCommonAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <!-- Simple Extension -->
  <xsd:group name="simpleSansTitleExtensionElement">
    <xsd:choice>
      <xsd:any namespace="##other" processContents="skip"/>
      <xsd:any namespace="##local" processContents="skip"/>
    </xsd:choice>
  </xsd:group>
  <xsd:group name="simpleExtensionElement">
    <xsd:choice>
      <xsd:any namespace="##other" processContents="skip"/>
      <xsd:any namespace="##local" processContents="skip"/>
    </xsd:choice>
  </xsd:group>
  <!-- Structured Extension -->
  <xsd:group name="structuredSansTitleExtensionElement">
    <xsd:choice>
      <xsd:any namespace="##other" processContents="skip"/>
      <xsd:any namespace="##local" processContents="skip"/>
    </xsd:choice>
  </xsd:group>
  <xsd:group name="structuredExtensionElement">
    <xsd:choice>
      <xsd:any namespace="##other" processContents="skip"/>
      <xsd:any namespace="##local" processContents="skip"/>
    </xsd:choice>
  </xsd:group>
  <!-- Other Extensibility -->
  <xsd:group name="extensionSansTitleElement">
    <xsd:choice>
      <xsd:group ref="app:simpleSansTitleExtensionElement"/>
      <xsd:group ref="app:structuredSansTitleExtensionElement"/>
    </xsd:choice>
  </xsd:group>
  <xsd:group name="extensionElement">
    <xsd:choice>
      <xsd:group ref="app:simpleExtensionElement"/>
      <xsd:group ref="app:structuredExtensionElement"/>
    </xsd:choice>
  </xsd:group>
  <xsd:group name="undefinedContent">
    <xsd:sequence>
      <xsd:group minOccurs="0" maxOccurs="unbounded" ref="app:anyForeignElement"/>
    </xsd:sequence>
  </xsd:group>
  <!-- Extensions -->
  <xsd:group name="anyElement">
    <xsd:sequence>
      <xsd:any processContents="skip"/>
    </xsd:sequence>
  </xsd:group>
  <xsd:group name="anyForeignElement">
    <xsd:choice>
      <xsd:any namespace="##other" processContents="skip"/>
      <xsd:any namespace="##local" processContents="skip"/>
    </xsd:choice>
  </xsd:group>
  <xsd:attributeGroup name="atomPlainTextConstruct">
    <xsd:attributeGroup ref="app:atomCommonAttributes"/>
    <xsd:attribute name="type">
      <xsd:simpleType>
        <xsd:restriction base="xsd:token">
          <xsd:enumeration value="text"/>
          <xsd:enumeration value="html"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:attributeGroup>
  <xsd:element name="atomXHTMLTextConstruct" abstract="true">
    <xsd:complexType mixed="true">
      <xsd:group minOccurs="0" maxOccurs="unbounded" ref="app:anyXHTML"/>
      <xsd:anyAttribute processContents="skip"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:attributeGroup name="atomXHTMLTextConstruct">
    <xsd:attributeGroup ref="app:atomCommonAttributes"/>
    <xsd:attribute name="type" use="required">
      <xsd:simpleType>
        <xsd:restriction base="xsd:token">
          <xsd:enumeration value="xhtml"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
  </xsd:attributeGroup>
  <xsd:complexType name="atomTextConstruct" mixed="true">
    <xsd:sequence>
      <xsd:element minOccurs="0" ref="app:atomXHTMLTextConstruct"/>
    </xsd:sequence>
    <xsd:attribute name="type">
      <xsd:simpleType>
        <xsd:restriction base="xsd:token">
          <xsd:enumeration value="text"/>
          <xsd:enumeration value="html"/>
          <xsd:enumeration value="xhtml"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>
    <xsd:attributeGroup ref="app:atomCommonAttributes"/>
  </xsd:complexType>
  <xsd:group name="anyXHTML">
    <xsd:sequence>
      <xsd:any namespace="http://www.w3.org/1999/xhtml" processContents="skip"/>
    </xsd:sequence>
  </xsd:group>
</xsd:schema>
<!-- EOF -->
