forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject cvs commit: xml-forrest/src/resources/library/xslt faq2document.xsl
Date Fri, 01 Nov 2002 02:55:09 GMT
crossley    2002/10/31 18:55:09

  Modified:    src/resources/library/xslt faq2document.xsl
  Log:
  Handle both "part" and "faq" elements.
  Submitted by: Keiron Liddle <keiron@aftexsw.com>
  
  Revision  Changes    Path
  1.4       +29 -4     xml-forrest/src/resources/library/xslt/faq2document.xsl
  
  Index: faq2document.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/library/xslt/faq2document.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- faq2document.xsl	7 Jun 2002 05:35:23 -0000	1.3
  +++ faq2document.xsl	1 Nov 2002 02:55:09 -0000	1.4
  @@ -15,27 +15,48 @@
         <section>
          <title>Questions</title>
          <ul>
  -        <xsl:apply-templates select="faq" mode="index"/>
  +        <xsl:apply-templates select="faq|part" mode="index"/>
          </ul>
         </section>
         <section>
          <title>Answers</title>
  -        <xsl:apply-templates select="faq"/>
  +        <xsl:apply-templates select="faq|part"/>
         </section>
       </body>
      </document>  
     </xsl:template>
   
  +  <xsl:template match="part" mode="index">
  +    <li>
  +      <link href="#part-{generate-id()}">
  +       <xsl:apply-templates select="title"/>
  +      </link>
  +       <ul>
  +        <xsl:apply-templates select="faq|part" mode="index"/>
  +       </ul>
  +    </li>
  +  </xsl:template>
  +
     <xsl:template match="faq" mode="index">
       <li>
  -      <link href="#faq-{position()}">
  +      <link href="#faq-{generate-id()}">
           <xsl:value-of select="question"/>
         </link>
       </li>
     </xsl:template>
   
  +  <xsl:template match="part">
  +    <anchor id="part-{generate-id()}"/>
  +    <section>
  +     <title>
  +      <xsl:value-of select="title"/>
  +     </title>
  +      <xsl:apply-templates select="faq|part"/>
  +    </section>
  +  </xsl:template>
  +
     <xsl:template match="faq">
  -    <anchor id="faq-{position()}"/>
  +    <anchor id="faq-{generate-id()}"/>
       <section>
        <title>
         <xsl:value-of select="question"/>
  @@ -49,6 +70,10 @@
     </xsl:template>
   
     <xsl:template match="answer">
  +    <xsl:apply-templates/>
  +  </xsl:template>
  +
  +  <xsl:template match="title">
       <xsl:apply-templates/>
     </xsl:template>
   
  
  
  

Mime
View raw message