DITA Map XHTML transform adds extra attribute information

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

DITA Map XHTML transform adds extra attribute information

Post by Jesse » Wed Feb 10, 2021 12:00 am


In my source DITA, I store attribute info that is used to map content in a context-sensitive help gadget.

It looks like this:

Code: Select all

<div id="5033" product="platform" />
When I transform to a single HTML file using the chunk to-content attribute on the map tag, the output in HTML looks like this:

Code: Select all

<div id="workparty__5033"></div>
It's appending the dita source file name to the front of the "id" attribute value, and dropping the product value completely.

How can I get it to transform exactly like it appears in the source? Are we talking XSL modifications, or is there simpler way like an argument I can modify in the transformation scenario?


Posts: 7405
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA Map XHTML transform adds extra attribute information

Post by Radu » Wed Feb 10, 2021 2:00 pm

Hi Jesse,

As chunking creates a larger HTML document from multiple DITA topics the processor probably tries to make the ID attribute of the HTML element unique in the context of the larger HTML document by prefixing it with the topic ID in which the original DITA element was defined.
About the original profiling attribute not being preserved in the HTML output, indeed this does not happen by default.
A DITAVAL filter file:
https://www.oxygenxml.com/doc/versions/ ... -file.html

can be applied when transforming the DITA content to HTML5 based outputs.
And the DITAVAL file can specify that a certain profiling attribute needs to pass through to the output:

Code: Select all

    <prop action="passthrough" att="product"/>
in which case in the HTML you should get a "data-product" attribute set on the HTML element produced from the original DITA element.

Radu Coravu
<oXygen/> XML Editor

Post Reply