PDA

View Full Version : [SOLVED] SelectSingleNode



john3j
05-19-2015, 07:48 AM
I have the following XML:


<?xml version="1.0" ?>
<NessusClientData_v2>
<Report name="Test-Scan" xmlns:cm="http://www.nessus.org/cm">
<ReportHost name="192.168.0.1">
<HostProperties>
<tag name="HOST_END">Wed Apr 15 12:09:15 2015</tag>
<tag name="LastAuthenticatedResults">1429114155</tag>
<tag name="Credentialed_Scan">true</tag>
<tag name="mac-address">a2:1e:62:6d:82:20</tag>
</HostProperties>
</ReportHost>
</Report>
</NessusClientData_v2>

I am trying to capture the MAC Address from the HostProperties tag, but I am not having any luck. Can anyone help me figure out what I am doing wrong? Here is the code I am using:


set myNode = oXMLFile.SelectSingleNode("/NessusClientData_v2/Report/ReportHost/tag[@name='mac-address']")
MAC = myNode.NextSibling.Text

Any help would be appreciated!

john3j
05-19-2015, 07:52 AM
I figured it out on my own...


Set myNode = oXMLFile.SelectSingleNode("/NessusClientData_v2/Report/ReportHost/HostProperties/tag[@name='mac-address']")

That works!