Re: [xml] XPath and abbreviated paths

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Sat Oct 28 2000 - 05:03:27 EDT


On Sat, Oct 28, 2000 at 01:46:59AM +0200, TOM wrote:
>
> Hi,
> I tried this:
> ptittom:~/libxml/origin$ ./testXPath --expr //title
> Error xpath.c:2345: Invalid type
> //title
> ^
> Object is empty (NULL)
> ptittom:~/libxml/origin$ ./testXPath //title
> Object is a Node Set :
> Set contains 6 nodes:
> 1 ELEMENT title
> 2 ELEMENT title
> 3 ELEMENT title
> 4 ELEMENT title
> 5 ELEMENT title
> 6 ELEMENT title
>
> The only difference when passing the --expr option is to call
> xmlXPathEvalExpression() instead of xmlXPathEval(), and the (nearly)
> only
> difference between these two functions is to call xmlXPathRoot() (in
> xmlXPathEval()) or not (in xmlXPathEvalExpression()).
>
> If we call ./testXPath --expr /EXAMPLE//title, it works, and if we look
> at xmlXPathEvalLocationPath(), we see that if the path begins with '//'
> xmlXPathRoot() isn't called, but if it begins with a simple '/' it is.
>
> I modified the function to always call xmlXPathRoot() if we havea
> single
> or double '/' at the beginning of the path and... it works!

   NO !
  I applied your patches. Nearly all the XPath and XPointer tests of
the testsuite were broken. The patch didn't applied cleanly due to
small changes commited in CVS in the meantime (patch from Albert
Chin-A-Young). I might have made an error in making the changes manually
but I really checked.

  So I rolled it back ...
  Please don't send patches where "make test" fails unless you can
justify that the tests are broken (in which case patch to the test results
are welcome).

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | libxml Gnome XML toolkit
Tel : +33 476 615 257  | 655, avenue de l'Europe | http://xmlsoft.org/
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Rpmfind search site
 http://www.w3.org/People/all#veillard%40w3.org  | http://rpmfind.net/
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Oct 28 2000 - 05:43:46 EDT