You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Konstantin Priblouda <kp...@yahoo.com> on 2002/10/05 15:05:11 UTC

Problem with ampersands

Hi guys, 

Mu customer used ampersand in their data and promptly
report generation with FOP failed.

Now I'm looking for solution to escape occuring
ampersands. Shall I wrap everything in CDATA sections
( and thus lose possibility to use entities ) or is
there better solution to this problem?

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Re: Problem with ampersands

Posted by Konstantin Priblouda <kp...@yahoo.com>.
> How do you get the data? If you read strings from a
> database,
> copy the string character by character and replace &
> with
> &amp; and < with &lt; while doing so. If you get
> files or
> something, use a stream editor.

I generate XSL-FO on the fly with velocity out of
my EJB data, and then fed it directly to FOP
Maybe I shall hack velocity to do automatically xml
escaping.

thanks,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Re: Problem with ampersands

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Konstantin Priblouda wrote:
> Mu customer used ampersand in their data and promptly
> report generation with FOP failed.
> 
> Now I'm looking for solution to escape occuring
> ampersands. Shall I wrap everything in CDATA sections
> ( and thus lose possibility to use entities ) or is
> there better solution to this problem?

How do you get the data? If you read strings from a database,
copy the string character by character and replace & with
&amp; and < with &lt; while doing so. If you get files or
something, use a stream editor.

It might be a question for XML-dev though.

J.Pietschmann