[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Excel Spreadsheet problem
I'm trying to get some useful data from an Excel 2003 spreadsheet, saved to XML. This is what the source file looks like (very much shortened): <?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"> ... <Worksheet> ... <Table> ... <Row> <Cell> <Data>ID</Data> ... </Cell> ... </Row> </Table> </Worksheet> </Workbook> And this is what I want: <?xml version="1.0" encoding="iso-8859-1"?> <table> <row> <cell>...</cell> ... </row> ... </table> Plus a namespace if it's necessary. This is how I tried: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="urn:schemas-microsoft-com:office:spreadsheet"> <xsl:output method="xml" encoding="iso-8859-1" indent="yes"/> <!-- Match the first <Table> element --> <xsl:template match="my:Table[1]"> <table> <xsl:apply-templates select="my:Row"/> </table> </xsl:template> <xsl:template match="my:Row"> <row> <xsl:apply-templates select="my:Cell"/> </row> </xsl:template> <xsl:template match="my:Cell"> <cell> <xsl:value-of select="my:Data"/> </cell> </xsl:template> <!-- Skip any other elements --> <xsl:template match="*"/> </xsl:stylesheet> And this is all I get: <?xml version="1.0" encoding="iso-8859-1"?> What am I doing wrong? Gustaf XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|