|
|
 |
Re: FN-FORUM: php, XML, content and searching
date posted 4th September 2007 09:12
Sam M - www.wiredeyes.com wrote:
> Hi Guys
> My question is about searching the xml data, the sites have a search
> facility using php/mySQL but I know very little about how to search through
> an XML document or if there is a nice way of doing it via php.
>
> My concerns are that all the xml data would have to be loaded into memory to
> do the search is there an elegant way to do it? Or even a prebuilt xml
> search component specific to the task etc maybe something that indexes a
> defined set of xml data periodically or triggered from php and uses that
> index as the data source much like it would in a mySQL database search.
Hello!
Using php5+ you can make use of the XPath section of the domxml extension.
http://uk3.php.net/domxml - for the extension overview.
Searching is described here
http://uk3.php.net/manual/en/function.xpath-eval-expression.php
The php manual documentation is not that great for this extension, I
would recommend buying "Upgrading to PHP5" which I think covers the new
PHP 5 XML functions very well.
http://link.artumi.com/ry (Short link to amazon, no affliate links)
Regards
Richard
--
Artumi Systems, 58 Salmon Street, Sheffield, S11 8DD.
Tel 0114 250 7654, Web http://www.artumi.com
VAT Reg 889 0317 88
|
 |
|