<?xml version='1.0' encoding='ISO-8859-1'?>
<!-- public2html.xsl
  - style sheet to generate an HTML page on the W3C site from XML source
  - Author: Max Froumentin (W3C) mf@w3.org
  - Copyright (c) 2001 W3C
  - $Id: public2html.xsl,v 1.42 2009/04/30 15:58:10 liam Exp $
  -->
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes" encoding="iso-8859-1"/>

<xsl:template match="/">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title><xsl:value-of select="publicPage/title"/></title>
    <style type="text/css" media="screen">
      <!-- d-o-e because of browser bug that make them ignore stylesheet 
           if " is &quot; -->
      <xsl:text disable-output-escaping="yes">
        @import "stylesheets/public.css";
        body { background-color: white };
      </xsl:text>
    </style>
  </head>

  <!-- BANNER: W3C - Domain logo -->

  <body>
    <div class="top-banner">
      <xsl:apply-templates select="/publicPage/notice"/>

      <a href="/"><img alt="W3C" src="/Icons/WWW/w3c_home"/></a>
      <xsl:choose>
        <xsl:when test="/publicPage/@domain='DF'">
          <a href="/DF/"> <img src="/Icons/df" width="212" height="48" alt="Document Formats Domain"/></a>
        </xsl:when>
       <xsl:when test="/publicPage/@domain='UbiWeb'">
          <a href="../../UbiWeb/"> <img src="../../Icons/ubi212" width="212" height="48" alt="Uniquitous Web Domain"/></a>
        </xsl:when>
       <xsl:when test="/publicPage/@domain='Architecture'">
          <a href="../../Architecture/"> <img src="../../Icons/arch" width="212" height="48" alt="Architecture Domain"/></a>
        </xsl:when>
        <xsl:otherwise>
          <xsl:message>Unknown or missing domain</xsl:message>
        </xsl:otherwise>
      </xsl:choose>
    </div>

    <div class="main-box">

      <xsl:apply-templates select="/publicPage/title"/>

      <div class="intro">
        <xsl:apply-templates select="publicPage/intro"/>
      </div>

      <div class="columns-container">
        <div class="left-content">
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Specifications'"/>
            <xsl:with-param name="resource" select="'spec'"/>
          </xsl:call-template>
  
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Resources from the WG'"/>
            <xsl:with-param name="resource" select="'wg-document'"/>
          </xsl:call-template>
  
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Mailing Lists'"/>
            <xsl:with-param name="resource" select="'mailing-list'"/>
          </xsl:call-template>
  
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Software'"/>
            <xsl:with-param name="resource" select="'implementation'"/>
          </xsl:call-template>

          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Translations'"/>
            <xsl:with-param name="resource" select="'translation'"/>
          </xsl:call-template>
  

        </div>

        <div class="right-content">
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Tutorials'"/>
            <xsl:with-param name="resource" select="'tutorial'"/>
          </xsl:call-template>
  
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Reference'"/>
            <xsl:with-param name="resource" select="'ref'"/>
          </xsl:call-template>
  
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Articles'"/>
            <xsl:with-param name="resource" select="'article'"/>
          </xsl:call-template>
  
          <xsl:call-template name="side-content">
            <xsl:with-param name="title" select="'Links'"/>
            <xsl:with-param name="resource" select="'link'"/>
          </xsl:call-template>
        </div>

  
          <!-- middle column: news -->
  
        <div class="centre-content">
	      <h2 id="news">News</h2>
          <xsl:for-each select="publicPage/news/item[position()&lt;11]">
              <h3>
                <xsl:variable name="id" select="concat('news-',@date,'-',translate(@title,' ()/+','_----'))"/>
                <a name="{$id}" id="{$id}">
                  <span class="date"><xsl:value-of select="@date"/></span>
                  <xsl:text>: </xsl:text>
                  <xsl:value-of select="@title"/>
                </a>
              </h3>
              <p><xsl:apply-templates/></p>

          </xsl:for-each>
        </div>
  
      </div>

    <xsl:apply-templates select="publicPage/maintainer"/>
    </div>
   

  </body>
</html>
</xsl:template>

<xsl:template match="title">
  <h1>
  <xsl:if test="@logo">
    <img src="{@logo}" alt="Activity's logo"/>
    <xsl:text> </xsl:text>
  </xsl:if>
  <xsl:apply-templates/>
  </h1>
</xsl:template>

<xsl:template name="side-content">
  <xsl:param name="title" select="'No Title'"/>
  <xsl:param name="resource" select="'misc'"/>

  <xsl:if test="/publicPage/resources/resource[@type=$resource]">
    <xsl:variable name="id" select="translate($title,' ()/+','_----')"/>
    <div class="side-item">
      <div class="side-item-title">
        <a name="{$id}" id="{$id}"><xsl:value-of select="$title"/></a>
      </div>

	<div class="side-item-content">
	  <ul>
	    <xsl:for-each select="/publicPage/resources/resource[@type=$resource]">
	      <li>
	      <xsl:apply-templates/>
	      </li>
	    </xsl:for-each>
	  </ul>
	</div>
    </div>
  </xsl:if>
</xsl:template>

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

<xsl:template match="maintainer">
  <address>
    <a href="{@uri}">
      <xsl:value-of select="@name"/>
    </a>
    (<xsl:value-of select="@email"/>),
    <xsl:value-of select="@occupation"/><br/>
    <xsl:apply-templates/>
  </address>
</xsl:template>

<xsl:template match="notice">
  <h2 class="notice"><xsl:apply-templates/></h2>
</xsl:template>

<!-- treat anything else as xhtml -->

<xsl:template match="*">
 <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
  <xsl:apply-templates select="@*|node()"/>
 </xsl:element>
</xsl:template>
 
 <xsl:template match="@*">
  <xsl:copy>
   <xsl:apply-templates/>
  </xsl:copy>
 </xsl:template>

</xsl:stylesheet>
