Connecting Tech Pros Worldwide Help | Site Map

xslt :how to check whether the value of a string variable is Yes or No?

Newbie
 
Join Date: Sep 2009
Posts: 18
#1: 3 Weeks Ago
how to check whether the value of a string variable is Yes or No?
Expand|Select|Wrap|Line Numbers
  1. xsl;variable name="test1" select="DBE:OBJECT/DBE:ATTRIBUTE[@name='test1']/DBE:String"/>
  2. xsl;variable name="test2" select="DBE:OBJECT/DBE:ATTRIBUTE[@name='test2']/DBE:String"/>
  3.  
  4. xsl;choose>
  5. xsl;when test="$test1 = 'Yes'>
  6.     xsl;apply-templates select="YES"/>
  7. /xsl;when>
  8. xsl;when test="$test2 = 'Yes'>
  9.     xsl;apply-templates select="Invalid"/>
  10. /xsl:when>
  11. xsl;otherwise>
  12.      xsl;apply-templates select="DBE:OBJECT/DBE:ATTRIBUTE[@name='test3']/DBE:String"/>
  13. /xsl;otherwise>
  14. /xsl;choose>
  15.  
Please let me know what is wrong in the above?
Reply

Tags
xslt