Monday, 6 August 2007

Silverlight and LINQ over Xml (XLinq)

I have been developing a very cool little app (which will be available in the next few weeks) and have been hit with a little snag.

Although I know that XLinq will be available in Silverlight, it currently is not available to use.

This left me with the dilemma of either using XmlReader to process the XmlDocument (this is the only supported method of parsing XML in Silverlight), or use a Web Service which returns the required objects and not use XML client side.

After much thought, I have decided it is better to download the XML and parse client side (and not go down the Web Service route). I can always rewrite the XML layer later on to use XLinq.

The reason i have decided to stick with my orginal plan of downloading the XML is to make effective use of caching, and to be able to give offline support.

I hope my thoughts on this might help you clarify your own thoughts when facing a similar problem.

Its a shame as the XLinq stuff is really neat, and I had a lot of fun playing with it last night. It really is a big improvement over using XmlReader or using the DOM (XmlDocument etc).

I will probably do a post about XLinq later on.

1 comment:

Anonymous said...

Thanks this helped heaps. Its a real pain about XLinq not being ready yet for silverlight. I wanted to use serialization but I couldn't use that with silverlight.