Is there a reason why I should use XMLReader with SAXParser? I see this 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 specific reason? Just interesting because my path is shorter and I really don't understand why I should use XMLReader.
source
share