This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Applying different transformations to every n'th node
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Applying different transformations to every n'th node
- From: "Selva, Francis" <Francis dot Selva at purchasepro dot com>
- Date: Wed, 12 Apr 2000 14:44:50 -0700
- Reply-To: xsl-list at mulberrytech dot com
Philip,
This is just to get the 4th category to display in a different row.Hope
this helps.
<xsl:for-each select="//category[position()< 4]">
<xsl:value-of select="."/><xsl:text> </xsl:text>
</xsl:for-each>
<xsl:for-each select="//category[not(position()<4)]">
<xsl:value-of select="."/><xsl:text> </xsl:text>
</xsl:for-each>
Change the < sign to = if u want to have a different template for the 4th
category.
Francis
*****************************************************
The woods are lovely,dark and deep.
But I have promises to keep,
And miles to go before I sleep
And miles to go before I sleep.
*****************************************************
> I have some xml that goes something like:
>
> ...
> <categories>
> <category id="something">Name of Category</category>
> <category id="something">Name of Category</category>
> <category id="something">Name of Category</category>
> ...
> </categories>
> ...
> Basically, what I am trying to do is create a table with 3
> columns, so I
> want every fourth column to start a new table row.
>
> --
> Philip McAllister
> Web Developer, ticketingsolutions
> pem@ticketingsolutions.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list