...

View Full Version : compare more than two strings



javaguy1007
04-14-2009, 08:40 PM
Hi frinds

I am trying to test condition somethiing like



<xsl:when test="contains(string,'stringA' || 'stringB'|| 'stringC')">
<xsl:value-of select="'abcd" />


But I am getting syntax error, can anyone help me how to test more than one string in one condition

Thanks

oesxyl
04-14-2009, 09:25 PM
Hi frinds

I am trying to test condition somethiing like



<xsl:when test="contains(string,'stringA' || 'stringB'|| 'stringC')">
<xsl:value-of select="'abcd" />


But I am getting syntax error, can anyone help me how to test more than one string in one condition

Thanks
change arguments for containts:


<xsl:if test="containts('stringA || stringB || stringC','string')">
....
</xsl:if>

also both arguments must be string. Don't work with 'stringA' || 'stringB'|| 'stringC'
you can use concat to join them:


<xsl:variable name="mystring" select(concat('stringA',' || ','stringB','|| ','stringC')"/>


best ergards

http://zvon.org/xxl/XSLTreference/Output/index.html

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum