[#11876] - Styled text: parsing error should abort fill process

Category:
Enhancement request
Priority:
High
Status:
Assigned
Project: Severity:
Critical
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

JRStyledTextParser.getStyledText(): line 249

When a styled text contains unescaped characters (e.g. '&', '<'...), the DOMParser will throw a SAXException, but the JRStyledText will catch this exception and continue with the text as unstyled text.
There's just a log entry in the "Error parsing styled text".

With this fallback-behaviour it can happen that we send wrong information to our customer without knowing it.
We woul like to have a setting that allows us to abort the fill process if the styled text can't be parsed.

v6.1.1
JasperReports
Neobye's picture
15
Joined: May 6 2013 - 6:01am
Last seen: 1 month 2 weeks ago

3 Comments:

#1
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

Would this be required for any type of markup (HTML, RTF), or just for styled text?

Thanks,
Teodor

#2

It makes sense to have this option on any of the markups.
A general setting would make sense. Optionally it could be a setting per markup.

To make an example what could happen with the current implemntation:
A textfield with markup html would receive a text like "investment strategy: bonds <10%".
The printed text on the pdf would be only "investment strategy: bonds ", because the "<10%" (if you got no spaces between < and 10%) is interpreted as opening tag, but is not known. It's just eliminated.

#3
  • Status:Feedback Requested» Assigned
Feedback