<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" media="screen" href="/App_Themes/default/rss.xslt"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:evnet="http://www.mscommunities.com/rssmodule/"><channel><title>Comment Feed for LINQ to XML vs XmlDocument &amp; xpath (TechOff on Channel 9)</title><atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/forums/techoff/442355-linq-to-xml-vs-xmldocument--xpath/rss/default.aspx" /><image><url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url><title>Comment Feed for LINQ to XML vs XmlDocument &amp; xpath (TechOff on Channel 9)</title><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/</link></image><description>LINQ to XML vs XmlDocument &amp; xpath</description><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/</link><language>en-us</language><pubDate>Thu, 27 Aug 2009 07:15:50 GMT</pubDate><lastBuildDate>Thu, 27 Aug 2009 07:15:50 GMT</lastBuildDate><generator>EvNet (EvNet, Version=1.0.3608.3122, Culture=neutral, PublicKeyToken=null)</generator><item><title>Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>&lt;p&gt;In my opinion xml related programs and class libraries should use the System.Xml.Linq.dll library. There there are methods that simpify your work. Do not use System.Xml directly. That will complicate things. For querying use LINQ to XML or if the language you use does not use the XPathSelectElement method under the System.Xml.XPath.Extensions namespace which uses an Xpath query string to return an XElement. IF you want to create a data type in XML look at this project I made and extend it to your liking &lt;a href="http://borgdylan.web.officelive.com/LinqXmlDatadll.aspx"&gt;http://borgdylan.web.officelive.com/LinqXmlDatadll.aspx&lt;/a&gt;&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=487059</link><pubDate>Thu, 27 Aug 2009 07:15:50 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=487059</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/487059/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>In my opinion xml related programs and class libraries should use the System.Xml.Linq.dll library. There there are methods that simpify your work. Do not use System.Xml directly. That will complicate things. For querying use LINQ to XML or if the language you use does not use the XPathSelectElement&amp;#8230;</evnet:previewtext><dc:creator>Dylan Borg</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/487059/Trackback.aspx</trackback:ping></item><item><title>Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>&lt;p&gt;Necro? I just have one comment, which is that XLinq works quite nicely with XPath. So you can do&amp;nbsp;a.XPathSelectElement("b/c/d/e") and you will get back an XElement whereas if you use plain XLinq, you'll have to do a.Element("b").Element("c").Element("d").Element("e") (I don't think XElement.Element contains any magic there?)&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=486773</link><pubDate>Tue, 25 Aug 2009 16:36:41 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=486773</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/486773/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Necro? I just have one comment, which is that XLinq works quite nicely with XPath. So you can do&amp;nbsp;a.XPathSelectElement("b/c/d/e") and you will get back an XElement whereas if you use plain XLinq, you'll have to do a.Element("b").Element("c").Element("d").Element("e") (I don't think XElement.Element contains any magic there?)</evnet:previewtext><dc:creator>Bent Rasmussen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/486773/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>&lt;p&gt;Hi, I'm looking for an implementation of any kind of newsML reader (or parser) do you have one? If you can help me with some info or sharing your API, I'll be send you thanks in advance.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Guillermo G.&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=486663</link><pubDate>Tue, 25 Aug 2009 00:25:51 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=486663</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/486663/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Hi, I'm looking for an implementation of any kind of newsML reader (or parser) do you have one? If you can help me with some info or sharing your API, I'll be send you thanks in advance.
&amp;nbsp;
Guillermo G.</evnet:previewtext><dc:creator>gugonzar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/486663/Trackback.aspx</trackback:ping></item><item><title>Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>For help with XPath performance, try to avoid using the XPath recursive descent operator '//'.&amp;nbsp; It is one of the most common mistakes that I see when reviewing under-performing XPath.&amp;nbsp; For some reason, everyone just feels that they *have to* use it even when they don't need it - doh!&lt;BR&gt;&lt;BR&gt;Also, when possible, be as node-specific as possible in the XPath.&amp;nbsp; In other words, if the node you are looking for can ever only be 5 levels deep, then your XPath query should be specified such that it only looks in the 5th level for the node instead of anything above or below.&lt;BR&gt;&lt;BR&gt;HTH</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=460419</link><pubDate>Tue, 10 Mar 2009 21:01:07 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=460419</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/460419/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>For help with XPath performance, try to avoid using the XPath recursive descent operator '//'.&amp;nbsp; It is one of the most common mistakes that I see when reviewing under-performing XPath.&amp;nbsp; For some reason, everyone just feels that they *have to* use it even when they don't need it - doh!Also,&amp;#8230;</evnet:previewtext><dc:creator>Dave Black</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/460419/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>You're using XPath on XmlDocument? I recommend you try using XPathDocument instead of XmlDocument. It's designed to read XML via XPath-queries and has a better performance.</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=442683</link><pubDate>Wed, 12 Nov 2008 11:12:07 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=442683</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/442683/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>You're using XPath on XmlDocument? I recommend you try using XPathDocument instead of XmlDocument. It's designed to read XML via XPath-queries and has a better performance.</evnet:previewtext><dc:creator>Tommy Carlier</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/442683/Trackback.aspx</trackback:ping></item><item><title>Re: Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>Thanks for your reply, I guess then it would not be worth forcing a move over to 3.5 for LINQ and I'll wait until I get the nod to develop on 3.5. If anything it makes the code more semantic, faster to develop and easier to read which I am all for.&lt;br&gt;&lt;br&gt;Ok so my next question is with your expereience of xpath can you give me any tips or best practices I should be using when navigating the XML DOM.&lt;br&gt;&lt;br&gt;I have basically built an API around something called &lt;a target="_blank" href="http://www.iptc.org/cms/site/single.html?channel=CH0087&amp;amp;document=CMS1206527546450"&gt;NewsML&lt;/a&gt; from which there are around maybe 20-30 files I need to parse on each refresh of the cache.&amp;nbsp; It's alot of XML to load in and my code takes a long time to get through it I am just using SelectNodes and SelectSingleNode methods of the XmlNode class with lots of foreach around XmlNodeLists, it doesn't strike me as the most optimized methods of navigating XML.&lt;br&gt;&lt;br&gt;Anyway your thoughts would be much appreciated.&lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;&lt;br&gt;Lee&lt;br&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=442673</link><pubDate>Wed, 12 Nov 2008 09:42:05 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=442673</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/442673/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Thanks for your reply, I guess then it would not be worth forcing a move over to 3.5 for LINQ and I'll wait until I get the nod to develop on 3.5. If anything it makes the code more semantic, faster to develop and easier to read which I am all for.Ok so my next question is with your expereience of&amp;#8230;</evnet:previewtext><dc:creator>Lee Dale</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/442673/Trackback.aspx</trackback:ping></item><item><title>Re: LINQ to XML vs XmlDocument &amp; xpath</title><description>I can't attest to either question with any degree of certainty, however, my limited understanding of Linq to XMl is that there is no performance guarantee by switching from Xpath to Linq.&lt;BR&gt;&lt;BR&gt;Reviewing various articles and newsgroups, I have seen a lot of unverified claims and rhetoric.&lt;BR&gt;&lt;BR&gt;The lack of evidence is silly, Take a look here for &lt;A href="http://visualstudiomagazine.com/columns/article.aspx?editorialsid=2506" target=_blank&gt;example&lt;/A&gt;: the author claims that the linq version should 'probably' be faster in 'most cases', but then she provides a ridiculous sample utilizing&amp;nbsp;an XML fragment that is neither well-formed nor rationally structured. basically, she used an extremely poorly designed XML fragment to illustrate her point. Cherry picking data to prove a theory isn't proof. If anyone ever came to me with that data structure I would throw them out of my office, seriously.&lt;BR&gt;&lt;BR&gt;I'm not in a position to comment with any authority which is faster, but I find it hard to imagine that linq could outperform a well optimized xpath query against a reasonably well structured document.&lt;BR&gt;&lt;BR&gt;That's just my 2 cents though, and I really don't have the experience with linq to substantiate it. I do however have tons (over 7 years of hardcore) experience with Xpath, XSL and XML.&lt;BR&gt;&lt;BR&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=442483</link><pubDate>Tue, 11 Nov 2008 19:44:21 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/442355-LINQ-to-XML-vs-XmlDocument--xpath/?CommentID=442483</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/442483/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>I can't attest to either question with any degree of certainty, however, my limited understanding of Linq to XMl is that there is no performance guarantee by switching from Xpath to Linq.Reviewing various articles and newsgroups, I have seen a lot of unverified claims and rhetoric.The lack of&amp;#8230;</evnet:previewtext><dc:creator>phreaks</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/442483/Trackback.aspx</trackback:ping></item></channel></rss>