read XML

F

frank

hello how can i read only the value's of this xml into asp.net (vbs) ?
I want the variables name and address Example: name = "Myname"

<scorelist>
<name value="Myname" />
<address value="15" value="Myaddress >
</scorelist>
 
G

Guest

You should not have two times the attribute value in the same element:
<address value="15" value="Myaddress >

Dim xmlDoc as New XmlDocument
xmlDoc.Load(Server.MapPath("file.xml"))

Dim nodes as XmlNodeList = xmlDoc.SelectNodes("scorelist/")
Dim node as XmlNode
for each node in nodes
Response.Write(node.Attributes("value"))
Next
--
Sonu Kapoor - [MCP]
ASP.NET Moderator
WebSite: http://www.Kapoorsolutions.com
Blog: http://www.Kapoorsolutions.com/blog/
ASP.NET News: http://www.Kapoorsolutions.com/reblogger/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top