formatting custom snippet (XSLT)

4 views
Skip to first unread message

manub

unread,
Nov 6, 2009, 8:26:18 AM11/6/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi everybody,

I modified my XSLT to show a metadata value as a snippet rather than
the original one. Now I want to format in bold (the classic
reformat_keyword) that snippet, bolding the search terms.

I used this approach, but it doesn't work (it still shows me the
metadata as a snipped, but without formatting):

<xsl:choose>
<xsl:when test="MT/@N='Contenuto' and MT/@V!=''">
<xsl:call-template name="reformat_keyword">
<xsl:with-param name="orig_string">
<xsl:value-of select="MT[@N = 'Contenuto']/@V"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="reformat_keyword">
<xsl:with-param name="orig_string" select="S"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>


Any suggestions?

Thank you.

JMarkham

unread,
Nov 9, 2009, 11:25:50 AM11/9/09
to Google Search Appliance/Google Mini - Google Search Appliance/Google Mini
Hi,

You aren't getting bolded keywords because these come with the <b>
tags already in the snippet in the raw XML search output. You would
need to add a routine to find the keywords (comparison to 'q' and
'as_q' parameters) and add the <b> tags yourself within your chosen
metadata. Not a trivial undertaking, and I have not seen an example
of this posted anywhere.

Jeff

Reply all
Reply to author
Forward
0 new messages