W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2003

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

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Tue, 2 Sep 2003 12:30:23 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106073DD0CB@daemsg02.software-ag.de>
To: Oliver Becker <obecker@informatik.hu-berlin.de>, public-qt-comments@w3.org
> 
> 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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:49 UTC