<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Magento Design Theme Configuration File
        </xs:documentation>
    </xs:annotation>

    <xs:element name="theme">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="title" type="title"/>
                <xs:element name="parent" type="parent_theme" minOccurs="0"/>
                <xs:element name="media" type="media" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="title">
        <xs:restriction base="xs:string">
            <xs:pattern value=".*[^\s].*"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- Short theme name: '<theme>'. Fully-qualified theme name: '<path>/<theme>'. -->
    <xs:simpleType name="parent_theme">
        <xs:restriction base="xs:string">
            <xs:pattern value="([^/]+/)?[^/]+"></xs:pattern>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="media">
        <xs:sequence>
            <xs:element name="preview_image" type="preview_image" maxOccurs="1"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="preview_image">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="order" type="xs:integer" use="optional"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

</xs:schema>
