Testing generator encoding problem

2004-02-13 Thread zheng jianjun
Hi ,

When testing cocoon 2.1.3 , I had the following problem . It's OK when read-in the static XML file pages/16.xmlin codepage "gb2312" by generator "file" , but notwork by the testing generator "test", which actually callLinux command "cat /./pages/16.xml" , the html did
generatedin IE , butno Chinese shown. Any advise , please ?

OS : Redhat 8.0 , locale="en_US.iso88591"
JDK 1.4.2_02-b03
Cocoon 2.1.3

web.xml :

 init-param param-namecontainer-encoding/param-name param-valueiso-8859-1/param-value /init-param init-param param-nameform-encoding/param-name param-valueiso-8859-1/param-value /init-param


sitemap.xmap :

!-- the testing generator , it is call "cat //pages/16.xml" ,then feeds it to the pipe --

map:pipelinemap:match pattern="result/*.test"map:generate type="test"/map:transform src=""/map:serialize type="html"//map:match/map:pipeline

map:pipelinemap:match pattern="result/*.html"map:generate src=""/map:transform src=""/map:serialize type="html"//map:match/map:pipeline
My static16.xmlis something like:

?xml version="1.0" encoding="GB2312"?report header title 40.13 (B) /title user MFG /user time 01/13/04 13:04:13 /time /header.
/report

report.xsl is something as the following:

?xml version="1.0"? !DOCTYPE stylesheet [!ENTITY nbsp "#x00A0;"]xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xsl:output method="html"   version="4.01"  doctype-public="-//W3C//DTD HTML 4.01//EN"  doctype-system="http://www.w3.org/TR/html4/strict.dtd" encoding="gb2312"  indent="yes"/
xsl:template match="report" html headtitleWIP Reports/title/head.
It's OK to input URL http://localhost:8080/cocoon/result/16.html in IE ,
but http://localhost:8080/cocoon/result/test.test won't work .

Thanks in advance.
Jianjun Zheng.Do You Yahoo!?
60

Re: Testing generator encoding problem

2004-02-13 Thread Stefan Burkard
hi

i'm not sure, but i think if your test-generator reads the file with the
cat-command, it is not unicode-aware. your redhat-locale is iso8859-1
and i think the unix-commands use this encoding to read and write files.

if this is true, your gb2312-characters get corrupted when cat reads in
the file, because it reads with iso8859-1

greetings
stefan

zheng jianjun wrote:
 Hi ,
  
 When testing cocoon 2.1.3 , I had the following  problem . It's OK when 
 read-in the static XML file pages/16.xml in codepage gb2312 by 
 generator file , but not work by the testing generator test, which 
 actually call Linux command cat  /./pages/16.xml , the html did
 generated in IE , but no Chinese shown. Any advise , please ?
  
 OS : Redhat 8.0 , locale=en_US.iso88591
 JDK 1.4.2_02-b03
 Cocoon 2.1.3
  
 web.xml :
 
 init-param
   param-namecontainer-encoding/param-name
   param-valueiso-8859-1/param-value
 /init-param
   
 init-param
   param-nameform-encoding/param-name
   param-valueiso-8859-1/param-value
 /init-param
 
  
 sitemap.xmap :
  
 !-- the testing generator , it is call cat //pages/16.xml , then 
 feeds it to the pipe --
  
  map:pipeline
  map:match pattern=result/*.test
  map:generate type=test/
  map:transform src=stylesheets/report.xsl/
  map:serialize type=html/
  /map:match
  /map:pipeline
  
  map:pipeline
  map:match pattern=result/*.html
  map:generate src=pages/{1}.xml/
  map:transform src=stylesheets/report.xsl/
  map:serialize type=html/
  /map:match
  /map:pipeline
 
 My static 16.xml is something like:
  
 ?xml version=1.0 encoding=GB2312?
 report
 header
title
   40.13 (B)
/title
user
MFG
/user
time
   01/13/04 13:04:13
/time
 /header
 .
 /report
  
 report.xsl is something as the following:
  
 ?xml version=1.0?
 !DOCTYPE stylesheet [
 !ENTITY nbsp #x00A0;
 ]
 xsl:stylesheet version=1.0 
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xsl:output method=html
 version=4.01
  doctype-public=-//W3C//DTD HTML 4.01//EN
  doctype-system=http://www.w3.org/TR/html4/strict.dtd;
  encoding=gb2312
  indent=yes/
 xsl:template match=report
 html
 headtitleWIP Reports/title/head
 .
 It's OK to input URL  http://localhost:8080/cocoon/result/16.html in IE ,
 but http://localhost:8080/cocoon/result/test.test won't work .
  
 Thanks in advance.
 Jianjun Zheng.
 
 
 
 *Do You Yahoo!?*
 60 
 http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.mail.yahoo.com



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