Question on asp, xml, vbscript - help
I'm retrieving an xml file from the web. It has a doctype which I need to remove or else my xsl can't render the xhtml. I'm trying to use regExp to find doctype and then delete is before my xsl does it's conversion. Below is my code. Any help would be greatly appreciated.
The error I get is:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'objRegExp.Replace'
<%
'Load the XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load(Server.MapPath("case.xml"))
Dim TextStr
Set TextStr = xml.documentElement
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<!DOCTYPE(.|\n)+?>"
TextStr = objRegExp.Replace(TextStr, "")
'--------Load the XSL-----------
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("case.xsl"))
Response.Write(TextStr.transformNode(xsl))
%>
I'm retrieving an xml file from the web. It has a doctype which I need to remove or else my xsl can't render the xhtml. I'm trying to use regExp to find doctype and then delete is before my xsl does it's conversion. Below is my code. Any help would be greatly appreciated.
The error I get is:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'objRegExp.Replace'
<%
'Load the XML
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load(Server.MapPath("case.xml"))
Dim TextStr
Set TextStr = xml.documentElement
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<!DOCTYPE(.|\n)+?>"
TextStr = objRegExp.Replace(TextStr, "")
'--------Load the XSL-----------
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("case.xsl"))
Response.Write(TextStr.transformNode(xsl))
%>
Last edited:







