<?xml version="1.0" encoding="utf8"?>
<!--
$Id: omniweb.xsl,v 1.33 2004/10/16 03:21:37 jmates Exp $

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

Stylesheet for eolas and OmniWeb.
-->
<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"/>
  <xsl:output method="html" indent="no"/>
  <xsl:strip-space elements="*"/>
  <xsl:preserve-space elements="info note warn li"/>
  <xsl:param name="stylesheet.version">
    <xsl:text>$Id: omniweb.xsl,v 1.33 2004/10/16 03:21:37 jmates Exp $</xsl:text>
  </xsl:param>
  <xsl:param name="request.preferred_style">
    <xsl:text>omniweb</xsl:text>
  </xsl:param>
<!-- OmniWeb does not support list-style-type: none <li> elements... -->
  <xsl:template match="info[../li]|note[../li]|warn[../li]">
    <xsl:call-template name="genElement">
      <xsl:with-param name="element" select="'p'"/>
    </xsl:call-template>
  </xsl:template>
  <xsl:template match="data[../li]">
    <xsl:call-template name="datablock"/>
  </xsl:template>
<!-- need to handle li a bit differently in OmniWeb -->
  <xsl:template match="li">
    <xsl:element name="{name()}">
      <xsl:choose>
        <xsl:when test="@style">
          <xsl:attribute name="style">
            <xsl:value-of select="@style"/>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="@class">
          <xsl:attribute name="class">
            <xsl:value-of select="@class"/>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="@xml:lang">
          <xsl:attribute name="class">
            <xsl:text>lang-</xsl:text>
            <xsl:value-of select="@xml:lang"/>
          </xsl:attribute>
        </xsl:when>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="@xlink:href">
          <a href="{@xlink:href}">
            <xsl:apply-templates/>
          </a>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates/>
        </xsl:otherwise>
      </xsl:choose>
<!-- kluge spacing between adjacent li; only other way appears to be with CSS2 (I forget how :)  this is due to my dislike of browsers bunching list elements all together by default -->
      <xsl:if test="name((following-sibling::*)[1])='li'">
        <br/>
        <xsl:text> </xsl:text>
      </xsl:if>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>
