Reputation: 21
I want to pass the value of employee_name
that I get from XML to a user-defined function in XSL. Please see the code below:
<xsl:for-each select="employees/employee">
<xsl:value-of select="employee_name"/>
<xsl:value-of select="
my:compareCI(
'--how to pass employee_name Value--',
'--how to pass employee_name Value--'
)
" />
</xsl:for-each>
Please any help me as I am new to XSL.
Upvotes: 2
Views: 2541
Reputation: 10210
<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>
Upvotes: 5