concept xml in category silverlight

appears as: XML, XML
Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services

This is an excerpt from Manning's book Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services.

Listing 1.1. Processing the Twitter search results using LINQ to XML

If you look in the output window from your last run, you’ll see that the result format is an AtomPub document with an entry node for each of the results. In Silverlight, you can parse Atom a couple ways: you can use the built-in parsing of the Syndication-Feed class or you can use LINQ to XML to parse the results.

LINQ to XML is a great technology and has many uses above and beyond AtomPub document parsing, so I’m going to go that route. We’ll end up with a little more code than the alternative approach, but I think it’s worth it.

Silverlight provides numerous methods to get to data hosted on other systems, from complex web services to a simple XML document. The networking and communications features of Silverlight enable you to send and receive data with a variety of technologies including SOAP services, XML, JSON, RSS, Atom, and even sockets.

In this section, we’ll describe the three major ways to use POX content. The three built-in methods to use XML content are LINQ to XML, also known as XLINQ, XmlReader, and XmlSerializer. In the following examples, we’ll demonstrate each of these ways to read the same data using different methods.