Search code examples
asp-classicglobal.asa

asp classic: "The system cannot find the path specified"


I'm trying to do server side xml transform and am specifying the templates I want to use in the global.asa for the paths I specify with server.MapPath. For files in the same folder, some are found and one gives an error. Any idea why?

For example, first one is found, the second one isn't server.MapPath("/website_root/subFolder/XSL/A.xsl")

server.MapPath("/website_root/subFolder/XSL/B.xsl")

The error says msxml3.dll error '80070003' The system cannot find the path specified

Thanks in advance.

EDIT: The problem is with the new templates added, the old declares for the files in the same folder show fine. Code below:

Dim oXSL, oXSLTemplateA, oXSLTemplateB, oXSLTemplateC, oXSLTemplateD, oXSLTemplateE
Set oXSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")

'A.xsl
oXSL.load server.MapPath("projectRoot/SubFolder/XSL/A.xsl")
Set oXSLTemplateA = Server.CreateObject("Msxml2.XSLTemplate")
oXSLTemplateA.stylesheet = oXSL
Set Application("ATemplate") = oXSLTemplateA

'B.xsl
Set oXSL = Nothing
Set oXSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
oXSL.load server.MapPath("/projectRoot/SubFolder/XSL/B.xsl")
Set oXSLTemplateB = Server.CreateObject("Msxml2.XSLTemplate")
oXSLTemplateB.stylesheet = oXSL 'ERROR ON THIS LINE
Set Application("BTemplate") = oXSLTemplateB

'C.xsl
Set oXSL = Nothing
Set oXSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
oXSL.load server.MapPath("/projectRoot/SubFolder2/XSL/C.xsl")
Set oXSLTemplateC = Server.CreateObject("Msxml2.XSLTemplate")
oXSLTemplateC.stylesheet = oXSL
Set Application("CTemplate") = oXSLTemplateC

'D.xsl
Set oXSL = Nothing
Set oXSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
oXSL.load server.MapPath("/projectRoot/SubFolder2/XSL/D.xsl")
Set oXSLTemplateD = Server.CreateObject("Msxml2.XSLTemplate")
oXSLTemplateD.stylesheet = oXSL
Set Application("DTemplate") = oXSLTemplateD

'E.xsl
Set oXSL = Nothing
Set oXSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
oXSL.load server.MapPath("/projectRoot/SubFolder2/XSL/E.xsl")
Set oXSLTemplateE = Server.CreateObject("Msxml2.XSLTemplate")
oXSLTemplateE.stylesheet = oXSL 'ERROR ON THIS LINE
Set Application("ETemplate") = oXSLTemplateE

EDIT: If I change E.xsl to a random name which I know doesn't exist. The error is different, it'll say msxml3.dll error '80004005' The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.


Solution

  • The xsl file was importing another xsl file which was using the full path and wasn't finding anything. I changed that to the relative path and it worked.