read XML from local variable in VB.NET
Posted on 2010-11-24
I have a RFID application who connect to a RFID controller and get the tag as they are red by the antennas. Packets is received as bytes and after conversion, the data portion of the packet is XML. I put the result in a string variable. On Quick Watch (Visual Studio), it gives:
<Matrics><EventGroup><EventList><Tag event='2' raw='000000000000000000000002' PC='3000' time='4ced7e36' RPL='3'/>
I need to get the tag values from this variable. I've never done any XML before.
Dim test As String = ""
Dim Packet As Byte() = Nothing
ReDim Packet(TotalBytes - 1)
Dim j As Integer = 0
For i As Integer = 8 To TotalBytes - 3
Packet(j) = Data(i)
j += 1
test = tcpXR450.BytestoString(Packet)
Dim XMLcmd As New XmlDocument
XMLcmd.Load(test) -----> THIS LINE CRASH with exception: "Illegal characters in path."
How can I get the values from the tag in this XML variable?
thanks for your help