<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx</link><description>XML (Extensible Markup Language) is a great format for saving structured data in. In this Tip I will be showing you how to read and process XML files from Silverlight using the XmlReader object. Let’s say, for example, you want to store a tree structure</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#322560</link><pubDate>Thu, 19 Nov 2009 00:13:38 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:322560</guid><dc:creator>mike.snow</dc:creator><description>&lt;p&gt;Can you access the XML file via IE?&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=322560" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#322511</link><pubDate>Wed, 18 Nov 2009 23:14:06 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:322511</guid><dc:creator>brucewpalmer</dc:creator><description>&lt;p&gt;I'm able to add a local version of the file to my project. But I really need it external so the config can be updated by a system manager without rebuilding. Got http to run but says it can't set credentials to access my site. I used Webclient.Credentials = new NetWorkCredentials(user, passwd) but got an exception that the property is not allowed.&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=322511" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#322490</link><pubDate>Wed, 18 Nov 2009 22:47:50 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:322490</guid><dc:creator>mike.snow</dc:creator><description>&lt;p&gt;Yes, like &lt;a rel="nofollow" target="_new" href="http://www.mysite.com/MyFile.xml"&gt;www.mysite.com/MyFile.xml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Are you able to include the XML file in your SL project?&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=322490" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#322487</link><pubDate>Wed, 18 Nov 2009 22:45:06 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:322487</guid><dc:creator>brucewpalmer</dc:creator><description>&lt;p&gt;I loaded the file up to my ftp site and still couldn't get a response on the async read. Does it have to be http?&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=322487" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#322211</link><pubDate>Wed, 18 Nov 2009 19:23:38 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:322211</guid><dc:creator>mike.snow</dc:creator><description>&lt;p&gt;Did you include the XML in your project? Make it relative path. You can't open files on the client that arne't included in the project.&lt;/p&gt;
&lt;p&gt;Or Try a absolute path by putting the file on a server and accessing it via http://...&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=322211" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#322208</link><pubDate>Wed, 18 Nov 2009 19:16:06 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:322208</guid><dc:creator>brucewpalmer</dc:creator><description>&lt;p&gt;Am having the same problem as HSCODER. Any suggestions?&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=322208" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#266313</link><pubDate>Sun, 09 Aug 2009 18:40:12 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:266313</guid><dc:creator>HSCoder</dc:creator><description>&lt;p&gt;I've implemented the code exactly as above. &amp;nbsp;It compiles correctly and runs. &amp;nbsp;The problem is that the callback function never gets called. &amp;nbsp;I've traced through in the debugger and watched the cl.DownloadStringAsync(uri) statement get executed. &amp;nbsp;Immediately after that I am checking the cl.isBusy and it shows false (async download not still in progress). &amp;nbsp;However, the callback function is never executed and there are no errors thrown at all. &amp;nbsp;Anybody have any ideas on what I might be doing wrong? &amp;nbsp;I am new to Silverlight, so I may be making an obvious mistake...&lt;/p&gt;
&lt;p&gt;Here is my code:&lt;/p&gt;
&lt;p&gt;Here's where I set everything up:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Open doc using WebClient (must use this for Silverlight)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WebClient cl = new WebClient();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cl.DownloadStringCompleted += new DownloadStringCompletedEventHandler(cl_DownloadStringCompleted);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Uri uri =&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new Uri(@&amp;quot;C:\Users\Aly\Desktop\Prototype3\Prototype3UI\Prototype3UI\ServerMonitorStatus.xml&amp;quot;, UriKind.Absolute);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cl.DownloadStringAsync(uri);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bool status = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status = cl.IsBusy;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (cl.IsBusy)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread.Sleep(1000);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status = cl.IsBusy;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;xmlData: &amp;quot; + xmlData);&lt;/p&gt;
&lt;p&gt;and here is my callback function:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;void cl_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlData = e.Result;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;xmlData: &amp;quot; + xmlData);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Thanks for any help you can give me!&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=266313" width="1" height="1"&gt;</description></item><item><title>Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#266104</link><pubDate>Sat, 08 Aug 2009 22:36:00 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:266104</guid><dc:creator>NewsPeeps</dc:creator><description>&lt;p&gt;Thank you for submitting this cool story - Trackback from NewsPeeps&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=266104" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#208121</link><pubDate>Fri, 17 Apr 2009 17:34:36 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:208121</guid><dc:creator>SharpGIS</dc:creator><description>&lt;p&gt;The problem with using the reader is that you require your tags to be in a specific order. However that's not how XML works.&lt;/p&gt;
&lt;p&gt;You could use the XML-to-LINQ, but that adds 50k to your XAP (why isn't it that these standard Dlls are part of the install grrrr?)&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=208121" width="1" height="1"&gt;</description></item><item><title>Programming with Silverlight, WPF &amp;amp; .NET &amp;raquo; XML mit Silverlight lesen</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#174915</link><pubDate>Mon, 16 Feb 2009 10:54:12 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:174915</guid><dc:creator>Programming with Silverlight, WPF &amp; .NET » XML mit Silverlight lesen</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Programming with Silverlight, WPF &amp;amp;amp; .NET &amp;amp;raquo; XML mit Silverlight lesen&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=174915" width="1" height="1"&gt;</description></item><item><title>Silverlight Cream for February 11, 2009 -- #514</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#173356</link><pubDate>Thu, 12 Feb 2009 04:56:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:173356</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;In this issue: Rob Houweling, Jonathan van de Veen, Peter Bromberg, Jeff Weber, Mike Snow, Jordan Knight&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=173356" width="1" height="1"&gt;</description></item><item><title>Silverlight Tip of the Day #94 – Reading XML through LINQ with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#173102</link><pubDate>Wed, 11 Feb 2009 19:53:19 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:173102</guid><dc:creator>Silverlight Tips of the Day - Blog by Mike Snow</dc:creator><description>&lt;p&gt;In Tip of the Day #93 I showed you how to read XML via XmlReader . However, a better and simpler approach&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=173102" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#173039</link><pubDate>Wed, 11 Feb 2009 17:11:51 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:173039</guid><dc:creator>mike.snow</dc:creator><description>&lt;p&gt;mbaker3- I wanted to demonstrated XmlReader. I will be doing a tutorial on LINQ next. Thanks.&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=173039" width="1" height="1"&gt;</description></item><item><title>Dew Drop - February 11, 2009 | Alvin Ashcraft's Morning Dew</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#172970</link><pubDate>Wed, 11 Feb 2009 14:49:50 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:172970</guid><dc:creator>Dew Drop - February 11, 2009 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Dew Drop - February 11, 2009 | Alvin Ashcraft's Morning Dew&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=172970" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Tip of the Day #93 – Reading XML with Silverlight</title><link>http://blogs.silverlight.net/blogs/msnow/archive/2009/02/10/silverlight-tip-of-the-day-93-reading-xml-with-silverlight.aspx#172956</link><pubDate>Wed, 11 Feb 2009 14:06:56 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:172956</guid><dc:creator>mbaker3</dc:creator><description>&lt;p&gt;I'm surprised to see an XML tutorial for Silverlight that doesn't implement LINQ. &amp;nbsp;Any reason for not using it?&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=172956" width="1" height="1"&gt;</description></item></channel></rss>