Evaluate expression in XSLT

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SubasreeG
    New Member
    • Aug 2006
    • 1

    Evaluate expression in XSLT

    Hi,

    I have a situation where expression to evaluate comes from the user. I have to execute the expression and based upon the result i have to perform certain operation. The problem is that the expression given by the user (in the form of a variable) does not evaluate when i give it under the if element in xslt.

    I have the sample code attached.
    Code:
    // the variable $condn is like this (this is an input from the user)
    $condn=starts-with($obj,'PRJ.1411.DSG1.')
    <xsl:choose>
               <xsl:when test="$condn">          
                  <z:row>
                    <xsl:for-each select="*">
                      <xsl:attribute name="{name(.)}">
                        <xsl:value-of select="."/>
                      </xsl:attribute>
                    </xsl:for-each>
                  </z:row>
                </xsl:when>
              </xsl:choose>
    The problem is that the if statement evaluates to true always (the expression in the variable is not getting evaualted).
    What can i do? I am not very familiar with XSLT.
    Last edited by Dormilich; Jan 22 '09, 09:43 AM. Reason: added [code] tags
Working...