<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xbean/scomp/derivation/facets/FacetRestriction"
    xmlns="http://xbean/scomp/derivation/facets/FacetRestriction"
    xmlns:base="http://xbean/scomp/derivation/facets/Facets"
>

    <xs:simpleType name="MinMaxInclusiveT">
        <xs:restriction base="base:MinMaxInclusiveT">
            <xs:minInclusive value="3"/>
            <xs:maxInclusive value="9"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="MinMaxInclusiveDateT">
            <xs:restriction base="base:MinMaxInclusiveDateT">
                <xs:minInclusive value="2003-12-11"/>
                <xs:maxInclusive value="2003-12-23"/>
            </xs:restriction>
        </xs:simpleType>



    <xs:simpleType name="MinMaxExclusiveT">
        <xs:restriction base="base:MinMaxExclusiveT">
            <xs:minExclusive value="3"/>
            <xs:maxExclusive value="9"/>
        </xs:restriction>
    </xs:simpleType>

     <xs:simpleType name="MinMaxExclusiveDateT">
        <xs:restriction base="base:MinMaxExclusiveDateT">
            <xs:minExclusive value="2003-12-11"/>
            <xs:maxExclusive value="2003-12-24"/>
        </xs:restriction>
    </xs:simpleType>

<!-- Compile time test: this needs to fail
    <xs:simpleType name="LengthT">
           <xs:restriction base="base:LengthT">
               <xs:length value="1"/>
           </xs:restriction>
       </xs:simpleType>
-->

    <xs:simpleType name="MinMaxLengthT">
           <xs:restriction base="base:MinMaxLengthT">
               <xs:minLength value="3"/>
               <xs:maxLength value="4"/>
           </xs:restriction>
       </xs:simpleType>

    <xs:simpleType name="DigitsT">
           <xs:restriction base="base:DigitsT">
               <xs:totalDigits value="3"/>
               <xs:fractionDigits value="1"/>
           </xs:restriction>
       </xs:simpleType>

    <xs:simpleType name="WSTReplace">
           <xs:restriction base="base:WSTPreserve">
               <xs:whiteSpace value="replace"/>
           </xs:restriction>
       </xs:simpleType>

    <xs:simpleType name="WSTCollapse">
           <xs:restriction base="base:WSTPreserve">
               <xs:whiteSpace value="collapse"/>
           </xs:restriction>
       </xs:simpleType>


     <xs:simpleType name="EnumT">
           <xs:restriction base="base:EnumT">
               <xs:enumeration value="a"/>
           </xs:restriction>
       </xs:simpleType>

    <xs:simpleType name="PatternT">
           <xs:restriction base="base:PatternT">
               <xs:pattern value="(a[^ef]d){3}"/>
           </xs:restriction>
       </xs:simpleType>

    <xs:element name="MinMaxInclusiveElt" type="MinMaxInclusiveT"/>
     <xs:element name="MinMaxInclusiveDateElt" type="MinMaxInclusiveDateT"/>
    <xs:element name="MinMaxExclusiveElt" type="MinMaxExclusiveT"/>
    <xs:element name="MinMaxExclusiveDateElt" type="MinMaxExclusiveDateT"/>
    <xs:element name="LengthElt" type="xs:integer"/>
    <xs:element name="MinMaxLengthElt" type="MinMaxLengthT"/>
    <xs:element name="DigitsElt" type="DigitsT"/>
    <xs:element name="WSReplaceElt" type="WSTReplace"/>
    <xs:element name="WSCollapseElt" type="WSTCollapse" />
    <xs:element name="EnumElt" type="EnumT"/>
    <xs:element name="PatternElt" type="PatternT"/>


</xs:schema>