topical media & game development

talk show tell print

professional-xml-25-Excel-simpleExcelXML.xsl / xsl



  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet version="2.0" xmlns:xl="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
          <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
          <xsl:template match="/">
                  <data>
                          <xsl:attribute name="type"><xsl:value-of select="/xl:Workbook/xl:Worksheet/@ss:Name"/></xsl:attribute>
                          <xsl:apply-templates select="/xl:Workbook/xl:Worksheet/xl:Table/xl:Row"/>
                  </data>
          </xsl:template>
          <xsl:template match="xl:Row">
                  <row>
                          <xsl:apply-templates select="xl:Cell"/>
                  </row>
          </xsl:template>
          <xsl:template match="xl:Cell">
                  <col>
                          <xsl:value-of select="xl:Data"/>
                  </col>
          </xsl:template>
  </xsl:stylesheet>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.