3
出於各種原因,我真的希望能夠在我們的Google Mini搜索結果中顯示文件名作爲結果標題,而不是缺省設置。我能夠用在Google Search Appliance中更改結果標題
<span class="l">
<xsl:value-of select="$stripped_url"/>
</span>
剩下的是什麼需要的是更換
<!-- *** Result Title (including PDF tag and hyperlink) *** -->
...
<span class="l">
<xsl:choose>
<xsl:when test="T">
<xsl:call-template name="reformat_keyword">
<xsl:with-param name="orig_string" select="T"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$stripped_url"/></xsl:otherwise>
</xsl:choose>
</span>
幾乎做到這一點:
- 用空格替換%20的
- 修剪網址,以便僅留下結束文件名
- 從末尾修剪文件擴展名
我該如何做到這一點?