[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: Attn Mike Kay (was using dom.Document as SAXON source)


Subject: RE: Attn Mike Kay (was using dom.Document as SAXON source)
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 21 Dec 1999 15:36:44 -0000

> The other problem I've encountered is with XMLEmitter, which calls
> close() on the Writer it is using inside the endDocument() method.
> I'm not sure if this is a good idea, mainly because that class is
> not responsible for calling open() (or init()) in the first place.
> It also prevents people from outputting more data using that writer.

This area has been problematic for a while, I've never quite sorted out a
satisfactory approach that works well in all cases. If I don't close the
writer, it sometimes doesn't get flushed and output is therefore lost. If I
do close it, it stops it being used again, and in the case of System.out it
seems to mean that subsequent output to System.out gets lost. The correct
approach is probably roughly along the lines of: if the user supplies a
writer, it's the user's responsibility to close it after use, if they supply
a filename, it's the system's. Any suggestions welcome.

Mike Kay

P.S. As those of you on the SAXON mailing list will know, SAXON 5.1 is now
available: includes bug fixes and multithreading.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread