<?xml version="1.0"?>
<!-- Basic stylesheet for processing documents written in "faq.dtd" into
	HTML equivalents. Not very sophisticated, doesn't handle all the
	possible details (eg of <link/>), but it suffices.

	$Id: faq.xsl,v 1.1 2002/06/10 23:50:43 liam Exp $
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  exclude-result-prefixes="xlink #default">

  <xsl:output method="xml" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
    
  <xsl:template match="/">
    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
        <xsl:apply-templates/>
    </html>
  </xsl:template>

  <xsl:template match="faq">
     <head>
	<title><xsl:value-of select="head/title"/></title>	
        <link href="/StyleSheets/activity-home.css" rel="stylesheet" type="text/css"/>
     </head>
     <body>

      <p align="right" class="navbar"><a href="/"><img align="left"
	    src="http://www.w3.org/Icons/w3c_home" border="0" alt="W3C" /></a><a
	  href="http://www.nist.gov"><img
	    src="http://www.nist.gov/itl/div897/images/nist_home.gif"
	    alt="National Institute of Standards and Technology" height="45"
	    width="231" align="left" border="0" /></a>

        <small><a href='http://www.w3.org/XML'>About XML</a> .
        <a href='http://www.w3.org/XML/Activity'>XML Activity statement</a><br />
        <a href="http://xw2k.sdct.itl.nist.gov/martinez/xmlts/2001/XML-Test-Suite/xmlconf/xmlfaq.html">Test Suites FAQ</a>
        <br />
        Member-restricted resource: <a href='http://www.w3.org/XML/Group/Core'>XML Working Group</a>
	</small></p>
	<xsl:apply-templates/>
     </body>
  </xsl:template>

  <xsl:template match="head">
     <xsl:apply-templates mode="head"/>
     <!-- Gather and generate the table of contents -->
     <xsl:apply-templates select="/faq/body" mode="toc"/>
  </xsl:template>

  <xsl:template match="title" mode="head">
     <h1 align="center" class="title" id="top"><xsl:value-of select="."/></h1> 
  </xsl:template>

  <xsl:template match="version" mode="head">
     <small><xsl:value-of select="."/></small> 
  </xsl:template>

  <xsl:template match="maintain" mode="head">
    <address>Maintained by:
        <a href="mailto:{email}?subject={subject}"><xsl:value-of select="name"/></a>
     </address>  
  </xsl:template>

  <xsl:template match="intro" mode="head">
     <xsl:apply-templates/>
     <p>
     <small>(Note: We maintain this document's source as
	<a href="http://xw2k.sdct.itl.nist.gov/martinez/xmlts/2001/XML-Test-Suite/xmlconf/faq[1].xml">faq.xml</a>, using the markup
	language defined by <a href="http://xw2k.sdct.itl.nist.gov/martinez/xmlts/2001/XML-Test-Suite/xmlconf/faq.dtd">faq.dtd</a>.
	This XHTML version is generated from that source using
	<a href="faq.xsl">faq.xsl</a>.)
     </small>
     </p>
  </xsl:template>


  <xsl:template match="body" mode="toc">
     <div class="toc">
       <h2><a name="toc">Table of contents</a></h2>
       <xsl:apply-templates select="section" mode="toc"/>
     </div>
  </xsl:template>

  <xsl:template match="section" mode="toc">
     <h3>
       <a href="#{@id}"><xsl:value-of select="title"/></a>
     </h3>
     <ul>
       <xsl:apply-templates select="qna" mode="toc"/>
     </ul>
  </xsl:template>

  <xsl:template match="qna" mode="toc">
     <li>
        <a href="#{@id}"><xsl:value-of select="q"/></a>
     </li>
  </xsl:template>



  <xsl:template match="section">
     <hr/>
     <h2><a name="{@id}"><xsl:value-of select="title"/></a></h2>
     <dl>
	<xsl:apply-templates select="qna"/>
     </dl>
  </xsl:template>

  <xsl:template match="qna">
     <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="q">
     <dt><b>
        <a name="{../@id}"><xsl:value-of select="."/></a>
     </b></dt>
  </xsl:template>

  <!-- Note that "a" means answer, not anchor, in the faq.dtd language!
       If you want to generate a reference, use <link/>.
  -->
  <xsl:template match="a">
     <dd>
        <xsl:apply-templates/>

        <p align="left">
          <a href="#top">Return to Top</a>
        </p>
     </dd>
  </xsl:template>



  <xsl:template match="body">
       <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="link">
     <a href="{@href}">
      <xsl:apply-templates/>
     </a>
  </xsl:template>

  <xsl:template match="p">
     <p><xsl:apply-templates/></p>
  </xsl:template>

  <!-- Anything not specifically handled is presumed to be
       HTML markup adopted into the FAQ DTD, and gets the
       identity transform. This is an attempt to avoid
       writing all the individual templates. -->
  <xsl:template match="@*|node()" priority="-1000">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
