In this recipe let's try to open an XML file saved in the local application folder. We will make use of the XDocument parse method for opening the XML file. LINQ to XML is the best and the easiest way to navigate the XML for Silverlight applications. LINQ to XML replaced the XSLT transformation in C#.
For this recipe let's create a new project named
Recipe1_LinqToXml under the solution folder named
Ch3_Recipes. We will use this solution for all our samples in this chapter. Change the Application Name in the
LINQToXML. Press F5 and run to make sure you have no errors.
In the following steps we will create an XML file with sample data for our testing purposes and then we will ...