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.

Test Search Results Page

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 Create search page
  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.

    Target XSL

  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. Add a tab

  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: Test query

|| Search || Web Publishing

comments powered by Disqus

Let's Get In Touch!


Ready to start your next project with us? That’s great! Give us a call or send us an email and we will get back to you as soon as possible!

+1.512.539.0322