This topic shows how to modify the XSLT that is used by the Core Results Web Part to display the raw XML that contains the search results data.
To modify the Web Part's XSL property:
1) In your browser, navigate to the results page URL:
http://ServerName/SiteName/Pages/results.aspx
2) Click the Site Actions link, and then click Edit Page.
3) In the Search Core Results Web Part, click the edit arrow to display the Web Part menu, and then click Edit Web Part. This opens the Web Part tool pane.
4) In the Display Properties section, clear Use Location Visualization.
5) To open the Text Entry Window for the XSL property, click the XSL Editor button. The XSL Editor button is located in the Display Properties section for all of the Web Parts
6) Replace the default XSLT with the following.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/></xmp>
</xsl:template>
</xsl:stylesheet>
7) This XSLT does not perform any actual transformation, so the
search results will display the raw XML data.
8) Click OK to save the changes to the Web Part.
9) Type a query in the Search box, and then click the search
button.
Because the search results are rendered without the
formatting provided by the XSLT, the raw XML for the search results data is
displayed instead.
No comments:
Post a Comment