Forum Bugs

PrinceXML not ignoring text within CSS comments defined in XHTML file

Dunnymeister
Build: Tested with both Prince 11.1 and Prince 20170629
Environment: Windows 10 (10.0.15063 Build 15063)

Description:
PrinceXML is unable to ignore data within CSS comments that are defined within an XHTML file. The characters ']]' appear to cause issues even though they're contained within valid CSS comment tags (both // and /* */ styles are affected)

Steps To Reproduce (example files and .bat to run attached below):
1) Define a <style> tag and use CSS comments that contain CDATA closing tags in a xhtml file
2) Attempt to convert the file to PDF with Prince

Current result:

Prince exits with an error message:

prince: C:/test/FileStorage/FileRepository/tmp/1ea568f3-28b9-43f4-b4c7-1e1e19deda6b/OEBPS/chapter0.xhtml:37: error: Sequence ']]>' not allowed in content
prince: C:/test/FileStorage/FileRepository/tmp/1ea568f3-28b9-43f4-b4c7-1e1e19deda6b/OEBPS/chapter0.xhtml:37: error: Sequence ']]>' not allowed in content
prince: C:/test/FileStorage/FileRepository/tmp/1ea568f3-28b9-43f4-b4c7-1e1e19deda6b/OEBPS/chapter0.xhtml:37: error: internal error: detected an error in element content
prince: C:\test\FileStorage\FileRepository\tmp\1ea568f3-28b9-43f4-b4c7-1e1e19deda6b\OEBPS\chapter0.xhtml: error: could not load input file
prince: error: failed to load all input documents


Expected result: Lines that are comments should be ignored

Please find files to reproduce attached. This test assumes you have prince available on your PATH.
  1. Prince_TestCase.zip0.6 kB
mikeday
This is not well-formed XML, you cannot nest CDATA sections.
Dunnymeister
Apolgogies, you're totally correct. We also use HTMLAgility pack to sanistise our markup prior to opening in prince and it looks like it does weird things with CDATA tags when OutputAsXML is enabled.

I'll take it up with them, thanks for your time!