Re: min and max for strings (correction TWO)

Greetings again all,

I've realised that min and max for strings are shortcuts for 
minLength and maxLength, hence there's no conflict between 
values or expressions :).

In response to the editor in 5.12.5: Yes, it might be a 
trifle confusing. Personally, I'd follow the principle of 
least surprise here: min/max could easily be mistaken for 
minimum/maximum alphabetic value. Presumably the XMLSchema 
developers had a reason for not doing something similar?

Also, I'm implementing a very small subset of XForms as a 
school project (in Java), and supporting different meanings 
for min and max in one context (i.e. non-string/binary 
types) and another is a small inconvenience. For instance 
(at the moment, at least) I have all facets extending an 
abstract superclass Facet (with a isValid method). These 
implementations recieve Objects, which are then cast by the 
facet as required. For example, minLength and maxLength use 
toString(), min and max (up til now) cast the supplied data 
to Comparable, etc. Now it will be necessary to implement an 
exception to the rule (i.e. if (data instanceof String) ...)

Anyway, that's my $0.02. Sorry for the inconvenience,

Dominic Cooney.

Received on Saturday, 20 January 2001 21:35:17 UTC