[xsl] namespaces and xmlns=""

Subject: [xsl] namespaces and xmlns=""
From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Date: Tue, 29 Nov 2005 11:04:06 +0000
Hi all, can someone explain why the following XML and XSLT produces an xmlns="" attribute on the image tag in the output. I am using MSXML4

XML:
<root/>

XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:local="#local-functions" xmlns:s="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:dc="http://purl.org/dc/elements/1.1/"; exclude-result-prefixes="msxsl local s dt rdf">


<xsl:variable name="rss_rdf_resource_image">
<xsl:element name="image">
<xsl:attribute name="rdf:resource">/images/logo042.gif</xsl:attribute>
</xsl:element>
</xsl:variable>
	<!--

-->
<xsl:template match="root">
<rdf:RDF xmlns="http://purl.org/rss/1.0/"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:image="http://purl.org/rss/1.0/modules/image/";>
<channel rdf:about="http://about.about.com/";>
<title>Recently Edited Articles</title>
<link>http://about.about.com/dfgdsf</link>
<description>Recently Edited Articles</description>
<dc:date>2005-11-29T10:16+03:00</dc:date>
<xsl:copy-of select="$rss_rdf_resource_image"/>
</channel>
</rdf:RDF>
</xsl:template>
</xsl:stylesheet>


Output:

<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns="http://purl.org/rss/1.0/"; xmlns:image="http://purl.org/rss/1.0/modules/image/"; xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
<channel rdf:about="http://about.about.com/";>
<title>Recently Edited Articles</title>
<link>http://about.about.com/dfgdsf</link>
<description>Recently Edited Articles</description>
<dc:date>2005-11-29T10:16+03:00</dc:date>
<image rdf:resource="/images/logo042.gif" xmlns=""/>
</channel>
</rdf:RDF>


_________________________________________________________________
MSN Messenger 7.5 is now out. Download it for FREE here. http://messenger.msn.co.uk


Current Thread