I'm trying to have an external Software list(in XML format) to read from, that we can change if needed (New Specialty software available on our network)
Right now I just want to write to an external Text file to make sure I'm getting stuff(Testing only)
this is what I've got so far:
Dim xmlDoc, nodeList
Set xmlDoc = XDocument.CreateDOM()
xmlDoc.async = false xmlDoc.LoadXml(path to XML File)
Set nodeList = xmlDoc.SelectNodes("descendant::SoftwareList[Software/sName = *]")
or
Set nodeList = xmlDoc.GetElementsByTagName("sName")
BOTH WORKED IN PREVIOUS FORMS
Dim fso, testFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set testFile = fso.CreateTextFile("C:\Temp\testfile.txt",True)
testFile.WriteLine(xmlDoc.GetElementsByTagName("sName").item(0).text) 'test for data
^--- this is where the errors are coming from
testFile.Close
The ERROR I'm getting is: Object required: 'xmlDoc.GetElementsByTagName(...).item(...)'
this is the test XML file.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<SoftwareList>
<Software>
<sName>Adobe Reader 8</sName>
</Software>
<Software>
<sName>WinZip 11.1</sName>
</Software>
</SoftwareList>
I don't understand what I'm doing wrong?