Is there any reason why I should use a XMLReader with the SAXParser? I'm seeing this kind of usage quite a lot:
sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
LoginContentHandler uch = new LoginContentHandler();
xr.setContentHandler(uch);
xr.parse(new InputSource(in));
I always use the parser this way:
sp = spf.newSAXParser();
DefaultHandler dh = new LoginContentHandler();
sp.parse(in, dh);
Any particular reason? Just wondering because my way is shorter, and I don't really see why I should use a XMLReader.