Parsing a XML file

Rat

Well-known member
Joined
Aug 2, 2005
Messages
72
Location
Somewhere between 0 and 1
Programming Experience
1-3
Here's the deal, my program receives a msg encoded using XML on UDP port.
And the output gets displayed in a RTB, how do i parse it ?

Thanks.
 

Rat

Well-known member
Joined
Aug 2, 2005
Messages
72
Location
Somewhere between 0 and 1
Programming Experience
1-3
And .. yes, the parsing has to be done before the message is displayed ...
I've got some codes here, now i need some help on how to do the parsing before i display the message .. the parsed message, has to be displayed almost immediately after the message is sent.

VB.NET:
Try

If Open.ShowDialog = DialogResult.OK Then

objTxtRd = New XmlTextReader(Open.FileName)

While (objTxtRd.Read())

If (objTxtRd.NodeType = XmlNodeType.Element) Then
				    
If (objTxtRd.HasAttributes) Then
	    
ListBox1.Items.Add("The Element " & objTxtRd.Name.ToString & " has " _
& objTxtRd.AttributeCount.ToString & " Attributes ")

ListBox1.Items.Add("The Attributes Are : ")

While (objTxtRd.MoveToNextAttribute())

ListBox1.Items.Add(objTxtRd.Name & " = " & objTxtRd.Value)

					    
End While
					
Else
					    
ListBox1.Items.Add("The Element " & objTxtRd.Name & " Has No Attributes.")
			    
End If
			 
ListBox1.Items.Add("")
				
End If
				
End While
			
End If
		
Catch err As Exception
		    
errmsg = errmsg + "Error Occured While Reading" & strFilePath & " " & err.ToString()
			
ListBox1.Items.Add(errmsg)

Finally
			
If Not objTxtRd Is Nothing Then
				
objTxtRd.Close()
			
End If
		
End Try

This, sample i tried with a ListBox, how do i do the same with a textbox or a richtextbox ?
 
Top Bottom