Note that there are some explanatory texts on larger screens.

plurals
  1. POLinq to XML parsing a single "status" node from the twitter API
    text
    copied!<p>OK, i'm building a windows phone twitter app, and I can't get this data parsed out for some reason. I'm just trying to parse out a single status...</p> <p>Here is the xml data from twitter...</p> <pre><code>&lt;status&gt; &lt;created_at&gt;Sat Sep 10 17:59:12 +0000 2011&lt;/created_at&gt; &lt;id&gt;112585933307645952&lt;/id&gt; &lt;text&gt;AP: Start 'em/Sit 'em Week 1 - Arrowhead Pride (blog): Midwest Sports FansAP: Start 'em/Sit 'em Week 1Arrowhead ... http://t.co/rWnx5pe&lt;/text&gt; &lt;source&gt;&amp;lt;a href="http://twitterfeed.com" rel="nofollow"&amp;gt;twitterfeed&amp;lt;/a&amp;gt;&lt;/source&gt; &lt;truncated&gt;false&lt;/truncated&gt; &lt;favorited&gt;false&lt;/favorited&gt; &lt;in_reply_to_status_id&gt;&lt;/in_reply_to_status_id&gt; &lt;in_reply_to_user_id&gt;&lt;/in_reply_to_user_id&gt; &lt;in_reply_to_screen_name&gt;&lt;/in_reply_to_screen_name&gt; &lt;retweet_count&gt;0&lt;/retweet_count&gt; &lt;retweeted&gt;false&lt;/retweeted&gt; &lt;user&gt; &lt;id&gt;27680614&lt;/id&gt; &lt;name&gt;Fantasy Football&lt;/name&gt; &lt;screen_name&gt;hackhype&lt;/screen_name&gt; &lt;location&gt;Atlanta, GA&lt;/location&gt; &lt;description&gt;NFL News and Fantasy Perspective!&lt;/description&gt; &lt;profile_image_url&gt;http://a1.twimg.com/profile_images/509176461/icon_normal.gif&lt;/profile_image_url&gt; &lt;profile_image_url_https&gt;https://si0.twimg.com/profile_images/509176461/icon_normal.gif&lt;/profile_image_url_https&gt; &lt;url&gt;http://www.facebook.com/hackhype&lt;/url&gt; &lt;protected&gt;false&lt;/protected&gt; &lt;followers_count&gt;29888&lt;/followers_count&gt; &lt;profile_background_color&gt;ebebeb&lt;/profile_background_color&gt; &lt;profile_text_color&gt;333333&lt;/profile_text_color&gt; &lt;profile_link_color&gt;0084B4&lt;/profile_link_color&gt; &lt;profile_sidebar_fill_color&gt;ebebeb&lt;/profile_sidebar_fill_color&gt; &lt;profile_sidebar_border_color&gt;040470&lt;/profile_sidebar_border_color&gt; &lt;friends_count&gt;6789&lt;/friends_count&gt; &lt;created_at&gt;Mon Mar 30 17:01:37 +0000 2009&lt;/created_at&gt; &lt;favourites_count&gt;1&lt;/favourites_count&gt; &lt;utc_offset&gt;-18000&lt;/utc_offset&gt; &lt;time_zone&gt;Quito&lt;/time_zone&gt; &lt;profile_background_image_url&gt;http://a2.twimg.com/profile_background_images/44228452/twitterbackground.jpg&lt;/profile_background_image_url&gt; &lt;profile_background_image_url_https&gt;https://si0.twimg.com/profile_background_images/44228452/twitterbackground.jpg&lt;/profile_background_image_url_https&gt; &lt;profile_background_tile&gt;false&lt;/profile_background_tile&gt; &lt;profile_use_background_image&gt;true&lt;/profile_use_background_image&gt; &lt;notifications&gt;false&lt;/notifications&gt; &lt;geo_enabled&gt;false&lt;/geo_enabled&gt; &lt;verified&gt;false&lt;/verified&gt; &lt;following&gt;true&lt;/following&gt; &lt;statuses_count&gt;10219&lt;/statuses_count&gt; &lt;lang&gt;en&lt;/lang&gt; &lt;contributors_enabled&gt;false&lt;/contributors_enabled&gt; &lt;follow_request_sent&gt;false&lt;/follow_request_sent&gt; &lt;listed_count&gt;466&lt;/listed_count&gt; &lt;show_all_inline_media&gt;false&lt;/show_all_inline_media&gt; &lt;default_profile&gt;false&lt;/default_profile&gt; &lt;default_profile_image&gt;false&lt;/default_profile_image&gt; &lt;is_translator&gt;false&lt;/is_translator&gt; &lt;/user&gt; &lt;geo /&gt; &lt;coordinates /&gt; &lt;place /&gt; &lt;possibly_sensitive&gt;false&lt;/possibly_sensitive&gt; &lt;contributors /&gt; &lt;entities&gt; &lt;user_mentions /&gt; &lt;urls&gt; &lt;url end="135" start="116"&gt; &lt;url&gt;http://t.co/rWnx5pe&lt;/url&gt; &lt;display_url&gt;bit.ly/ookpnp&lt;/display_url&gt; &lt;expanded_url&gt;http://bit.ly/ookpnp&lt;/expanded_url&gt; &lt;/url&gt; &lt;/urls&gt; &lt;hashtags /&gt; &lt;/entities&gt; &lt;/status&gt; </code></pre> <p>Here is the code I'm using to parse it out (it's not working). It's compiling and running, but "thisTweet" is coming back as null....</p> <pre><code>XElement xmlData = XElement.Parse(e.Result); thisTweet = (from tweet in xmlData.Descendants("status") select new Tweet { created_at = tweet.Element("created_at").Value, text = tweet.Element("text").Value, //user info name = tweet.Element("user").Element("name").Value, profile_image_url = tweet.Element("user").Element("profile_image_url").Value, screen_name = tweet.Element("user").Element("screen_name").Value, user_id = tweet.Element("user").Element("id").Value }).First&lt;Tweet&gt;(); DataContext = thisTweet; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload