Matthew McDermott

Matthew is a principal consultant for Catapult Systems. A Microsoft MVP (SharePoint Server), Matthew blogs about SharePoint and Microsoft technologies related to collaboration, web content management and productivity.
RSS Feed

Create a XML Test Page for Search Results

I have been working on a couple search projects lately and have found it very helpful to create a XML Results page in my Search Center.

It is easy enough to do.

  1. In the Search Center choose Site Actions | Create Page.
  2. Create a new Search Results page and call it XMLResults.aspx

  3. Once the page is created, set the "Target search results page URL" property of the Search Box to "xmlresults.aspx". This will direct any new queries from the XMLResults page back to the page, rather than the default Results page.

  4. Edit the Search Core Results Web part and remove all of the XSL and replace it with the text from this MSDN Article.
    <?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>
  5. Click OK to save your changes.
  6. Add a tab for your new page by clicking the "Add new tab" link under the tab strip.
  7. Complete the form with a Tab Name of XML, Page of xmlresults.aspx.

  8. Choose OK and return to the XMLResults page. Publish the XMLResults page.
  9. Execute a query that returns results and you should see something like the following:

Posted by Matthew McDermott on Thursday, 28 Aug 2008 09:14
2 Comments | Filed under: Search, Web Publishing
Bookmark this post with:        

Comments

On 21 Aug 2009 10:17, Kindler Chase said:

Thanks for posting the custom XML results page. Works great :)

On 21 Nov 2009 10:57, Michael said:

This is great. Thank you for such a great post. Michael

Leave a comment

Name (required)

Url

Email

Comments

Complete this section to post your comment