W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2006

Re: Default and Fixed Attribute declarations

From: Jeff Rafter <lists@jeffrafter.com>
Date: Tue, 03 Oct 2006 12:06:55 -0700
Message-ID: <4522B4CF.9060409@jeffrafter.com>
To: Michael Kay <mike@saxonica.com>
CC: 'Mukul Gandhi' <gandhi.mukul@gmail.com>, xmlschema-dev@w3c.org

Thanks all,

I think that my confusion probably started by comparing the fixed and 
default functionality of attributes and elements (e.g. in 5.1 the 
presence of an element is allowable as long as it is empty). This is a 
silly confusion for me to have had... but all sorted now.

Thanks,
Jeff

Michael Kay wrote:
>> I did a quick check with XMLSpy 2006. It reports this as a 
>> validation error. So as you say, (a) is the answer.
> 
> 
> Really, trying out implementations is no way to find out what the spec says.
> The answer is in Schema Part 1 section 3.5.4:
> 
> For an attribute information item to be.valid. with respect to an attribute
> use its .normalized value. must match the canonical lexical representation
> of the attribute use's {value constraint} value, if it is present and fixed.
> 
> Given <xs:attribute name="foo" type="xs:string" fixed="bar" />, there is an
> attribute use with a {value constraint} that is fixed and has the value
> "bar". The .normalized value. of the attribute information item is "", which
> does not match.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 
> 
Received on Tuesday, 3 October 2006 19:07:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:55 GMT