forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@apache.org
Subject cvs commit: xml-forrest/src/resources/skins/bert/xslt/html tab2menu.xsl
Date Thu, 06 Jun 2002 22:20:44 GMT
stevenn     2002/06/06 15:20:44

  Added:       src/documentation/content/xdocs tabs.xml
               src/resources/schema/dtd tab-cocoon-v10.dtd
               src/resources/skins/bert/images label.gif
               src/resources/skins/bert/xslt/html tab2menu.xsl
  Log:
  new files for the bert skin (tab support - proof of concept)
  
  Revision  Changes    Path
  1.1                  xml-forrest/src/documentation/content/xdocs/tabs.xml
  
  Index: tabs.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE book PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.0//EN" "tab-cocoon-v10.dtd">
  
  <tabs software="Forrest"
      title="Apache Forrest"
      copyright="@year@ The Apache Foundation"
      xmlns:xlink="http://www.w3.org/1999/xlink">
  
    <tab label="Home" dir=""/>
    <tab label="How-Tos" dir="community/howto/"/>
    <tab label="XML Site" dir="xml-site/"/>
  
  </tabs>
  
  
  1.1                  xml-forrest/src/resources/schema/dtd/tab-cocoon-v10.dtd
  
  Index: tab-cocoon-v10.dtd
  ===================================================================
  <!-- ===================================================================
       
       Apache Cocoon Documentation Top DTD (Version 1.0)
  
  PURPOSE:
  This DTD defines the /top.xml documentation configuration files.
  
  TYPICAL INVOCATION:
  
    <!DOCTYPE book PUBLIC
         "-//APACHE//DTD Cocoon Documentation Book Vx.yz//EN"
         "top-cocoon-vxyz.dtd">
  
    where 
    
      x := major version
      y := minor version
      z := status identifier (optional)
        
  NOTES:
  We need to replace this DTD with the proper one.
  We are only using this DTD to enable validation during "build docs"
  because every XML instance must declare its ruleset.
  
  This initial minimal DTD has been reverse-engineered from the structure
  of the current documents, e.g. 
   documentation/xdocs/book.xml
    
  AUTHORS:
    Bert Van Kets <bert@vankets.com>
    
  FIXME:
    - find the proper DTD for top.xml
  
  CHANGE HISTORY:
    20020506 Initial version. (BVK)
      
  COPYRIGHT:
    Copyright (c) @year@ The Apache Software Foundation.
    
    Permission to copy in any form is granted provided this notice is 
    included in all copies. Permission to redistribute is granted 
    provided this file is distributed untouched in all its parts and 
    included files.
    
  ==================================================================== -->
  <!ELEMENT tabs (tab)*>
  <!ELEMENT tab EMPTY>
  <!ATTLIST tabs
    software CDATA #REQUIRED
    title CDATA #REQUIRED
    copyright CDATA #REQUIRED
    xmlns:xlink CDATA #IMPLIED
  >
  <!ATTLIST tab
    label CDATA #REQUIRED
    dir CDATA #REQUIRED
    type (visible | hidden) "visible"
  >
  <!-- =============================================================== -->
  <!-- End of DTD -->
  <!-- =============================================================== -->
  
  
  
  1.1                  xml-forrest/src/resources/skins/bert/images/label.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/bert/xslt/html/tab2menu.xsl
  
  Index: tab2menu.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="resource"/>
    
    <xsl:template name="spacer">
      <td width="8">
        <img src="skin/images/spacer.gif" width="8" height="8" alt=""/>
      </td>
    </xsl:template>
    
    <xsl:template name="not-selected">
        <td valign="bottom">
          <table cellspacing="0" cellpadding="0" border="0" height="25" summary="non selected
tab">
            <tr>
              <td bgcolor="#B2C4E0" width="5" valign="top"><img src="skin/images/tab-left.gif"
alt="" width="5" height="5" /></td>
              <td bgcolor="#B2C4E0" valign="middle">
                <a href="/xml-forrest/{@dir}"><font face="Arial, Helvetica, Sans-serif"
size="2"><xsl:value-of select="@label"/></font></a>
              </td>
              <td bgcolor="#B2C4E0" width="5" valign="top"><img src="skin/images/tab-right.gif"
alt="" width="5" height="5" />
              </td>
            </tr>
          </table>
        </td>
    </xsl:template>
    
    <xsl:template name="selected">
        <td valign="bottom">
          <table cellspacing="0" cellpadding="0" border="0" height="30" summary="selected
tab">
            <tr>
              <td bgcolor="#4C6C8F" width="5" valign="top"><img src="skin/images/tabSel-left.gif"
alt="" width="5" height="5" /></td>
              <td bgcolor="#4C6C8F" valign="middle">
                <font face="Arial, Helvetica, Sans-serif" size="2" color="#ffffff"><b><xsl:value-of
select="@label"/></b></font>
              </td>
              <td bgcolor="#4C6C8F" width="5" valign="top"><img src="skin/images/tabSel-right.gif"
alt="" width="5" height="5" /></td>
            </tr>
          </table>
        </td>
    </xsl:template>
    
    <xsl:template match="tabs">
      <div class="tab">
        <table cellspacing="0" cellpadding="0" border="0" summary="tab bar">
          <tr>
            <xsl:apply-templates/>
          </tr>
        </table>
      </div>
    </xsl:template>
    
    <xsl:template match="tab">
      <xsl:call-template name="spacer"/>
      <xsl:choose>
        <xsl:when test="$resource!='' and @dir=''">
          <xsl:call-template name="not-selected"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="starts-with($resource,@dir)">
             <xsl:call-template name="selected"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="not-selected"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
  </xsl:stylesheet>
  
  

Mime
View raw message