terminate OT after extension point processing?

17 views
Skip to first unread message

Alan Houser

unread,
Aug 25, 2021, 6:06:00 PM8/25/21
to DITA-OT Users
Colleagues,

I've created a DITA-OT plugin to adjust normalized DITA. The plugin invokes a custom Ant task at the "depend.preprocess.post" extension point. The Ant task invokes a custom XSLT on the contents of the "out" folder ($dita.output.dir), and populates the folder with my intended results.

However, after my custom Ant task, the default "normalize" stage often (but not always) runs again, stomping on my precious result files in the "out" folder. I suspect Ant is picking up an anomaly in file creation/modification times, possibly from working on a network drive.

My current workaround is to put my custom result files elsewhere. But am I missing a way to terminate processing after my custom Ant task? I could use the Ant "Fail" directive, but I don't want my plugin to terminate with a "Build Failed" message.

TIA!

-Alan

cant0r

unread,
Aug 25, 2021, 7:03:22 PM8/25/21
to DITA-OT Users
Hi Alan,

The default normalize stage is run just after the proprocess target has finished.
So, since you attach your custom target to the end of of prerocess target your target will run but it will be followed by the default XSLT call invoking the normalize.xsl stylesheet.
This stylesheet will stop "running" if it doesn't encounter anymore .dita or .ditamap files and it won't start of course if there's none available. 

You'd have to overwrite the org.dita.normalize plugin by creating a new plugin based on its dita transtype to overwrite this behavior so a new transtype has to be created.

If you don't want to create a new transtype or you want that default normalize stage to be run you'd have to make a hard copy of this plugin.

So you would do the following I guess:
1. Create a copy of this plugin 
2. Rename the copy
3. Extract the contents of the dita2dita target to another target and put this target's name next tk the preprocess in the depends attribútum.
4. Register your target next to the previous one as done in the previous szép
5. Integrate

Regards,
Tamás
Reply all
Reply to author
Forward
0 new messages