[phpXML] Latest version? Version 1.N.2
Brought to you by:
bs_php,
nigelswinson
From: <nig...@us...> - 2001-10-09 13:11:36
|
> I see that only version 1.0 is available for download from phpxml.org, > but I've seen many error reports and fixes come through this list. = Where > can I download the latest version? As far as I'm aware, the version that I have "published" contains the = combination of all the bug fixes that I have seen so far. ftp://129.215.200.115/Pub/phpxml/xml.php I have found a series of "issues" recently with the XPath expressions = that I am currently fixing. =20 -------------------------------------------------------------------------= ------- Detailed description for those who care: The issue arises in the function evaluate() and it's calls to = evaluate_predicate() function. =20 To demostrate the problem visit: = http://www.phpxml.org/scripts/testsuite/index.php and select the = translation-example.xml file and use the following XPath expression = leaving the XPath context blank. //*[contains('title','to')] Clearly the string "title" does not contain "to", so this XPath = expression is logically the same as: //*[false] Yet the evaluate function recons that the template element holds an = element where this condition is true. The problem arises from the fact that evaluate() removes all ' chars, = thus making the XPath expression equal to: //*[contains(title,to)] Hence the script catches the fact that /template[1]/title[1] exists and = tries to see if it's content contains the XPath expression "to". Now the XPath expression "to" should evaluate to the empty node set, as = there are no <to> elements, but instead evaluate_predicate() returns the = string itself deciding that "to" must be a literal string, not a node = name. And so it decides that //*[contains('title','to')] matches the = /template[1] element. -------------------------------------------------------------------------= ------- Resolution: The evalute function should not strip ' chars, as it needs to = distinguish between string literals, and XPath expressions. The = evaluation should then detect the literal strings and not evaluate them = as XPath expressions. -------------------------------------------------------------------------= ------- The version at my ftp site contains this fix. ftp://129.215.200.115/Pub/phpxml/xml.php I'm still hoping that Michael will make me a sourceforge developer of = this project, otherwise I will continue to post fixes at the above site = and update the Changes.html document that can be found there. Nigel |