How to resolve entities in a SAX parser - please help
I am using the following code to create a SAX parser. My only problem is that I don't know how to assign an entity resolver to it. I know how to create an EntityResolver class with the resolveEntity method, but I don't know how to apply it to the parser, as SAXParser objects do not have a setEntityResolver method like the DocumentBuilder class does.
Here is the code:
So how would I go about setting an EntityResolver to the saxParser object?
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
InputStream in = new URL(url).openStream();
saxParser.parse(new File("c:\\java\\corejava2\\Chapter2\\SAXTest\\test.xhtml"), handler);
Thanks for your help, I greatly appreciate it!