Customizing the DITA map metrics report

Post here questions and problems related to editing and publishing DITA content.
rminaker
Posts: 27
Joined: Thu Dec 19, 2013 4:34 pm

Customizing the DITA map metrics report

Post 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.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Customizing the DITA map metrics report

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rminaker
Posts: 27
Joined: Thu Dec 19, 2013 4:34 pm

Re: Customizing the DITA map metrics report

Post by rminaker »

Works great! Thanks Radu!

R.
Post Reply