Thread: match( "/* | /text()" ) causes error from _InternalEvaluate()
Brought to you by:
bs_php,
nigelswinson
From: <gk...@pr...> - 2002-07-05 08:07:25
|
* @version 3.1 * @CVS $Id: XPath.class.php,v 1.99 2002/06/20 12:20:38 bs_php Exp $ */ No matter what your input xml looks like, it seems you cannot use '|' operator with a combination of textParts and childNodes: Xpath->match( "/* | /text()" ) results in this message: XPath error in -:-</b> Results from _InternalEvaluate() are corrupt. Do you need to call reindexNodeTree()? Given input: <a>cdata<b>cdata</b></a> The following matches work fine: Xpath->match( "/* | /a/*" ) Xpath->match( "/text()" ) Xpath->match( "/a/text()" ) The following fail: Xpath->match( "/text() | /a/text()" ) Xpath->match( "//text()" ) Are these bugs or is my xpath invalid? - Greg |
From: Nigel S. <nig...@us...> - 2002-07-09 01:37:23
|
> No matter what your input xml looks like, it seems you cannot use '|' > operator with a combination of textParts and childNodes: > > Xpath->match( "/* | /text()" ) Agree. Bug, many thanks :o). Have added a test to the test harness that shows the bug, as yet unfixed. Nigel |
From: Nigel S. <nig...@us...> - 2002-07-11 02:00:48
|
This was because the text nodes weren't in the nodeIndex[]. This has now been fixed. See CVS if you can't wait for the next release. :o) > No matter what your input xml looks like, it seems you cannot use '|' > operator with a combination of textParts and childNodes: > > Xpath->match( "/* | /text()" ) > > results in this message: > XPath error in -:-</b> Results from _InternalEvaluate() are corrupt. Do > you > need to call reindexNodeTree()? > > Given input: > <a>cdata<b>cdata</b></a> > > The following matches work fine: > Xpath->match( "/* | /a/*" ) > Xpath->match( "/text()" ) > Xpath->match( "/a/text()" ) > > The following fail: > Xpath->match( "/text() | /a/text()" ) > Xpath->match( "//text()" ) > > Are these bugs or is my xpath invalid? |
From: Ben Sth. <ben...@or...> - 2002-10-10 09:38:24
|
hi list just wondering wether this is a serious warning/error or not worth mentioning: Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of method_exists(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in xxx/xpath/xpath.class.php on line 3156 I get this error when including the xpath class. I once read about performance reasons why to use this pass-by-reference thing. but in fact I do not know a lot about it... cheers ben |
From: Nigel S. <nig...@us...> - 2002-10-10 12:31:01
|
> just wondering wether this is a serious warning/error or not worth > mentioning: > > Warning: Call-time pass-by-reference has been deprecated - argument passed > by value; If you would like to pass it by reference, modify the declaration > of method_exists(). If you would like to enable call-time pass-by-reference, > you can set allow_call_time_pass_reference to true in your INI file. > However, future versions may not support this any longer. in > xxx/xpath/xpath.class.php on line 3156 > > I get this error when including the xpath class. I once read about > performance reasons why to use this pass-by-reference thing. but in fact I > do not know a lot about it... I personally never really got a good handle on this issue, but I don't think it is serious. I think there was a change in philosophy at php.net and they planned to remove call-time-pass-by-reference, but then brought it back in again in later versions. What version of PHP are you using, and what version of Php.XPath are you using? I'm using 4.1.1 (Win32) and have allow_call_time_pass_reference set to on. And my production server is 4.2.3 (Linux) and also has allow_call_time_pass_reference set to on. Hope this is of some help, and if were lucky someone else on the list will clarify for the both of us... :o) Nigel |
From: Ben Sth. <ben...@or...> - 2002-10-11 12:13:27
|
>> just wondering wether this is a serious warning/error or not worth >> mentioning: >> >> Warning: Call-time pass-by-reference has been deprecated - argument passed >> by value; If you would like to pass it by reference, modify the > declaration >> of method_exists(). If you would like to enable call-time > pass-by-reference, >> you can set allow_call_time_pass_reference to true in your INI file. >> However, future versions may not support this any longer. in >> xxx/xpath/xpath.class.php on line 3156 >> >> I get this error when including the xpath class. I once read about >> performance reasons why to use this pass-by-reference thing. but in fact I >> do not know a lot about it... > > I personally never really got a good handle on this issue, but I don't think > it is serious. I think there was a change in philosophy at php.net and they > planned to remove call-time-pass-by-reference, but then brought it back in > again in later versions. > > What version of PHP are you using, and what version of Php.XPath are you > using? I'm using 4.1.1 (Win32) and have allow_call_time_pass_reference set > to on. And my production server is 4.2.3 (Linux) and also has > allow_call_time_pass_reference set to on. > > Hope this is of some help, and if were lucky someone else on the list will > clarify for the both of us... :o) > > Nigel > already more I needed to know ;-) we use phpxpath 3.3, php4.1.2 on linux. call-time-pass-by-reference is on via htaccess since this morning, and everything works very ok... thanks ben |