473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to read XML from a string variable??

I am trying to get data from a web service. The service returns a
string like this:

<string
xmlns="http://www.webserviceX.NET/"><StockQuotes><Stock><Symbol>TEVA</Symbol><Last>33.25</Last><Date>10/27/2006</Date><Time>4:00pm</Time><Change>-0.37</Change><Open>33.62</Open><High>33.63</High><Low>33.19</Low><Volume>4080868</Volume><MktCap>25.426B</MktCap><PreviousClose>33.62</PreviousClose><PercentageChange>-1.10%</PercentageChange><AnnRange>29.22
- 45.91</AnnRange><Earns>0.084</Earns><P-E>400.24</P-E><Name>TEVA PHARM
INDS A</Name></Stock></StockQuotes></string>

I cannot figure how to extract the XML element (like LAST). I know I
could search the string for the data but I assume VB has a way to move
the string to a XML variable and then use something like variable.LAST
to get the last field. Any help would be appreciated!!!!

Sheila

Oct 28 '06 #1
2 2358

gw*****@kc.rr.com wrote:
I am trying to get data from a web service. The service returns a
string like this:

<string
xmlns="http://www.webserviceX.NET/"><StockQuotes><Stock><Symbol>TEVA</Symbol><Last>33.25</Last><Date>10/27/2006</Date><Time>4:00pm</Time><Change>-0.37</Change><Open>33.62</Open><High>33.63</High><Low>33.19</Low><Volume>4080868</Volume><MktCap>25.426B</MktCap><PreviousClose>33.62</PreviousClose><PercentageChange>-1.10%</PercentageChange><AnnRange>29.22
- 45.91</AnnRange><Earns>0.084</Earns><P-E>400.24</P-E><Name>TEVA PHARM
INDS A</Name></Stock></StockQuotes></string>

I cannot figure how to extract the XML element (like LAST). I know I
could search the string for the data but I assume VB has a way to move
the string to a XML variable and then use something like variable.LAST
to get the last field. Any help would be appreciated!!!!

Sheila
Shelia,

You could always load the xml string into an XmlDocument and use that
to navigate the xml.

--
Tom Shelton

Oct 29 '06 #2

Tom Shelton wrote:
>
You could always load the xml string into an XmlDocument and use that
to navigate the xml.

--
Tom Shelton
or read it by dataset (by .ReadXML)

Mrozu

Oct 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each...
2
by: dumbo | last post by:
Hello, who gives one more shining solution to me? My application load form "A". The form "A" by means of a push-button load form "B" that in its turn by means of a push-button load form "C". Form...
3
by: ad | last post by:
I have a text file in the directory of my web application. How can I read this text file into a string vaiable?
4
by: weirdstuff | last post by:
Hi. I have this simple code: =========================================== ->Database query here (.. some code) $row=mysql_fetch_array($res); (...)
2
by: dbonin1599 | last post by:
I have the following code, the first set of code is the SQL version, the second set of code is an attempt to put the code into a VB String see "UpdateVariations". I need help, I think most of it is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.