Removing required-cleanup and draft-comment completely from topic

10 views
Skip to first unread message

Toshihiko Makita

unread,
Mar 11, 2021, 9:41:03 AMMar 11
to DITA-OT Users
Hi everyone,

I'm developing DITA to HTML stylesheet from scratch. In the past I've received DITA topic from user that includes required-cleanup and draft-comment element. 
According to DITA specification,  required-cleanup can include any elements and draft-comment also can contain various elements.
In the normal stylesheet processing, I want remove these two elements completely from topic because they should not appeared in final output.
What is the best way to do this? Should I implement "depend.preprocess.post " extension point in "preprocess"? Or are there any appropriate customization points in DITA-OT processing flow?
If you have any implementation experience, please let me know.

Regards,

-- 
 /*------------------------------------------------------------------------------------ 
    Toshihiko Makita 
    Development Group. Antenna House, Inc. Ina Branch
    Web site: http://www.antenna.co.jp/ 
                      http://www.antennahouse.com/ 
   -------------------------------------------------------------------------------------*/

Chris Papademetrious

unread,
Mar 11, 2021, 3:39:51 PMMar 11
to DITA-OT Users
Hi Toshihiko,

The existing html5 plugin sets an Ant DRAFT parameter from the DITA-OT args.draft argument:

 <param name="DRAFT" expression="${args.draft}" if:set="args.draft"/>

then the html5 XSLT checks $DRAFT to decide whether to publish the draft elements or not. Can you follow a similar model, or is this an obvious answer and I'm not understanding what you're really asking? If you're asking whether doing this in preprocess or your own plugin is best, then one thing to consider is that you would want your preprocess deletion to run *only* when your transformation is being used, not when other transformations (also using preprocess) are used.

 - Chris

Toshihiko Makita

unread,
Mar 11, 2021, 9:32:13 PMMar 11
to DITA-OT Users
Hi Chirs,

Thank you for your suggestion.

> one thing to consider is that you would want your preprocess deletion to run *only* when your transformation is being used
Yes, it is very important point for DITA-OT operation. I will carefully implement this feature.

> Can you follow a similar model, or is this an obvious answer and I'm not understanding what you're really asking? 
Ignoring draft-comment and required-cleanup from final output is very easy.
<xsl:template match="*[@class => contains-token('topic/required-cleanup')]" priority="N"/>
<xsl:template match="*[@class => contains-token('topic/draft-comment')]" priority="N"/>

However if these two elements exist in DITA to HTML5 stylesheet input, it can have a major influence on table, fig or equation-block element numbering. This is because I want remove them from the DITA to HTML5 stylesheet input.

Regards,
-- 
/*--------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 --------------------------------------------------*/ 
2021年3月12日金曜日 5:39:51 UTC+9 chris...@gmail.com:
Reply all
Reply to author
Forward
0 new messages