[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: are all strings in a sequence valid potential QNam

Subject: Re: are all strings in a sequence valid potential QNames
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Thu, 4 Feb 2010 22:04:45 +0530
Re:  are all strings in a sequence valid potential QNam
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@xxxxxxxxxxxx> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.