I have just migrated to a Windows 7 IIS 7 setup and am trying to get some classic ASP code working to load an XML file. This is the code that used to work on my Windows XP setup:
First of all it wasn't creating the XML object so I had to change the first line to:
Now there are no errors but there is nothing in the getMainNode object. Previsouly I was looping through this and adding some stuff to a database etc like so:
Now getMainNode has a length of 0 and I have no idea why. Any help on this would be appreciated.
Code:
set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load(Server.MapPath("mysite/test.xml"))
Set getMainNode = xmlDoc.getElementsByTagName("MainNode")
First of all it wasn't creating the XML object so I had to change the first line to:
Code:
Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument")
Now there are no errors but there is nothing in the getMainNode object. Previsouly I was looping through this and adding some stuff to a database etc like so:
Code:
For i = 0 To (getMainNode.Length - 1)
....
next
Now getMainNode has a length of 0 and I have no idea why. Any help on this would be appreciated.