java - Retrieve data being parsed by SAXParser on runtime -


i have method parse xml data inputstream

 public static void parsexml(inputstream stream, defaulthandler handler) {     try     {         saxparserfactory factory = saxparserfactory.newinstance();         factory.setvalidating(false);         saxparser parser = factory.newsaxparser();          parser.parse(stream, handler);     }     catch (parserconfigurationexception pce)     {         // code here     }     catch (saxparseexception spe)     {         // if exception caught, log current data being parsed saxparser here     }     catch (saxexception se)     {          // if exception caught, log current data being parsed saxparser here     }     catch (ioexception ie)     {         // code here     } } 

is there anyway log data being parsed saxparser whenever saxparseexception/saxexception caught?


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -