Home > SharePoint, SharePoint 2010 > SharePoint – Display Search Result as Raw XML

SharePoint – Display Search Result as Raw XML

Search results are formatted on screen using XSLT’s. At times the XSLT’s will not give back the result was were expecting. In such cases we need to debug to find the root cause. To start with the first step I will do is by checking the search results in Raw XML format. This helps me to rule out issue with Search vs. Issue with XSLT’s

To display data in XML we should use following in the XSL Editor of Search webpart

<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>

OOB by default custom XSL is disabled. To enable it

  • Open properties of “Search Core Results” webpart
  • Un-check property “Use Location Visualization”

WV-4

Advertisements
  1. jorge
    March 19, 2013 at 2:30 AM

    Thanks man!!!! simple and usefull!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: