Project

Profile

Help

Transformer.reset()

Added by Anonymous about 16 years ago

Legacy ID: #3164362 Legacy Poster: Damien Hollis (dphollis)

Hi Michael, I'm currently working on a project to migrate from using Xalan to use Saxon. In the process we are changing our code to JAXP exclusively; so that we can easily change the underlying implementation as necessary. So far everything is working except when we try to reset() the Saxon Transformer (Controller). I noticed in the mail archive that you intend to implement the Transformer.reset() method in a future release of Saxon. Can you tell me what release and when it will be available? In the same post you suggested that you wouldn't clear the document pool. I have some concerns about this: - first, the documentation for reset() says that it should return the transformer to the same state that it would be in if it were newly created - therefore the document pool should be empty. - second, we cache the transformers and reuse them frequently. If the reset() method doesn't clear the document pool we'll end up with huge document pools which will affect overall performance in the long run. As mentioned above, we don't want to have any implementation specific code, therefore we don't want to have to call clearDocumentPool(). Have you had further thoughts on this? Do you agree with my concerns? Regards, Damien


Replies (1)

RE: Transformer.reset() - Added by Anonymous about 16 years ago

Legacy ID: #3164634 Legacy Poster: Michael Kay (mhkay)

reset() will be in the next version, I don't yet have a release date for that but it's not imminent. It's not obvious what the right design is here. The spec does indeed say that reset() leaves the transformer in the same state, but I take that to mean the logical state; it doesn't mean that you can't re-use resources that have been cached. In fact, if you don't re-use cached resources, there seems no point at all in reusing the same Transformer rather than creating a new one. I would recommend that you create a new Transformer for each transformation.

    (1-1/1)

    Please register to reply