I am looking for a function that finds a string from a RSS feed and retrieve the whole content of the matched nodes values.
I've made unsuccessfull tests using fn:matches function.
Here is my PHP code ;
$document = new DOMDocument();
$document->preserveWhiteSpace = FALSE;
$xpath = new DOMXPath($document);
$query = '/rss/channel/item/' . $markup .'[fn:matches(".","' . $string .'")]';
$results = $xpath->query($query);
In this example I wanted to retrieve titles containing the word "Liga" from RSS titles.
When submitting query /rss/channel/item/title[fn:matches(".","Liga")] my code displays all titles, even those not containing the word "Liga".
Does anyone have any idea to solve this ?
Xpath query solution
I've found a solution with contains function to query by an element's enclosed text :
I can get out now, I'm free :-)
Aha! Somebody else who loves XPath as me, I suppose :-) Yes, the
|All times are GMT. The time now is 12:39 PM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0