resourceid in single HTML topic

Jesse
Posts: 10
Joined: Fri Nov 13, 2020 9:24 pm

resourceid in single HTML topic

Post by Jesse » Fri Jan 15, 2021 11:39 pm

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

Radu
Posts: 7399
Joined: Fri Jul 09, 2004 5:18 pm

Re: resourceid in single HTML topic

Post by Radu » Tue Jan 19, 2021 10:10 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Jesse
Posts: 10
Joined: Fri Nov 13, 2020 9:24 pm

Re: resourceid in single HTML topic

Post by Jesse » Tue Jan 19, 2021 10:42 pm

Thanks, Radu!

Post Reply