Page 1 of 1

Transformation fails to find DTD file for DITA XML

Posted: Fri Dec 19, 2014 10:35 pm
by pablojvarela
Hi!
I am trying to run DITA transformation scenarios on DITA XML files.
The XML files are based on customized versions of topic/concept/task/reference, not on the standard DITA-OT's.

To make Oxygen aware of these customizations, I created an XML catalog, and added the catalog entry in $OXYGEN/frameworks/dita/catalog.xml. Then I made the DOCTYPE declarations match the PUBLIC IDs I have set in the catalog. For SYSTEM ID, I just entered the DTD filename.

Now, this puzzles me: Validation succeeds, but Transformation fails to find the appropriate DTDs.
[DOTJ012F][FATAL] Failed to parse the input file './my.ditamap'. The XML parser reported the following error: ./my-custom.dtd (The system cannot find the file specified)

It seems as if Oxygen is following the PUBLIC ID through the XML catalog to find the DTD whereabouts during validation, but not during trasnformation. So it tries to find the DTD in the same path where the XML file is stored, instead of looking in the path defined in the XML catalog.

Thanks for your support,
Pablo

Re: Transformation fails to find DTD file for DITA XML

Posted: Mon Dec 22, 2014 10:02 am
by Radu
Dear Pablo,

The DITA publishing is done using an open source tool called the DITA Open Toolkit.
This tool looks at a single XML catalog file:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\catalog-dita.xml

Ideally when you create a DITA DTD specialization you can bundle it as a DITA Open Toolkit plugin. For example you can look at how the MathML DITA DTD specialization plugin looks like:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\mathml

and then integrate the plugin running the DITA OT Integrator transformation scenario:

http://www.oxygenxml.com/doc/ug-oxygen/ ... ation.html

As a workaround, to see that this works, you can manually open the catalog-dita.xml I mentioned and add in it a nextCatalog entry pointing to your additional XML catalog, then try to publish again.

Regards,
Radu

Re: Transformation fails to find DTD file for DITA XML

Posted: Mon Dec 22, 2014 4:00 pm
by pablojvarela
Thanks, Radu,
I know.
My catalog-dita.xml already contains the nextCatalog entry to my specialized topic types.
This is precisely why validation does work.

But how come validation works, but transformation does not?
It seems as if Oxygen is following the PUBLIC ID through the XML catalog to find the DTD whereabouts during validation, but not during trasnformation. So it tries to find the DTD in the same path where the XML file is stored, instead of looking in the path defined in the XML catalog.

Re: Transformation fails to find DTD file for DITA XML

Posted: Mon Dec 22, 2014 5:56 pm
by sorin_ristache
I suppose you have the option Prefer: public selected in Options -> Preferences -> XML / XML Catalog but the Prefer option is not passed to the DITA transformations so the XML catalog resolver only looks for system IDs, not public IDs.

Does the transformation prefer the system ID instead of the public ID also in the case of adding the attribute prefer="public" to the root element catalog in the file OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\catalog-dita.xml and after that repeating the DITA transformation? If yes (which means the DITA transformation still prefers the system IDs) please send us your customized versions of DITA topic DTDs and your XML catalog declarations which you added in Oxygen, for reproducing the problem.

Re: Transformation fails to find DTD file for DITA XML

Posted: Mon Dec 22, 2014 9:00 pm
by pablojvarela
Thanks Radu.
I set

Code: Select all

prefer="public"
in the catalog and now transformations work.

Pablo