Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Display records in 3 columns

From: "Peter Lukan" <peter.lukan@-------->
To:
Date: 4/2/2004 2:33:00 AM
Thanks for Solution - I've found another one - for my situation is better
and faster

How:
I actually get data from SQL server - so I've added a rownumber column and
then corrected XSLT into:

<xsl:for-each select="data/rows">
    <xsl:if test="1=(rownumber mod 3)"><tr></xsl:if>
        <td><img src="Objekti/test/<xsl:value-of select="filename"/>"
/></td>
    <xsl:if test="0=(rownumber mod 3)"></tr></xsl:if>
</xsl:for-each>

And - It works really great and fast

anyway thanx for solution.
Peter
----- Original Message ----- 
From: "Michael Kay" <mhk@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, April 01, 2004 1:08 PM
Subject: RE: [xsl] Display records in 3 columns


> You can do it this way, but you need to display a different node each
time,
> so you presumably want something like
>
> <xsl:value-of select="data/objekt/filename[$count+1]"/>
>
> However, you really don't need recursion for this. Just
>
> <xsl:for-each select="data/objekt/filename">
>     <xsl:if test="position() mod 3 = 0">..</xsl:if>
>
> Michael Kay
>
> > -----Original Message-----
> > From: Peter Lukan [mailto:peter.lukan@xxxxxxxx]
> > Sent: 01 April 2004 10:04
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: [xsl] Display records in 3 columns
> >
> > Hello!
> >
> > I'm having trouble with displaying data in 3 columns.
> >
> > I've managed to create a table with 3 columns :
> >
> > ******* XSL code ***********
> >
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> >
> > <xsl:output method="html"/>
> >
> > <xsl:template match="/">
> >  <table width="400">
> >  <xsl:call-template name="coloredRow">
> >   <xsl:with-param name="count" select="1"/>
> >  </xsl:call-template>
> >  </table>
> > </xsl:template>
> >
> >
> > <xsl:template name="coloredRow">
> > <xsl:param name="count"/>
> >
> > <xsl:if test="$count != count(data/objekt)">
> >
> >   <xsl:if test="1=($count mod 3)">#<#tr#>#</xsl:if>
> >
> >   <td bgcolor="#ccff66">
> >     vsebina: <xsl:value-of select="data/objekt/filename"/>
> >    </td>
> >
> >   <xsl:if test="0=($count mod 3)">#<#/tr#>#</xsl:if>
> >      <xsl:call-template name="coloredRow">
> >         <xsl:with-param name="count" select="$count + 1"/>
> >      </xsl:call-template>
> >
> > </xsl:if>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> > ************* end of XSL code **************
> >
> > but I can't display different records in this code <xsl:value-of
> > select="data/objekt/filename"/>
> > I think I should use position() function but don't know how!
> >
> > Thanx Peter Lukan


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent