Re: Php.XPath 3.2 released!!
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-07-22 19:28:20
|
> I was using a very old version of phpxpath and have been reluctant to > upgrade because it has been working so well for me. SInce I lurk here I > knew the later versions were faster so I finally downloaded the latest > version and decided to test it. It turns out that phpxpath is now a whole > new animal and the API has changed quite a bit. Here is a snippet of how I > was using this class. We actually supported both old and new methods all the way through the 2.X branch, but expired the "old" methods as of 3.0. We changed the function names to be more like the DOM api, as we felt this would reduce the learning curve to our users. > $xml = new XPath(); > $xml->load_string ($results_xml); http://www.carrubbers.org/scripts/php/xpath/doc/#importFromString > $a = $xml->get_attributes($xml->root); http://www.carrubbers.org/scripts/php/xpath/doc/#getAttributes > $resultcount = $a['COUNT']; > > if ($resultcount): > // we know we have results so let's deal with them. > $results = $xml->evaluate("/RESULTS/RESULT"); This is still in as: http://www.carrubbers.org/scripts/php/xpath/doc/#evaluate In general it was just function name changes, but there were some differences along the way, please backup data and test well before releasing on your production site (As we should always do, and I didn't) :o) Cheers, Nigel |