xsl-list
[Top] [All Lists]

Re: [xsl] are all strings in a sequence valid potential QNames

2010-02-04 10:35:35
I think, this has been a great discussion. I completely missed the
special case of "castable as" for xs:QName.

I learnt (I've gone back to my memory lane :)) from Ken's post, that
lexical & value space of xs:QName is different. The value space of
xs:QName checks for a URI, and "castable as" works on a value and not
on lexical representation.

As has been told, "castable as" is not correct for this use case. As
Mike suggests, I'll also go for a regex solution.

On Thu, Feb 4, 2010 at 11:10 AM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
wrote:

Just to check that by "valid potential QName" you mean a string that is in
the lexical space of xs:QName and will therefore constitute a valid QName
provided the prefix is in scope?

($x castable as xs:QName) will not work because (a) it also tests whether
the prefix is in scope, and (b) to avoid the issues of it therefore being
context-sensitive, the W3C spec says this is only allowed if the argument
($x) is a string literal.

So you do need to use the regex approach.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>