W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2007

Re: Interaction of explicit attributes and wildcards

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Wed, 24 Jan 2007 13:49:15 +0000
To: "srinivasarao vegunta" <mukalsin@lycos.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bejpkedr8.fsf@hildegard.inf.ed.ac.uk>

Hash: SHA1

[Please _don't_ use HTML-format mail to public lists -- not all of us
are using Outlook!]

srinivasarao vegunta writes:

 According to several schema processors, (Saxon, Xerces, MS .NET), the        
 following instance:                                                          
 <e att1="banana"/>                                                           
 is valid against the following schema:                                       
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"                       
 elementFormDefault="qualified" attributeFormDefault="unqualified">           
 <xs:complexType name="B">                                                    
 <xs:attribute name="att1" use="optional" type="xs:decimal"/>                 
 <xs:anyAttribute namespace="##local"                                         
 <xs:complexType name="R">                                                    
 <xs:restriction base="B">                                                    
 <xs:attribute name="att1" use="prohibited"/>                                 
 <xs:anyAttribute namespace="##local"                                         
 <xs:element name="e" type="R"/>                                              
 But change the element declaration to <xs:element name="e" type="B"/>, and   
 validation fails, saying that "banana" is not a valid xs:decimal (the same   
 set of schema processors agree on this).                                     
 Surely the element cannot be a valid instance of R unless it is also a valid 
 instance of B?                                                               

You have hit on one of the areas where the Schema REC fails to live up
to its own promise that restrictions accept subsets of their base.

The behaviour you describe is conformant, it follows all the explicit
rules in the spec. for checking valid restrictions.  It's just that
those rules aren't quite 'right'.

The XML Schema WG expects to fix this problem in v1.1.

- -- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Version: GnuPG v1.2.6 (GNU/Linux)

Received on Wednesday, 24 January 2007 13:49:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:39 UTC