[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Applying different transformations to every n'th node

Subject: RE: Applying different transformations to every n'th node
From: "Selva, Francis" <Francis.Selva@xxxxxxxxxxxxxxx>
Date: Wed, 12 Apr 2000 14:44:50 -0700
select every n rows
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@xxxxxxxxxxxxxxxxxxxxxx
  


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.