<?xml version="1.0" encoding="utf-8"?>
<!--
AdamMil.Web is a library providing helpful classes for web development using
the .NET Framework.

http://www.adammil.net/
Written 2015-2016 by Adam Milazzo.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-->
<xs:schema targetNamespace="http://adammil.net/webdav.server/mediaTypes" elementFormDefault="qualified"
           xmlns="http://adammil.net/webdav.server/mediaTypes"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="mediaType">
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-zA-Z0-9!#\$%&amp;'\*\+\-\.\^_`\|~]+/[a-zA-Z0-9!#\$%&amp;'\*\+\-\.\^_`\|~]+" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="extension">
    <xs:restriction base="xs:string">
      <xs:pattern value="[^\.].*" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:element name="mediaTypeMap">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="mediaType" type="mediaType" use="required" />
            <xs:attribute name="extension" type="extension" use="required" />
            <xs:attribute name="canonicalExtension" type="xs:boolean" default="false" />
            <xs:attribute name="canonicalMediaType" type="xs:boolean" default="true" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="defaultExtension" type="extension" />
      <xs:attribute name="defaultMediaType" type="mediaType" />
    </xs:complexType>
  </xs:element>
</xs:schema>
