When you only need an incremental row number in your stylesheet try the
"xsl:number" Command. See XSLT specs for documentation.

> -----Ursprüngliche Nachricht-----
> Von: Andrew C. Oliver [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 19. Dezember 2001 16:18
> An: [EMAIL PROTECTED]
> Betreff: REQ: XSP in a stylesheet help
> 
> 
> Hi all,
> 
> (please CC me your response, I get the digest)
> 
> I'm working on a stylesheet that is intent on organizing the 
> simple-sql
> example page ($COCOON/docs/samples/sql/sql-page.xml) into a gnumeric
> style xml spreadsheet.  I'm very close, but I need to an 
> incremental row
> number.  I figured I'd just use XSP inside of my stylesheet, but all
> I've accomplished so far is a literal printout of what is in 
> between the
> <xsp:expr> tags.  I thought perhaps I needed some other directives
> inside the cocoon configuration but I've not 
> 
> Attached is my stylesheet so far.  Can someone point me in the right
> direction.  I've been reading like mad (yes I read 
> xml.apache.org), and
> I'm just short of the understanding I need to pull this off.  
> An example
> of a stylesheet that uses an incremental value via xsp would be ideal,
> or if someone could show me how to get this to work would be even
> better.  One thing I know I've got to figure out is how to get the
> expression value into the row attribute, but first even 
> getting the expr
> tag interpreted correctly would be a good start. 
> 
> Once I get a few of these finished we'll probably have enough 
> test cases
> for our XML->XLS serialization project 
> (sourceforge.net/projects/poi). 
> (it shares gnumeric's xml format) We hope to release a beta 
> on Monday. 
> 
> Thanks,
> 
> Andy
> 
> --------------------------------------------------------------
> -----------
> <?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";
>                              
> xmlns:xsp="http://apache.org/1999/XSP/Core";
>                               >
> 
>   <xsl:param name="view-source"/>
>   <xsp:logic>
>         int incr = 5;
>   </xsp:logic>
> 
>   <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="2"/>
>                  </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">
>      <rowid><xsp:expr>incr</xsp:expr></rowid>
>      <gmr:Cell Col="0" Row="{rowid}" ValueType="60">
>        <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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
> 
> 
> 
> 
> 

---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to