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