Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-215

XSLTMediator doesn't handle text output correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • NIGHTLY
    • 1.2
    • Core
    • None
    • Mac OS X

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            veithen Andreas Veithen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: