Hello,
I'm working with a javax.xml.stream.events.XMLEvent in batch within a class that implements the ItemWriter interface. The XMLEvent was created and populated via a StAX XMLEventReader which had parsed a UTF-8 XML file. It is a StartElement event type.
The XMLEvent has a writeAsEncodedUnicode(Writer w) method that will format it's contents as an XML string and write it to your writer. It works great when running on Windows, but on UNIX - the XML string is not written out (the method does not throw an exception either). Anyone have an ideas for how to make it work on UNIX?
Here's the call:
Here's a javadoc note for the method:Code:private static FileWriter reportWriter; : currentElement.writeAsEncodedUnicode(reportWriter);
Based on what I see, I see no reason why it should not work on UNIX. I appreciate any comments.This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.
Thanks!
Mike


Reply With Quote
