Forum Feature requests

Option to specify a custom XML Catalog or a custom CatalogResolver

tofi86
When generating PDF with Prince 10 from an XML file, I get the following error:

err|can't open input file: No such file or directory(C:/Users/{{absolute_path_to_xml_base_dir}}/pagina.dtd)
wrn|failed to load external entity "C:/Users/{{absolute_path_to_xml_base_dir}}/pagina.dtd"(C:/Users/{{absolute_path_to_xml_base_dir}}/2-printcss_custom2.xml:3)


I found this topic http://www.princexml.com/forum/topic/2653/how-do-i-decide-with-dtd-to-use?p=1#12219 which suggests to add our DTD to the "Prince DTD catalog".
I assume the "Prince DTD catalog" is meant to be the XML catalog file in "prince/engine/dtd/catalog.xml".

However, we have our own XML catalog file on the system and cannot place custom files or folders in "prince/engine/dtd" (missing admin rights).

Please add an option to specify a custom XML Catalog or a custom CatalogResolver on the commandline and/or in the Java interface.
mikeday
What is the DOCTYPE declaration in your XML document? Does it have a system path, or just a public identifier?
tofi86
Sorry, forgot to mention that.
We use a system identifier:

<!DOCTYPE root SYSTEM "pagina.dtd">

And a catalog.xml file in our toolchain resolves this relative path to an absolute path.
tofi86
Any news on this topic?
mikeday
This is not yet implemented, it will require some modifications to the way we use libxml2.
tofi86
Hi Mike, do you have any news regarding this issue?
I still encounter this issue in current Prince 11.3.1 and would live to be able to use named entities and such from my XML files...
tofi86
By the way, this has a new error message in Prince 11.3.1:

err|XML external entity loading is disabled (C:/Users/{{absolute_path_to_xml_base_dir}}/pagina.dtd)
warn|failed to load external entity "C:/Users/{{absolute_path_to_xml_base_dir}}/pagina.dtd" (C:/Users/{{absolute_path_to_xml_base_dir}}/3-printcss_custom2.xml:8)

Edited by tofi86

mikeday
XML external entities have been disabled by default for security reasons, but can be enabled with the --xml-external-entities option.

We have not added an option to specify the catalog location yet; too many things to do, unfortunately. :(
tofi86
Okay, thanks for the feedback. Still looking forward to see XML catalogs implemented, but not that urgent.

However, regarding the "XML external entities": this message wasn't thrown before when the DTD had been placed next to the XML file. The DTD was loaded just fine and we have been able to evaluate default attributes and named entities. but now we get this error message. but we don't use "external" entities. we use a local DTD via SYSTEm identiefier: <!DOCTYPE root SYSTEM "pagina.dtd">

Is this already an "external entity"? Or do I understand this wrong?
mikeday
This is already an external entity, yes.