New to XML

mear1628

New member
Joined
Mar 7, 2014
Messages
2
Programming Experience
Beginner
I'm new to XML and I need to write a program that reads XML info from a server. I already receive the complete XML line, but now I need to filter the info.
I receive 2 XML lines:
< status time="16:30:30" fasttime="50:35" \>
< info ID="54365" name="John" laptime="55:58" passtrhoughtime="16:25:59" \>

Now I need the status and info information and the values between " "

Who can help me (programming in VB.net)

Mear1628
 
Hi,

Have a play with these two examples which show different ways to get the information you are after:-

Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
  Dim myXDoc As XDocument = <?xml version="1.0" encoding="utf-8"?>
                            <root>
                              <status time="16:30:30" fasttime="50:35"/>
                              <info ID="54365" name="John" laptime="55:58" passtrhoughtime="16:25:59"/>
                            </root>
  MsgBox(myXDoc...<status>.@time)
 
  For Each currentAttribute As XAttribute In myXDoc...<info>.Attributes
    MsgBox(currentAttribute)
  Next
End Sub


Hope that helps.

Cheers,

Ian
 
Back
Top