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

Subject: Re: [xsl] are all strings in a sequence valid potential QNames
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 Feb 2010 10:13:20 +0100
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?

  "[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."

I hope this helps.

. . . . . . . . . . . . Ken

-- XSLT/XQuery/XPath training after 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: Crane Softwrights Ltd. Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: Video overview: G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 Legal business disclaimers:

Current Thread