[xsl] Default namespace matching

Subject: [xsl] Default namespace matching
From: "Ed Yau" <eyau@xxxxxxxxxxxxxxx>
Date: Fri, 29 Dec 2006 17:13:11 -0000
Hi,

I think I must be misunderstanding something fundamental about
namespaces.  Is it not the case that if your source file has a default
namespace, in order to get the stylesheet to match, all you have to do
is include the same namespace in the declaration?  My stylesheet works
fine if I delete the xmlns declaration on both files - can someone
please tell me how to make it work without any modification?  I've been
stuck on this for ages....any help appreciated!

Cheers,
   Ed

Please see below.

Here is my source file.

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40";>
 ....
</Workbook>

Here is part of my stylesheet.

<xsl:stylesheet version="1.0"
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:html="http://www.w3.org/TR/REC-html40";>
		<!-- pull in structure  -->
	<xsl:template match="//Workbook">
		<mapping>

			<xsl:for-each select="Worksheet">
				<xsl:apply-templates select="."/>
			</xsl:for-each>
		</mapping>
	</xsl:template>

	<xsl:template match="Worksheet[@ss:Name='Zone']">
			<xsl:for-each select="Table/Row">
				<xsl:apply-templates
select="Cell[1]/Data[@ss:Type='String']" mode="zone"/>
			</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

Current Thread