[ 
https://issues.apache.org/jira/browse/SYNAPSE-215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen resolved SYNAPSE-215.
-------------------------------------

    Resolution: Fixed

> XSLTMediator doesn't handle text output correctly
> -------------------------------------------------
>
>                 Key: SYNAPSE-215
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-215
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: NIGHTLY
>         Environment: Mac OS X
>            Reporter: Andreas Veithen
>             Fix For: 1.2
>
>         Attachments: 
> TEST-org.apache.synapse.mediators.transform.XSLTMediatorTest.xml, 
> text-enc-test-patch.txt
>
>
> When the output of the XSL transformation is text rather than XML, 
> XLSTMediator uses ByteArrayOutputStream#toString to retrieve the generated 
> content. According to the Javadoc, toString transforms "bytes into characters 
> according to the platform's default character encoding". However, nothing 
> guarantees that the XSLT processor uses the same encoding when writing to the 
> ByteArrayOutputStream. Indeed, on my Mac OS X environment, the default 
> platform encoding is MacRoman, while Xalan chooses UTF-8 as output encoding. 
> This causes all non ASCII characters to be corrupted.
> Also, XLSTMediator always tries to parse the output as XML and only falls 
> back to text when an error occurs. This strategy is not optimal and could 
> lead to unexpected results. XSLTMediator should switch between XML and text 
> output by determining the output method specified in the stylesheet. It 
> should be possible to achieve this by using Transformer#getOutputProperty.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to