Thursday, July 5, 2012

Rendered SharePoint search result in xml format


Hello ,
using below xslt we get the sharepoint 2010 search result in xml format.
For that ,
1. Go to the search result page
2. Edit the page and Edit the core search result webpart property.
3. Go to the xslt section and first create the backup of the existing xslt for the search result and replace it wil below xslt
<?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>
4. Click ok and save and publish the page
5. Perform search again it will rendered the search result in xml format.

Regards
Hiren Patel

No comments:

Post a Comment