[Home] [By Thread] [By Date] [Recent Entries]
Dear colleagues. I am a newbie.
I hope to be helped here. My java-code doesn't work.
public class XGLanls {
public void analyse(String filename) {
try {
File f = new File(filename);
InputSource is = new InputSource(f.toURL().toString());
HandlerBase h = new MyHandler();
Parser p = ParserFactory.makeParser("org.apache.xerces.parsers.SAXParser");
p.setDocumentHandler(h);
p.setErrorHandler(h);
p.parse(is);
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
}
It gives the exception
java.lang.NullPointerException
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1094)
at com.wolf.tra.xglanls.XGLanls.analyse(XGLanls.java:32)
|

Cart



