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

Re: Alternate coloured Row Issue

Subject: Re: Alternate coloured Row Issue
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 13 Jun 2001 04:11:57 -0700 (PDT)
asp alternate coloured row
Tanzila Mohammad wrote:

> My problem relates to incorporating an independent last row, and making it
> follow the same colour pattern:
> 
> E.G
> if odd=red and even=blue
> 
> if there were 4 products you would expect:
>         row 1 (red) Motorcyles
>         row 2 (blue) Accessories
>         row 3 (red) Clothing
>         row 4 (blue) Cars
>         row 5 (red) Contact Us <!-- here is the problem-->
> 
> if there were 3 products then you would expect:
>         row 1 (red) Motorcyles
>         row 2 (blue) Accessories
>         row 3 (red) Clothing
>         row 4 (blue) Contact Us <!-- here is the problem-->


This produces the wanted effect (I've omited your templates for brevity -- also
specify the $lastProduct variable exactly in the way you need it):

<xsl:output method="html" indent="yes"/>
<xsl:variable name="lastProduct">
               <product>
                 <productID>999</productID>
                 <name>lastProduct</name>
                 </product>
</xsl:variable>

<xsl:template match="/">
 <table>
   <xsl:apply-templates select="products/product 
                                | msxsl:node-set($lastProduct)/product"/>
 </table>
</xsl:template>


Hope this helped.

Cheers,
Dimitre Novatchev.






__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 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.