<?xml version="1.0" encoding="utf8"?>
<!--
$Id: searchbot.xsl,v 1.11 2010/04/28 18:35:25 jmates Exp $

The author disclaims all copyrights and releases this document into
the public domain.

Stylesheet for eolas and web search agents (like GoogleBot).
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0">
  <xsl:import href="default.xsl"/>
<!-- HTML instead of XHTML as all bots likely do not support XHTML -->
  <xsl:output method="html" indent="no" encoding="utf-8"/>
  <xsl:strip-space elements="*"/>
  <xsl:preserve-space elements="info note warn li"/>
  <xsl:param name="stylesheet.version">
    <xsl:text>$Id: searchbot.xsl,v 1.11 2010/04/28 18:35:25 jmates Exp $</xsl:text>
  </xsl:param>
<!-- use default stylesheet (CSS) to avoid folks keying in on searchbot term -->
  <xsl:param name="request.preferred_style">
    <xsl:text>default</xsl:text>
  </xsl:param>
<!-- disable following, bots do not need -->
  <xsl:template name="navlinks"/>
  <xsl:template name="page-footer"/>
  <xsl:template name="page-header">
    <xsl:apply-templates select="summary/title"/>
    <xsl:choose>
      <xsl:when test="summary/abstract">
        <xsl:value-of select="summary/abstract"/>
      </xsl:when>
      <xsl:when test="summary/description">
        <xsl:value-of select="summary/description"/>
      </xsl:when>
    </xsl:choose>
  </xsl:template>
<!-- skip first title name for pages, as often repeats title due to eolas limitation -->
  <xsl:template match="/eolas/section[position()=1]/title"/>
  <xsl:template match="title">
    <xsl:element name="h{count(ancestor-or-self::section) + 1}">
      <a name="{generate-id(.)}">
        <xsl:apply-templates/>
      </a>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>
