<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lars Wilhelmsen &#187; Annoyance</title>
	<atom:link href="http://www.larswilhelmsen.com/category/annoyance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.larswilhelmsen.com</link>
	<description>Computer Software Guy Living Between the Edge and Corner Cases</description>
	<lastBuildDate>Wed, 11 Jan 2012 13:05:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>LINQ to XML: XPathSelectElement Annoyance</title>
		<link>http://www.larswilhelmsen.com/2008/12/12/linq-to-xml-xpathselectelement-annoyance/</link>
		<comments>http://www.larswilhelmsen.com/2008/12/12/linq-to-xml-xpathselectelement-annoyance/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 14:08:23 +0000</pubDate>
		<dc:creator>larsw</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Annoyance]]></category>
		<category><![CDATA[Bug?]]></category>
		<category><![CDATA[LINQ to XML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://larsw.wordpress.com/2008/12/12/linq-to-xml-xpathselectelement-annoyance/</guid>
		<description><![CDATA[It may be me – since I’m no XPath (or XSLT) pro, but the following is in my book a bug – or at least an annoyance category 3: Given the following XML document loaded into an XDocument: &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;Elements&#62; &#60;Element Id=&#34;1&#34; /&#62; &#60;Element Id=&#34;2&#34; /&#62; &#60;Element Id=&#34;3&#34; /&#62; &#60;Element Id=&#34;4&#34; /&#62; &#60;Element [...]]]></description>
			<content:encoded><![CDATA[<p>It may be me – since I’m no XPath (or XSLT) pro, but the following is in my book a bug – or at least an annoyance category 3:</p>
<p>Given the following XML document loaded into an XDocument:</p>
<pre style="background:#222222;"><span style="background:#222222;color:#66bfff;">&lt;?xml </span><span style="background:#222222;color:white;">version</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;1.0&quot; </span><span style="background:#222222;color:white;">encoding</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;utf-8&quot;</span><span style="background:#222222;color:#66bfff;">?&gt;
&lt;Elements&gt;
  &lt;Element </span><span style="background:#222222;color:white;">Id</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;1&quot; </span><span style="background:#222222;color:#66bfff;">/&gt;
  &lt;Element </span><span style="background:#222222;color:white;">Id</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;2&quot; </span><span style="background:#222222;color:#66bfff;">/&gt;
  &lt;Element </span><span style="background:#222222;color:white;">Id</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;3&quot; </span><span style="background:#222222;color:#66bfff;">/&gt;
  &lt;Element </span><span style="background:#222222;color:white;">Id</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;4&quot; </span><span style="background:#222222;color:#66bfff;">/&gt;
  &lt;Element </span><span style="background:#222222;color:white;">Id</span><span style="background:#222222;color:#66bfff;">=</span><span style="background:#222222;color:#d282a6;">&quot;5&quot; </span><span style="background:#222222;color:#66bfff;">/&gt;
&lt;/Elements&gt;</span></pre>
<p>The following XPath should&#160; yield the first element of the list:</p>
<pre style="background:#222222;"><span style="background:#222222;color:#bac794;">&quot;//Element[@Id = '1']&quot;</span></pre>
<p>
  <br />Guess what? If use the .XPathSelectElement() extension method, the result will be null – nada!</p>
</p>
<pre style="background:#222222;"><span style="background:#222222;color:#bac794;">&quot;//Element[@Id='1']&quot;</span></pre>
<p>
  <br />The same query without the whitespace around the equal sign will give you the right result.</p>
<p>If you’re an XPath pro I would like your opinion on the matter – or else I’m turning this issue over to <a href="http://connect.microsoft.com/" target="_blank">http://connect.microsoft.com/</a></p>
<p><em>Sigh.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.larswilhelmsen.com/2008/12/12/linq-to-xml-xpathselectelement-annoyance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

