Plugin order on catalog-dita.xml

Post here questions and problems related to editing and publishing DITA content.
BilderbergCEO
Posts: 3
Joined: Fri May 06, 2022 3:58 pm

Plugin order on catalog-dita.xml

Post by BilderbergCEO »

Hi everyone,

BACKGROUND
We needed a custom attribute for PH elements. @otherprops and @ouputclass were already in use, so we genuinely needed a new custom attribute, which we successfully implemented in a DITA OT plugin using DTDs.

Our solution has 3 plugins: one for PDF output, one for HTML output, and a common plugin used by both outputs, so we added the custom attribute to the common plugin. The custom attribute works perfectly, Oxygen Editor correctly displays the custom attribute for PH elements, and DITA handles the custom attribute when building output.

PROBLEM
The problem is that now--after the addition of our new code--our common plugin only works if it is listed first in plugin/org.dita.base/catalog-dita.xml. For years the order never mattered, but now it does. We've written a script to rewrite catalog-dita.xml as a workaround, but we would prefer a solution that doesn't require editing in org.dita.base every time dita install is run.

Is there a way to specify plugin priority, or is there a better way to specify custom attributes that avoids this issue?
Radu
Posts: 9661
Joined: Fri Jul 09, 2004 5:18 pm

Re: Plugin order on catalog-dita.xml

Post by Radu »

Hi,
It is not clear to me what exactly you did, our technical support does not cover debugging custom DITA specializations, in general a specialization which adds a new DITA attribute is indeed packed as a DITA OT plugin and then installed in the DITA OT:
https://www.oxygenxml.com/doc/versions/ ... ation.html

An attribute domain specialization (a specialization which adds a new attribute) needs to obey a set of rules written in the specs:
https://www.oxygenxml.com/dita/1.3/spec ... butes.html

Also once you create an attribute specialization plugin you need to change all your DITA DOCTYPE DTDs and declare your own public and system IDs, you cannot remain on the base DITA DTDs referenced in the XML files.
There is a very small sample DITA DTD specialization plugin here:
https://github.com/oxygenxml-incubator/ ... gin-sample
It adds a new attribute "phase-of-moon" available for all DITA elements and it does this also by adding new DOCTYPE public IDs:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OXYGENXML//CUSTOM//TOPIC//EN" "topic.dtd">

Code: Select all

<p phase-of-moon="value1">Topic paragraph</p>
https://github.com/oxygenxml-incubator/ ... topic.dita

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BilderbergCEO
Posts: 3
Joined: Fri May 06, 2022 3:58 pm

Re: Plugin order on catalog-dita.xml

Post by BilderbergCEO »

Thanks for the quick reply. I think I understand now.
Post Reply