W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Re: Is the fixed-attribute on length-facet useless?

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 14 Aug 2002 13:38:36 +0100
Message-ID: <21169753372.20020814133836@jenitennison.com>
To: Rainer Becker <r.becker@Nitro-Software.com>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hi Rainer,

>>> (1) Would you agree, that the fixed-attribute is useless
>>>      in connection with length?
>>
>>Yes.
>
> Okay, to go go a step further, this should be regarded as an error
> in the spec?

I wouldn't view it as an error. Nothing breaks if you use the fixed
attribute on xs:length, and I don't think people are likely to get
confused by what it does; just because it has no purpose doesn't mean
it's an error. To my mind, the fixed attribute *in general* is
completely unnecessary and confusing, but that doesn't make it an
error.

>>> (2) What good is length anyways, is there a reason, why
>>>      XML Schema 1.1 should still use it? 
>> 
>>It's only a shorthand for setting minLength and maxLength to the
>>same value, I think, but in some cases that shorthand feels more
>>natural. I don't see any big reason to drop it.
>
> In my opinion, it causes misunderstandings, that are not necessary.
> May sound a bit harsh, but I would favour dropping it ;-).

I don't agree, but send your comment along to
www-xml-schema-comments@w3.org; perhaps the WG will, especially if you
illustrate some of the misunderstandings that arise from having an
xs:length facet in addition to the minLength and maxLength facets.

>>> I see, that the fixed-attribute on minLength und maxLength is
>>> vitally important. 
>> 
>>Personally, I don't see the purpose of the fixed attribute anywhere (I
>>know what it does, just can't conceive of a situation in which it's a
>>useful thing to do). If you could provide a use-case, I'd really
>>appreciate it...
>
> Yes, Jeni, vitally important was a bit exaggerated. Sorry for that.
> Thinking about an use-case I get the notion of a password-type
> (maybe with some sort of special feature ) in a schema, that serves
> as a base for derived types. A fixed-attribute on minLength would
> make sense, in order to prevent a user to derive a type by
> restriction, that would allow a password with less than the
> minLength value. Any use-case I can possibly think of goes in the
> direction, how to protect a base type....
 
Sure, but when you restrict the password type, the restricted type
can't have a minLength that's *less than* the password's minLength in
any case. The same goes for any other facet -- if a value is valid for
a simple type, then it *must* be valid for its base type, by
definition. The fixed attribute would allow you to prevent people from
deriving types in which the minLength facet is *more than* the base
minLength facet, but I just can't think of a time when that would be
useful. Perhaps you can think of another use case?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 14 August 2002 08:38:38 GMT

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