[phpXML] problem with evaluate...rooted out a deeply hidden error
Brought to you by:
bs_php,
nigelswinson
From: <big...@ya...> - 2001-10-03 05:02:38
|
Okay, I am sitting here pulling my hair out over this one until I finally dug myself down to the root of the problem. Say I have a file <root> <node number="0"/> </root> If i did $xml->evaluate("/root/node/@number") or $xml->evaluate("/root/node/attribute::number") I would get NOTHING as a result...now, I changed to 0 to a 1 and I got a result...so somewhere a 0 was being considered a nothing...I found the problem on line 2679 in the _handleAxis_attribute function The problem is, the use of the function empty(), which returns true if the contents are the number 0, so what should be done is replace it with if(strlen(blah blah) > 0) That way, any number is accepted and only an empty string will fall through...Hope this can be patched... Dan On 02 Oct 2001 23:43:32 +0000, nig...@us... wrote: > RE: [phpXML] problem with whitespace> Is there a way to search nodes by > case-insensitive attributes? > > I've never found one. Sorry. Seems to be an ommision in the XPath spec. > This has bugged me in the past too. Perhaps we should create a new string > function to map to lower case or something... I think this feature is "some > way off" though. > > =========================== > For the most recent version of phpxml, V1.N.X, and an archive of this list > visit: http://www.sourceforge.net/projects/phpxmldb > > -- > This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |