|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Alternating table row colors with recursion
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








