[thelist] php and xpath
Tim Stickland
tstickland at gmail.com
Wed Jul 12 17:22:26 CDT 2006
There are two things that really drive me mad - regular expressions and
XPath expressions. This week it's XPath's turn...
I'm trying to parse an RSS feed using Xpath. Here's a simplified version of
the XML:
<rss>
<channel>
<title>feed name</title>
<channel>
<item>
<category>Music</category>
<category>Youth</category>
<description>blah blah</description>
</item>
<item>
<category>Transport</category>
<category>Cars and Bikes</category>
<category>Automotive</category>
</item>
</rss>
What I want to be able to do is select all item nodes (and child nodes) that
contain a category node with a value of 'Transport'. How would I do that?
Something along the lines of:
//item[category=Transport]
Any help greatly appreciated...
Thanks
Tim
More information about the thelist
mailing list