Page 1 of 1

resourceid in single HTML topic

Posted: Fri Jan 15, 2021 11:39 pm
by Jesse
Hello,

I am generating a single HTML file with all of my topics from my ditamap compiled using the DITA Map XHTML transform and a chunk to-content attribute on my starting <map> element.

Each topic in the ditamap has a resourceid set:

Code: Select all

 <prolog>
  <resourceid id="5040" appname="platform"/>
 </prolog>
Is there any way I could get that <resourceid> metadata to appear as an attribute in the beginning <dev> tag in each topic in the compiled HTML file?

Right now the <div> gets transformed as following:

Code: Select all

<div class="nested0" aria-labelledby="ariaid-title1" id="cm-duplicate-case">
But it would be a lot more useful if it appeared like the following (or something similar) because our developers use this file and these IDs to map context-sensitive help:

Code: Select all

<div resourceid id="5040" appname="platform">
Thanks,
Jesse

Re: resourceid in single HTML topic

Posted: Tue Jan 19, 2021 10:10 am
by Radu
Hi Jesse,

Maybe you can do this with an XSLT customization.
In the XSLT stylesheet:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.xhtml/xsl/xslhtml/dita2htmlImpl.xsl

there is an XSLT template which outputs the topics:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/topic ')]" mode="child.topic" name="child.topic">
maybe you can create a DITA OT plugin which adds an extra XSLT stylesheet for XHTML processing that overrides this base XSLT stylesheet and makes the appropriate changes to it.

As an example this DITA OT plugin adds XSLT processing for HTML5, XHTML and XSL-FO:

https://github.com/oxygenxml/dita-embed-html-xslfo

and a topic about installing a DITA OT plugin:
https://www.oxygenxml.com/doc/versions/ ... lugin.html

Regards,
Radu

Re: resourceid in single HTML topic

Posted: Tue Jan 19, 2021 10:42 pm
by Jesse
Thanks, Radu!