Wong Kok Wai wrote: > When I parse two documents that uses the same DTD consecutively, > and I use the same instance of my implementation of EntityResolver, > a "stream closed" exception is thrown. The workaround is to create > a new instance for each document. This is rather inefficient as the > same DTD is used and one instance of entity resolver implementation > is sufficient IMHO. Is this a feature or a bug?
You can use the same instance of your EntityResolver but it sounds like you're caching the same instance of the returned InputSource. Is this true? If you are caching the DTD to return from the EntityResolver, you should cache the entire contents of the stream into memory and then create new InputSource objects whose input stream read from memory. Every call to EntityResolver should return a new InputSource. -- Andy Clark * IBM, JTC - Silicon Valley * [EMAIL PROTECTED]
