It looks as if the DOM implementation you are using (part of JTidy) doesn't implement the version of the DOM interface that Saxon is using (DOM level 3). Saxon tries to use DOM level 3 methods only if the implementation supports them, but in this case the exception thrown when the method is not there isn't one of the exceptions that Saxon is testing for. The code in net.sf.saxon.dom.NodeWrapper reads:
            try {
                Class[] argClasses = {Node.class};
                Method isSameNode = Node.class.getMethod("isSameNode", argClasses);
                Object[] args = {((NodeWrapper)other).node};
                Boolean b = (Boolean)(isSameNode.invoke(node, args));
                return b.booleanValue();
            } catch (NoSuchMethodException e) {
                // use fallback implementation
            } catch (IllegalAccessException e) {
                // use fallback implementation
            } catch (InvocationTargetException e) {
                // use fallback implementation
and it seems that AbstractMethodError should be added to the list.
Michael Kay

From: [] On Behalf Of Julien Chambert
Sent: 19 July 2006 15:28
Subject: [saxon] problem with xquery


      i'm new in use of Xquery. I have to parse a web site and i try to use xquery Api Saxon. but i have some problems with the exception generated:

     to made the query, I use a function wioch take in arguments the query and Document
here is the code:

         public static List runXQuery(Document dom, String query) throws XPathException {
        Configuration configuration = new Configuration();
        StaticQueryContext staticContext = new StaticQueryContext(configuration);
        XQueryExpression queryExpression = staticContext.compileQuery(query);
        DynamicQueryContext dynamicContext = new DynamicQueryContext(configuration);
        dynamicContext.setContextNode(new DocumentWrapper(dom, "", configuration));

        return queryExpression.evaluate(dynamicContext);

the exception generated :
Exception in thread "main" java.lang.AbstractMethodError: org.w3c.tidy.DOMElementImpl.isSameNode(Lorg/w3c/dom/Node;)Z
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke( :25)
    at java.lang.reflect.Method.invoke(
    at net.sf.saxon.dom.NodeWrapper.isSameNodeInfo(
    at net.sf.saxon.dom.NodeWrapper.compareOrder(
    at net.sf.saxon.sort.GenericSorter.quickSort1( :226)
    at net.sf.saxon.sort.GenericSorter.quickSort(
    at net.sf.saxon.sort.DocumentOrderIterator.<init>(
    at net.sf.saxon.sort.DocumentSorter.iterate (
    at net.sf.saxon.expr.ForExpression.iterate(
    at net.sf.saxon.query.XQueryExpression.iterator(
    at net.sf.saxon.query.XQueryExpression.evaluate (
    at hu.midori.kosmos.server.util.WebCrawlingUtils.runXQuery(

 and the query:

for $d in //table/tr
            { data(fn:normalize-space($d/child::td[1]/text())) }|
            { data(fn:normalize-space($d/child::td[2]/child::a/text())) }

Please, someone can explain me where is the mistake?

  perhaps my website can't be parsed with this technique. Are there conditions to parse html?