You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2003/01/02 19:04:47 UTC

cvs commit: jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets document2html.xsl

vmassol     2003/01/02 10:04:47

  Modified:    documentation/docs/skins/jakarta.apache.org/stylesheets
                        document2html.xsl
  Log:
  - Added support for <section> (which can be nested). It has the same behaviour as <s1>, <s2> etc
  - Added support for <a href> in addition to existing <link href>
  
  Note: This is still experimental and shouldn't be used for now. It's part of a migration to a new DTD but this DTD has not been finalized yet! :-)
  
  Revision  Changes    Path
  1.5       +47 -2     jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets/document2html.xsl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- document2html.xsl	15 Dec 2002 18:26:34 -0000	1.4
  +++ document2html.xsl	2 Jan 2003 18:04:47 -0000	1.5
  @@ -11,7 +11,6 @@
     <xsl:param name="target"/>
   
     <xsl:output method="html" indent="yes"/>
  -<!--  <xsl:strip-space elements="*"/> -->
   
     <!-- voodoo magic to calculate base directory -->
     <xsl:template name="get-base-directory">  
  @@ -224,10 +223,48 @@
   <!-- body section -->
   <!-- ====================================================================== -->
   
  +  <xsl:template match="section">
  +  
  +    <xsl:variable name="level" select="count(ancestor::section)+1"/>
  +	 
  +    <xsl:choose>
  +      <xsl:when test="$level=1">
  +        <xsl:call-template name="section">
  +          <xsl:with-param name="width">100%</xsl:with-param>
  +          <xsl:with-param name="font-size">+1</xsl:with-param>
  +          <xsl:with-param name="name"><xsl:value-of select="@name"/></xsl:with-param>
  +        </xsl:call-template>
  +      </xsl:when>
  +      <xsl:when test="$level=2">
  +        <xsl:call-template name="section">
  +          <xsl:with-param name="width">98%</xsl:with-param>
  +          <xsl:with-param name="font-size">+0</xsl:with-param>
  +          <xsl:with-param name="name"><xsl:value-of select="@name"/></xsl:with-param>
  +        </xsl:call-template>
  +      </xsl:when>
  +      <xsl:when test="$level=3">
  +        <xsl:call-template name="section">
  +          <xsl:with-param name="width">96%</xsl:with-param>
  +          <xsl:with-param name="font-size">-1</xsl:with-param>
  +          <xsl:with-param name="name"><xsl:value-of select="@name"/></xsl:with-param>
  +        </xsl:call-template>
  +      </xsl:when>
  +      <xsl:otherwise>
  +        <xsl:call-template name="section">
  +          <xsl:with-param name="width">94%</xsl:with-param>
  +          <xsl:with-param name="font-size">-2</xsl:with-param>
  +          <xsl:with-param name="name"><xsl:value-of select="@name"/></xsl:with-param>
  +        </xsl:call-template>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +
  +  </xsl:template>  
  +
     <xsl:template match="s1">
       <xsl:call-template name="section">
         <xsl:with-param name="width">100%</xsl:with-param>
         <xsl:with-param name="font-size">+1</xsl:with-param>
  +      <xsl:with-param name="name"><xsl:value-of select="@title"/></xsl:with-param>
       </xsl:call-template>
     </xsl:template>
   
  @@ -235,6 +272,7 @@
       <xsl:call-template name="section">
         <xsl:with-param name="width">98%</xsl:with-param>
         <xsl:with-param name="font-size">+0</xsl:with-param>
  +      <xsl:with-param name="name"><xsl:value-of select="@title"/></xsl:with-param>
       </xsl:call-template>
     </xsl:template>
   
  @@ -242,6 +280,7 @@
       <xsl:call-template name="section">
         <xsl:with-param name="width">96%</xsl:with-param>
         <xsl:with-param name="font-size">-1</xsl:with-param>
  +      <xsl:with-param name="name"><xsl:value-of select="@title"/></xsl:with-param>
       </xsl:call-template>
     </xsl:template>
   
  @@ -249,12 +288,14 @@
       <xsl:call-template name="section">
         <xsl:with-param name="width">94%</xsl:with-param>
         <xsl:with-param name="font-size">-2</xsl:with-param>
  +      <xsl:with-param name="name"><xsl:value-of select="@title"/></xsl:with-param>
       </xsl:call-template>
     </xsl:template>
   
     <xsl:template name="section">
      <xsl:param name="width" />
      <xsl:param name="font-size" />
  +   <xsl:param name="name" />
   
      <div align="right">
       <table border="0" cellspacing="0" cellpadding="2">
  @@ -263,7 +304,7 @@
         <td bgcolor="#525D76">
          <font face="arial,helvetica,sanserif" color="#ffffff">
           <xsl:attribute name="size"><xsl:value-of select="$font-size"/></xsl:attribute>
  -        <b><xsl:value-of select="@title"/></b>
  +        <b><xsl:value-of select="$name"/></b>
          </font>
         </td>
        </tr>
  @@ -464,6 +505,10 @@
   <!-- ====================================================================== -->
   <!-- links section -->
   <!-- ====================================================================== -->
  +
  + <xsl:template match="a">
  +   <a href="{@href}"><xsl:apply-templates/></a>
  + </xsl:template>
   
    <xsl:template match="link">
      <a href="{@href}"><xsl:apply-templates/></a>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>