I am trying to find a way to set the timeout value of the XMLDOM object as i currently have a transformation that is exceeding the current value.
can anyone direct me in the correct direction? below is the current code I am using.
function xmlTransform(xml,xslt, xpathqry)
'instantiate the XML DOM object, set the call type to sync and load the url passed
Dim oXml
Set oXml = Server.CreateObject("MSXML
2.DOMDocum
ent.4.0")
'Set oXml = Server.CreateObject("MSXML
2.ServerXM
LHTTP.4.0"
)
oXml.async = false
'This is required to execute a http request - a URL querystring will not execute without this - jy 19/10/04
oXml.setProperty "ServerHTTPRequest", true
oXML.setProperty "SelectionLanguage", "XPath"
oXml.load xml
debugtofile("xml = " & xml)
debugtofile("xslt = " & xslt)
debugtofile("xpathqry = " & xpathqry)
'determine the length of one of the common report nodes - this will be used to determine whether the recordeset was returned with No Data
Dim xpathNodeLength
Set xpathNodeLength = oxml.selectNodes(xpathqry)
debugtofile("Length of Node " & xpathqry & " = " & xpathNodeLength.length)
'If there is an error when loading the XML document or querystring, output err code and err reason
if oXml.parseerror.errorcode <> 0 then xmlTransform = "<h1><font color=red>Error loading XML Document :</font></h1><b>Error Code : " & oXml.parseerror.errorcode & "</b><br><b>Reason : " & oXml.parseerror.reason & "</b>"
debugtofile("XML CONTENT = " & oXml.xml)
'instantiate the XSLT DOM object, set the call type to sync and load the file path passed
Dim oXsl
Set oXsl = Server.CreateObject("MSXML
2.DOMDocum
ent.4.0")
oXsl.async = false
'load the virtual path of the .xslt file
oXsl.load Server.MapPath(xslt)
'If there is an error when loading the XSL document or querystring, output err code and err reason
if oXsl.parseerror.errorcode <> 0 then xmlTransform = "<h1><font color=red>Error loading XSL Document :</font></h1><b>Error Code : " & oXsl.parseerror.errorcode & "</b><br><b>Reason : " & oXsl.parseerror.reason & "</b><br><b>Server MapPath: " & Server.MapPath(xslt)
'If there have been no errors, AND a dataset has been returned apply the XSL transformation
if oXsl.parseerror.errorcode = 0 and oXml.parseerror.errorcode = 0 and xpathNodeLength.length = 0 then
xmlTransform= "<br><br><br><br><h1><cent
er><font color=blue>No Data</font></center></h1>"
elseif oXml.parseerror.errorcode = 0 and oXsl.parseerror.errorcode = 0 then
xmlTransform= cleanstring(oXml.transform
Node(oXsl)
)
end if
'destroy them all! (clean up the objects.)
set oXml=nothing
set oXsl=nothing
end function
Start Free Trial