OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML Schema restriction contradiction?



hi,

is the current definition of <restriction> in the XML Schema CR 24/10/2001 contradictory or am i missing something?

in Part 1:Structures Appendix A: Schema for XML Schemas (normative)

<complexType name="restrictionType">
        <complexContent>
                <extension base="annotated">
                        <sequence>
                                <choice>
                                        <group ref="typeDefParticle" minOccurs="0"/>
                                        <group ref="simpleRestrictionModel" minOccurs="0"/>
                                </choice>
                        <group ref="attrDecls"/>
                        </sequence>
                <attribute name="base" type="QName" use="required"/>
                </extension>
        </complexContent>
</complexType>

This seems to conform to the Schema validation that I am using (XML Spy 3.5) which returns an error that the base attribute is required when i use a XML Schema containing restrictions without a base but with a simpleType child.

However in Part 2:Datatypes section 5.1.1

"Either the base  [attribute] or the simpleType  [child] must be present, but not both."

which matches with the given Schema for Datatype Definitions which states

<element name="restriction" substitutionGroup="simpleDerivation" id="restriction">
        <complexType>
                <annotation>
                        <documentation xml:lang="en" source="http://www.w3.org/TR/xmlschema-2/#element-restriction">
                        base attribute and simpleType child are mutually exclusive, but one or other is required
                                </documentation>
                </annotation>
                <complexContent>
                        <extension base="annotated">
                                <group ref="simpleRestrictionModel"/>
                                <attribute name="base" type="QName" use="optional"/>
                        </extension>
                </complexContent>
        </complexType>
</element>

So, is the base attribute optional or required? Is the XML Spy validator correctly validating my XML Schema?
The offending (error producing) XML Schema code is:

<simpleType name="SFColor">
      <restriction>
         <simpleType>
            <list itemType="xmta:ZeroToOneFloat"/>
         </simpleType>
         <length value="3"/>
      </restriction>
   </simpleType>

regards

lyndon


Lyndon J B Nixon ... MAGIC Centre, GMD FOKUS ... Berlin, Germany
"what is now proved was once only imagined" - william blake
PhD Student, Integration of Internet into MPEG-4 & MPEG-7
nixon@fokus.gmd.de   members.tripod.co.uk/~madeejit/phd.htm