Page 1 of 1

How to show indexterms in DocBook 5 Webhelp

Posted: Thu Nov 06, 2014 7:34 pm
by cyoo
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

Re: How to show indexterms in DocBook 5 Webhelp

Posted: Tue Nov 11, 2014 6:24 pm
by sorin_ristache
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>

Re: How to show indexterms in DocBook 5 Webhelp

Posted: Tue Nov 11, 2014 7:17 pm
by cyoo
Thanks! That took care of it and I am getting the results I wanted in Webhelp output.