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 / faq2document.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  1.6 KB  |  65 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:import href="copyover.xsl"/>
  23.  
  24.   <xsl:template match="faqs">
  25.    <document>
  26.     <header>
  27.      <title><xsl:value-of select="@title"/></title>
  28.     </header>
  29.     <body>
  30.       <s1 title="Questions">
  31.        <ul>
  32.         <xsl:apply-templates select="faq" mode="index"/>
  33.        </ul>
  34.       </s1>
  35.       <s1 title="Answers">
  36.         <xsl:apply-templates select="faq"/>
  37.       </s1>
  38.     </body>
  39.    </document>  
  40.   </xsl:template>
  41.  
  42.   <xsl:template match="faq" mode="index">
  43.     <li>
  44.       <jump anchor="faq-{position()}">
  45.         <xsl:value-of select="question"/>
  46.       </jump>
  47.     </li>
  48.   </xsl:template>
  49.  
  50.   <xsl:template match="faq">
  51.     <anchor id="faq-{position()}"/>
  52.     <s2 title="{question}">
  53.       <xsl:apply-templates/>
  54.     </s2>
  55.   </xsl:template>
  56.  
  57.   <xsl:template match="question">
  58.     <!-- ignored since already used -->
  59.   </xsl:template>
  60.  
  61.   <xsl:template match="answer">
  62.     <xsl:apply-templates/>
  63.   </xsl:template>
  64.  
  65. </xsl:stylesheet>