[sc34wg3] CTM: Specifying datatypes
xuan--sc34wg3--isotopicmaps.org at baldauf.org
Mon Mar 30 14:47:38 EDT 2009
Lars Heuer wrote:
> Hi Xuân,
> It would be very nice if you take a minute to read
> <http://learn.to/quote> (and follow these rules of course). TIA.
>>> Requiring that the string which was provided by the user is kept,
>>> would be wrong imo.
>> Well, why?
>> We can make it very simple:
>> An attempt to set the datatype only succeeds either if the old
>> datatype is xsd:string or if the old datatype equals the new
>> datatype, otherwise such an attempt is an error.
> Yes, actually I thought about limiting the datatype to xsd:string
> until Lars Marius brought up his examples. :) We could limit the
> 'input' datatype to xsd:string, of course, but I thought it would be
> neither fish nor fowl, just one more special case.
Well, like the star * becoming a literal... ;-)
>> The purpose of overriding datatypes is to make it possible to write
>> typed strings as template-arguments without providing the type
>> information over and over again.
> Yep, but I think limiting the stuff to xsd:string and creating a
> special case would be wrong (maybe rho influenced me more than I
> thought ;)). What's special about strings? Because everything has a
> string representation? If everything has a string representation, why
> shouldn't we allow the examples Lars Marius has brought up? All XML
> Schema datatypes have at least one string representation.
This is special about string. The syntactic value space of string
encompasses all syntactic value spaces. This is not true for other
> And if we
> limit the datatype to xsd:string, what about our escaping rules, do we
> need an additional "raw" string literal or do we assume that the other
> datatype can happily use our de-escaped strings?
The latter. We always assume, and do not verify, that whatever is stored
in a value of an occurrence matches the datatype which is stored in the
same occurrence. Ensuring that it indeed does match is out of the scope
of TMDM and CTM.
We've hat the discussion in Prague whether we would have escape-less
strings (which was said to be useful for regular expressions, for
example). The decision was, for the time being, to not have a second
string literal syntax. My person opinion is currently: I do not care
whether we have a raw string syntax, but if we have one, such a raw
string literal should be started with a single quotes (or, if we want to
be really "correct" and avoid premature termination of such a raw string
literal, the delimiters of such a raw string literal should be related
pairs, such as «double angle quotes» (reachable by AltGr+Y and AltGr+X
on my keyboard ;-))). Other suggested delimiters were slashes (e.g.
/this is a string for regular expressions/), which I think are too
> Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the sc34wg3