Maileen,
You can try this sample I made once as well
\\\\
Dim xmlString As String = "<department>" & _
"<employee name=""ABC"" age=""31"" sex=""male""/>" & _
"<employee name=""CDE"" age=""40"" sex=""male""/></department>"
Dim sr As New System.IO.StringReader(xmlString)
Dim doc As New Xml.XmlDocument
doc.Load(sr)
'or just in this case doc.LoadXML(xmlString)
Dim reader As New Xml.XmlNodeReader(doc)
While reader.Read()
Select Case reader.NodeType
Case Xml.XmlNodeType.Element
If reader.Name = "employee" Then
MessageBox.Show(reader.GetAttribute("name"))
End If
End Select
End While
///
Cor
"Maileen" <no****@email.com>
....
Hi,
I have a XML file which consists of several elements and I would like to
retrieve the value of 1 element particularly.
for example :
...
<Database_Location>
C:\test\db1.mdb
</Database_Location>
I try to get the value of "C:\test\db1.mdb" with the following code :
While XmlRead.Read
If (XmlNodeType.Element) Then
If (XmlRead.Name = "Database_Location") Then
MsgBox("before : " & XmlRead.Value)
End If
End If
End While
but every time I get the Value empty...why ?
thanks a lot,
Maileen