File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAX Parser How to break once i get required values

 
Sanjay Ra
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using a SAX Parser (xerces) .
I dont need to parse the entire XML and would like to stop parsing once i get certain values.
How could i do this?

thanks
Sanjay
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could just throw some custom RuntimeException and catch it outside the call to parse(). Certainly not too pretty but at least it works.
 
Sanjay Ra
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is this the only way ?

thanks!
Sanjay
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic