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

Re: Apply Template based on position or count

Subject: Re: Apply Template based on position or count
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxx>
Date: Thu, 5 Feb 2004 19:37:47 -0700
how to sort apply template
Here is what I have (in an effort to spit out 2 columns)

 <table width="200" border="1">
  <xsl:for-each select="//z:row">
        <xsl:if test="position() mod 2 = 1">
     <tr>
         <td valign="top"><xsl:apply-templates select="."
mode="session_info"/></td>
            <td valign="top"><xsl:apply-templates select="."
mode="session_info"/></td>
        </tr>
        </xsl:if>
        </xsl:for-each>
    </table>

Notic:  the second select is "."  How do i get the next z:row?

Karl


----- Original Message -----
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, February 05, 2004 6:25 PM
Subject:  Apply Template based on position or count


> Hi there,
>
> I have a node fragment with (lets say) 20 items in it.  I would like to
> apply a template rule which matches the first 10 nodes, and then later the
> 2nd ten.  Ultimately I am trying to create two columns in my html output.
> Now, lets say there are 25 items, so the first set would contain 13 items
> and the 2nd set 12 items - but somehow in XSLT no that we need to match 13
> rows on the left so add 1 more row.
>
> So, can you apply-templates and specify some sort of [1-10] match?
>
> Karl
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 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.