Hi Tim

This question is best asked on the XSL List, rather than Cocoon Users, but here's an 
answer anyway:

Test to see if the report has any preceding reports. Perhaps something like:

<div id="sw{normalize-space(report-name)}">
        <xsl:if test="not(preceding-sibling::report)">
                <xsl:attribute name="class">dlgSwitchSelected</xsl:attribute>
        </xsl:if>

...

</div>

> -----Original Message-----
> From: Tim Bachta [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 11 June 2003 2:08 p.m.
> To: [EMAIL PROTECTED]
> Subject: conditions in xsl
> 
> 
> Is it possible to do if statements in an xsl page.  What I am 
> trying to
> do is set the first value I get back as selected then set the rest as
> unselected.  Example since it is hard to explain.
> 
> I currently have this:
> 
> <xsl:template match="report">
> 
> <xsl:variable name="report-name"><xsl:value-of
> select="report-name"/></xsl:variable>
> 
> <div id="sw{normalize-space(report-name)}" class="dlgSwitchSelected"
> ><img src="images\icons\occurrenceOverview.gif" /><xsl:value-of
> select="normalize-space(report-name)"/></div>
> 
> </xsl:template>
> 
>  
> 
> this gives me back this:
> 
>  
> 
> <div class="dlgSwitchSelected" id="swOverdue Task Report">
> 
> <img src="images\icons\occurrenceOverview.gif">Overdue Task 
> Report</div>
> 
> <div class="dlgSwitchSelected" id="swTask Status Report">
> 
> <img src="images\icons\occurrenceOverview.gif">Task Status 
> Report</div>
> 
> <div class="dlgSwitchSelected" id="swUn-Assigned Task Report">
> 
> <img src="images\icons\occurrenceOverview.gif">Un-Assigned Task
> Report</div>
> 
>  
> 
>  
> 
> What I want is to get this back:
> 
> <div class="dlgSwitchSelected" id="swOverdue Task Report">
> 
> <img src="images\icons\occurrenceOverview.gif">Overdue Task 
> Report</div>
> 
> <div class="dlgSwitch" id="swTask Status Report">
> 
> <img src="images\icons\occurrenceOverview.gif">Task Status 
> Report</div>
> 
> <div class="dlgSwitch" id="swUn-Assigned Task Report">
> 
> <img src="images\icons\occurrenceOverview.gif">Un-Assigned Task
> Report</div>
> 
>  
> 
> where the only one that has the selected class is the first one.  Any
> help would be great.  Thank you very much.
> 
>  
> 
> Tim Bachta
> 
>  
> 
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to