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

Re: Alternating table row colors with recursion

Subject: Re: Alternating table row colors with recursion
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 28 Nov 2000 19:23:39 GMT
asp xslt alternating row colors
> I think he wants the rows to alternate for each message.

So did I. but I thought that the input was such that each of those
selects would only pick up one message. (Without seeing the input
it's a bit hard to tell:-) 


David Carlisle wrote:
> <xsl:template match = "Message">
>  <xsl:param name="x"/>
> <tr class="{$x}">
> <td>
> </td>
> </tr>
> <xsl:apply-templates select = "//Message[ParentMessageID = '$MID']">
>   <xsl:with-param name="x">
>     <xsl:choose>
>        <xsl:when test="$x='red'>yellow</xsl:when>
>        <xsl:otherwise>red</xsl:otherwise>
>      </xsl:chose>
>   </xsl:with-param>
> </xsl:apply-templates>


$MID isn't a parameter to the template so if any instance of
select = "//Message[ParentMessageID = '$MID']">
selects more than one message, then the output will be rather strange
as you'll get a tr row for each message but after each one
an identical set of nodes would be processed by the apply-templates.

My solution was based on this observation leading me to assume
that the input was rather restricted.

If not then the whole thing is probably wrong, but in that case Ithink
we need more info about what the input does look like.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp


 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.