RE: [xsl] Namespace-alias using #default with no default namespace in scope

Subject: RE: [xsl] Namespace-alias using #default with no default namespace in scope
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 12 May 2006 11:01:49 +0100
> Ah! Is a more recent version of the XSLT 2.0 spec available 
> somewhere? I'm currently reading, 
> which says: "W3C Candidate Recommendation 3 November 2005".

That URL always points to the latest. But all the agreed changes are
publicly available as bugzilla entries.
> If we have:
> <xsl:stylesheet ... xmlns:from="urn:test:from" xmlns:to="urn:test:to">
>   <xsl:namespace-alias stylesheet-prefix="from" result-prefix="to"/>
> Some processors prefer using the "from" prefix for the 
> resulting elements and some processors use the "to" prefix.
> Couldn't there be a rule, or at least a suggestion in XSLT 
> 2.0 to use either the literal namespace prefix or the target 
> namespace prefix?

It's well-defined in XSLT 2.0 which prefix you get. The rule

"A namespace node whose string value is a target namespace URI is copied to
the result tree, whether or not the URI identifies an excluded namespace."

means that in normal circumstances (that is, when the same namespace
bindings are in scope for the xsl:namespace-alias element and the literal
result element) you will get the result-prefix.

Michael Kay

Current Thread