[reportlab-users] XML markup error

Michael Porter reportlab-users@reportlab.com
Mon, 7 Jun 2004 09:18:46 +0100


This is standard library one I use...

from xml.sax.saxutils import escape
Paragraph(escape('Smith & Son'))

Michael Porter
ReportLab

> -----Original Message-----
> From: reportlab-users-admin@reportlab.com
> [mailto:reportlab-users-admin@reportlab.com]On Behalf Of Jerome Alet
> Sent: 07 June 2004 07:54
> To: reportlab-users@reportlab.com
> Subject: Re: [reportlab-users] XML markup error
> 
> 
> On Mon, Jun 07, 2004 at 08:20:43AM +0200, Ulrich Wisser wrote:
> > 
> >       Paragraph('Smith & Son')
> > 
> > Is there a function to transform the string to proper XML?
> 
> I usually call the replace() method on strings, begining with 
> replace("&", "&amp;") then doing the < and > ("&" should be first 
> else you'll have some problems) 
> 
> maybe the standard python library contains something better, though
> 
> bye
> 
> Jerome Alet
> -- 
> "Ni dieu ! Ni Maitre ?" - Me.
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
> 
>