You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Andrew C. Oliver" <ac...@nc.rr.com> on 2001/12/19 22:17:03 UTC
HSSF-Serializer stylesheet (WAS: Re: XSP in a stylesheet help)
Thanks everyone who helped. As it turned out I didn't need XSP (and the
O'Reilly book deceived me). Here is the final solution to my problem.
(I ran this against the simple-sql example). I realize this is the
wrong list to ask, but we'd love to have some more examples if anyone is
game (I'll ask on the developers list as well).
Thanks,
Andy
--------------STYLESHEET -------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0"
>
<xsl:param name="view-source"/>
<xsl:template match="page">
<gmr:Workbook xmlns:gmr="http://www.gnome.org/gnumeric/v7">
<gmr:Sheets>
<gmr:Sheet DisplayFormulas="false" HideZero="false"
HideGrid="false" HideColHeader="false" HideRowHeader="false"
DisplayOutlines="true" OutlineSymbolsBelow="true"
OutlineSymbolsRight="true">
<gmr:Name><xsl:value-of select="title"/></gmr:Name>
<gmr:MaxCol>2</gmr:MaxCol>
<gmr:Cols DefaultSizePts="48">
<gmr:ColInfo No="0" Unit="48" MarginA="2"
MarginB="2" Count="7"/>
</gmr:Cols>
<gmr:Rows DefaultSizePts="12.8">
<gmr:RowInfo No="0" Unit="12.8" MarginA="0"
MarginB="0" Count="9"/>
<gmr:RowInfo No="10" Unit="12.8" MarginA="1"
MarginB="0" Count="24"/>
</gmr:Rows>
<gmr:Cells>
<xsl:apply-templates/>
</gmr:Cells>
</gmr:Sheet>
</gmr:Sheets>
</gmr:Workbook>
</xsl:template>
<xsl:template match="sql:rowset">
<xsl:apply-templates select="sql:row"/>
</xsl:template>
<xsl:template match="sql:row">
<gmr:Cell Col="0" ValueType="60">
<xsl:variable name="rownumber"><xsl:number level="any"
from="content" count="sql:row"/></xsl:variable>
<xsl:attribute name="Row">
<xsl:value-of select="$rownumber + 4"/>
</xsl:attribute>
<gmr:Content>
<xsl:value-of select="sql:name"/>
</gmr:Content>
</gmr:Cell>
<xsl:apply-templates select="sql:rowset"/>
</xsl:template>
<xsl:template match="para"></xsl:template>
<xsl:template match="title"></xsl:template>
</xsl:stylesheet>
--
www.superlinksoftware.com
www.sourceforge.net/projects/poi - port of Excel format to java
http://developer.java.sun.com/developer/bugParade/bugs/4487555.html
- fix java generics!
The avalanche has already started. It is too late for the pebbles to
vote.
-Ambassador Kosh
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>