RE: [XSLT2] 11.1.4 Namespace Aliasing: #default and attributes

> 
> the current text in "11.1.4 Namespace Aliasing" of the XSLT 
> 2.0 WD doesn't state if the value "#default" applies to 
> unprefixed attributes.

Let's assume:

<xsl:stylesheet
  xmlns="default.uri"
  xmlns:out="other.uri">

<xsl:namespace-alias stylsheet-prefix="#default" result-prefix="out"/>

Then the rules say that any attribute of an LRE whose name has namespace URI
"default.uri" will be copied into the result tree in namespace "other.uri".
This can't happen unless the attribute is prefixed in the stylesheet (which
means there must be another namespace declaration that binds a prefix to
"default.uri".

> 
> One could argue, that a default namespace as declared by xmlns never 
> applies to unprefixed attributes, so the value "#default" 
> doesn't change the namespace of a literal attribute.

It changes the namespace of an attribute if the namespace URI of the
attribute in the stylesheet is the same as the default namespace URI.

We tend to treat the "null namespace" in XSLT as being just another
namespace whose name happens to be "". On that interpretation, if the
stylesheet contains the (explicit or implicit) declaration xmlns="", then
#default will change the namespace URI of any element or attribute in the
null namespace. I think that this is the correct interpretation and we
should clarify it.

I don't think it's relevant that the default namespace declaration doesn't
apply to attributes. xsl:namespace-alias is changing the namespace of
elements and attributes that are in a particular namespace, it's not
relevant how they got there.

Thanks for the comment,

Michael Kay

Received on Tuesday, 2 September 2003 06:30:37 UTC