Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Interaction of explicit attributes and wildcards

From: "Michael Kay" <mike@--------.--->
To: "'Henry S. Thompson'" <ht@---.--.--.-->, "'srinivasarao vegunta'" <mukalsin@-----.--->
Date: 1/24/2007 5:36:00 PM
I'm not sure how my message of 8 Dec came to be reposted, but I'm glad it's
caused some discussion.

This situation can't occur with elements because UPA prevents an element
particle overlapping with an element wildcard particle. There's no
corresponding rule for attributes: the explicit attribute wins over the
attribute wildcard. It's not clear why the rules for elements/attributes
here are asymmetric.

Rather than making this case an error (an invalid schema), it would seem
more helpful to define the rules so that use="prohibited" means what it
says: an attribute of this name is prohibited, despite the presence of a
wildcard that would otherwise permit it.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Henry S. Thompson
> Sent: 24 January 2007 13:49
> To: srinivasarao vegunta
> Cc: xmlschema-dev@w...
> Subject: Re: Interaction of explicit attributes and wildcards
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> 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:sequence/>                                               
>                 
>  <xs:attribute name="att1" use="optional" type="xs:decimal"/> 
>                 
>  <xs:anyAttribute namespace="##local"                         
>                 
>  processContents="skip"/>                                     
>                 
>  </xs:complexType>                                            
>                 
>  <xs:complexType name="R">                                    
>                 
>  <xs:complexContent>                                          
>                 
>  <xs:restriction base="B">                                    
>                 
>  <xs:attribute name="att1" use="prohibited"/>                 
>                 
>  <xs:anyAttribute namespace="##local"                         
>                 
>  processContents="skip"/>                                     
>                 
>  </xs:restriction>                                            
>                 
>  </xs:complexContent>                                         
>                 
>  </xs:complexType>                                            
>                 
>  <xs:element name="e" type="R"/>                              
>                 
>  </xs:schema>                                                 
>                 
>  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.
> 
> ht
> - --
>  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@i...
>                    URL: http://www.ltg.ed.ac.uk/~ht/ [mail 
> really from me _always_ has this .sig -- mail without it is 
> forged spam] -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
> 
> iD8DBQFFt2PbkjnJixAXWBoRArzHAJsFzcU5+hgsZ61Wsiq7Ue2dTu8n4QCeJKNC
> FFyL2hvq4zjr4bzRiZuf31I=
> =pVkY
> -----END PGP SIGNATURE-----
> 


From petexmldev@t... Wed Jan 24 18:13:16 2007
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1H9mcW-0


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent