As Jim noted, writing HTML to highlight search term is totally up to you.
Assuming you want to put all search term occurrences into strong
tags, you'll need to process current()
to add this markup to every appearance of search term. To do it you can replace
<xsl:value-of select="current()" disable-output-escaping="yes"/>
with recursive template call:
<xsl:call-template name="highlight">
<xsl:with-param name="string" select="current()"/>
<xsl:with-param name="term" select="$search"/>
</xsl:call-template>
and template which does replacing might look like
<xsl:template name="highlight">
<xsl:param name="string"/>
<xsl:param name="term"/>
<xsl:variable name="before" select="substring-before($string, $term)"/>
<xsl:choose>
<xsl:when test="starts-with($string, $term) or string-length($before) > 0">
<xsl:value-of select="$before"/>
<!-- write whatever markup to highlight search term occurrence here -->
<strong><xsl:value-of select="$term"/></strong>
<xsl:variable name="after" select="substring-after($string, $term)"/>
<xsl:if test="string-length($after) > 0">
<xsl:call-template name="highlight">
<xsl:with-param name="string" select="$after"/>
<xsl:with-param name="term" select="$term"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>