[reportlab-users] Re: usersGuide Platypus including '<' in text
paulino1 at sapo.pt
Sun Oct 29 17:32:40 EST 2006
> Date: Sun, 29 Oct 2006 07:41:22 -0800
> From: george <georgel at telebyte.com>
> Subject: [reportlab-users] UsersGuide Platypus including '<' in text
> To: reportlab-users at reportlab.com
> Message-ID: <4544CBA2.7070201 at telebyte.com>
> Content-Type: text/plain; charset="us-ascii"
> Im documenting some text which includes the following m*x + b < limit.
> When try to insert this into a Paragraph, I get an error message ending
> raise "xml parser error (%s) in paragraph beginning\n'%s'"\
> xml parser error (bogus < or &) in paragraph beginning
> 'm*x + b < limit'
> I haven't been able to find out how to escape 'reserved' characters such
> as '<' and '>'.
Here's the escape sequences for the special characters in XML:
(from software carpentry: http://osl.iu.edu/~lums/swc/www/xml.html )
You can use the re module to replace each character for it's escape
sequence in your paragraphs:
>>>string = 'smtih & smith'
>>>re.sub('&', '&', string)
'smith & smith'
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users