]> granicus.if.org Git - apache/commitdiff
Three xsl changes:
authorJoshua Slive <slive@apache.org>
Mon, 18 Feb 2002 15:43:15 +0000 (15:43 +0000)
committerJoshua Slive <slive@apache.org>
Mon, 18 Feb 2002 15:43:15 +0000 (15:43 +0000)
1. If there are no directives for a module, print "This module provides
no directives."

2. Add the type="section" parameter for <directive> and
<directivesynopsis>.  The < and > should not be included.  They will
be added by the transformation.

3. All fragment anchors (internal page links) go to lowercase.

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

docs/manual/style/manual.xsl

index afca801bbef67d5edc1cc72097b298807ddcda61..a07eb4d0703450c958069bb6b51a8750cdc2ba28 100644 (file)
@@ -12,6 +12,9 @@
   <!-- Defined parameters (overrideable) -->
   <xsl:param    name="relative-path" select="'.'"/>
 
+  <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
+  <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+
   <!-- Process an entire document into an HTML page -->
   <xsl:template match="modulesynopsis">
 
 
 <h2>Directives</h2>
 
+<xsl:if test="directivesynopsis">
 <ul>
  <xsl:for-each select="directivesynopsis/name">
   <xsl:sort select="name"/>
   <xsl:variable name="name">
    <xsl:value-of select="."/>
   </xsl:variable>
-  <li><a href="#{$name}"><xsl:value-of select="."/></a></li>
+  <xsl:variable name="lowername" select="translate($name, $uppercase, $lowercase)" />
+  <li><a href="#{$lowername}"><xsl:value-of select="."/></a></li>
  </xsl:for-each>
 </ul>
+</xsl:if>
+<xsl:if test="not(directivesynopsis)">
+<p>This module provides no directives.</p>
+</xsl:if>
 
 <xsl:apply-templates select="section"/>
 
   <xsl:template match="section/title"></xsl:template>
 
   <xsl:template match="directivesynopsis">
+
   <xsl:variable name="name">
    <xsl:value-of select="./name"/>
   </xsl:variable>
-
-    <h2><a name="{$name}"><xsl:value-of select="./name"/> Directive</a></h2>
+  <xsl:variable name="lowername" select="translate($name, $uppercase, $lowercase)" />
+    <h2><a name="{$name}"><xsl:if test="./@type='section'">&lt;</xsl:if><xsl:value-of select="./name"/><xsl:if test="./@type='section'">&gt;</xsl:if></a>
+        <a name="{$lowername}">Directive</a></h2>
 <table bgcolor="#cccccc" border="0" cellspacing="0" cellpadding="1">
 <tr><td>
 <table bgcolor="#ffffff" width="100%">
       <xsl:variable name="directive">
         <xsl:value-of select="."/>
       </xsl:variable>
+      <xsl:variable name="lowerdirective" select="translate($directive, $uppercase, $lowercase)" />
       <xsl:if test="@module=/modulesynopsis/name">
-        <a class="directive" href="#{$directive}"><xsl:value-of select="."/></a>
+        <a class="directive" href="#{$lowerdirective}"><xsl:if test="./@type='section'">&lt;</xsl:if><xsl:value-of select="."/><xsl:if test="./@type='section'">&gt;</xsl:if></a>
       </xsl:if>
       <xsl:if test="@module!=/modulesynopsis/name">
-        <a class="directive" href="{$module}.html#{$directive}"><xsl:value-of select="."/></a>
+        <a class="directive" href="{$module}.html#{$lowerdirective}"><xsl:if test="./@type='section'">&lt;</xsl:if><xsl:value-of select="."/><xsl:if test="./@type='section'">&gt;</xsl:if></a>
       </xsl:if>
     </xsl:if>
     <xsl:if test="not(@module)">