cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <Alfred.Nathan...@swx.com>
Subject RE: How to avoid the encoded text &#220 in pdf generation
Date Wed, 12 Jul 2006 12:27:27 GMT
Sure, that all figures.  You read from the database the character
sequence
'&' '#' '2' '2' '0' ';'.  The text serializer send these characters
verbatim
to the output.  The XML serializer has to ensure that the output is
wellformed
XML and escapes the '&' as "&amp;".

To solve your immediate problem you can fixup the database input by
global
replaces in the XSP such as

    text = text.replaceAll("&amp;#220;", "\u00DC");

Note that the &amp; syntax is necessary in an XSP source file.  In a
plain
Java file it would be

    text = text.replaceAll("&#220;", "\u00DC");

If you have a lot of different umlauts to fix it may be worthwhile to
program a function to handle all &#...; with a single regex.

The question remains why the database contains serialized XML text
rather
than Latin-1 or Unicode plain text.  Can't you just fix the database
content?

HTH, Alfred.

-----Original Message-----
From: Dingjun Jia [mailto:dingjun.jia@gmail.com] 
Sent: Dienstag, 11. Juli 2006 21:38
To: users@cocoon.apache.org
Subject: AW: How to avoid the encoded text &#220 in pdf generation 

The text in the database is &#220; and not modified by the JDBC driver,
because if i use the following, I get text &#220.
<map:match pattern="test.txt">
<map:generate src="test/test.xsp" type="serverpages"/>
<!-- In the test.xsp i just only used esql to get the data from databse.
-->

<map:serialize type="text"/> 
</map:match>


If i use xml serializer, not text serilaizer, i get text &amp;#220; .
 
So i suspect, the transform step (<map:transform src="test/pdf.xsl"
type="xslt" />) expects a xml file, so the first step 
(<map:generate src="test/test.xsp" type="serverpages"/>) will generate a
xml
file, and the text in this xml file is then &amp;220; .

which possibilities should I try to tweak the xsp? 
Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message