examples/xmlpatterns/schema/files/recipe.xsd
author Eckhart Koeppen <eckhart.koppen@nokia.com>
Wed, 21 Apr 2010 11:15:19 +0300
branchRCL_3
changeset 11 25a739ee40f4
parent 0 1918ee327afb
permissions -rw-r--r--
3a438a6e0b41f1ef657ef0e648d352db636204aa

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:element name="recipe">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="title" type="xsd:string"/>
                <xsd:element name="ingredient" type="ingredientType" maxOccurs="unbounded"/>
                <xsd:element name="time" type="timeType"/>
                <xsd:element name="method">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="step" type="xsd:string" maxOccurs="unbounded"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:complexType name="ingredientType">
        <xsd:attribute name="name" type="xsd:string"/>
        <xsd:attribute name="quantity" type="xsd:positiveInteger"/>
        <xsd:attribute name="unit" type="xsd:string"/>
    </xsd:complexType>

    <xsd:complexType name="timeType">
        <xsd:attribute name="quantity" type="xsd:positiveInteger"/>
        <xsd:attribute name="unit">
            <xsd:simpleType>
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="seconds"/>
                    <xsd:enumeration value="minutes"/>
                    <xsd:enumeration value="hours"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:complexType>

</xsd:schema>