[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|