home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / doclist2document.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  3.1 KB  |  101 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <xsl:stylesheet
  19.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20.     version="1.0">
  21.  
  22.  <xsl:template match="doclist">
  23.   <document>
  24.    <header>
  25.     <title>List of all documentation</title>
  26.    </header>
  27.    <body>
  28.     <s1 title="Documentation List">
  29.      <p>
  30.       This complete list shows, at a glance, how all of the documentation
  31.       fits together within the hierarchy of sections.
  32. <!--      For an overview of the documentation see the new
  33.       "Table of Contents". -->
  34.      </p>
  35.      <p>
  36.       The side-panel of each actual document is used to reach other documents
  37.       that are relevant to that section. The side-panel will change, according
  38.       to that section's location in the documentation hierarchy.
  39.      </p>
  40.     </s1>
  41.     <xsl:apply-templates/>
  42.    </body>
  43.   </document>
  44.  </xsl:template>
  45.  
  46.  <xsl:template match="book">
  47.   <s1 title="{@title}">
  48.    <xsl:if test="position()=1">
  49.     <p>This first section is a list of the top-level documentation
  50.      (and is a replica of this page's side-panel).</p>
  51.    </xsl:if>
  52.    <xsl:apply-templates/>
  53.   </s1>
  54.  </xsl:template>
  55.  
  56.  <xsl:template match="menu">
  57.   <xsl:if test="@label!='Navigation'">
  58.   <p><strong><xsl:value-of select="@label"/></strong></p>
  59.    <ul>
  60.     <xsl:apply-templates>
  61.      <xsl:with-param name="uri" select="../@uri"/>
  62.     </xsl:apply-templates>
  63.    </ul>
  64.   </xsl:if>
  65.  </xsl:template>
  66.  
  67.  <xsl:template match="menu-item">
  68.   <xsl:param name="uri"/>
  69.   <xsl:if test="not(@type) or @type!='hidden'">
  70.    <xsl:if test="@label!='Main' and @label!='User Documentation'">
  71. <!-- FIXME: ensure href is not full URL scheme:// -->
  72. <!--
  73.   (uri=<xsl:value-of select="$uri"/> href=<xsl:value-of select="@href"/>)
  74. -->
  75.     <li><link href="{$uri}{@href}"><xsl:value-of select="@label"/></link>
  76.     </li>
  77.    </xsl:if>
  78.   </xsl:if>
  79.  </xsl:template>
  80.  
  81.  <xsl:template match="external">
  82.   <xsl:param name="uri"/>
  83.   <xsl:if test="not(@type) or @type!='hidden'">
  84.    <xsl:choose>
  85.     <!-- FIXME: specially handle menu item "API (Javadoc)", it causes a bug. -->
  86.     <xsl:when test="starts-with(@label,'API')">
  87.      <li><link href="http://cocoon.apache.org/apidocs/"><xsl:value-of select="@label"/></link></li>
  88. <!-- FIXME: here is the bug:
  89.      <li><link href="{@href}"><xsl:value-of select="@label"/></link></li>
  90.      <li><xsl:value-of select="@label"/>href=<xsl:value-of select="@href"/></li>
  91. -->
  92.     </xsl:when>
  93.     <xsl:otherwise>
  94.      <li><link href="{@href}"><xsl:value-of select="@label"/></link></li>
  95.     </xsl:otherwise>
  96.    </xsl:choose>
  97.   </xsl:if>
  98.  </xsl:template>
  99.  
  100. </xsl:stylesheet>
  101.