Thanks for the reply, Dave.

I didn't believe you about it working with files but you're right :-)

Since, as you say, the XML is normalized to '\n', I was suprised that there
were '\r's being passed to XalanOutputStream. Maybe the platform line ending
conversion is happening too early in the process? Also, the output sent to
stderr is send to the XalanOutputStream containing only '\n's. This implies
that Xalan is expecting (hoping) no platform line ending conversion to
happen for stdout but is counting on in for stderr. Am I reading the
situation correctly?

Cheers,
Brian

Dave wrote:
> This is a really difficult problem to deal with when writing to
> stdout/cout.  Since XML normalizes everything to \n, we end up having to
> normalize back to \r\n on Windows.  Sometimes we can do it, and sometimes
> we can't.
>
> When writing to a binary file, it's not a problem, since we always open
> files in binary mode.  But cout is very problematic, because it's a text
> stream.  It's just another one of those endless Windows vs. Unix problems
> that's really difficult to deal with.  It's also a huge performance issue,
> since we have to examine and escape every character as it's serialized.
>
> If you have any suggestions, I'm all ears...
>
> Dave

Reply via email to