|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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 gwhi***@kc.rr.com wrote:
Show quoteHide quote > I am trying to get data from a web service. The service returns a Shelia,> 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 You could always load the xml string into an XmlDocument and use that to navigate the xml. -- Tom Shelton Tom Shelton wrote:
> or read it by dataset (by .ReadXML)> You could always load the xml string into an XmlDocument and use that > to navigate the xml. > > -- > Tom Shelton Mrozu
Constants can't be defined in a namespace. WTH?
Selecting a single node in 'XML' Math class for Visual Basic.NET (matrix operations) Graph control webreq.getresponse exceptions Application.StartupPath Adding a Web Reference into a Windows Project turn off assertions in VB 2005 Errors in Page directive Determine if xml is malformed |
|||||||||||||||||||||||