[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: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 4 Feb 2010 09:29:37 +0000
Re:  are all strings in a sequence valid potential QNam
On 4 February 2010 09:13, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx>
wrote:
> At 2010-02-04 09:04 +0000, Andrew Welch 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.
>>
>> Could you do a  fn:prefix-from-QName($x) = fn:in-scope-prefixes(.)
>> check before doing the castable as check?
>
> Nope:
>
>  http://www.w3.org/TR/2007/REC-xpath20-20070123/#id-castable
>  "[if] the input argument of the expression is of type xs:string but it is
>   not a literal string, the result of the castable expression is false."

To help me understand that :-) can you provide an example of a user
constructed string that is not a string literal?

For example, tokenizing a string into a sequence of strings... they
are all string literals aren't they?




--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.