Try the following Visual Basic Example (add reference to MSXML 3.0):
Dim ObjXML As New MSXML2.DOMDocument30
Dim ANode As IXMLDOMNode
ObjXML.async = False
If ObjXML.Load("c:\1.xml") Then
Set ANode = ObjXML.selectSingleNode("//users[@UserName=""tim'roberts""]")
If Not ANode Is Nothing Then
MsgBox ANode.Attributes(0).nodeTypedValue
Else
MsgBox "Not found!"
End If
Else
MsgBox "Error: " & ObjXML.parseError.reason
End If
|