You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by do...@apache.org on 2001/02/27 09:04:33 UTC

cvs commit: jakarta-avalon/src/skins/avalon/stylesheets book2project.xsl document2html.xsl

donaldp     01/02/27 00:04:33

  Modified:    src/skins/avalon/stylesheets book2project.xsl
                        document2html.xsl
  Log:
  Updated style to make image copy of files to original directory structure.
  
  Revision  Changes    Path
  1.3       +10 -2     jakarta-avalon/src/skins/avalon/stylesheets/book2project.xsl
  
  Index: book2project.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/skins/avalon/stylesheets/book2project.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- book2project.xsl	2001/02/26 13:42:21	1.2
  +++ book2project.xsl	2001/02/27 08:04:32	1.3
  @@ -14,8 +14,12 @@
   
     <xsl:template match="page|hidden">
   
  -    <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  +    <create source="{@source}" 
  +            target="{substring(@source,0,string-length(@source)-3)}.html" 
  +            producer="parser" 
  +            printer="html">
         <processor name="xslt">
  +        <parameter name="docid" value="{@source}"/>
           <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
         </processor>
       </create>
  @@ -24,11 +28,15 @@
   
     <xsl:template match="changes">
   
  -    <create source="{@source}" target="{@id}.html" producer="parser" printer="html">
  +    <create source="{@source}" 
  +            target="{substring(@source,0,string-length(@source)-3)}.html" 
  +            producer="parser" 
  +            printer="html">
         <processor name="xslt">
           <parameter name="stylesheet" value="sbk:/style/stylesheets/{name(.)}2document.xsl"/>
         </processor>
         <processor name="xslt">
  +        <parameter name="docid" value="{@source}"/>
           <parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
         </processor>
       </create>
  
  
  
  1.3       +51 -13    jakarta-avalon/src/skins/avalon/stylesheets/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/skins/avalon/stylesheets/document2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- document2html.xsl	2001/02/26 13:42:21	1.2
  +++ document2html.xsl	2001/02/27 08:04:32	1.3
  @@ -4,7 +4,32 @@
   
     <xsl:param name="stylebook.project"/>
     <xsl:param name="copyright"/>
  +  <xsl:param name="docid"/>
  +  <xsl:param name="target"/>
   
  +  <!-- voodoo magic to calculate base directory -->
  +  <xsl:template name="get-base-directory">  
  +    <xsl:call-template name="get-base-directory-internal">
  +      <xsl:with-param name="file" select="$docid"/>
  +    </xsl:call-template>
  +  </xsl:template>  
  +
  +  <xsl:template name="get-base-directory-internal">
  +    <xsl:param name="file"/>     
  +    <xsl:choose>
  +      <xsl:when test="contains( $file, '/' )">
  +        <xsl:variable name="remainder" select="substring-after($file, '/')" />
  +        <xsl:variable name="path">
  +          <xsl:call-template name="get-base-directory-internal">
  +            <xsl:with-param name="file" select="$remainder"/>
  +          </xsl:call-template>
  +        </xsl:variable>
  +        <xsl:value-of select="concat('../',$path)"/>
  +      </xsl:when>
  +      <xsl:otherwise>./</xsl:otherwise>
  +    </xsl:choose>
  +  </xsl:template>
  +
   <!-- ====================================================================== -->
   <!-- document section -->
   <!-- ====================================================================== -->
  @@ -25,29 +50,38 @@
             <tr>
               <td valign="top" align="left">
                 <a href="http://jakarta.apache.org/index.html">
  -              <img src="resources/jakarta-logo.gif" hspace="0" vspace="0" border="0"/>
  +                <img hspace="0" vspace="0" border="0">
  +                  <xsl:attribute name="src"><xsl:call-template 
  +                  name="get-base-directory"/>resources/jakarta-logo.gif</xsl:attribute>
  +                </img>
                 </a>
               </td>
   
               <td width="100%" valign="top" align="left" bgcolor="#ffffff">
  -              <img src="resources/header.gif" 
  -                   hspace="0" 
  +              <img hspace="0" 
                      vspace="0" 
                      border="0" 
                      alt="{header/title}" 
  -                   align="right"/>
  +                   align="right">
  +                   <xsl:attribute name="src"><xsl:call-template 
  +                  name="get-base-directory"/>/resources/header.gif</xsl:attribute>
  +              </img>
               </td>
             </tr>
             
             <tr>
  -            <td width="100%" height="2" colspan="2" background="resources/line.gif">
  -                <img src="resources/line.gif" 
  -                     width="1" 
  -                     height="2" 
  -                     hspace="0" 
  -                     vspace="0" 
  -                     border="0" 
  -                     alt="{header/title}" />
  +            <td width="100%" height="2" colspan="2">
  +              <xsl:attribute name="background"><xsl:call-template
  +                   name="get-base-directory"/>/resources/line.gif</xsl:attribute>
  +              <img width="1" 
  +                   height="2" 
  +                   hspace="0" 
  +                   vspace="0" 
  +                   border="0" 
  +                   alt="{header/title}">
  +                <xsl:attribute name="src"><xsl:call-template 
  +                  name="get-base-directory"/>/resources/line.gif</xsl:attribute>
  +              </img>
               </td>                
             </tr>
           </table>
  @@ -119,7 +153,11 @@
   
     <xsl:template match="page|faqs|changes|todo|spec">
       <li>
  -      <a><xsl:attribute name="href"><xsl:value-of select="../@base"/>/<xsl:value-of select="@id"/>.html</xsl:attribute>
  +      <a>
  +        <xsl:attribute name="href"><xsl:if 
  +           test="../@base"><xsl:value-of select="../@base"/>/</xsl:if><xsl:call-template
  +           name="get-base-directory"/><xsl:value-of 
  +           select="substring(@source,0,string-length(@source)-3)"/>.html</xsl:attribute>
            <font face="arial,helvetica,sanserif" size="-1">
              <xsl:value-of select="@label"/>
            </font>