Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-24-2011, 12:53 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  
Old 04-24-2011, 02:17 AM   PM User | #2
scdv2
New to the CF scene

 
Join Date: Apr 2011
Posts: 3
Thanks: 0
Thanked 2 Times in 2 Posts
scdv2 is an unknown quantity at this point
use XPath with an xmlDocument or XDocument if your want to use linq

To write the Html, i would use an xmlDocument for cleaner code.
scdv2 is offline  
Old 04-24-2011, 05:24 PM   PM User | #3
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Please do not cross post. Original thread: http://www.codingforums.com/showthread.php?t=225047
__________________
OracleGuy
oracleguy is offline  
Closed Thread

Bookmarks

Tags
asp.net, concatenate, node, vb.net, xml

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:33 AM.


Advertisement
Log in to turn off these ads.