<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using LINQ to XML instead of XmlReader</title>
	<atom:link href="http://brian.dobberteen.com/code/using-linq-to-xml-instead-of-xmlreader/feed/" rel="self" type="application/rss+xml" />
	<link>http://brian.dobberteen.com/code/using-linq-to-xml-instead-of-xmlreader/</link>
	<description>Fun With Web Development!</description>
	<lastBuildDate>Wed, 14 Jul 2010 02:43:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: GazNewt</title>
		<link>http://brian.dobberteen.com/code/using-linq-to-xml-instead-of-xmlreader/comment-page-1/#comment-742</link>
		<dc:creator>GazNewt</dc:creator>
		<pubDate>Tue, 08 Jun 2010 22:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://brian.dobberteen.com/?p=87#comment-742</guid>
		<description>I had a similar decision to make about handling XML in a more &quot;modern&quot; way. In the end I went for this kind of thing

foreach( var oElement in oParentElement.Elements())
{
	switch( oElement.Name.LocalName.ToLower())
	{
		case &quot;id&quot; : oObject.Id = oElement.Value; break;
		case &quot;items&quot; : LoadItems( oObject, oElement); break;
	}
}

Quite a lot of code in the end but it works as a forward reader quite nicely

I gave a little bit of though about using LINQ to XML but it seemed overkill, I assumed it would be a lot slower than forward reading</description>
		<content:encoded><![CDATA[<p>I had a similar decision to make about handling XML in a more &#8220;modern&#8221; way. In the end I went for this kind of thing</p>
<p>foreach( var oElement in oParentElement.Elements())<br />
{<br />
	switch( oElement.Name.LocalName.ToLower())<br />
	{<br />
		case &#8220;id&#8221; : oObject.Id = oElement.Value; break;<br />
		case &#8220;items&#8221; : LoadItems( oObject, oElement); break;<br />
	}<br />
}</p>
<p>Quite a lot of code in the end but it works as a forward reader quite nicely</p>
<p>I gave a little bit of though about using LINQ to XML but it seemed overkill, I assumed it would be a lot slower than forward reading</p>
]]></content:encoded>
	</item>
</channel>
</rss>
