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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prao2005
    New Member
    • Sep 2009
    • 18

    #1

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

    how to check whether the value of a string variable is Yes or No?
    Code:
    xsl;variable name="test1" select="DBE:OBJECT/DBE:ATTRIBUTE[@name='test1']/DBE:String"/>
    xsl;variable name="test2" select="DBE:OBJECT/DBE:ATTRIBUTE[@name='test2']/DBE:String"/>
    
    xsl;choose>
    xsl;when test="$test1 = 'Yes'>
        xsl;apply-templates select="YES"/>
    /xsl;when>
    xsl;when test="$test2 = 'Yes'>
        xsl;apply-templates select="Invalid"/>
    /xsl:when>
    xsl;otherwise>
         xsl;apply-templates select="DBE:OBJECT/DBE:ATTRIBUTE[@name='test3']/DBE:String"/>
    /xsl;otherwise>
    /xsl;choose>
    Please let me know what is wrong in the above?
Working...