DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10326>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10326

Encoding Problems with XALAN





------- Additional Comments From [EMAIL PROTECTED]  2002-06-29 06:40 -------
hi Gary,

First of all thanx for replying.U see i have already specified the encoding 
format of utf-8 in the XSL file.Also i have tried passing the ByteArrayOutput 
Stream directly  into the StreamResult Constructor.But its not working .the 
encoding is still lost.I am attaching the snippets of the XSL file and the code 
that u suggested for Transforming.

//***************************************************************
//XSL FILE

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

<xsl:output method="html" version="1.0" encoding="utf-8"/> 

<xsl:template match="/">

<tr>
<td>
<table border="0" width="100%">

    <xsl:apply-templates select="SUMMARY/CAT"/>

</table>
</td>
</tr>

</xsl:template>

//***************************************************************
//TRANSFORMER CODE.

        String htmlString = null;

        //Getting the StreamResult.
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        StreamResult htmlResult = new StreamResult(baos);
        
        // get the transformer factory
        TransformerFactory tFactory = TransformerFactory.newInstance();

        // get the transformer object set with XSL
        Transformer transformer = tFactory.newTransformer(xslSource);

        //Use transformer to convert XML to HTML
        transformer.transform(xmlSource, htmlResult);

        //Getting back the populated Output Stream.
        baos = (ByteArrayOutputStream)htmlResult.getOutputStream();
        
        //Getting the html string.
        htmlString = baos.toString();

        //Returning the String.
        return htmlString; 

//***************************************************************

Waiting for ur reply.

Thanx and Regards.
Pradnesh Alve.

Reply via email to