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.
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.
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>
What can i do? I am not very familiar with XSLT.