Reputation: 1534
I use Apache digester to parse a big XML file. I need to gracefully stop parsing the XML when some particular tag value is found. In my case it's a kind of metadata at the beginning of the XML.
The only solution I've found so far is to create a rule which throws an Exception. But I feel it is rather hack than proper solution.
Can I tell the Digester to stop processing and skip the rest of XML?
Upvotes: 0
Views: 106
Reputation: 86774
You are looking for a way to short-circuit normal processing when a terminating condition is encountered. An exception, which you catch in the driver, is the way to go.
Upvotes: 1