<?xml version="1.0" encoding="utf8"?>
<!--
$Id: valid.xsl,v 2.10 2005/12/22 20:41:51 jmates Exp $

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

Stylesheet for eolas and Mozilla on Mac OS.
-->
<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="xml" media-type="text/html" indent="no"/>
  <xsl:param name="stylesheet.version">
    <xsl:text>$Id: valid.xsl,v 2.10 2005/12/22 20:41:51 jmates Exp $</xsl:text>
  </xsl:param>
  <xsl:param name="request.preferred_style">
    <xsl:text>default</xsl:text>
  </xsl:param>
  <xsl:template match="eolas">
    <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
</xsl:text>
    <xsl:element name="html">
      <xsl:choose>
        <xsl:when test="@xml:lang">
          <xsl:attribute name="lang">
            <xsl:value-of select="@xml:lang"/>
          </xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:attribute name="lang">
            <xsl:text>en-US</xsl:text>
          </xsl:attribute>
        </xsl:otherwise>
      </xsl:choose>
      <head>
        <title>
          <xsl:value-of select="summary/title"/>
        </title>
<!-- figure out CSS stylesheet to use by param name passed in -->
        <xsl:element name="link">
          <xsl:attribute name="rel">stylesheet</xsl:attribute>
          <xsl:attribute name="type">text/css</xsl:attribute>
          <xsl:attribute name="href">
            <xsl:text>/_xs/eolas/</xsl:text>
            <xsl:choose>
              <xsl:when test="string-length($request.preferred_style) &gt; 0">
                <xsl:value-of select="$request.preferred_style"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:text>default</xsl:text>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:text>.css</xsl:text>
          </xsl:attribute>
        </xsl:element>
<!--        <link rel="P3Pv1" href="/w3c/p3p.xml"/> -->
        <meta name="MSSmartTagsPreventParsing" content="TRUE"/>
      </head>
      <body>
        <xsl:call-template name="navlinks"/>
        <xsl:call-template name="page-header"/>
        <xsl:apply-templates select="section"/>
        <xsl:call-template name="page-footer"/>
      </body>
    </xsl:element>
  </xsl:template>
<!-- valid HTML requires invisible list items surrounding <p> and such embedded inside lists, this is a KLUGE, better to treat <li> as a container, and only throw data into <info> or other blocks. -->
  <xsl:template match="info[../li]|note[../li]|warn[../li]">
    <li style="list-style-type: none;">
      <xsl:call-template name="genElement">
        <xsl:with-param name="element" select="'p'"/>
      </xsl:call-template>
    </li>
  </xsl:template>
  <xsl:template match="data[../li]">
    <li style="list-style-type: none;">
      <xsl:call-template name="datablock"/>
    </li>
  </xsl:template>
</xsl:stylesheet>
