]> granicus.if.org Git - apache/commitdiff
KISS.
authorAndre Malo <nd@apache.org>
Sun, 17 Nov 2002 05:23:23 +0000 (05:23 +0000)
committerAndre Malo <nd@apache.org>
Sun, 17 Nov 2002 05:23:23 +0000 (05:23 +0000)
<xsl:attribute> makes the life easy :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97547 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/xsl/common.xsl
docs/manual/style/xsl/directiveindex.xsl
docs/manual/style/xsl/quickreference.xsl
docs/manual/style/xsl/sitemap.xsl

index 16663001a7ceb9ea37a4f2fbdb7e6f6174a56776..34cabc1f847bdf5471b618a9b44c7859b91db032 100644 (file)
     </div> <!-- /page-header -->
 
     <div class="up">
-      <xsl:choose>
-        <xsl:when test="parentdocument">
-          <a href="{parentdocument/@href}"><img src="{$path}/images/left.gif" alt="&lt;-" title="&lt;-" /></a>
-        </xsl:when>
-        <xsl:otherwise>
-          <a href="./"><img src="{$path}/images/left.gif" alt="&lt;-" title="&lt;-" /></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="&lt;-" title="&lt;-" />
+      </a>
     </div>
 
     <div id="path">
   <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"/>
   <!-- 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 -->
 
   <!-- <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) &gt; 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 -->
 
index 704674cf2959173e74acdb32680c4fe2bcba7595..4f99a6028b8fbc55d430cf8c671346c63f84bb15 100644 (file)
     <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'">&lt;</xsl:if>
-            <xsl:value-of select="name"/>
-            <xsl:if test="@type = 'section'">&gt;</xsl:if>
-          </a>
-        </xsl:when>
-
-        <xsl:otherwise>
-          <a href="{../name}.html#{translate(name,$uppercase,$lowercase)}">
-            <xsl:if test="@type = 'section'">&lt;</xsl:if>
-            <xsl:value-of select="name"/>
-            <xsl:if test="@type = 'section'">&gt;</xsl:if>
-          </a>
-        </xsl:otherwise></xsl:choose>
+      <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:if test="@type = 'section'">&lt;</xsl:if>
+          <xsl:value-of select="name"/>
+          <xsl:if test="@type = 'section'">&gt;</xsl:if>
+        </a>
       </li>
 
 <xsl:text>
index 05a5ffda093c38d10f989face468e3825fdf4890..82bc0118ef802ab6b3d32c46465efc4eb864109a 100644 (file)
     <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>
             <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)) &gt; 0">
             <xsl:apply-templates select="description"/>
             <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 -->
index 2a664b7ce795190fcfe31c23a171ec57fe37b81b..12a7cfe9fbd9a2dfc839b22e93bf83e40a8af491 100644 (file)
   <!-- 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="."/>
       <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 -->