cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <>
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
'&' '#' '2' '2' '0' ';'.  The text serializer send these characters
to the output.  The XML serializer has to ensure that the output is
XML and escapes the '&' as "&amp;".

To solve your immediate problem you can fixup the database input by
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
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
than Latin-1 or Unicode plain text.  Can't you just fix the database

HTH, Alfred.

-----Original Message-----
From: Dingjun Jia [] 
Sent: Dienstag, 11. Juli 2006 21:38
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"/> 

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
file, and the text in this xml file is then &amp;220; .

which possibilities should I try to tweak the xsp? 

To unsubscribe, e-mail:
For additional commands, e-mail:
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:
For additional commands, e-mail:

View raw message