Subject:XSL / XML to create Excel Reports Author:Brandon H. Date:09 Nov 2005 10:32 AM
I am working with an XSL stylesheet transforming XML data and rendering an Excel spreadsheet. I am having a problem with the namespaces which go along with the <Workbook> tag.
Since the namespaces are declared within the xsl:template tag, when I am trying to piece out the report sections into separate <xsl:template match="blah"> tags it is not finding the namespaces.
Above is the code I would have moved into a sub-template, and the ss: prefix is not resolving. Is there a way to include the namespaces in these templates without including <Workbook> tag?
All of the namespaces needed to be moved to the opening <xsl:stylesheet> tag. Also, the xmlns="urn:schemas-microsoft-com:office:spreadsheet" found in the <Workbook> tag must be included in any sub templates as follows:
every time you have to output an element or attribute that has to be in the urn:schemas-microsoft-com:office:spreadsheet name-space you have use prefix ss:
The point is it doesn't matter which prefix you choose as long is mapped to the right name-space.