<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
    xmlns:foo="urn:foo"
    targetNamespace="urn:foo"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="1.0">
    <xsd:complexType name="Foo">
        <xsd:sequence>
            <xsd:element
                maxOccurs="unbounded"
                minOccurs="0"
                name="Foo" />
            <xsd:element
                maxOccurs="1"
                minOccurs="1"
                name="bar">
                <xsd:complexType>
                    <xsd:attribute
                        name="value"
                        use="required">
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:enumeration value="bar01" />
                                <xsd:enumeration value="bar02" />
                                <xsd:enumeration value="bar03" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="RestrictedFoo">
        <xsd:complexContent>
            <xsd:restriction base="foo:Foo">
                <xsd:sequence>
                    <xsd:element
                        maxOccurs="1"
                        minOccurs="1"
                        name="Foo" />
                    <xsd:element
                        maxOccurs="1"
                        minOccurs="1"
                        name="bar">
                        <xsd:complexType>
                            <xsd:attribute
                                name="value"
                                use="required">
                                <xsd:simpleType>
                                    <xsd:restriction
                                        base="xsd:string">
                                        <xsd:enumeration value="bar01" />
                                        <xsd:enumeration value="bar02" />
                                        <xsd:enumeration value="bar03" />
                                    </xsd:restriction>
                                </xsd:simpleType>
                            </xsd:attribute>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:restriction>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:schema>
