[reportlab-users] Re: usersGuide Platypus including '<' in text
Paulino
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 '>'.
>
> thanks
> george
>
>
Here's the escape sequences for the special characters in XML:
Sequence Character
|<| |<|
|>| |>|
|"| |"|
|&| |&|
(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'
>>>import re
>>>re.sub('&', '&', string)
'smith & smith'
Paulino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://two.pairlist.net/pipermail/reportlab-users/attachments/20061029/04556527/attachment.html
More information about the reportlab-users
mailing list