[reportlab-users] xml parser error (invalid attribute name class) in paragraph

Jon.Reinsch jon.reinsch at noaa.gov
Fri Dec 14 14:00:19 EST 2012


Well, given that it was simply ignored in 2.5, I might as well remove
the class attribute from my markup, rather than apply the patch. "style"
doesn't seem to work either (I get "ValueError: findSpanStyle not
implemented in this parser"). However, something that didn't work in 2.5
(font backColor="yellow") is now supported. Without the exception on the
class attribute, I probably wouldn't have discovered this. Thanks!

On 12/13/2012 4:49 AM, Robin Becker wrote:

> On 12/12/2012 18:09, Jon.Reinsch wrote:

>> I developed code using ReportLab 2.5, but after upgrading to 2.6, it

>> fails. An

> ....

>>

>> As I said, my code ran fine in ReportLab 2.5. Thanks for any advice

>> you can offer.

>>

>

> A quick fix for your issue is to modify the file

>

> reportlab/platypus/paraparser.py using this patch

>

> Index: reportlab/platypus/paraparser.py

> ===================================================================

> --- reportlab/platypus/paraparser.py (revision 3986)

> +++ reportlab/platypus/paraparser.py (working copy)

> @@ -166,6 +166,7 @@

> 'backcolor':('backColor',toColor),

> 'bgcolor':('backColor',toColor),

> 'style': ('style',None),

> + 'class': ('',None),

> }

> #things which are valid font attributes

> _linkAttrMap = {'size': ('fontSize', _num),

>

>

> which modifies the _spanAttrMap definition.



More information about the reportlab-users mailing list