xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: Xalan/Xerces question.
Date Mon, 21 Feb 2000 19:36:12 GMT
I can't speak to your exact error below, except that you might want to try
using an absolute XPath ("/test/foo") rather than a relative ("test/foo").
One of the ozone guys forwarded me this code snippet:

    protected static final NodeList getNodesByXPath(Node node, String
path) throws Exception {
        XPathSupportDefault xpath_support = new XPathSupportDefault();
        XPath xpath = new XPath(xpath_support,null);
        XPathProcessorImpl parser = new XPathProcessorImpl(xpath_support);
        xpath.installFunction("document", new
        XObject xobject = xpath.execute(xpath_support,node,null);
        return xobject.nodeset();

and it works like a champ for me.

- donald

View raw message