You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Asankha C. Perera (JIRA)" <ji...@apache.org> on 2008/01/07 07:00:37 UTC

[jira] Updated: (SYNAPSE-215) XSLTMediator doesn't handle text output correctly

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

Asankha C. Perera updated SYNAPSE-215:
--------------------------------------

    Fix Version/s: 1.2

postponing to fix post 1.1.1

> 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: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org