I have a very large xml file to be parsed. This file needs to be parsed every hour by 6 different modules in the application. Each module parses it differently(basically we are using SAX and the content handler for each module is different) Is it possible to have a generic parser parse the file once and call the different content handlers depending upon some criteria instead of parsing it 6 times. We have just started to think about this architecture and any idea is welcome.
Thanks Lasse, This should work. Also, I was looking at the XMLFilter class. Looks like this class works more like a pipe and events can flow from one reader to another. It does not help much when we have more than one reader at the same level in the hierarchy. Am I right here ?
Umm. I've never used XMLFilter and really can't say what it's meant for... Based on the API of XMLFilterImpl, though, it looks like you could use the exact same code that I posted but only type "extends XMLFilterImpl" instead of "extends DefaultHandler".