[Home] [By Thread] [By Date] [Recent Entries]
Title: Reusing a JAXP SAX parser hi I have a situation where I'm parsing many instances of a document conforming to a given schema.
I'm able to reuse the same parser without any problems, but I'm concerned that I may be experiencing uncessary overhead in processing the schemas associated with the document I'm parsing. I'm using the following to setup my parser i.e. using JAXP: SAXParserFactory spf = SAXParserFactory.newInstance();
for each document input stream: parser.parse(inputStream, handler); I find that my entity resolver gets called for each schema in the list of schemas for each document I process (which I guess isn't suprising given that the entity resolver is a feature of the handler which is passed into the parse call). However, this means that the parser is presumably parsing the same schema instance for every document. It would be nice if the parser could be setup with the schemas just once. My underlying parser is xerces 2.2 Is this just something I shouldn't be worried about? Is is something that can be accomplished by using the parser's native interface? Thanks
|

Cart



