Hi ACE,
Here is a good example of some people trying to do what you
want to
do:
http://www.stylusstudio.com/xsllist/200306/post50900.ht
ml
Based upon that, here is what I had to do to make this work
in the
default XSLT:
1. Add this following template. This template will look for
the last
instance of a forward slash and then take the string that
comes after
that (in most cases the filename):
<xsl:template
name="substring-after-last">
<xsl:param name="url" />
<xsl:param name="substr" />
<!-- Extract the string which comes after the first
occurence -->
<xsl:variable name="temp"
select="substring-after($url,$substr)"/>
<xsl:choose>
<!-- If it still contains the search string then
recursively
process -->
<xsl:when test="$substr and
contains($temp,$substr)">
<xsl:call-template
name="substring-after-last">
<xsl:with-param name="url"
select="$temp" />
<xsl:with-param name="substr"
select="$substr" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$temp" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
2. Then, you will need to find the place where the title
text is
formed. This should be around line 2500-ish and then change
that code
to call the template you created above:
<xsl:choose>
<xsl:when test="T">
<xsl:call-template
name="substring-after-last">
<xsl:with-param name="url"
select="$display_url"/>
<xsl:with-param name="substr"
select="'/'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of
select="$stripped_url"/></
xsl:otherwise>
</xsl:choose>
Hope this helps. I have not tested this for SMB or other
non-http URLs
but it should be ok.
Good luck!
Brian
On Sep 22, 8:29 pm, ACE1 <pkalogi... gmail.com> wrote:
> Dear all,
> I need to crawl many .doc files. GSA takes as Title of
the results the
> title of .doc properties.Let's assume that there is the
file "First
> Test.doc" and the title in properties is
"Title Test".When this file
> will be crawled in the results will appear:
> [MS Word] Title Test
> Snippet
> URL:...../First%20Test.doc
>
> I want to modify the XSLT and appear as result:
> [MS Word] First Test.doc
> Snippet
> URL:..../First Test.doc
>
> So I want as result title to be the filename and to
replace is %20
> with space.
>
> If anyone could help I would be thankful. I found some
relevant posts
> but I can have the result that I desire.
>
> Thanks in advance.
>
> POSTS:
> [1]http://groups.google.com/group/Google-Mi
ni/browse_thread/thread/c5cc1...
> [2]http://groups.google.com/group/Google-Mi
ni/browse_thread/thread/49a49...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Search Appliance" group.
To post to this group, send email to
Google-Search-Appliance googlegroups.com
To unsubscribe from this group, send email to
Google-Search-Appliance-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/Google-Search-Applian
ce?hl=en
-~----------~----~----~----~------~----~------~--~---
|