Bug #3856
closedPremature end of primary result serialization
0%
Description
Recent refactorisation of the transformer->destination interface, pushing the responsibility for receiver closure onto Destination.closeAndNotify()
appears in at least one instance, not to be flushing the XMLEmitter.writer
buffer.
The circumstances appear difficult to minimise (it's the XSLT-based compiler running, carrying out a normal XML serialization to primary output, with no additional result documents), but in this case in XSLT30Transformer.applyTemplates()#305
at the invocation of destination.closeAndNotify()
, the Receiver sOut
(which is actually a CloseNotifier
) has a trail:
RegularSequenceChecker -> SequenceNormalizerWithSpaceSeparator -> XMLIndenterPE -> XMLEmitter
with a UTF-8Writer
as the writer
field of the XMLEmitter
and for which the buffer hasn't been flushed to the file output stream.
destination
is a Serializer
whose helper
field is a DestinationHelper
with no listeners
. Consequently on closeAndNotify()
the output stream is closed and no action is taken on flushing or closing the UTF8Writer
, which in any case would have to happen before the stream was closed.
As a temporary measure restoring a sOut.close()
action before destination.closeAndNotify()
fixes the issue, but I think something elsewhere might be better.
Please register to edit this issue