You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2004/11/27 16:26:56 UTC
svn commit: r106722 - /httpd/httpd/trunk/docs/manual/style/css/manual.css /httpd/httpd/trunk/docs/manual/style/xsl/common.xsl
Author: nd
Date: Sat Nov 27 07:26:55 2004
New Revision: 106722
URL: http://svn.apache.org/viewcvs?view=rev&rev=106722
Log:
introduce data tables
Modified:
httpd/httpd/trunk/docs/manual/style/css/manual.css
httpd/httpd/trunk/docs/manual/style/xsl/common.xsl
Modified: httpd/httpd/trunk/docs/manual/style/css/manual.css
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/docs/manual/style/css/manual.css?view=diff&rev=106722&p1=httpd/httpd/trunk/docs/manual/style/css/manual.css&r1=106721&p2=httpd/httpd/trunk/docs/manual/style/css/manual.css&r2=106722
==============================================================================
--- httpd/httpd/trunk/docs/manual/style/css/manual.css (original)
+++ httpd/httpd/trunk/docs/manual/style/css/manual.css Sat Nov 27 07:26:55 2004
@@ -358,6 +358,16 @@
text-align: center;
}
+td.data {
+ font-family: monospace;
+ text-align: right;
+ padding-left: 1em;
+}
+
+th.data {
+ text-align: right;
+}
+
tr.odd { /* for large tables alternating colors */
background-color: #f2f2f2;
}
Modified: httpd/httpd/trunk/docs/manual/style/xsl/common.xsl
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/docs/manual/style/xsl/common.xsl?view=diff&rev=106722&p1=httpd/httpd/trunk/docs/manual/style/xsl/common.xsl&r1=106721&p2=httpd/httpd/trunk/docs/manual/style/xsl/common.xsl&r2=106722
==============================================================================
--- httpd/httpd/trunk/docs/manual/style/xsl/common.xsl (original)
+++ httpd/httpd/trunk/docs/manual/style/xsl/common.xsl Sat Nov 27 07:26:55 2004
@@ -96,13 +96,16 @@
<xsl:comment>
&lf;
<xsl:text> </xsl:text>
- <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+ <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+ <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
&lf;
<xsl:text> </xsl:text>
- <xsl:text>This file is generated from xml source: DO NOT EDIT</xsl:text>
+ <xsl:text>This file is generated from xml source: </xsl:text>
+ <xsl:text>DO NOT EDIT</xsl:text>
&lf;
<xsl:text> </xsl:text>
- <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+ <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
+ <xsl:text>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</xsl:text>
&lf;
<xsl:text> </xsl:text>
</xsl:comment>
@@ -747,6 +750,7 @@
</xsl:template>
<!-- /related/directivelist -->
+
<!-- ==================================================================== -->
<!-- <table> -->
<!-- ==================================================================== -->
@@ -757,31 +761,12 @@
<xsl:attribute name="class">bordered</xsl:attribute>
</xsl:if>
- <!-- style="zebra": alternating colors per row, i.e. every second row -->
- <!-- gets a class="odd". Header lines (no <td>) get a -->
- <!-- class="header". These lines will be excluded from -->
- <!-- the "odd" line count. That way header lines act -->
- <!-- interjectional, which creates a better visual and -->
- <!-- psychological effect. -->
<xsl:choose>
<xsl:when test="@style = 'zebra'">
- <xsl:for-each select="tr">
- <tr>
- <xsl:choose>
- <xsl:when test="count(td) = 0">
- <xsl:attribute name="class">header</xsl:attribute>
- </xsl:when>
-
- <xsl:when
- test="position() mod 2 =
- (count(preceding-sibling::tr[count(td) = 0]) mod 2)">
- <xsl:attribute name="class">odd</xsl:attribute>
- </xsl:when>
- </xsl:choose>
-
- <xsl:apply-templates />
- </tr>&lf;
- </xsl:for-each>
+ <xsl:apply-templates select="tr" mode="zebra-table" />
+ </xsl:when>
+ <xsl:when test="@style = 'data'">
+ <xsl:apply-templates select="tr" mode="data-table" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
@@ -790,6 +775,60 @@
</table>
</xsl:template>
<!-- /table -->
+
+<!-- data-table -->
+<xsl:template match="tr" mode="data-table">
+<!-- style="data": fixed font, padding-left and right alignment for <td>s -->
+<xsl:variable name="cross-table" select="boolean(
+ preceding-sibling::tr/th[1]|following-sibling::tr/th[1])" />
+
+<tr>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="local-name() = 'td'">
+ <td class="data">
+ <xsl:apply-templates select="*|@*|text()" />
+ </td>
+ </xsl:when>
+ <xsl:when test="local-name() = 'th' and
+ (not($cross-table) or
+ count(preceding-sibling::*) > 0)">
+ <th class="data">
+ <xsl:apply-templates select="*|@*|text()" />
+ </th>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="self::node()" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+</tr>&lf;
+</xsl:template>
+
+
+<!-- zebra-table -->
+<xsl:template match="tr" mode="zebra-table">
+<!-- style="zebra": alternating colors per row, i.e. every second row -->
+<!-- gets a class="odd". Header lines (no <td>) get a -->
+<!-- class="header". These lines will be excluded from -->
+<!-- the "odd" line count. That way header lines act -->
+<!-- interjectional, which creates a better visual and -->
+<!-- psychological effect. -->
+<tr>
+ <xsl:choose>
+ <xsl:when test="count(td) = 0">
+ <xsl:attribute name="class">header</xsl:attribute>
+ </xsl:when>
+
+ <xsl:when test="position() mod 2 = (count(preceding-sibling::tr[count(td) = 0]) mod 2)">
+ <xsl:attribute name="class">odd</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates />
+</tr>&lf;
+</xsl:template>
+<!-- /zebra-table -->
<!-- ==================================================================== -->