PDF Export - & in Equipment name causes invalid entity error

Description

I'm getting error messages about Entity must immediately follow the &. It seems the issue is the pcg files change the & in equipment name to & and the & isn't being recognized as a valid entity.

Environment

None

Activity

Show:
Andrew Maitland
March 17, 2012, 7:57 PM

These seem to be the offending entries:

EQUIPNAME:Ring of Deflection & Movement|OUTPUTORDER:6|COST:23500.0|WT:0.02|QUANTITY:1.0|CUSTOMIZATION:[BASEITEM:Boots of Striding And Springing|DATA:NAME=Ring of Deflection & Movement$EQMOD=ADDTYPE&pipe;Ring.BNS_AC_DEFL&pipe;+3._WEIGHTADD&pipe;-0,9799999999999999995836663657655662973411381244659423828125$SPROP=(Boots of Striding And Springing (Add TypeRing/ AC Bonus (Deflection) (+3)))]

and

EQUIPSET:Feet|ID:0.1.10|VALUE:Ring of Deflection & Movement|QUANTITY:1.0|USETEMPMODS:Y

Tom Parker
March 18, 2012, 9:31 AM

What specifically are the error messages?

James Dempsey
March 18, 2012, 4:14 PM

Apparently this is a PDF export error.

09:13:51.216 SEVERE SwingWorker-pool-2-thread-2 FOPHandler:248 Exception in FOPHandler:run
org.apache.fop.apps.FOPException: The entity name must immediately follow the '&' in the entity reference.
at org.apache.fop.apps.Driver.render(Driver.java:503)
at pcgen.util.FOPHandler.run(FOPHandler.java:242)
at pcgen.system.BatchExporter.exportCharacterToPDF(BatchExporter.java:243)
at pcgen.gui2.dialog.ExportDialog$PDFExporter.doInBackground(ExportDialog.java:567)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

---------
org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:191)
at org.apache.fop.apps.Driver.render(Driver.java:498)
at pcgen.util.FOPHandler.run(FOPHandler.java:242)
at pcgen.system.BatchExporter.exportCharacterToPDF(BatchExporter.java:243)
at pcgen.gui2.dialog.ExportDialog$PDFExporter.doInBackground(ExportDialog.java:567)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

James Dempsey
March 18, 2012, 4:47 PM

New UI merge had caused a regression in the Eq export tag. It was not using the filtering system to make special characters safe for output. The fucntion has been reinstated.

Andrew Maitland
March 18, 2012, 5:33 PM

Works great. Thanks.

Fixed

Assignee

James Dempsey

Reporter

Andrew Maitland

Labels

None

Theme

None

Epic/Theme

None

Pending User Input

None

Components

Fix versions

Affects versions

Priority

Minor
Configure