Re: [xml] Big clean up in XPath

Date view Thread view Subject view Author view

From: TOM (ptittom@free.fr)
Date: Thu Oct 26 2000 - 10:16:26 EDT


On 26/10/2000 14:57:06 Daniel Veillard wrote:
>
> On Thu, Oct 26, 2000 at 01:33:16AM +0200, TOM wrote:
> >
> > Hi,
> > The attached patch fixes many bugs in XPath implementation:
>
> First question:
> - did you compile it ? Some added to xmlXPathNumberFunction()
> is:
> xmlChar* content = xmlNodeGetContent(ctxt->content->node);
> clearly this is wrong, this should be
> xmlChar* content = xmlNodeGetContent(ctxt->context->node);
> and there is a couple of other obvious errors proving this
> wasn't even compiled.

Yes I did, it seems I send an obsolete patch (but I believe I fixed it
too, I don't understand exactly what I did...).
I'm really sorry for this mistake...

> > - errors in function names (local-name() and namespace-uri(),
> > not local-part() and namespace(); C function names now are
> > xmlXPathLocalNameFunction() and xmlXPathNamespaceURIFunction())
>
> minor, applied but now that those function names get exported
> via xpathInternals.h future changes to just rename function
> will not be accepted to not break binary compatibility.

Ok.
Note also that the xmlXPathNormalizeFunction() is registered twice, for
"normalize" (which isn't in the XPath spec) and "normalize-space".

> > - adds the sum() function

It's bogus, I'll fix this soon.
I have some segfaults from time to time...

> > - doesn't seem there is a namespace support for functions
> > (last() is equivalent to foo:last() and bar:last()), it'll be
> > necessary for proprietary XPath extension functions.
>
> humm, do we really need namespace in that case, IMHO it should
> just be string comparisons.

I haven't yet looked at it in details but it seems if we want to extend
XPath we must use our own namespace. And 2 extension sets could have
functions with the same name, they only differ by their namespace. It seems
it's what the Apache Group done for Xalan and its extensions (the one
about database connectivity for example if I have good memory)
I'll check it in details.

> > - it seems impossible to pass node-sets (actually only relative
> > paths or abbreviated absolute paths, and the root node) to
> > functions: [...]
> gdb seems the only way to get this fixed . There is still a
> couple of evaluation problems, right.

Yes, I didn't have time yesterday to debug all this. I'll try to do it
this afternoon.

> You should double check later once I have commited your patches
> into CVS.

I won't neglect it!

Tom
...sincerely sorry...

----
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 : Thu Oct 26 2000 - 13:43:47 EDT