Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl:when, using a test with an 'or' 1

Status
Not open for further replies.

YYYYUU

Programmer
Dec 13, 2002
47
GB
This is the code I have

<xsl:choose>
<xsl:when test=&quot;//document/menu/@selectopt = 'Modify'&quot;>

I want this to work if the //document/menu/@selectopt = 'Modify' OR //document/menu/@selectopt = 'Delete'.



How can I do this. cheers
 
I think this is what you want:

<xsl:choose>

<xsl:when test=&quot;//document/menu/@selectopt = 'Modify'&quot;>
Code in here
</xsl:when>

<xsl:when test=&quot;//document/menu/@selectopt = 'Delete'>
Code in here
</xsl:when>

<xsl:eek:therwise>
Code in here
</xsl:eek:therwise>

</xsl:choose>





Nick (Software Developer)


nick@retrographics.fsnet.co.uk
nick.price@myenable.com
 
Thank you this overcomes my problem. I presume there is no xsl 'or'.

thanks.
 
Actually, it is possible to use &quot;or&quot; within an if or when statement in xsl such as :

<xsl:when test=&quot;($variable= 1) Or ($variable=2)&quot;>

</xsl:when>

Sorry, I should have seen this shorter solution to your problem.

Nick (Software Developer)


nick@retrographics.fsnet.co.uk
nick.price@myenable.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top