[reportlab-users] How do I print a '&'?

Martin_Simon reportlab-users@reportlab.com
Mon, 13 Sep 2004 19:04:58 +0200


Or try this:

from xml.sax.saxutils import escape
story.append(Paragraph(escape(your_text), your_style)

So you will print all those XML entities correctly without thinking much 
about it.
Martin Simon

Ilja Booij schrieb:

>On Mon, 13 Sep 2004 17:25:05 +0200, Jerome Alet <alet@librelogiciel.com> wrote:
>  
>
>>On Mon, Sep 13, 2004 at 05:20:52PM +0200, Ilja Booij wrote:
>>    
>>
>>>Hi all,
>>>
>>>reportlab's a really nice product. Thanks.
>>>
>>>I've run into a problem. It's probably just my own mistake.
>>>
>>>I cannot seem to output the '&' symbol when using a paragraph:
>>>
>>>The following just prints nothing on the place of the '&':
>>>
>>>story.append(Paragraph("IC & S", styNormal)).
>>>      
>>>
>>try this : story.append(Paragraph("IC &amp; S", styNormal)).
>>
>>you have to use correct SGML entities for special characters
>>    
>>
>
>Of course. I should drink more coffee. 
>
>Thanks!
>
>Ilja
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>  
>