Transformation fails to find DTD file for DITA XML

Post here questions and problems related to editing and publishing DITA content.
pablojvarela
Posts: 9
Joined: Thu Jul 12, 2012 7:41 pm

Transformation fails to find DTD file for DITA XML

Post 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
Radu
Posts: 9058
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation fails to find DTD file for DITA XML

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
pablojvarela
Posts: 9
Joined: Thu Jul 12, 2012 7:41 pm

Re: Transformation fails to find DTD file for DITA XML

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Transformation fails to find DTD file for DITA XML

Post 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.
Regards,
Sorin

<oXygen/> XML Editor Support
pablojvarela
Posts: 9
Joined: Thu Jul 12, 2012 7:41 pm

Re: Transformation fails to find DTD file for DITA XML

Post by pablojvarela »

Thanks Radu.
I set

Code: Select all

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

Pablo
Post Reply