Project

Profile

Help

Saxon API Serializer - [Saxon 9.005 Java]

Added by Anonymous over 15 years ago

Legacy ID: #6709988 Legacy Poster: pvallone (pvallone)

Hi, I am using Saxon 9.005 API for Java embedded in my application. I use the a Serializer to output the resulting file: Serializer out = new Serializer(); Do I need to close or dispose this instance of the Serializer? After transformation, I try to open the resulting file, but I get an error that the file is being used by another application. This usually means that I have not closed or disposed of an object. Any thoughts? Thx Phil


Replies (2)

RE: Saxon API Serializer - [Saxon 9.005 Java] - Added by Anonymous over 15 years ago

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

If you supply an OutputStream or Writer as the output destination, you should close it yourself. (Saxon's general principle is that whoever creates a stream should also close it.) If you supply a File, Saxon should close the output, and I don't think it is currently doing so. I've fixed this for the 9.2 release, but I think it's probably a bit difficult/risky to patch for 9.1. In the meantime, please supply a FileOutputStream and close it yourself after use.

RE: Saxon API Serializer - [Saxon 9.005 Java] - Added by Anonymous over 15 years ago

Legacy ID: #6750702 Legacy Poster: pvallone (pvallone)

Will do, Thanks Phil

    (1-2/2)

    Please register to reply