zopefoundation / z3c.rml

An alternative implementation of RML
Other
100 stars 51 forks source link

paraStyle and blockTableStyle names are not handled separately #108

Open joeUser555 opened 1 year ago

joeUser555 commented 1 year ago

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

I defined a paraStyle and a blockTableStyle with an identical name.

What I expect to happen:

In a para element the paraStyle name referenced should give the paraStyle with this name.

What actually happened:

The blockTableStyle with the identical name got returned and caused an exception:

AttributeError: 
paragraph text '<para>paraStyle Helvetica 12pt</para>' caused exception 'TableStyle' object has no attribute 'name'

style-name-conflict.rml.txt

What version of Python and Zope/Addons I am using:

Ubuntu 22.04, Python 3.10, zope-event-4.6

regebro commented 1 year ago

Yes, this is correct, and as far as I can tell reportlab behaves the same.

joeUser555 commented 1 year ago

If paraStyle names and blockTableStyle names share the same namespace the parser should yield a warning or better an error if the style name is use in both categories in one document.

regebro commented 1 year ago

Warning if you redefine a style does make sense.