You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by an...@apache.org on 2004/12/06 04:46:54 UTC
svn commit: r109943 - /forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl /forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl
Author: antonio
Date: Sun Dec 5 19:46:53 2004
New Revision: 109943
URL: http://svn.apache.org/viewcvs?view=rev&rev=109943
Log:
Compact code. Remove trailing spaces
Modified:
forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl
forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl
Modified: forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl
Url: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl?view=diff&rev=109943&p1=forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl&r1=109942&p2=forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl&r2=109943
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl (original)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/document2html.xsl Sun Dec 5 19:46:53 2004
@@ -29,10 +29,10 @@
- <a name/> anchors are added if the id attribute is specified
-->
-<xsl:stylesheet version="1.0"
+<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:param name="dynamic-page" select="'false'"/>
+ <xsl:param name="dynamic-page" select="'false'"/>
<xsl:param name="notoc"/>
<xsl:param name="path"/>
<!-- <xsl:include href="split.xsl"/> -->
@@ -56,8 +56,8 @@
<xsl:template match="document">
<div class="content">
<table summary="" class="title">
- <tr>
- <td valign="middle">
+ <tr>
+ <td valign="middle">
<xsl:if test="normalize-space(header/title)!=''">
<h1>
<xsl:value-of select="header/title"/>
@@ -139,6 +139,7 @@
<div class="frame {local-name()}">
<div class="label">
<xsl:choose>
+ <!-- FIXME: i18n Transformer here -->
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
<xsl:when test="local-name() = 'note'">Note</xsl:when>
<xsl:when test="local-name() = 'warning'">Warning</xsl:when>
@@ -201,8 +202,8 @@
<xsl:apply-templates/>
<!--
<xsl:call-template name="format">
- <xsl:with-param select="." name="txt" />
- <xsl:with-param name="width">80</xsl:with-param>
+ <xsl:with-param select="." name="txt" />
+ <xsl:with-param name="width">80</xsl:with-param>
</xsl:call-template>
-->
</pre>
@@ -214,13 +215,8 @@
<xsl:template match="icon">
<xsl:apply-templates select="@id"/>
- <img src="{@src}" alt="{@alt}" class="icon">
- <xsl:if test="@height">
- <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@width">
- <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
- </xsl:if>
+ <img class="icon">
+ <xsl:copy-of select="@height | @width | @src | @alt"/>
</img>
</xsl:template>
@@ -232,13 +228,8 @@
<xsl:template match="figure">
<xsl:apply-templates select="@id"/>
<div align="center">
- <img src="{@src}" alt="{@alt}" class="figure">
- <xsl:if test="@height">
- <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@width">
- <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
- </xsl:if>
+ <img class="figure">
+ <xsl:copy-of select="@height | @width | @src | @alt"/>
</img>
</div>
</xsl:template>
@@ -246,11 +237,7 @@
<xsl:template match="table">
<xsl:apply-templates select="@id"/>
<table cellpadding="4" cellspacing="1" class="ForrestTable">
- <xsl:if test="@cellspacing"><xsl:attribute name="cellspacing"><xsl:value-of select="@cellspacing"/></xsl:attribute></xsl:if>
- <xsl:if test="@cellpadding"><xsl:attribute name="cellpadding"><xsl:value-of select="@cellpadding"/></xsl:attribute></xsl:if>
- <xsl:if test="@border"><xsl:attribute name="border"><xsl:value-of select="@border"/></xsl:attribute></xsl:if>
- <xsl:if test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:if>
- <xsl:if test="@bgcolor"><xsl:attribute name="bgcolor"><xsl:value-of select="@bgcolor"/></xsl:attribute></xsl:if>
+ <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor"/>
<xsl:apply-templates/>
</table>
</xsl:template>
@@ -264,9 +251,10 @@
<xsl:template match="header/authors">
<xsl:for-each select="person">
<xsl:choose>
- <xsl:when test="position()=1">by </xsl:when>
- <xsl:otherwise>, </xsl:otherwise>
+ <xsl:when test="position()=1">by</xsl:when>
+ <xsl:otherwise>,</xsl:otherwise>
</xsl:choose>
+ <xsl:text> </xsl:text>
<xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:template>
@@ -287,19 +275,15 @@
</xsl:choose>
</span>
</xsl:template>
-
+
<xsl:template match="@major">
v<xsl:value-of select="."/>
</xsl:template>
-
- <xsl:template match="@minor">
- <xsl:value-of select="concat('.',.)"/>
- </xsl:template>
-
- <xsl:template match="@fix">
+
+ <xsl:template match="@minor | @fix">
<xsl:value-of select="concat('.',.)"/>
</xsl:template>
-
+
<xsl:template match="@tag">
<xsl:value-of select="concat('-',.)"/>
</xsl:template>
@@ -340,8 +324,8 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-
- <!-- Templates for "toc" mode. This will generate a complete
+
+ <!-- Templates for "toc" mode. This will generate a complete
Table of Contents for the document. This will then be used
by the site2xhtml to generate a Menu ToC and a Page ToC -->
@@ -379,6 +363,6 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
-
+
</xsl:stylesheet>
Modified: forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl
Url: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl?view=diff&rev=109943&p1=forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl&r1=109942&p2=forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl&r2=109943
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl (original)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/site2xhtml.xsl Sun Dec 5 19:46:53 2004
@@ -80,10 +80,10 @@
<!-- Whether to obfuscate email links -->
<xsl:variable name="obfuscate-mail-links" select="//skinconfig/obfuscate-mail-links"/>
- <!-- If true, the font size script will not be rendered -->
+ <!-- If true, the font size script will not be rendered -->
<xsl:variable name="disable-font-script" select="//skinconfig/disable-font-script"/>
<!-- If true, an the images on all external links will not be added -->
- <xsl:variable name="disable-external-link-image" select="//skinconfig/disable-external-link-image"/>
+ <xsl:variable name="disable-external-link-image" select="//skinconfig/disable-external-link-image"/>
<xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
<xsl:variable name="spacer" select="concat($root, 'skin/images/spacer.gif')"/>
@@ -93,7 +93,7 @@
<xsl:if test="(//skinconfig/trail/link3/@name)and(//skinconfig/trail/link3/@name!='')"> > <a href="{//skinconfig/trail/link3/@href}"> <xsl:value-of select="//skinconfig/trail/link3/@name"/></a> </xsl:if>
<script type="text/javascript" language="JavaScript" src="{$root}skin/breadcrumbs.js"/>
</xsl:template>
-
+
<xsl:template match="site">
<html>
<head>
@@ -185,19 +185,19 @@
<!-- Add links to any standards-compliance logos -->
<xsl:template name="compliancy-logos">
<xsl:if test="$filename = 'index.html' and //skinconfig/disable-compliance-links = 'false'">
- <a href="http://validator.w3.org/check/referer"><img class="logoImage"
+ <a href="http://validator.w3.org/check/referer"><img class="logoImage"
src="{$skin-img-dir}/valid-html401.png"
alt="Valid HTML 4.01!" title="Valid HTML 4.01!" height="31" width="88" border="0"/></a>
-
- <a href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logoImage"
- src="{$skin-img-dir}/vcss.png"
+
+ <a href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logoImage"
+ src="{$skin-img-dir}/vcss.png"
alt="Valid CSS!" title="Valid CSS!" height="31" width="88" border="0"/></a>
</xsl:if>
</xsl:template>
<!-- Generates the PDF link -->
<xsl:template match="div[@id='skinconf-pdflink']">
- <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
+ <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
<td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
<img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
PDF</a>
@@ -214,7 +214,7 @@
</td>
</xsl:if>
</xsl:template>
-
+
<!-- Generates the POD link -->
<xsl:template match="div[@id='skinconf-podlink']">
<xsl:if test="$disable-pod-link = 'false'">
@@ -224,20 +224,20 @@
</td>
</xsl:if>
</xsl:template>
-
+
<!-- Generates the XML link -->
<xsl:template match="div[@id='skinconf-xmllink']">
<xsl:if test="$disable-xml-link = 'false'">
<td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
- <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
- xml</a>
+ <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="XML"/><br/>
+ XML</a>
</td>
</xsl:if>
</xsl:template>
<!-- Generates the "printer friendly version" link -->
<xsl:template match="div[@id='skinconf-printlink']">
- <xsl:if test="$disable-print-link = 'false'">
+ <xsl:if test="$disable-print-link = 'false'">
<script type="text/javascript" language="Javascript">
function printit() {
if (window.print) {
@@ -245,9 +245,7 @@
window.print();
}
}
-</script>
-<script type="text/javascript" language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
@@ -277,7 +275,7 @@
<a href="{@href}" class="external">
<xsl:apply-templates/>
</a>
- </xsl:when>
+ </xsl:when>
<xsl:otherwise>
<!-- xsl:copy-of makes sure we copy <a href> as well as <a name>
or any other <a ...> forms -->
@@ -298,10 +296,10 @@
</xsl:if>
</xsl:template>
- <xsl:template name="minitoc">
+ <xsl:template name="minitoc">
<xsl:param name="tocroot"/>
<xsl:if test="count($tocroot/tocitem) >= $config/toc/@min-sections">
- <xsl:if test="contains($config/toc/@location,'page')">
+ <xsl:if test="contains($config/toc/@location,'page')">
<ul class="minitoc">
<xsl:for-each select="$tocroot/tocitem">
<li>
@@ -320,23 +318,21 @@
</xsl:if>
</xsl:template>
- <xsl:template name="html-meta">
+ <xsl:template name="html-meta">
<meta name="Generator" content="Apache Forrest"/>
- <meta>
- <xsl:attribute name="name">Forrest-version</xsl:attribute>
+ <meta name="Forrest-version">
<xsl:attribute name="content">
<xsl:value-of select="//info/forrest-version"/>
</xsl:attribute>
</meta>
- <meta>
- <xsl:attribute name="name">Forrest-skin-name</xsl:attribute>
+ <meta name="Forrest-skin-name">
<xsl:attribute name="content">
<xsl:value-of select="//info/project-skin"/>
</xsl:attribute>
</meta>
</xsl:template>
- <xsl:template name="feedback">
+ <xsl:template name="feedback">
<div id="feedback">
<xsl:value-of select="$config/feedback"/>
<xsl:choose>