Saturday, April 6, 2013

Trying to parse xml in Windows Phone 7.8 app but getting null value?

I am trying to parse a xml that I got as response to webservice response the xml is shown below

<GeneralSearchResponse> <serverDetail></serverDetail> <exceptions exceptionCount="1"></exceptions> <clientTracking height="19" type="logo" width="106"></clientTracking> <searchHistory></searchHistory> <categories matchedCategoryCount="1" returnedCategoryCount="1"> <category id="0"> <name>bart</name> <categoryURL>http://www.shopping.com/bart/products?oq=bart&linkin_id=7000610 </categoryURL> <items matchedItemCount="1045" pageNumber="1" returnedItemCount="5"> <product id="130506037"></product> <product id="104483377"></product> <offer featured="false" id="tp-VCdOoO1RL6xICeRONqg==" smartBuy="false" used="false"></offer> <offer featured="false" id="12evWWi57lddzFufngUWsg==" smartBuy="false" used="false"></offer> <product id="96754577"></product> </items> <attributes matchedAttributeCount="5" returnedAttributeCount="5"></attributes> <contentType>hybrid</contentType> </category> <intActualCategoryCount>4</intActualCategoryCount> </categories> <relatedTerms></relatedTerms> </GeneralSearchResponse> 

But when I am trying to parse using following code I am not able to get any descend or any node

XDocument xDoc = new XDocument(); xDoc = XDocument.Parse(data); var xEle = xDoc.Root.Descendants("categories"); 

But xEle is not having any categories. Please let me know what is the issue??

Source: http://stackoverflow.com/questions/15843428/trying-to-parse-xml-in-windows-phone-7-8-app-but-getting-null-value

Facebook Down bo jackson bo jackson hanukkah justin tv justin tv Sarah Savage

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.