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

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

Experimental display of outline of document.
-->
<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" encoding="utf-8"/>
  <xsl:strip-space elements="*"/>
  <xsl:preserve-space elements="info note warn li"/>
  <xsl:param name="default.uri"/>
  <xsl:param name="request.preferred_style"/>
  <xsl:param name="stylesheet.version">
    <xsl:text>$Id: outline.xsl,v 2.11 2010/04/28 18:35:25 jmates Exp $</xsl:text>
  </xsl:param>
<!-- basic root element and section handling. -->
<!-- these will the templates most often overridden -->
<!-- you may also want to handle the summary element -->
  <xsl:template match="eolas">
    <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" mode="outline"/>
<!--        <xsl:call-template name="page-footer"/> -->
      </body>
    </xsl:element>
  </xsl:template>
  <xsl:template match="section[section]" mode="outline">
    <p>
<!--      <xsl:number count="section" format="1"/>
      <xsl:text>. </xsl:text> -->
      <xsl:value-of select="title"/>
    </p>
    <blockquote>
      <xsl:apply-templates select="section" mode="outline"/>
    </blockquote>
  </xsl:template>
  <xsl:template match="section" mode="outline">
    <p>
<!--      <xsl:number count="section" format="1"/>
      <xsl:text>. </xsl:text> -->
      <xsl:value-of select="title"/>
    </p>
<!--    <blockquote>
      <xsl:apply-templates select="section" mode="outline"/>
    </blockquote> -->
  </xsl:template>
</xsl:stylesheet>
