maandim
12 years agoNew Contributor
selectSingleNode using vbscript
Below is the structure of my xml file:
<configuration>
<appSettings>
<add key="ProductVersion" value="5.5.5"/>
<add key="LogsDirectory" value="e:\\Logs"/>
</appSettings>
....
<configuration>
I am trying following code to get value of LogsDirectory:
configurationFilePath = "e:\conf.xml"
Set xmlDoc = CreateObject("MSXML2.DomDocument.6.0")
xmlDoc.async = false
Call xmlDoc.load(configurationFilePath)
xpath1 = ".//configuration/appSettings/add[@key='LogsDirectory']/@value"
LogsDirectory = xmlDoc.selectSingleNode(xpath1)
But it is giving error as object required.
Any help highly appreciated.
Thanks