john3j
05-08-2015, 11:55 AM
I have the following XML code:
<?xml version="1.0" ?>
<NessusClientData_v2>
<Policy><policyName>Full Scan</policyName>
<Preferences><ServerPreferences><preference><name>plugin_set</name>
<value>16775;16066;...</value>
</preference>
<preference><name>TARGET</name>
<value>192.168.0.1</value>
</preference>
</ServerPreferences>
<Preferences>
</NessusClientData_V2>
I am trying to utilize the following code to show "192.168.0.1" in a message box, but I am apparently doing something wrong. Here is my code:
Sub ParseXML(fname, IP)
Set oXMLFile = CreateObject("Microsoft.XMLDOM")
oXMLFile.Load (fname)
Set MyNode = oXMLFile.SelectSingleNode("/NessusClientData_v2/Preferences/ServerPreferences/Preference[../name='TARGET']/text")
If Not MyNode Is Nothing Then
MsgBox MyNode.Text
End If
If anyone could help me figure out what I am doing wrong, I would appreciate it. I am using Microsoft Excel 2010. I am not getting an error or a message box of any kind.
<?xml version="1.0" ?>
<NessusClientData_v2>
<Policy><policyName>Full Scan</policyName>
<Preferences><ServerPreferences><preference><name>plugin_set</name>
<value>16775;16066;...</value>
</preference>
<preference><name>TARGET</name>
<value>192.168.0.1</value>
</preference>
</ServerPreferences>
<Preferences>
</NessusClientData_V2>
I am trying to utilize the following code to show "192.168.0.1" in a message box, but I am apparently doing something wrong. Here is my code:
Sub ParseXML(fname, IP)
Set oXMLFile = CreateObject("Microsoft.XMLDOM")
oXMLFile.Load (fname)
Set MyNode = oXMLFile.SelectSingleNode("/NessusClientData_v2/Preferences/ServerPreferences/Preference[../name='TARGET']/text")
If Not MyNode Is Nothing Then
MsgBox MyNode.Text
End If
If anyone could help me figure out what I am doing wrong, I would appreciate it. I am using Microsoft Excel 2010. I am not getting an error or a message box of any kind.