Re: <time> values in HTML5

> It's not hard to define a subtype of xsd:boolean that
> accepts only 'true' and 'false' (or any other subset of the
> lexical space).  It's also not hard to define a union of
> boolean (or of such a subtype) with another type containing
> the other values needed in an enumerated type.
>
What you can't do, however, is define a subtype of boolean that accepts 
the values "✓" and "✗", or a subtype of xs:time that accepts "HH:MM".

We almost got there in XSD 1.1 by recognizing the possibility of adding 
further "pre-lexical facets", and Saxon in fact has an experimental 
extension that allows a user-defined pre-lexical facet to define 
conversions from the value as written into the (abstract) "lexical 
space", and another conversion for the reverse.

Michael Kay
Saxonica

Received on Monday, 5 December 2011 21:11:40 UTC