Re: JDK1.5 Xpath problem
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Fri, 15 Sep 2006 19:07:11 +0200
abcd_68@xxxxxxxxxxx wrote:
However, if I unplug the network, I get (after a *long* timeout) a
java.net.SocketException. I looked around and I found out that I have
to define a class implementing EntityResolver to change the default
behaviour (i.e., fetch the DTD over the net) and obtain an InputSource
from it.
Now my problem is: How do I do it? Neither in javax.xml.xpath.XPath nor
in javax.xml.xpath.XPathFactory did I find an appropriate place nor did
I find a method to gain access to the underlying SAX parser.
I don't know how to do it if you pass an InputSource to the evaluate method. You can however also pass in an object where the object is a W3C DOM Node. And if you look at DocumentBuilder it has a method setEntityResolver. That should allow you to create a DOM Document without fetching the DTD from the remote host, and you can then pass in the Document to the evaluate method. I am not sure a DOM Node/Document is the most efficient data structure to do XPath on but at least that approach might work for your problem.
--
Martin Honnen
http://JavaScript.FAQTs.com/
.
- Prev by Date: "value substitution/population" in template XML using XPath
- Previous by thread: "value substitution/population" in template XML using XPath
- Index(es):
Relevant Pages
|