hello,

      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(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at net.sf.saxon.dom.NodeWrapper.isSameNodeInfo(NodeWrapper.java:200)
    at net.sf.saxon.dom.NodeWrapper.compareOrder(NodeWrapper.java:278)
    at net.sf.saxon.sort.LocalOrderComparer.compare(LocalOrderComparer.java:30)
    at net.sf.saxon.sort.DocumentOrderIterator.compare(DocumentOrderIterator.java:53)
    at net.sf.saxon.sort.GenericSorter.quickSort1(GenericSorter.java :226)
    at net.sf.saxon.sort.GenericSorter.quickSort(GenericSorter.java:183)
    at net.sf.saxon.sort.DocumentOrderIterator.<init>(DocumentOrderIterator.java:34)
    at net.sf.saxon.sort.DocumentSorter.iterate (DocumentSorter.java:66)
    at net.sf.saxon.expr.ForExpression.iterate(ForExpression.java:514)
    at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:199)
    at net.sf.saxon.query.XQueryExpression.evaluate (XQueryExpression.java:119)
    at hu.midori.kosmos.server.util.WebCrawlingUtils.runXQuery(WebCrawlingUtils.java:98)

 and the query:

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

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?