Hi Paul

From: "Paul Caton" <[EMAIL PROTECTED]>
> We are looking at using dom4j in an application that deals with
> arbitrary sections of an XML-encoded document. I just wanted to ask,
> in the API for XPath, does the phrase "XPath expression" cover only
> the functions defined in XML Path Language 1.0, or does it also cover
> the functions added to the XPath syntax by section 5.4 of the the
> XPointer draft specification ("range-to", etc.)?
> I'm kind of assuming
> it doesn't, as XPointer isn't mentioned in the API doc. If this is
> true, are there any plans to cover these functions in the near future?

I'd certainly like to have full XPointer support in dom4j if possible.
(XInclude and XLink would be nice too, along with XML Signature). I'll add
implementing XPointer to the to do list.

I'd be happy for the XPath engine to support all the XPointer functions by
default providing the implementation does nothing detrimental to other
users. I've not looked too deeply at XPointer but from what I saw it
shouldn't be too hard to implement in dom4j.

If anyone fancies implementing some of the XPointer functions, please email
them to this list and we'll include them in the standard distribution.

To add a particular function to the XPath engine in dom4j you can install it
with the following code:-

import org.dom4j.xpath.XPathFunctionContext;

public class Foo {

    static {
        // install new XPath functions

        XPathFunctionContext.getInstance().addFunction( "my-function", new
MyFunction() );
        XPathFunctionContext.getInstance().addFunction( "my-function2", new
MyFunction2() );
    }
}

Or it might be easier to patch your local copy of XPathFunctionContext to
add your functions there.

To see how to implement a function try looking at some of the existing
implementations in org.dom4j.xpath.function.

James



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to