xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abel Braaksma <abel.onl...@xs4all.nl>
Subject Re: Problem with Asian Language fonts
Date Wed, 09 Jul 2008 13:52:59 GMT
Rakesh Kumar S wrote:
> Thanks a lot John...
> it worked fine...
>
> Now should i do this conversion every time ...
> Because XML stores this as &amp; but i need this as & while converting as PDF

XML does not store anything (XML is a meta language and does not have 
actions on its own). Your problem is either when you store it to the 
database (you say that you escape the data) or when you retrieve it back 
(using Castor, as you stated in your original question). At some point, 
you have a character, say "€" (euro symbol), it gets escaped to &#128;, 
which gets escaped to &amp;#128; (a second escape which is not proper). 
It may even be escaped one more time, storing it in the database as 
&amp;amp;#128;.

To get out of this mess do the following:

1. Always check your data using a text editor (DO NOT USE A BROWSER TO 
VIEW XML!)
2. Make sure you do not escape at all anymore (!!!)
3. Before storing it in the database, use XSLT (or a tool) to store the 
XML as XML with encoding "US-ASCII", this will effectively escape all 
higher characters (above ASCII 127).
4. When retrieving it from the database, either do nothing (use the XML 
with the encoding US-ASCII should be just fine to Apache FOP or any 
other XML capable process), or transform it to XML with encoding UTF-8 
for readability. Most (XSLT/tool) processors will remove the entities to 
their UTF-8 character counterparts, but they are not required to do so!

Regardless: do not escape by hand, only use XML tools and set the 
encoding to something your database can store. That way, you do not have 
to worry about silly double / triple up or down conversions.

HTH,

Cheers,
-- Abel --

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


Mime
View raw message