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 22:19:27 +0100
At 2010-02-04 16:46 +0000, Andrew Welch wrote:
> As has been told, "castable as" is not correct for this use case. As
> Mike suggests, I'll also go for a regex solution.

I would disagree, "castable as" is absolutely the correct approach in
this case (creating element names based on some input).

If an element name were only the prefix and local name, then sure ... but one isn't creating an element name, one is creating an element expanded name using an element qualified name.

However, it's not possible because of the (imho) unnecessary
restriction in the spec, so you are forced to fall back to a regex
based solution.

Currently even NCNames fail the castable xs:QName test, which has to be wrong.

Note that I included an NCName literal string in my illustration and it passed ... or are you referring to a string with an NCName value? A string with an NCName value would still be based on the default namespace of the unspecified node for context. In my illustration the default namespace was effectively null since there was no default namespace declaration.

Hopefully this could be looked at for 2.1...?

What would be the details of your proposal for a change? Would simply using the context node (and an error if the context item isn't a node) be enough?

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