Friday 6 April 2012

how to read the xml file (which is getting as result) by using xml document

XmlDocument xml = new XmlDocument();
string response = _oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/people/~", null,null);
//here response is in xml formate
xml.LoadXml(response);
            //XmlNodeList xnList = xml.SelectNodes("/person");
            //string firstName = "", lastName = "", headline = "";
            //foreach (XmlNode xn in xnList)
            //{
            //    firstName = xn["first-name"].InnerText;
            //    lastName = xn["last-name"].InnerText;
            //    headline = xn["headline"].InnerText;
            //    //string url = xn["url"].InnerText;
return firstName + " " + lastName + " " + headline;

No comments:

Post a Comment