Errors and Performance Issues - AFS

AFS Integration Guide

Reference Guide

When an error occurs while processing the style sheet, AFS reverts to XML Output and produces an error message in the output feed.

The XSLT style sheet must be accurate. Like any piece of software, an XSLT style sheet must be thoroughly tested and validated. Since XSLT is an interpreted language, errors only occur at run-time during user queries. It may only happen for selected combinations of filters or sources.

The AFS v7 XML output feed is designed for fast and easy XSLT processing. When writing an XSLT style sheet, it must be taken into account that this program will be executed for each query of the search service requesting an HTML output — which means several millions of times per day in heavily loaded sites. Usual recommendations include:

  • Avoiding using // in XPaths to select any node in the feed.
  • Using xsl:key and key() to store the result of an XPath, and to retrieve the value. The XPath can only be evaluated once . Its value is accessed in random memory in id calls.
  • Using templates too zoom in the document and from there use relative XPaths.

A sample, lightweight, and efficient XSLT style sheet is bundled with AFS v7.