Inspired? No home

VBScript in XSLT

Did you know you can use VBScript in XSLT files?

Sample script which goes after the xslt namespace:

<msxml:script language="VBScript" implements-prefix="VBCustomScript">
<![CDATA[
function VBCustomScript(str)
VBCustomScript= "test" & str
 end function
]]>
</msxml:script>



add to xslt namespace:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:VBCustomScript="#VBCustomScript"
>



in xslt:

<xsl:value-of select=""VBCustomScript:VBCustomScript(string(@Field))""/>
Written on 14 April 2005.
blog comments powered by Disqus