A
Andy Norman
I have a strange problem.
When I try to call the input property of the MSXML processor object from
VBScript in an ASPX page I get the error "Member not found".
The same code (with a few "set" statements added) works find in ASP.
What on earth is going on ? I can't find anything in the knowledge base on
it.
Here is a copy of a test page that demonstrates the problem.
<%@ Page validateRequest=false aspcompat="TRUE" language="vbscript"
trace="true" debug="true" %>
<script language="vbscript" runat="server">
sub Transform()
dim oXmlIn
dim oXsl
dim oTemplate
dim oProc
dim sXsl
oXmlIn = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
if oXmlIn.loadXml("<root/>") then
Trace.Write("Xml load worked")
else
Trace.Write("Xml load failed")
end if
sXsl = "<?xml version=""1.0""?>" & _
"<xsl:stylesheet version=""1.0""
xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">" & _
"<xslutput method=""html""/>" & _
"<xsl:template match=""/"">root</xsl:template>" & _
"</xsl:stylesheet>"
oXsl = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
if oXsl.loadXml(sXsl) then
Trace.Write("Xsl load worked")
else
Trace.Write("Xsl load failed")
end if
oTemplate = Server.CreateObject("MSXML2.XSLTemplate.4.0")
oTemplate.stylesheet = oXsl
oProc = oTemplate.createProcessor()
if oProc is nothing then
Trace.Write("createProcessor failed")
else
Trace.Write("createProcessor worked")
end if
oProc.input = oXmlIn
oProc.transform
end sub
</script>
<%
Call Transform()
%>
When I try to call the input property of the MSXML processor object from
VBScript in an ASPX page I get the error "Member not found".
The same code (with a few "set" statements added) works find in ASP.
What on earth is going on ? I can't find anything in the knowledge base on
it.
Here is a copy of a test page that demonstrates the problem.
<%@ Page validateRequest=false aspcompat="TRUE" language="vbscript"
trace="true" debug="true" %>
<script language="vbscript" runat="server">
sub Transform()
dim oXmlIn
dim oXsl
dim oTemplate
dim oProc
dim sXsl
oXmlIn = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
if oXmlIn.loadXml("<root/>") then
Trace.Write("Xml load worked")
else
Trace.Write("Xml load failed")
end if
sXsl = "<?xml version=""1.0""?>" & _
"<xsl:stylesheet version=""1.0""
xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">" & _
"<xslutput method=""html""/>" & _
"<xsl:template match=""/"">root</xsl:template>" & _
"</xsl:stylesheet>"
oXsl = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
if oXsl.loadXml(sXsl) then
Trace.Write("Xsl load worked")
else
Trace.Write("Xsl load failed")
end if
oTemplate = Server.CreateObject("MSXML2.XSLTemplate.4.0")
oTemplate.stylesheet = oXsl
oProc = oTemplate.createProcessor()
if oProc is nothing then
Trace.Write("createProcessor failed")
else
Trace.Write("createProcessor worked")
end if
oProc.input = oXmlIn
oProc.transform
end sub
</script>
<%
Call Transform()
%>