[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Type change during restriction

From: Werner Guttmann <werner.guttmann@gmx.net>
Date: Fri, 22 Sep 2006 21:19:43 +0200
Message-ID: <4514374F.6050209@gmx.net>
To: Michael Kay <mike@saxonica.com>
CC: xmlschema-dev@w3.org, 'Reinhard Pötz' <reinhard.poetz@gmx.net>
Re: Type change during restriction

Thanks, Michael, for spelling this out so very 'user friednly' .. ;-).

Werner

Michael Kay wrote:
>> when restricting a complex type, is it actually allowed (at 
>> all) to change the type of an attribute defined at the 
>> complex type to be restricted ?
>>
> 
> Yes, subject to the rules in
> http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
> 
> To paraphrase the rules:
> 
> 2.1.1, 3 if there's an attribute that's required in the base type then it
> must be present (and required) in the derived type
> 
> 2.1.2 the type of the attribute in the derived type must be a restriction of
> the type of the corresponding attribute in the base type
> 
> 2.1.3 if the base type specifies a fixed value, then the derived type must
> specify the same fixed value.
> 
> (Wouldn't it be nice if the spec were written like that, instead of saying
> things like "what would have been the {name} and {target namespace} of the
> {attribute declaration} of an attribute use in the set per clause 1 above
> but for the ·actual value· of the use [attribute] of the relevant
> <attribute> among the [children] of <restriction> being prohibited.")
> 
> Remember of course, that unlike child elements, attributes are automatically
> inherited from the base type unless you explicitly exclude them (an
> asymmetry I've always found very ugly).
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 
Received on Friday, 22 September 2006 21:12:56 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.