I'm trying to parse an RSS2 feed (using Delphi and MSXML)
and this code is not returning the correct number of itemnodes:


oChannelNode := RSSXML.selectsinglenode('rss').firstchild;
oItemNodes := oChannelNode.selectNodes('//item[category="Tech Tips"]');

oItemsNodes.length is 2 when it should be 3.

Any ideas as to why that xpath query is not working correctly?


The XML Below is what I'm parsing:

<?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/">
<channel>
<title>OurBlog Ľ Tech Tips</title>
<atom:link href="http://www.mysite.com/blog/?cat=21&feed=rss2" rel="self" type="application/rss+xml" />
<link>http://www.mysite.com/blog</link>
<description>Our Blog</description>
<pubDate>Fri, 08 May 2009 17:54:31 +0000</pubDate>
<generator>http://wordpress.org/?v=2.7</generator>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<item>
<title>Let the Infrastructure Rebuild Commence!</title>
<link>http://www.mysite.com/blog/?p=131</link>
<comments>http://www.mysite.com/blog/?p=131#comments</comments>
<pubDate>Wed, 04 Mar 2009 21:07:03 +0000</pubDate>
<dc:creator>admin</dc:creator>
<category><![CDATA[Stimulus Package & Construction]]></category>
<category><![CDATA[Tech Tips]]></category>
<category><![CDATA[bonding]]></category>
<guid isPermaLink="false">http://www.mysite.com/blog/?p=131</guid>
<description><SNIP></description>
<content:encoded><SNIP></content:encoded>
<wfw:commentRss>http://www.mysite.com/blog/?feed=rss2&amp;p=131</wfw:commentRss>
</item>
<item>
<title>Where Does All Your Time Go?</title>
<link>http://www.mysite.com/blog/?p=67</link>
<comments>http://www.mysite.com/blog/?p=67#comments</comments>
<pubDate>Fri, 20 Feb 2009 16:10:17 +0000</pubDate>
<dc:creator>admin</dc:creator>
<category><![CDATA[Tech Tips]]></category>
<category><![CDATA[better business]]></category>
<category><![CDATA[reconciling your time]]></category>
<category><![CDATA[time management]]></category>
<guid isPermaLink="false">http://www.mysite.com/blog/?p=67</guid>
<description></description>
<content:encoded></content:encoded>
<wfw:commentRss>http://www.mysite.com/blog/?feed=rss2&amp;p=67</wfw:commentRss>
</item>
<item>
<title>Spyware, Ugh! Donít Let It Slow You Down</title>
<link>http://www.mysite.com/blog/?p=49</link>
<comments>http://www.mysite.com/blog/?p=49#comments</comments>
<pubDate>Mon, 16 Feb 2009 17:12:16 +0000</pubDate>
<dc:creator>admin</dc:creator>
<category><![CDATA[Tech Tips]]></category>
<category><![CDATA[Ad-Aware]]></category>
<category><![CDATA[Internet security]]></category>
<category><![CDATA[Microsoft Defender]]></category>
<category><![CDATA[spyware]]></category>
<category><![CDATA[ways to avoid spyware]]></category>
<guid isPermaLink="false">http://www.mysite.com/blog/?p=49</guid>
<description></description>
<content:encoded></content:encoded>
<wfw:commentRss>http://www.mysite.com/blog/?feed=rss2&amp;p=49</wfw:commentRss>
</item>
</channel>
</rss>