Re: [xml] XPath on a subtree

On Sun, Mar 31, 2013 at 06:44:44PM +0800, Daniel Veillard wrote:
On Sat, Mar 30, 2013 at 07:11:35PM +0000, Alex Bligh wrote:
BTW the xml is generated so that should be discarded from the

That's strange. It appears in git and has a history.

How does one regenerate it (as the normal build process

  Ah, well usually I do this only at release times, but it can
be useful when developping a patch too, so have a look at

  It is a large bit of rather ugly Python, but it scans the .h
files, the .c files, and generate a formal API description of
all exported entry points and structures:

From there a number of other things are generated such as the
online docs, checks for the exported symbol files, python
bindings ...

  Ah, another thing which is generated from it is testapi.c
(make rebuild_testapi) which is used to exercise the full set of
the API against weird input etc ...

Testing xpath : 32 of 40 functions ...

Program received signal SIGSEGV, Segmentation fault.
0x00000000004f9691 in xmlXPathSetContextNode (node=0x82bd50, ctx=0x0)
    at xpath.c:15091
15091       if (node->doc == ctx->doc)

 and it indicates you forgot to check the arguments from that new
function. There is actually a number of possible error case so
it is better to make the function return an error status,
I also modified xmlXPathNodeEval to return NULL if str is NULL or
if xmlXPathSetContextNode failed :-)

I commited the result:

 thanks !


Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]