Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Read - Properties

Status
Not open for further replies.

SQLScholar

Programmer
Aug 21, 2002
2,127
GB
Hey all,

I have this XML:

Code:
<?xml version="1.0"?>
<root>
	<command name="set">
		<property name="ChassisIntrusion" ischecked="1" outcome="OK" value="4" errorcode="0x0"/>
		<property name="WakeupOnLAN" ischecked="1" outcome="OK" value="6" errorcode="0x0"/>
		<property name="BIOSSetupPassword" ischecked="1" outcome="OK" value="1234567890" errorcode="0x0"/>
	</command>

</root>

And what i am trying to do in VB is on the wake on lan - get the value of VALUE! I am reading online how to read XML in vb but i cant seem to find anything reading properties like i have.

TIA

Dan

----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss

Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
 
[tt] IXMLDOMElement.getAttribute("value")[/tt]
 
'sub to get a named attribute value from a Node
Private Function getNamedItem(ByVal strAttribute, ByVal oNode)
getNamedItem = ""

Dim oTemp
Set oTemp = oNode.Attributes.getNamedItem(strAttribute)
If Not oTemp Is Nothing Then
getNamedItem = oNode.Attributes.getNamedItem(strAttribute).Text
Else
'MsgBox "not there"
End If
Set oTemp = Nothing

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top