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 2002/11/17 06:23:23 UTC
cvs commit: httpd-2.0/docs/manual/style/xsl common.xsl directiveindex.xsl quickreference.xsl sitemap.xsl
nd 2002/11/16 21:23:23
Modified: docs/manual/style/xsl common.xsl directiveindex.xsl
quickreference.xsl sitemap.xsl
Log:
KISS.
<xsl:attribute> makes the life easy :)
Revision Changes Path
1.19 +50 -79 httpd-2.0/docs/manual/style/xsl/common.xsl
Index: common.xsl
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/common.xsl,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- common.xsl 10 Nov 2002 20:34:48 -0000 1.18
+++ common.xsl 17 Nov 2002 05:23:23 -0000 1.19
@@ -110,14 +110,12 @@
</div> <!-- /page-header -->
<div class="up">
- <xsl:choose>
- <xsl:when test="parentdocument">
- <a href="{parentdocument/@href}"><img src="{$path}/images/left.gif" alt="<-" title="<-" /></a>
- </xsl:when>
- <xsl:otherwise>
- <a href="./"><img src="{$path}/images/left.gif" alt="<-" title="<-" /></a>
- </xsl:otherwise>
- </xsl:choose>
+ <a href="./">
+ <xsl:if test="parentdocument">
+ <xsl:attribute name="href"><xsl:value-of select="parentdocument/@href"/></xsl:attribute>
+ </xsl:if>
+ <img src="{$path}/images/left.gif" alt="<-" title="<-" />
+ </a>
</div>
<div id="path">
@@ -160,11 +158,10 @@
<xsl:template name="bottom">
<div id="footer">
<p class="apache">
-
- <xsl:value-of select="$messages/message[@name='maintainedby']"/>
-
+ <xsl:value-of select="$messages/message[@name='maintainedby']"/>
<xsl:text> </xsl:text>
- <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a>
+ <a href="http://httpd.apache.org/docs-project/"
+ >Apache HTTP Server Documentation Project</a>
</p>
<xsl:call-template name="super-menu"/>
@@ -424,19 +421,13 @@
<!-- ground colors, depending on type of note. -->
<!-- -->
<xsl:template match="note">
- <xsl:choose>
- <xsl:when test="@type='warning'">
- <div class="warning">
- <xsl:apply-templates/>
- </div>
- </xsl:when>
-
- <xsl:otherwise>
- <div class="note">
- <xsl:apply-templates/>
- </div>
- </xsl:otherwise>
- </xsl:choose>
+ <div class="note">
+ <xsl:if test="@type='warning'">
+ <xsl:attribute name="class">warning</xsl:attribute>
+ </xsl:if>
+
+ <xsl:apply-templates/>
+ </div>
</xsl:template>
<!-- /note -->
@@ -575,74 +566,54 @@
<!-- <table> -->
<!-- -->
<xsl:template match="table">
- <xsl:variable name="content"><xsl:choose>
- <xsl:when test="@style = 'zebra'">
- <xsl:for-each select="tr">
-
- <!-- catch content -->
- <xsl:variable name="current">
- <xsl:apply-templates />
- </xsl:variable>
-
- <!-- header line -->
- <xsl:if test="count(td) = 0">
- <tr class="header"><xsl:copy-of select="$current" /></tr>
- </xsl:if>
-
- <!-- data line -->
- <xsl:if test="count(td) > 0">
- <xsl:variable name="offset" select="count(preceding-sibling::*[count(td) = 0]) mod 2" />
-
- <xsl:if test="position() mod 2 = $offset">
- <tr class="odd"><xsl:copy-of select="$current" /></tr>
- </xsl:if>
-
- <xsl:if test="position() mod 2 != $offset">
- <tr><xsl:copy-of select="$current" /></tr>
- </xsl:if>
- </xsl:if>
+ <table>
+ <xsl:if test="@border">
+ <xsl:attribute name="class">bordered</xsl:attribute>
+ </xsl:if>
+
+ <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::*[count(td) = 0]) mod 2)">
+ <xsl:attribute name="class">odd</xsl:attribute>
+ </xsl:when></xsl:choose>
+
+ <xsl:apply-templates />
+ </tr>
<xsl:text>
</xsl:text> <!-- insert line break -->
- </xsl:for-each>
- </xsl:when>
+ </xsl:for-each>
+ </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise></xsl:choose>
- </xsl:variable>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
- <xsl:if test="@border">
- <table class="bordered">
- <xsl:copy-of select="$content" />
- </table>
- </xsl:if>
-
- <xsl:if test="not(@border)">
- <table>
- <xsl:copy-of select="$content" />
- </table>
- </xsl:if>
</xsl:template>
- <!-- /table border -->
+ <!-- /table -->
<!-- -->
<!-- <ol type -->
<!-- -->
<xsl:template match="ol">
- <xsl:if test="@type = 'A'">
- <ol class="up-A">
- <xsl:apply-templates/>
- </ol>
- </xsl:if>
+ <ol>
+ <xsl:if test="@type = 'A'">
+ <xsl:attribute name="class">up-A</xsl:attribute>
+ </xsl:if>
- <xsl:if test="not(@type)">
- <ol>
- <xsl:apply-templates/>
- </ol>
- </xsl:if>
+ <xsl:apply-templates/>
+ </ol>
</xsl:template>
<!-- /ol type -->
1.6 +10 -15 httpd-2.0/docs/manual/style/xsl/directiveindex.xsl
Index: directiveindex.xsl
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/directiveindex.xsl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- directiveindex.xsl 16 Oct 2002 06:45:22 -0000 1.5
+++ directiveindex.xsl 17 Nov 2002 05:23:23 -0000 1.6
@@ -74,22 +74,17 @@
<xsl:for-each select="$directives[$letter=translate(substring(normalize-space(name),1,1),$lowercase,$uppercase)]">
<xsl:sort select="name"/>
- <li><xsl:choose>
- <xsl:when test="position()=1">
- <a name="{$letter}" id="{$letter}" href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
- <xsl:if test="@type = 'section'"><</xsl:if>
- <xsl:value-of select="name"/>
- <xsl:if test="@type = 'section'">></xsl:if>
- </a>
- </xsl:when>
+ <li>
+ <a href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
+ <xsl:if test="position()=1">
+ <xsl:attribute name="id"><xsl:value-of select="$letter"/></xsl:attribute>
+ <xsl:attribute name="name"><xsl:value-of select="$letter"/></xsl:attribute>
+ </xsl:if>
- <xsl:otherwise>
- <a href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
- <xsl:if test="@type = 'section'"><</xsl:if>
- <xsl:value-of select="name"/>
- <xsl:if test="@type = 'section'">></xsl:if>
- </a>
- </xsl:otherwise></xsl:choose>
+ <xsl:if test="@type = 'section'"><</xsl:if>
+ <xsl:value-of select="name"/>
+ <xsl:if test="@type = 'section'">></xsl:if>
+ </a>
</li>
<xsl:text>
1.7 +20 -27 httpd-2.0/docs/manual/style/xsl/quickreference.xsl
Index: quickreference.xsl
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/quickreference.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- quickreference.xsl 16 Oct 2002 06:45:22 -0000 1.6
+++ quickreference.xsl 17 Nov 2002 05:23:23 -0000 1.7
@@ -93,20 +93,20 @@
<xsl:for-each select="$directives[$letter=translate(substring(normalize-space(name),1,1),$lowercase,$uppercase)]">
<xsl:sort select="name"/>
- <!-- create the content -->
- <xsl:variable name="current-row">
- <td><xsl:choose>
- <xsl:when test="position()=1">
- <a name="{$letter}" id="{$letter}" href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
- <xsl:apply-templates select="syntax"/>
- </a>
- </xsl:when>
+ <tr>
+ <xsl:if test="position() mod 2 = $offset">
+ <xsl:attribute name="class">odd</xsl:attribute>
+ </xsl:if>
- <xsl:otherwise>
- <a href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
- <xsl:apply-templates select="syntax"/>
- </a>
- </xsl:otherwise></xsl:choose>
+ <td>
+ <a href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
+ <xsl:if test="position()=1">
+ <xsl:attribute name="id"><xsl:value-of select="$letter"/></xsl:attribute>
+ <xsl:attribute name="name"><xsl:value-of select="$letter"/></xsl:attribute>
+ </xsl:if>
+
+ <xsl:apply-templates select="syntax"/>
+ </a>
</td>
<td>
@@ -132,9 +132,13 @@
<xsl:when test="../status='Experimental'">X</xsl:when>
</xsl:choose>
</td>
- </xsl:variable>
+ </tr>
+
+ <tr>
+ <xsl:if test="position() mod 2 = $offset">
+ <xsl:attribute name="class">odd</xsl:attribute>
+ </xsl:if>
- <xsl:variable name="descr">
<td colspan="4" class="descr"><xsl:choose>
<xsl:when test="string-length(normalize-space(description)) > 0">
<xsl:apply-templates select="description"/>
@@ -144,18 +148,7 @@
<xsl:text>-</xsl:text>
</xsl:otherwise></xsl:choose>
</td>
- </xsl:variable>
-
- <!-- and now choose between odd n even --><xsl:choose>
- <xsl:when test="position() mod 2 = $offset">
- <tr class="odd"><xsl:copy-of select="$current-row"/></tr>
- <tr class="odd"><xsl:copy-of select="$descr"/></tr>
- </xsl:when>
-
- <xsl:otherwise>
- <tr><xsl:copy-of select="$current-row"/></tr>
- <tr><xsl:copy-of select="$descr"/></tr>
- </xsl:otherwise></xsl:choose>
+ </tr>
<xsl:text>
</xsl:text> <!-- insert a line break -->
1.4 +6 -14 httpd-2.0/docs/manual/style/xsl/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/sitemap.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sitemap.xsl 16 Oct 2002 06:45:22 -0000 1.3
+++ sitemap.xsl 17 Nov 2002 05:23:23 -0000 1.4
@@ -85,7 +85,11 @@
<!-- category/page -->
<!-- -->
<xsl:template match="category/page">
- <xsl:variable name="link">
+ <li>
+ <xsl:if test="@separate='yes'">
+ <xsl:attribute name="class">separate</xsl:attribute>
+ </xsl:if>
+
<xsl:if test="@href">
<a href="{@href}">
<xsl:value-of select="."/>
@@ -94,19 +98,7 @@
<xsl:if test="not(@href)">
<xsl:value-of select="."/>
</xsl:if>
- </xsl:variable>
-
- <xsl:if test="@separate='yes'">
- <li class="separate">
- <xsl:copy-of select="$link"/>
- </li>
- </xsl:if>
-
- <xsl:if test="not(@separate='yes')">
- <li>
- <xsl:copy-of select="$link"/>
- </li>
- </xsl:if>
+ </li>
<xsl:text>
</xsl:text> <!-- insert line break -->