This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Applying different transformations to every n'th node


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]