[
Lists Home |
Date Index |
Thread Index
]
Hi all. I'm working with JAXP and SAX2, trying to use a custom entity
resolver, and failing. So far as I can tell, the resolver is not actually
ever getting any calls to resolveEntity(), so I assume I'm not setting it
properly and the parser doesn't know about it.
I'm having trouble finding good documentation for how to go about this --
the doc I've mostly seen seems to refer to SAX1. What I'm doing is:
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
[...]
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
XMLReader xmlReader = parser.getXMLReader();
MyEntityResolver er = new MyEntityResolver();
xmlReader.setEntityResolver(er);
parser.parse (new InputSource (...), handler);
[...]
(JDK 1.4.)
I'd be very appreciative if someone could tell me what's going wrong.
Thanks,
Jessica
|