cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Cordes <mcord...@maine.edu>
Subject Re: What is the &&(java) within XSL.
Date Thu, 26 Oct 2000 13:35:18 GMT
I would do:

if ( <xsl:value-of select="string(//bodytext/setdatum/set)"/>
		&amp;&amp; !<xsl:value-of select="string(//bodytext/setzeit/set)"/>
		)
		{
			// do stuff

		}

This should work assuming the set node can only have values of 		
'true' or 'false'. 


Your xsl test is pretty close it would be

<xsl:if 
	test="//bodytext/setdatum/set = 'true' and //bodytext/setzeit/set  = 'false'"
>
	// do stuff

</xsl:if>	

You may also want to replace set with set[1] if you just want to 
test the first set found for  true/falseness.  As I recally comparing
a nodeset to a string checks to see if any node in that set is equal 
to the string, but I could be wrong.
	
Disclaimer - this is all untested, and I am certainly as error prone
as the next.

-matt

On Thu, Oct 26, 2000 at 09:40:19AM +0200, Rob van der Zeijden wrote:
> I want to test two variables. The test in java would be
> if (//bodytext/setdatum/set == true && //bodytext/setzeit/set == false)
> 
> Is this test also possible within XSL. The test would proberly a bit look
> like:
> 
>       <xsl:if test="//bodytext/setdatum/set = 'true' &&
> //bodytext/setzeit/set  = 'false'">
> 
> But cocoon does not like the &&s.
> 
> Thanks.
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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