How to show indexterms in DocBook 5 Webhelp

cyoo
Posts: 2

How to show indexterms in DocBook 5 Webhelp

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

Re: How to show indexterms in DocBook 5 Webhelp

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

Re: How to show indexterms in DocBook 5 Webhelp

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

Return to “DocBook”

Who is online

Users browsing this forum: No registered users and 1 guest