[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Default namespace matching

Subject: Default namespace matching
From: "Ed Yau" <eyau@xxxxxxxxxxxxxxx>
Date: Fri, 29 Dec 2006 17:13:11 -0000
 Default namespace matching
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.