How to show indexterms in DocBook 5 Webhelp

cyoo
Posts: 2
Joined: Thu Oct 25, 2012 9:48 pm

How to show indexterms in DocBook 5 Webhelp

Post by cyoo » Thu Nov 06, 2014 7:34 pm

In DocBook5 using the DocBook Webhelp transformation I would like to get all indexterms to not only appear in the index but also to display in the flow of the generated HTML. Would this be possible through an ANT parameter similar to DITA args.indexshow, a CSS property, or perhaps some other means?

My DocBook v5 XML source looks like this:

Code: Select all

<para>I walked a <indexterm><primary>black dog</primary></indexterm> in the park yesterday.</para>
After DocBook WebHelp, my HTML output looks like:

Code: Select all

<p>I walked a <oxygen:indexterm xmlns:oxygen="http://www.oxygenxml.com/ns/webhelp/index" primary="black dog"/> in the park yesterday.</p>
I want the HTML output to look like:

Code: Select all

<p>I walked a <oxygen:indexterm xmlns:oxygen="http://www.oxygenxml.com/ns/webhelp/index" primary="black dog"/>black dog in the park yesterday.</p>
So that "black dog" is both an index term and also shows up as text in the HTML.

Thanks,

Craig Westling
Craig Westling

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: How to show indexterms in DocBook 5 Webhelp

Post by sorin_ristache » Tue Nov 11, 2014 6:24 pm

Hi Craig,

This can be done with the following modification: please add the following code at the end of the template with the attribute match="d:indexterm" in file OXYGEN_INSTALL_DIR\frameworks\docbook\xsl\com.oxygenxml.webhelp\xsl\docbook\chunk_custom.xsl:

Code: Select all

  <xsl:if test="d:primary">
<xsl:text> </xsl:text><xsl:value-of select="d:primary"/>
</xsl:if>
<xsl:if test="d:secondary">
<xsl:text> </xsl:text><xsl:value-of select="d:secondary"/>
</xsl:if>
<xsl:if test="d:tertiary">
<xsl:text> </xsl:text><xsl:value-of select="d:tertiary"/>
</xsl:if>
Regards,
Sorin

<oXygen/> XML Editor Support

cyoo
Posts: 2
Joined: Thu Oct 25, 2012 9:48 pm

Re: How to show indexterms in DocBook 5 Webhelp

Post by cyoo » Tue Nov 11, 2014 7:17 pm

Thanks! That took care of it and I am getting the results I wanted in Webhelp output.
Craig Westling

Post Reply