Hi
How to pass a variable name inside sp2010 xslt Random function ?is there a way to do it?
eg : ddwrt:random($no of questions)?
thanks in a
Technology Tips and News
Hi
How to pass a variable name inside sp2010 xslt Random function ?is there a way to do it?
eg : ddwrt:random($no of questions)?
thanks in a
Hi,
From your description, I understand that you want to pass a variable to a function in xslt.
In this condition, you can use the xsl function definition consisted by "function name", "param name" and "value-of".
I think below code will suit for you:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns1="http://www.example.com">
<xsl:function name="ns1:functionName">
<xsl:param name="employee_name"/>
<xsl:value-of select="$employee_name"/>
</xsl:function>
<xsl:template match="/">
<xsl:value-of select="ns1:functionName('John Doe')"/>
</xsl:template>
</xsl:stylesheet>