W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 1999

Redundant namespace declarations in the output tree

From: Kay Michael <Michael.Kay@icl.com>
Date: Thu, 4 Nov 1999 19:08:24 -0000
Message-ID: <93CB64052F94D211BC5D0010A800133170F1F6@wwmess3.bra01.icl.co.uk>
To: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
SAXON currently never outputs a namespace declaration unless there is an
element or attribute name that uses it.

My understanding of the latest spec is that on a literal result element I am
required to output redundant namespace declarations (unless they are
suppressed using xsl:exclude-result-prefixes), while on elements written
using xsl:element I am allowed to output redundant namespace declarations,
but am not required to do so: and further, there is no way for the user to
control whether I do so or not, except by the global exclude-result-prefixes
on xsl:stylesheet. Is this correct?

Reading xsl:copy again I see this also says that when copying an element
node I should output all its namespace nodes including those that might only
be needed for attributes that are not copied, and again there seems to be no
way for the user to suppress it except at the stylesheet level. 

I can see why it might sometimes make sense to output redundant namespace
declarations (e.g. when the result document is a stylesheet) but I can't see
why the three cases are different.

Futher, for a literal result element, the spec says that all attributes
except those in the XSLT namespace are copied, and that all namespaces
except those in the XSLT and extension element namespaces are copied. This
means that if there is an attribute that uses an extension element prefix,
the attribute is copied but its namespace is not. This must be wrong.


Mike Kay
Received on Thursday, 4 November 1999 14:08:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:49 GMT