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

Robin Becker robin at reportlab.com
Mon Dec 17 08:41:14 EST 2012


On 14/12/2012 19:00, Jon.Reinsch wrote:

> 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!

>

well some good came out of this then. As for the style="...." that is in fact
equivalent in some ways to class in html. The standard parser doesn't implement
findSpanStyle, but derived parsers can choose to do so. The findSpanStyle method
should return a dictionary like object when given the style attribute. Currently
the only implementation is in rml2pdf. The returned object can specify all or
none of fontName fontSize textColor backColor etc etc.


> 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

>> ....

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

.......efinition.

>

--
Robin Becker


More information about the reportlab-users mailing list