TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-12-2011, 12:42 AM   #1 (permalink)
The Visitor
 
OvinBovin's Avatar
 
Join Date: Jun 2011
Location: Normandy
Posts: 2
Thanks: 0
OvinBovin is on a distinguished road
Default Xpath query

Hi all,

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;
$document->load("soccer-rss.xml");
$xpath = new DOMXPath($document);
$string="Liga";
$markup="title";
$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 ?
OvinBovin is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
can i insert value from another page into next page query fairytale89 Absolute Beginners 0 03-21-2010 12:25 AM
Problem executing MSSQL query in PHP trmbne2000 MySQL & Databases 2 06-30-2009 02:52 PM
Query With a C# Variable?‏ StevenF The Lounge 5 12-08-2008 05:32 AM
query question Evulness Absolute Beginners 4 04-21-2008 07:46 PM
Query caching xenon Advanced PHP Programming 4 01-29-2008 08:20 PM


All times are GMT. The time now is 05:32 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design