Re: [xml] XPath functions ignoring their name

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 ("";) 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...


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