cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conal Tuohy" <Conal.Tu...@vuw.ac.nz>
Subject RE: conditions in xsl
Date Wed, 11 Jun 2003 02:12:07 GMT
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:tbachta@kopent.com]
> Sent: Wednesday, 11 June 2003 2:08 p.m.
> To: cocoon-users@xml.apache.org
> 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: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message