View Single Post
Old 04-24-2011, 12:57 AM   PM User | #1
NKeuxmuis
New Coder

 
Join Date: Feb 2011
Posts: 23
Thanks: 4
Thanked 0 Times in 0 Posts
NKeuxmuis is an unknown quantity at this point
In VB.net how do I concatenate the varied value of 3 tags all with the same name?

How do I concatenate all of the interests from the following XML file into one variable using vb.net 4.

Code:
<xml>
     <client>
          <name>Paul Davis</name>
          <interest>Football</interest>
          <interest>Swimming</interest>
          <interest>Internet</interest>
     </client>
</xml>
The VB code I have so far is as follows

Code:
Dim buffer As String

For Each itm In clients
If (itm.<name>.Value = CType(Session("Client"), String)) Then
Continue For
End If

buffer &= "<table><tr>"
buffer &= String.Format("<td>{0}</td>", itm.<name>.Value)
buffer &= String.Format("<td>{0}</td>", // The interests should be selected here
buffer &= "</tr></table>"

Next
lblOutput.Text = buffer
NKeuxmuis is offline   Reply With Quote