1 <xsl:stylesheet version="1.0"
2 xmlns="urn:schemas-microsoft-com:office:spreadsheet"
3 xmlns:xhtml="http://www.w3.org/1999/xhtml"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
6 xmlns:o="urn:schemas-microsoft-com:office:office"
7 xmlns:x="urn:schemas-microsoft-com:office:excel"
8 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
10 <xsl:output method="xml" indent="yes" omit-xml-declaration="no" media-type="application/xml"/>
12 <xsl:template match="/">
13 <xsl:processing-instruction name="mso-application">
14 <xsl:text>progid="Excel.Sheet"</xsl:text>
15 </xsl:processing-instruction>
17 <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
18 xmlns:o="urn:schemas-microsoft-com:office:office"
19 xmlns:x="urn:schemas-microsoft-com:office:excel"
20 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
21 xmlns:html="http://www.w3.org/TR/REC-html40">
24 <Style ss:ID="Default" ss:Name="Normal">
25 <Alignment ss:Vertical="Bottom"/>
34 <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
37 <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
39 <Interior ss:Color="#99CCFF" ss:Pattern="Solid"/>
41 <Style ss:ID="s23" ss:Name="Currency">
43 ss:Format="_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)"/>
46 <NumberFormat ss:Format="_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)"/>
49 <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
53 <xsl:apply-templates mode="top"/>
59 <xsl:template match="*" mode="top">
62 <xsl:when test="xhtml:table[@class='ricoSimpleGrid']">
63 <xsl:apply-templates mode="grid"/>
67 <xsl:apply-templates select="*" mode="top"/>
74 <xsl:template match="*" mode="grid">
78 <xsl:when test="xhtml:thead">
79 <xsl:call-template name="processTable">
80 <xsl:with-param name="id" select="@id"/>
81 <xsl:with-param name="headRows" select="xhtml:thead/xhtml:tr"/>
82 <xsl:with-param name="bodyRows" select="xhtml:tbody/xhtml:tr"/>
86 <xsl:when test="xhtml:tbody">
87 <xsl:call-template name="processTable">
88 <xsl:with-param name="id" select="@id"/>
89 <xsl:with-param name="headRows" select="xhtml:tbody/xhtml:tr[1]"/>
90 <xsl:with-param name="bodyRows" select="xhtml:tbody/xhtml:tr[position() > 1]"/>
95 <xsl:call-template name="processTable">
96 <xsl:with-param name="id" select="@id"/>
97 <xsl:with-param name="headRows" select="xhtml:tr[1]"/>
98 <xsl:with-param name="bodyRows" select="xhtml:tr[position() > 1]"/>
107 <!-- Perform the actual table transformation -->
109 <xsl:template name="processTable">
110 <xsl:param name="id" />
111 <xsl:param name="headRows" />
112 <xsl:param name="bodyRows" />
115 <xsl:attribute name="ss:Name">
116 <xsl:value-of select='$id'/>
120 <xsl:apply-templates select="$headRows" mode="convertHeadRow"/>
121 <xsl:apply-templates select="$bodyRows" mode="convertBodyRow"/>
129 <xsl:template match="*" mode="convertHeadRow">
131 <xsl:apply-templates select="xhtml:td | xhtml:th" mode="convertHeadCell"/>
136 <xsl:template match="*" mode="convertHeadCell">
137 <xsl:element name="Cell">
138 <xsl:attribute name="ss:StyleID">s22</xsl:attribute>
139 <xsl:if test="@colspan">
140 <xsl:attribute name="ss:MergeAcross"><xsl:value-of select="number(@colspan)-1"/></xsl:attribute>
142 <Data ss:Type="String">
143 <xsl:value-of select="."/>
149 <xsl:template match="*" mode="convertBodyRow">
151 <xsl:apply-templates select="xhtml:td | xhtml:th" mode="convertBodyCell"/>
156 <xsl:template match="*" mode="convertBodyCell">
157 <Cell><Data ss:Type="String"><xsl:value-of select="."/></Data></Cell>