File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Stopping STAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Stopping STAX" Watch "Stopping STAX" New topic
Author

Stopping STAX

igwe kalu kalu ogba
Ranch Hand

Joined: Feb 03, 2005
Posts: 133
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.
 
Consider Paul's rocket mass heater.
 
subject: Stopping STAX
 
Similar Threads
how to extract part of data from XML file
Parsers
APIs or any wrapper over SAX to avoid dirty code
xml parsers does not read such a large file contents
is there any other tech to replace XPATH+DOM?