Hi,

I couldn't find a bug filed against problem this so I thought I'd ask the
group if anyone has encountered before. I'm using Xalan 1.1/Xerces 1.4.

It looks like the problem is that XalanOutputStream is being passed string
containing platform line endings in some cases and UNIX line endings in
others. When XalanOutputStream forwards the buffer to cout, cout translates
"\n" => "\r\n" so this problem happens.

Here is my stylesheet (Windows line endings):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
    <xsl:output indent="no"/>
    <xsl:template match="test">
    <xsl:value-of select="text()"/>
    </xsl:template>
</xsl:stylesheet>

And source (Window line endings):
<?xml version="1.0" encoding="UTF-8"?>
<test>
This
is
a
test
</test>

Output:
<?xml version="1.0" encoding="UTF-8"?>\r\r\n
This\r\r\n
is\r\r\n
a\r\r\n
test\r\r\n

Reply via email to