- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Sun, 13 Jan 2002 14:21:37 +0000
- To: www-xml-query-comments@w3.org
Hi,
Looking at the string-value accessor for simple typed values - while I
think it's right to use the canonical lexical representation of the
values, unfortunately the XML Schema Datatypes Rec doesn't detail the
canonical lexical representation of all of the primitive types. In
particular, no canonical lexical representation is specified for:
- xs:string, xs:base64Binary, xs:anyURI (but that's OK, I think we
can guess)
- xs:duration - presumably the lexical representation contains all
components of the duration (years, months, days, hours, minutes
and seconds, even those that occur 0 times? Or are these omitted?
In the latter case, what's the canonical lexical representation of
PT0S? Since the number of seconds can be a decimal, is this
decimal represented with a decimal point (i.e. using the canonical
lexical representation for xs:decimal)?
- xs:date - what happens to the timezone component? Presumably,
unlike xs:dateTime and xs:time, this isn't normalized to Z?
(And similarly for xs:gYearMonth, xs:gYear, xs:gMonthDay,
xs:Month, and xs:Day)
- xs:QName and xs:NOTATION - these are the trickiest (their value
spaces are the same). The XML Schema Rec states that the lexical
representation of a QName depends on the in-scope namespaces. When
you're doing a query/transformation, which namespace declarations
do you use - the ones in the query/stylesheet or the ones from the
source document? What if there's more than one namespace
declaration for the namespace URI? What if there aren't any?
The difficulty with using the original prefix for the QName is
that the definition of a canonical lexical representation is that
two equal values have exactly the same canonical lexical
representation. Equality of QNames should be based purely on the
namespace URI and local name, not on the prefix. One possibility
would be to introduce something like:
{namespace-uri}local-name
but this is not, of course, a valid lexical representation of a
QName.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
Received on Sunday, 13 January 2002 09:22:36 UTC