Although not standard, you can execute JavaScript functions from within your XSLT.
In MSXML, you can use the msxsl:script extension element .
<?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace"> <msxsl:script language="JScript" implements-prefix="user"> function getUser() { return user; } </msxsl:script> <xsl:template match="/"> <xsl:value-of select="user:getUser(.)"/> </xsl:template> </xsl:stylesheet>
source share