Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stopping STAX

 
igwe kalu kalu ogba
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am using the Stax parser to browse an xml document. Whenever a certain element is found, the attributes of that element are used to call a webservice. I am doing this on a JSP page. Now, I would like to add a stop button to my page. Such that, if the user clicks on the Stop button, the stax parser will stop streaming the info completely.
Inorder to read a file in stax, I normally use::



Should I just user parser.close() to stop the xml file from being read?
If so, does this mean that parser has to be declared as a class variable a la public XMLStreamReader parser;?

Please note that the page is resubmitting to itself when the parser reads the file. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic