|
From: <rga...@us...> - 2002-10-21 20:53:09
|
Update of /cvsroot/csms/csms-core/src/documentation/override/forrest/skins/csms-site/xslt/html In directory usw-pr-cvs1:/tmp/cvs-serv17822 Added Files: book2menu.xsl document2html.xsl site2xhtml.xsl Log Message: Added skin to forrest --- NEW FILE: book2menu.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="resource"/> <xsl:template match="book"> <menu> <xsl:apply-templates/> </menu> </xsl:template> <xsl:template match="project"> </xsl:template> <!-- <xsl:template match="menu[position()=1]"> <xsl:apply-templates/> </xsl:template> --> <xsl:template match="menu"> <div id="submenu"> <h4><xsl:value-of select="@label"/></h4> <ul> <xsl:apply-templates/> </ul> </div> </xsl:template> <xsl:template match="menu-item"> <li> <xsl:if test="not(@type) or @type!='hidden'"> <xsl:choose> <xsl:when test="@href=$resource"> <xsl:value-of select="@label"/> </xsl:when> <xsl:otherwise> <a href="{@href}"><xsl:value-of select="@label"/></a> </xsl:otherwise> </xsl:choose> </xsl:if> </li> </xsl:template> <xsl:template match="external"> <xsl:if test="not(@type) or @type!='hidden'"> <li> <a href="{@href}"><xsl:value-of select="@label"/></a> </li> </xsl:if> </xsl:template> <xsl:template match="node()|@*" priority="-1"/> </xsl:stylesheet> --- NEW FILE: document2html.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- ====================================================================== --> <!-- document section --> <!-- ====================================================================== --> <xsl:template match="/"> <!-- checks if this is the included document to avoid neverending loop --> <xsl:if test="not(book)"> <document> <xsl:choose> <xsl:when test="document/header/title"> <title><xsl:value-of select="document/header/title"/></title> </xsl:when> <xsl:otherwise> <title>NO TITLE</title> </xsl:otherwise> </xsl:choose> <body> <xsl:apply-templates/> <xsl:if test="/document/header/authors"> <div id="authors"> <xsl:for-each select="/document/header/authors/person"> <xsl:choose> <xsl:when test="position()=1">by </xsl:when> <xsl:otherwise>, </xsl:otherwise> </xsl:choose> <xsl:value-of select="@name" /> </xsl:for-each> </div> </xsl:if> </body> </document> </xsl:if> <xsl:if test="book"> <xsl:apply-templates/> </xsl:if> </xsl:template> <!-- ====================================================================== --> <!-- header section --> <!-- ====================================================================== --> <xsl:template match="header"> <!-- ignore on general document --> </xsl:template> <!-- ====================================================================== --> <!-- body section --> <!-- ====================================================================== --> <xsl:template match="section"> <xsl:variable name = "level" select = "count(ancestor::section)+1" /> <xsl:choose> <xsl:when test="$level=1"> <h2><xsl:value-of select="@title"/></h2> </xsl:when> <xsl:when test="$level=2"> <h3><xsl:value-of select="@title"/></h3> </xsl:when> <xsl:when test="$level=3"> <h4><xsl:value-of select="@title"/></h4> </xsl:when> <xsl:otherwise> <h5><xsl:value-of select="@title"/></h5> </xsl:otherwise> </xsl:choose> <div class="section"><xsl:apply-templates/></div> </xsl:template> <!-- ====================================================================== --> <!-- footer section --> <!-- ====================================================================== --> <xsl:template match="footer"> <!-- ignore on general documents --> </xsl:template> <!-- ====================================================================== --> <!-- paragraph section --> <!-- ====================================================================== --> <xsl:template match="p"> <p><xsl:apply-templates/></p> </xsl:template> <xsl:template match="note"> <p><i><xsl:apply-templates/></i></p> </xsl:template> <xsl:template match="source"> <div class="code"><pre><xsl:apply-templates/></pre></div> </xsl:template> <xsl:template match="fixme | note | warning"> <div class="frame {local-name()}"> <div class="label"> <xsl:choose> <xsl:when test="local-name() = 'note'">Note</xsl:when> <xsl:when test="local-name() = 'warning'">Warning</xsl:when> <xsl:otherwise> Fixme (<xsl:value-of select="@author" />) </xsl:otherwise> </xsl:choose> </div> <div class="content"> <xsl:apply-templates /> </div> </div> </xsl:template> <!-- ====================================================================== --> <!-- list section --> <!-- ====================================================================== --> <xsl:template match="ul|ol|dl"> <blockquote> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </blockquote> </xsl:template> <xsl:template match="li"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="sl"> <ul> <xsl:apply-templates/> </ul> </xsl:template> <xsl:template match="dt"> <li> <strong><xsl:value-of select="."/></strong> <xsl:text> - </xsl:text> <xsl:apply-templates select="dd"/> </li> </xsl:template> <!-- ====================================================================== --> <!-- table section --> <!-- ====================================================================== --> <xsl:template match="table"> <table class="body-table"> <caption><xsl:value-of select="caption"/></caption> <xsl:apply-templates/> </table> </xsl:template> <xsl:template match="tr"> <tr class="body-table"><xsl:apply-templates/></tr> </xsl:template> <xsl:template match="th"> <th class="body-table" colspan="{@colspan}" rowspan="{@rowspan}"> <b><xsl:apply-templates/></b>  </th> </xsl:template> <xsl:template match="td"> <td class="body-table" colspan="{@colspan}" rowspan="{@rowspan}"> <xsl:apply-templates/>  </td> </xsl:template> <xsl:template match="tn"> <tn class="body-table" colspan="{@colspan}" rowspan="{@rowspan}">   </tn> </xsl:template> <xsl:template match="caption"> <!-- ignore since already used --> </xsl:template> <!-- ====================================================================== --> <!-- markup section --> <!-- ====================================================================== --> <xsl:template match="strong"> <b><xsl:apply-templates/></b> </xsl:template> <xsl:template match="em"> <i><xsl:apply-templates/></i> </xsl:template> <xsl:template match="code"> <span class="fixed"><xsl:apply-templates/></span> </xsl:template> <xsl:template match="sup"> <sup><xsl:apply-templates/></sup> </xsl:template> <xsl:template match="sub"> <sub><xsl:apply-templates/></sub> </xsl:template> <!-- ====================================================================== --> <!-- images section --> <!-- ====================================================================== --> <xsl:template match="figure"> <p> <xsl:choose> <xsl:when test="string(@width) and string(@height)"> <img src="{@src}" alt="{@alt}" width="{@width}" height="{@height}"/> </xsl:when> <xsl:otherwise> <img src="{@src}" alt="{@alt}"/> </xsl:otherwise> </xsl:choose> </p> </xsl:template> <xsl:template match="img"> <img src="{@src}" alt="{@alt}"/> </xsl:template> <xsl:template match="icon"> <img src="{@src}" alt="{@alt}"/> </xsl:template> <!-- ====================================================================== --> <!-- links section --> <!-- ====================================================================== --> <xsl:template match="link"> <a href="{@href}"><xsl:apply-templates/></a> </xsl:template> <xsl:template match="connect"> <xsl:apply-templates/> </xsl:template> <xsl:template match="jump"> <a href="{@href}#{@anchor}"><xsl:apply-templates/></a> </xsl:template> <xsl:template match="fork"> <a href="{@href}" target="_blank"><xsl:apply-templates/></a> </xsl:template> <xsl:template match="anchor"> <a name="{@id}"><xsl:comment>anchor</xsl:comment></a> </xsl:template> <!-- ====================================================================== --> <!-- specials section --> <!-- ====================================================================== --> <xsl:template match="br"> <br/> </xsl:template> </xsl:stylesheet> --- NEW FILE: site2xhtml.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <head> <title><xsl:value-of select="/site/document/title"/></title> <link rel="stylesheet" type="text/css" href="skin/common.css" /> </head> <body> <!-- header --> <div id="header"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td id="jakartaLogoTD" valign="middle" align="left"><a href="@group-logo.href@"><img id="jakartaLogo" src="@group-logo.src@" border="0"/></a></td> <td id="projectLogoTD" valign="middle" align="right"><a href="@project-logo.href@"><img id="projectLogo" src="@project-logo.src@" border="0"/></a></td> </tr> </table></div> <!-- end header --> <!-- breadcrumb trail (javascript-generated) --> <div id="breadcrumbs"> <a href="@link1.href@" class="menu">@link1@ ></a> <a href="@link2.href@" class="menu">@link2@ ></a> <a href="@link3.href@" class="menu">@link3@</a> <script language="JavaScript1.2" type="text/javascript"> <!-- function sentenceCase(str) { var lower = str.toLowerCase(); return lower.substr(0,1).toUpperCase() + lower.substr(1); } function getDirsAsArray() { var trail = document.location.pathname.split("/"); var lastdir = (trail[trail.length-1].indexOf(".html") != -1)? trail.length-2 : trail.length-1; var urlprefix = "/avalon/"; var postfix = " >"; for(var i = 1; i <= lastdir; i++) { document.writeln('<a href=' + urlprefix + trail[i] + ' class="menu">' + sentenceCase(trail[i]) + '</a>'+postfix); urlprefix += trail[i] + "/"; if(i == lastdir-1) postfix = ":"; } } getDirsAsArray(); // --> </script> </div> <!-- end breadcrumb trail --> <!-- main section of page --> <div id="main"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <!-- menu --> <div id="menu"> <xsl:copy-of select="/site/menu/node()|@*"/> </div> <!-- end menu column --> </td> <!-- spacer --> <td width="10"> </td> <td valign="top" width="100%"> <!-- contents column --> <!-- contents --> <div id="title"><h1><xsl:value-of select="/site/document/title"/></h1></div> <div id="contents"> <xsl:copy-of select="/site/document/body/node()|@*"/> </div> <!-- end contents column --> <script language="JavaScript"> <![CDATA[<!-- document.write("last modified: " + document.lastModified); // -->]]> </script> </td> </tr> </table></div> <!-- end main section of page --> <!-- footer --> <div id="footer"> Copyright ©@year@ @vendor@. All Rights Reserved. </div> <a href="http://jakarta.apache.org/ant/"><img align="right" src="skin/images/ant_logo_medium.gif" alt="Ant Logo" border="0"/></a> <a href="http://xml.apache.org/cocoon/"><img align="right" src="skin/images/built-with-cocoon.gif" alt="Cocoon Logo" border="0"/></a> <a href="http://www.krysalis.org/centipede/"><img align="right" src="skin/images/centipede-logo-small.gif" alt="Krysalis Centipede Logo" border="0"/></a> <a href="http://sourceforge.net/projects/csms"><img src="http://sourceforge.net/sflogo.php?&group_id=65029&type=5" width="210" height="62" border="0" alt="SourceForge.net Logo"/></a> <!-- end footer --> </body> </html> </xsl:template> </xsl:stylesheet> |