<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.juicer.org"
            xmlns="http://www.juicer.org"
            elementFormDefault="qualified">
    <xsd:element name="warranty" type="xsd:string"/>
    <xsd:element name="guarantee" substitutionGroup="warranty" type="xsd:string"/>
    <xsd:complexType name="appliance">
        <xsd:sequence>
            <xsd:element name="description" type="xsd:string"/>
            <xsd:element ref="warranty" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="juiceAppliance">
        <xsd:complexContent>
            <xsd:extension base="appliance">
                <xsd:sequence>
                    <xsd:element name="name" type="xsd:string"/>
                    <xsd:element name="image" type="imageType"/>
                    <xsd:element name="weight" minOccurs="0">
                        <xsd:complexType>
                            <xsd:simpleContent>
                                <xsd:extension base="xsd:positiveInteger">
                                    <xsd:attribute name="units" type="xsd:string" fixed="pounds"/>
                                </xsd:extension>
                            </xsd:simpleContent>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="cost" minOccurs="1" maxOccurs="unbounded">
                        <xsd:complexType>
                            <xsd:simpleContent>
                                <xsd:extension base="money">
                                    <xsd:attribute name="currency" use="required">
                                        <xsd:simpleType>
                                            <xsd:restriction base="xsd:string">
                                                <xsd:enumeration value="USD"/>
                                                <xsd:enumeration value="CAD"/>
                                            </xsd:restriction>
                                        </xsd:simpleType>
                                    </xsd:attribute>
                                </xsd:extension>
                            </xsd:simpleContent>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="retailer">
                        <xsd:complexType>
                            <xsd:attribute name="href" type="xsd:anyURI"/>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
                <xsd:attribute name="id" type="xsd:ID" use="required"/>
                <xsd:attribute name="electric" type="xsd:boolean" use="required"/>
                <xsd:attribute name="type" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="press"/>
                            <xsd:enumeration value="gear"/>
                            <xsd:enumeration value="centrifugal"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="juicer" type="juiceAppliance"/>
    <xsd:simpleType name="money">
        <xsd:restriction base="xsd:decimal">
            <xsd:fractionDigits value="2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="imageType">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="(.)+\.(gif|jpg|jpeg|bmp)"/>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:schema>