XsltTransformer & result-document
Added by Anonymous almost 18 years ago
Legacy ID: #4038366 Legacy Poster: paul.middleton (paul__middleton)
Hello, I'm currently running into an issue with the XsltTransformer class when the xslt I am trying to run contains an xsl:result-document element. I am trying to cache the XsltTransformer object so I don't have to recreate it the next time I run the transform. The problem is that the second time I call the run method I get the following error. "Cannot write more than one result document to the same URI, or write to a URI that has been read:" If the xslt does not contain an xsl:result-document element I can reuse the XsltTransformer object multiple times just fine. Is there something I have to do to reset the XsltTransformer object when the xslt contains an xsl:result-document, or should I just cache the XsltExecutable object and recreate the XsltTransformer object each time I want to use the stylesheet? Thanks, Paul
Replies (1)
RE: XsltTransformer & result-document - Added by Anonymous almost 18 years ago
Legacy ID: #4038748 Legacy Poster: Michael Kay (mhkay)
There is possibly some tidying up I could do to make the XsltTransformer serially reusable. However, I don't believe there is any significant advantage to be gained by reusing it (indeed, there may be a cost in keeping unneeded objects locked in memory) and my advice would be to create a new XsltTransformer for each transformation. Reusing the XsltExecutable, by contrast, is extremely important.
Please register to reply