how to get node value frmo xml document

djohnston

Active member
Joined
Jun 1, 2006
Messages
33
Programming Experience
Beginner
xml string variables

Ok so basically i have sent a byte array to a web service converted it back into an xml string now i need to know how to loop through the string and pull the variables out so i can then pass them to a database.

It would be greatly appreciated if someone could either explain how this works or some example code would be nice.

I think probably about 3 more weeks of programming and i can start answering questions on forums. I am still working on my first week.
 
Moved to appropriate forum.

As always with .NET there are many, many ways to accomplish this task.
The DataSet class has a ReadXML method which does what it's name implies (reads XML into a dataSet). Perhaps this method will suit your needs?
 
xml string to variables

I just need to know how to loop through an xml string and pull the variables out. I didnt think it would be very hard to do. But im not exactly sure how to do it.
 
Thanks for the help

That doesnt really help me though
I tried the code i found and it didnt do much for actually working.
 
answer

HTML:
<123>
<456>
<123>databasevalue</123> 
 
<345>databasevalue1</345> 
 
<567>databasevalue2</567> 
 
<891>databasevalue3</891> 
 
<234>14</234> 
<123>
<456>
lets say that is the file itself but in a byte array i need to get the values from it databasevalue,databasevalue1,
databasevalue2,databasevalue3,14.
1
 
Last edited by a moderator:
djohnston, I merged some of your threads regarding this webservice/xml/byte-arrays yesterday, but decided the xml stuff was really a separate topic so I moved these out again. :)

About reading nodes and nodevalues from Xml, the tip from suddenelfilio about XpathNavigator can be used. You should also read through a couple of these Xml tutorials : http://www.vbcity.com/forums/faq.asp?fid=15&cat=XML
 
Back
Top