su*************@gmail.com wrote:
sUrl = "http://abcd.com/getresults.aspx?zipcode=" + zipcode +
"&areaCode=" + areacode + "&Landmark=" + landmark;
Now I want to duplicate this functionality in my code (like invoking
this url from within a function and getting the xml as output from the
function) so that my code can parse the xml got in return.
Well there are lots of ways to parse XML in .NET and all should allow
you to pass in your sUrl, you can use an XmlTextReader e.g.
XmlTextReader xmlReader = new XmlTextReader(sUrl)
or you can use an XPathDocument e.g.
XPathDocument xPathDocument = new XPathDocument(sUrl);
or you can create an XmlDocument instance and use the Load method
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(sUrl);
It depends on what you want to do, XmlTextReader allows forwards only
pull parsing pulling in node by node and consuming not much resources
that way.
XPathDocument builds a read only tree model for the whole document
allowing for XPath navigation.
XmlDocument builds a DOM tree model for the whole document allowing
changes to contents and structure.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/