Re: [xml] RFE: support for function here() in XPath

Cool! Thanks!!!


Daniel Veillard wrote:
On Sat, Mar 09, 2002 at 06:49:41AM -0800, Aleksey Sanin wrote:

I am working on XMLDSig implementation and I need some help from you.
A new XPath function here() was introduced by this standard:
Will it be possible to add this function to libxml2?

It is there, as part of XPointer, but you need to do a bit of work:
- you need to register it in your XPath context
xmlXPathContextPtr ctxt;

xmlXPathRegisterFunc(ctxt, (xmlChar *)"here",
- you need to provide a pointer to the node within the context:
ctxt->here = here;

Both are done in xmlXPtrNewContext() in xpointer.c f you want to have a look,
the implementation of here() itself is trivial, this should work as is without
need for a patch.

It's funny for me to see this, for historical reasons based on my previous
work in the W3C XML Linking WG.


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