Okay I'll try to explain this quick and as simple as I can...
What I am trying to do is extract four different things from a xml... first off here is the url of the XML I am using, and from that url XML I am trying to display only the Name(Symbol), Last, High, and Low.
So on my application when the user hits the button to get a stock quote what appears right now is everything from that XML, but I only want those 4 things I listed above to show up.
Here is my code that I right now...
HttpWebRequest myHttpWebRequest = null; //Declare an HTTP-specific implementation of the WebRequest class.
HttpWebResponse myHttpWebResponse = null; //Declare an HTTP-specific implementation of the WebResponse class
XmlTextReader myXMLReader = null; //Declare XMLReader
XPathNavigator nav;
XPathDocument docNav;
//Create Request
String stockQuote = "http://www.webservicex.net/stockquote.asmx/GetQuote?Symbol=T" + txtInfo.Text;
myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(stockQuote);
myHttpWebRequest.Method = "GET";
myHttpWebRequest.ContentType = "text/xml; encoding='utf-8'";
//Get Response
myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
//Load response stream into XMLReader
myXMLReader = new XmlTextReader(myHttpWebResponse.GetResponseStream());
docNav = new XPathDocument(myXMLReader);
// Create a navigator to query with XPath.
nav = docNav.CreateNavigator();
txtResults.Text = txtResults.Text + nav.Name + " - " + nav.Value + Environment.NewLine;