When using the results page in Office SharePoint Server 2007 or Search Server 2008, the results are returned as an xml-structure and for a better display transformed using an xslt-script. By modifying this xslt-script you can customize the search results. But when you need to know the content of the xml-structure, you can use this xslt-transformation:

<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="no" omit-xml-declaration="yes" />

    <xsl:param name="node_depth" select="0" />

    <xsl:template match="node()|@*">
        <b>
            <xsl:value-of select="local-name()" />
        </b>
        <xsl:if test="text() != ”">
            = <xsl:value-of select="text()" />
        </xsl:if>
        <br/>

        <xsl:call-template name="new_record">
            <xsl:with-param name="node_depth"
            select="count(ancestor::node())" />
        </xsl:call-template>

        <xsl:apply-templates select="node()|@*"/>
    </xsl:template>

    <xsl:template name="new_record">
        <xsl:param name="node_depth" />
        <xsl:if test="$node_depth = 2">
            ———–<br/>
        </xsl:if>
    </xsl:template>

</xsl:stylesheet>

The main code of this transformation was taken from this community thread: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.xml&tid=22a04ddf-dca4-4bf8-a8a5-da68f435d548&cat=en_US_d02fc761-3f6b-402c-82f6-ba1a8875c1a7&lang=en&cr=&sloc=en-us&m=1&p=1

To use this xslt-transformation, add a new Search Core Results webpart and insert the script into the xsl-Editor of the webpart.

Advertisements