Re: [xml] XPath functions ignoring their name
- From: Thomas Broyer <tbroyer ltgt net>
- To: xml gnome org
- Subject: Re: [xml] XPath functions ignoring their name
- Date: Tue, 22 May 2001 17:37:06 +0200
Le 22/05/01 08:21:08, Daniel Veillard a écrit :
Not exactly. If I use, e.g., the EXSLT set:distinct() function, the
callback should be able to retrieve the local-name ("distinct') and
namespace URI ("http://exslt.org/sets") of the function.
Have a look to the example of func:function in the libxslt list to see
why I need this.
I'm pretty sure this can be found in the current OP evaluated in the
XPath module.
We can find the local name and the prefix. The prefix is resolved to the
namespace URI in xmlXPathCompOpEval. If the function can only access the
current OP, it must re-resolve the prefix into URI...
Extending the context is certainly cleaner at this point.
OK, something to keep in memory for libxml3 ...
I'll add two xmlChar* into xmlXPathParserContext (one for the local name,
the other for the namespace URI), modify xmlXPathCompOpEval to set/unset
them in «case XPATH_OP_FUNCTION» and provide two functions (or macros) to
access them inside an xmlXPathEvalFunc callback.
...except if you prefer just adding a pointer to the current OP and redo
the prefix->URI resolution in the callback function...
Tom.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]