Returning search results as XML
When troubleshooting search problems you may want to be able to see search results without the XSLT transformation. In other words in XML without the formatting. This can be useful when troubleshooting search results because it enables you see the raw XML data so you can see all of the fields.
By default you see search results as follows :
To see the underlying XML follow the steps below.
- Click on Site Actions, Edit Page.
- In the Search Core Results we part click edit, Modify Shared Web Part. Next click the XSL Editor button.
- Replace the existing XSL with the XSL below (save off the existing XSL if you wish)
<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> |
- Click Save and OK then Exit Edit Mode.
- Now search again. You should see something like the results below (I've masked my server name deliberately). As you can see the formatting has been removed allowing you to see only the XML.
