[xsl] Saxon output unused namespace declarations

Subject: [xsl] Saxon output unused namespace declarations
From: Weihua JIANG <weihua.jiang@xxxxxxxxx>
Date: Thu, 23 Jul 2009 17:11:16 +0800
I am using SAXONB  9.1.0.6J under Linux for XSLT 2.0.

For following stylesheet:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="2.0"
>
<xsl:template match="/" xmlns:xs="http://www.w3.org/2001/XMLSchema";>
B  <xsl:param name="p1" select="(xs:anyURI('one.uri'),
xs:anyURI('eins.uri'))"/>
B  <xsl:param name="p2" select="(xs:anyURI('two.uri'),
xs:anyURI('zwei.uri'))"/>
<out>
B  <xsl:value-of select="$p1 != $p2"/> should be true
</out>
</xsl:template>
</xsl:stylesheet>

Saxon get the output as
<?xml version="1.0" encoding="UTF-8"?><out
xmlns:xs="http://www.w3.org/2001/XMLSchema";>true should be true
</out>

I am wondering why the namespace declaration for xmlns:xs is
outputted. This namespace declaration is not used by the out element.
So, from my opinion, to make the output as simple as possible, the
XSLT 2.0 processor shall not output such declaration.

But, since Saxon is the de facto XSLT 2.0 standard implementation. I
guess this complies with XSLT 2.0 spec. Can anyone tell whether there
is any statements in XSLT 2.0 spec saying something about it?

Thanks
Weihua

Current Thread