I'm new to XSL / XML and trying out some basic VBscript in XSL. I can't seem to get any values out of VBScript and I've tried looking and asking everywhere on what may be wrong. I can't seem to find why this doesn't work. Here is the XML I have:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="C:\PathTo.xsl"?>
<greeting>Hello, world!</greeting>
and the XSL I have:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:xslscript="xmlns:vbs="urn:schemas-sqlxml-org:vbs">
<msxsl:script language="VBScript" implements-prefix="vbs">
<![CDATA[
Dim x
x=1
]]>
</msxsl:script>
<xsl:template match="/">
<html>
<head>
<title>Today's greeting</title>
</head>
<body>
<p><xsl:value-of select="vbs:x"/></p>
<p><xsl:value-of select="greeting"/></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The Hello, world! comes out on in Internet Explorer but no value of 1 from the VBScript.
It seems as if the VBScript doesn't even run because I can add something like 'number = 1' in the VBScript without using a corresponding 'Dim number' and the script still runs, no expected undeclared variable error.
I have tried MSXMLv2 3.0 and 4.0sp2. Anyone know why this doesn't work?
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="C:\PathTo.xsl"?>
<greeting>Hello, world!</greeting>
and the XSL I have:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:xslscript="xmlns:vbs="urn:schemas-sqlxml-org:vbs">
<msxsl:script language="VBScript" implements-prefix="vbs">
<![CDATA[
Dim x
x=1
]]>
</msxsl:script>
<xsl:template match="/">
<html>
<head>
<title>Today's greeting</title>
</head>
<body>
<p><xsl:value-of select="vbs:x"/></p>
<p><xsl:value-of select="greeting"/></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The Hello, world! comes out on in Internet Explorer but no value of 1 from the VBScript.
It seems as if the VBScript doesn't even run because I can add something like 'number = 1' in the VBScript without using a corresponding 'Dim number' and the script still runs, no expected undeclared variable error.
I have tried MSXMLv2 3.0 and 4.0sp2. Anyone know why this doesn't work?