Page 1 of 1

Customizing the DITA map metrics report

Posted: Wed Jun 24, 2015 5:01 pm
by rminaker
Hi,

I've been able to modify the report.xsl and the report2XHTML.xsl files to re-organize/remove some of the data in the default report (e.g., have a whole list of topics sorted by word count, as opposed to the two lists).

I'd like to take this a step further (if possible) by adding a new column to the existing tables that contain the topic names, which would identify the 'topic type' (concept, task, reference). I had no problem adding the column to the report2XHTML.xsl.

Code: Select all


 <xsl:template match="oxyd:topMinWords">
<h3>Top min words topics</h3>
<table class="htable">
<tr class="header">
<th>Topic</th>
<th>Words</th>
[b]<th>Topic type</th>[/b]
</tr>
<xsl:apply-templates/>
But I'm having trouble getting the data to show up in the column. If this is something that's easy to do, some help would be much appreciated. Even if there was a way to relate all the other data in the report to the topic names, even if it isn't pretty, this would be very helpful.

Thanks!

R.

Re: Customizing the DITA map metrics report

Posted: Thu Jun 25, 2015 9:17 am
by Radu
Hi Ryan,

In the XSLT stylesheeet:

OXYGEN_INSTALL_DIR\frameworks\dita\report\modules\text.xsl

after the lines:

Code: Select all

            <oxyd:characters>
<xsl:value-of select="string-length(normalize-space($topicText))"/>
</oxyd:characters>
you can add:

Code: Select all

            <oxyd:type>
<xsl:value-of select="*[1]/name()"/>
</oxyd:type>
and then in the XSLT stylesheet:

OXYGEN_INSTALL_DIR\frameworks\dita\report\report2XHTML.xsl

in the template:

Code: Select all

    <xsl:template match="oxyd:topicText">
you can add one extra cell in the row like:

Code: Select all


..............
<td>
<xsl:value-of select="oxyd:type"/>
</td>
</tr>
..............
Regards,
Radu

Re: Customizing the DITA map metrics report

Posted: Thu Jun 25, 2015 3:33 pm
by rminaker
Works great! Thanks Radu!

R.