cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yury Mikhienko <yu...@mobicomk.donpac.ru>
Subject support non-english characters in HSSFSerializer
Date Thu, 13 Mar 2003 14:18:06 GMT
Hi all!

Sorry for jumping into your discussion, but I had the same problem a while back :((
I am using cocoon v.2.0.4 and trying to create an ms-exel document using non-english characters
but HSSFSerializer 
does not work properly (as in cocoon v2.0.2). In created document I get the corrupted symbols
instead of russian text :((

in sitemap I set the following:

    <map:serializers default="html">
     <map:serializer name="xls" src="org.apache.cocoon.serialization.HSSFSerializer" mime-type="application/vnd.ms-excel">
       <encoding>UTF-8</encoding>
     </map:serializer>
    </map:serializers>

if I set the encoding to KOI8-R, I get some problems.

my page2xls.xsl:

<?xml version="1.0" encoding="KOI8-R"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                             xmlns:gmr="http://www.gnome.org/gnumeric/v7" >

  <xsl:param name="view-source"/>

  <xsl:template match="page">
   <gmr:Workbook xmlns:gmr="http://www.gnome.org/gnumeric/v7">
     <gmr:Sheets>
         <gmr:Sheet DisplayFormulas="false" HideZero="false" HideGrid="false" HideColHeader="false"
HideRowHeader="false" DisplayOutlines="true" OutlineSymbolsBelow="true" OutlineSymbolsRight="true">
                 <gmr:Name><xsl:value-of select="title"/></gmr:Name>
                 <gmr:MaxCol>2</gmr:MaxCol>
                 <gmr:Cols DefaultSizePts="100">
                     <gmr:ColInfo No="0" Unit="100" MarginA="2" MarginB="2" Count="7"/>
                 </gmr:Cols>
                 <gmr:Rows DefaultSizePts="12.8">
                        <gmr:RowInfo No="0" Unit="12.8" MarginA="0" MarginB="0" Count="9"/>
                        <gmr:RowInfo No="10" Unit="12.8" MarginA="1" MarginB="0" Count="24"/>
                 </gmr:Rows>
                 <gmr:Cells>
                        <xsl:apply-templates select="content"/>
                 </gmr:Cells>
        </gmr:Sheet>
     </gmr:Sheets>
    </gmr:Workbook>
  </xsl:template>

  <xsl:template match="content">
     <gmr:Cell Col="0" ValueType="60" Row="0">
       <gmr:Content>
                <xsl:text>ั‚ะตัั‚</xsl:text>
        </gmr:Content>
     </gmr:Cell>
  </xsl:template>
</xsl:stylesheet>

Where I'm wrong? Can anyone help me?
Thanks for advice.


-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

Mime
View raw message