forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/skins/avalon-tigris/xslt/html book2menu.xsl document2html.xsl dotdots.xsl pathutils.xsl renderlogo.xsl site2xhtml.xsl split.xsl tab2menu.xsl
Date Tue, 05 Nov 2002 07:36:50 GMT
jefft       2002/11/04 23:36:50

  Added:       src/resources/skins/avalon-tigris/css site.css
               src/resources/skins/avalon-tigris/images add.jpg
                        ant_logo_small.gif built-with-cocoon.gif
                        centipede-logo-small.gif favicon.ico note.gif
                        remove.jpg update.jpg void.gif
               src/resources/skins/avalon-tigris/xslt/fo document2fo.xsl
               src/resources/skins/avalon-tigris/xslt/html book2menu.xsl
                        document2html.xsl dotdots.xsl pathutils.xsl
                        renderlogo.xsl site2xhtml.xsl split.xsl
                        tab2menu.xsl
  Log:
  New skin contributed by Peter Donald
  
  Revision  Changes    Path
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/css/site.css
  
  Index: site.css
  ===================================================================
  /*
   * Other colors:
   *  - dark blue: #036
   *  - bluish: #269
   *
   */
  
  /*
   * The Banner section.
   */
  .banner, .projectLogo, .groupLogo, .projectLogo a, .groupLogo a,
      .groupLogo a:visited, .projectLogo a:visited,
      .groupLogo a:link, .projectLogo a:link {
    font-weight: bold;
    color: #036;
    font-size: large;
  }
  
  /*
   * The Status + Footer section.
   */
  .status, .breadcrumb, .searcher, .tabs {
    font-weight: bold;
    font-size: x-small;
    background-color: #ddd;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #aaa;
    padding-left: 12px;
    padding-right: 12px;
    vertical-align: middle;
    color: #036;
  }
  
  .selectedTab {
    color: #036;
  }
  
  /*
   * The Menu section.
   */
  .menuColumn {
  }
  .menubar {
    padding-left: 12px;
    background: #eee;
    border-top: 1px solid #fff;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
  }
  .menu {
    padding-bottom: .5em;
    font-size: x-small;
    text-decoration: none;
  }
  .menuLabel { font-weight: bold; }
  .menuItem {
    padding-left: 12px;
    text-decoration: none;
  }
  
  /*
   * The Content section.
   */
  .contentColumn {
    margin-top: 8px;
    margin-bottom: 8px;
    margin-right: 8px;
    margin-left: 8px;
  }
  
  h1, h2, h3, h4 {
    padding-top: 3px;
    padding-bottom: 3px;
    padding-left: 12px;
    padding-right: 12px;
    vertical-align: middle;
    margin-top: 0px;
    margin-bottom: 0px;
    margin-right: 0px;
    margin-left: 0px;
  }
  
  h3, h4 { color: #fff; }
  h3 { background-color: #036; }
  h4 { background-color: #888; }
  
  .code {
    font-family: 'Andale Mono', Courier, monospace;
    border-color: #CFDCED;
    border-style: solid;
    border-width: 1px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 5px;
    padding-right: 5px;
  }
  
  .section {
    padding-bottom: 10px;
  }
  
  .subsection {
    padding-bottom: 5px;
  }
  
  /*
   * The Footer section.
   */
  .footer, .copyright, .host, .credit {
    text-align: center;
    padding: 1px 1px;
    font-size: xx-small;
  }
  
  /*
   * General Settings
   */
  body {
    background: #fff;
    color: #000;
    text-decoration: none;
  }
  
  a:link, .menuItem a:visited, .status a:visited {
   color: blue;
  }
  
  a:active, a:hover {
    color: #f30 !important;
    text-decoration: none;
  }
  
  body, th, td {
    font-family: Verdana, Helvetica, Arial, sans-serif;
    font-size: small;
  }
  
  .logoImage {
    vertical-align: top;
  }
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/add.jpg
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/ant_logo_small.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/built-with-cocoon.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/centipede-logo-small.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/favicon.ico
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/note.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/remove.jpg
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/update.jpg
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/images/void.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/fo/document2fo.xsl
  
  Index: document2fo.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:fo="http://www.w3.org/1999/XSL/Format"
                  version="1.0">
  
    <xsl:output method="xml"/>
  
    <xsl:template match="/">
      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <fo:layout-master-set>
  
          <fo:simple-page-master master-name="first-page"
            page-height="11in" 
            page-width="8.5in"
            margin-top="1in" 
            margin-bottom="1in" 
            margin-left="1.25in" 
            margin-right="1in">
            <fo:region-body
              margin-top="0.5in"
              margin-bottom=".5in"/>
            <fo:region-after 
              region-name="first-footer"
              extent=".5in"
              display-align="before"/>
          </fo:simple-page-master>
  
          <fo:simple-page-master master-name="even-page"
            page-height="11in" 
            page-width="8.5in"
            margin-top="1in" 
            margin-bottom="1in" 
            margin-left="1.25in" 
            margin-right="1in">
            <fo:region-before
              region-name="even-header"
              extent="0.5in"
              border-bottom="0.5pt solid"/>
            <fo:region-body
              margin-top="0.5in"
              margin-bottom=".5in"/>
            <fo:region-after 
              region-name="even-footer"
              extent=".5in"
              display-align="before"/>
          </fo:simple-page-master>
  
          <fo:simple-page-master master-name="odd-page"
            page-height="11in" 
            page-width="8.5in"
            margin-top="1in" 
            margin-bottom="1in" 
            margin-left="1.25in" 
            margin-right="1in">
            <fo:region-before
              region-name="odd-header"
              extent="0.5in"
              border-bottom="0.5pt solid"/>
            <fo:region-body
              margin-top="0.5in"
              margin-bottom=".5in"/>
            <fo:region-after 
              region-name="odd-footer"
              extent=".5in"
              display-align="before"/>
          </fo:simple-page-master>
  
          <fo:page-sequence-master master-name="book">
            <fo:repeatable-page-master-alternatives>
              <fo:conditional-page-master-reference
                page-position="first"
                master-reference="first-page"/>
              <fo:conditional-page-master-reference
                odd-or-even="odd"
                master-reference="odd-page"/>
              <fo:conditional-page-master-reference
                odd-or-even="even"
                master-reference="even-page"/>
            </fo:repeatable-page-master-alternatives>
          </fo:page-sequence-master>
        </fo:layout-master-set>
        
        <fo:page-sequence master-reference="book">
          <xsl:apply-templates/>
        </fo:page-sequence>
        
      </fo:root>
    </xsl:template>
    
    <xsl:template match="document">
      <fo:title><xsl:value-of select="header/title"/></fo:title>
      
      <fo:static-content flow-name="first-footer">
        <fo:block
          border-top="0.25pt solid"
          padding-before="6pt"
          text-align="center">
          <xsl:apply-templates select="footer"/>
        </fo:block>
        <fo:block
          text-align="start">
          Page <fo:page-number/>
        </fo:block>
      </fo:static-content>
  
      <fo:static-content flow-name="even-header">
        <fo:block
          text-align="end"
          font-style="italic">
          <xsl:value-of select="header/title"/>
        </fo:block>
      </fo:static-content>
  
      <fo:static-content flow-name="even-footer">
        <fo:block
          border-top="0.25pt solid"
          padding-before="6pt"
          text-align="center">
          <xsl:apply-templates select="footer"/>
        </fo:block>
        <fo:block
          text-align="end">
          Page <fo:page-number/>
        </fo:block>
      </fo:static-content>
  
      <fo:static-content flow-name="odd-header">
        <fo:block
          text-align="start"
          font-style="italic">
          <xsl:value-of select="header/title"/>
        </fo:block>
      </fo:static-content>
      
      <fo:static-content flow-name="odd-footer">
        <fo:block
          border-top="0.25pt solid"
          padding-before="6pt"
          text-align="center">
          <xsl:apply-templates select="footer"/>
        </fo:block>
        <fo:block
          text-align="start">
          Page <fo:page-number/>
        </fo:block>
      </fo:static-content>
  
      <fo:flow flow-name="xsl-region-body">
        <fo:block
          padding-before="24pt"
          padding-after="24pt"
          font-size="24pt"
          font-weight="bold">
          <xsl:value-of select="header/title"/>
        </fo:block>
        
        <fo:block
          text-align="justify"
          padding-before="18pt"
          padding-after="18pt">
          <xsl:apply-templates/>
        </fo:block>
      </fo:flow>
    </xsl:template>
    
    <xsl:template match="abstract">
      <fo:block
        font-size="12pt"
        text-align="center"
        space-before="20pt"
        space-after="25pt"
        width="7.5in"
        font-family="serif"
        font-style="italic">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
    
    <xsl:template match="notice">
      <fo:block
        font-size="10pt"
        text-align="left"
        space-before="20pt"
        width="7.5in"
        font-family="serif"
        border-top="0.25pt solid"
        border-bottom="0.25pt solid"
        padding-before="6pt"
        padding-after="6pt">
        NOTICE: <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
  
    <xsl:template match="section">
      
      <xsl:param name="level">0</xsl:param>
      <xsl:variable name="size" select="16-(number($level)*2)"/>
      
      <fo:block
        font-family="serif"
        font-size="{$size}pt"
        font-weight="bold"
        space-before="12pt">
        <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
        <xsl:text> </xsl:text>
        <xsl:value-of select="title"/>
      </fo:block>
      <xsl:apply-templates>
        <xsl:with-param name="level" select="number($level)+1"/>
      </xsl:apply-templates>
      
    </xsl:template>
    
    <xsl:template match="title">
      <!-- do nothing as titles are handled in their parent templates -->
    </xsl:template>
    
    <xsl:template match="subtitle">
      <xsl:param name="level">0</xsl:param>
      <xsl:variable name="size" select="16-(number($level)*1.5)"/>
  
      <fo:block
        font-weight="bold"
        font-size="{$size}pt">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
  
    <xsl:template match="authors">
      <fo:block
        space-before="20pt"
        font-weight="bold"
        font-size="9pt">
        <xsl:for-each select="person">
          <xsl:value-of select="@name"/>, <xsl:value-of select="@email"/>
          <xsl:if test="not(position() = last())">, </xsl:if>
        </xsl:for-each>
      </fo:block>
    </xsl:template>
  
    <xsl:template match="p">
      <fo:block
        space-before="4pt"
        space-after="4pt"
        font-family="serif">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
    
  
    <xsl:template match="source">
      <fo:block
        font-family="monospace"
        font-size="10pt"
        background-color="#f0f0f0"
        white-space-collapse="false"
        text-align="start">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
    
    
    <xsl:template match="ol|ul">
      <fo:list-block 
        provisional-distance-between-starts="18pt"
        provisional-label-separation="3pt"
        text-align="start">
        <xsl:apply-templates/>
      </fo:list-block>
    </xsl:template>
    
    <xsl:template match="ol/li">
      <fo:list-item>
        <fo:list-item-label 
          end-indent="label-end()">
          <fo:block>
            <xsl:number format="1."/>
          </fo:block>
        </fo:list-item-label>
        <fo:list-item-body 
          start-indent="body-start()">
          <fo:block
            font-family="serif">
            <xsl:apply-templates/>
          </fo:block>
        </fo:list-item-body>
      </fo:list-item>
    </xsl:template>
    
    <xsl:template match="ul/li">
      <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
          <fo:block>&#x2022;</fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()">
          <fo:block
            font-family="serif">
            <xsl:apply-templates/>
          </fo:block>
        </fo:list-item-body>
      </fo:list-item>
    </xsl:template>
    
    <xsl:template match="dl">
      <fo:list-block
        provisional-distance-between-starts="18pt"
        provisional-label-separation="3pt"
        text-align="start">
        <xsl:apply-templates/>
      </fo:list-block>
    </xsl:template>
    
    <xsl:template match="dt">
      <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
          <fo:block></fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()">
          <fo:block
            font-weight="bold">
            <xsl:apply-templates/>
          </fo:block>
        </fo:list-item-body>
      </fo:list-item>
    </xsl:template>
    
    <xsl:template match="dd">
      <fo:list-item>
        <fo:list-item-label end-indent="label-end()">
          <fo:block></fo:block>
        </fo:list-item-label>
        <fo:list-item-body start-indent="body-start()">
          <fo:block>
            <xsl:apply-templates/>
          </fo:block>
        </fo:list-item-body>
      </fo:list-item>
    </xsl:template>
    
    <xsl:template match="strong">
      <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
    </xsl:template>
    
    <xsl:template match="em">
      <fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
    </xsl:template>
  
    <xsl:template match="code">
      <fo:inline font-family="monospace"><xsl:apply-templates/></fo:inline>
    </xsl:template>
  
    <xsl:template match="warning">
      <fo:block
        margin-left="0.25in"
        margin-right="0.25in"
        font-weight="bold"
        font-size="10pt"
        font-family="serif"
        space-before="10pt"
        border-before-style="solid"
        border-start-style="solid"
        border-end-style="solid"
        border-color="#D00000"
        background-color="#D00000"
        color="#ffffff">
        Warning: <xsl:value-of select="title"/>
      </fo:block>
      <fo:block
        margin-left="0.25in"
        margin-right="0.25in"
        font-family="serif"
        font-size="8pt"
        border-after-style="solid"
        border-start-style="solid"
        border-end-style="solid"
        border-color="#D00000"
        background-color="#fff0f0"
        padding-start="3pt"
        padding-end="3pt"
        padding-before="3pt"
        padding-after="3pt"
        space-after="10pt">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
  
    <xsl:template match="note">
      <fo:block
        margin-left="0.25in"
        margin-right="0.25in"
        font-weight="bold"
        font-size="10pt"
        color="#ffffff"
        font-family="serif"
        space-before="10pt"
        border-before-style="solid"
        border-start-style="solid"
        border-end-style="solid"
        border-color="#A0C9F5"
        background-color="#A0C9F5">
        Note: <xsl:value-of select="title"/>
      </fo:block>
      <fo:block
        margin-left="0.25in"
        margin-right="0.25in"
        font-family="serif"
        font-size="8pt"
        space-after="10pt"
        border-after-style="solid"
        border-start-style="solid"
        border-end-style="solid"
        border-color="#A0C9F5"
        background-color="#F0F0FF"
        padding-start="3pt"
        padding-end="3pt"
        padding-before="3pt"
        padding-after="3pt">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
  
    <xsl:template match="fixme">
      <fo:block
        margin-left="0.25in"
        margin-right="0.25in"
        font-weight="bold"
        font-size="10pt"
        color="#FFFFFF"
        font-family="serif"
        space-before="10pt"
        border-before-style="solid"
        border-start-style="solid"
        border-end-style="solid"
        border-color="#C6C650"
        background-color="#C6C650">
        FIXME (<xsl:value-of select="@author"/>): <xsl:value-of select="title"/>
      </fo:block>
      <fo:block
        margin-left="0.25in"
        margin-right="0.25in"
        font-family="serif"
        font-size="8pt"
        space-after="10pt"
        border-after-style="solid"
        border-start-style="solid"
        border-end-style="solid"
        border-color="#C6C650"
        background-color="#FFF0F0"
        padding-start="3pt"
        padding-end="3pt"
        padding-before="3pt"
        padding-after="3pt">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>
  
    <xsl:template match="link">
      <fo:basic-link color="blue" text-decoration="underline" external-destination="{@href}"><xsl:apply-templates/></fo:basic-link>
    </xsl:template>
  
    <xsl:template match="figure">
      <!-- FIXME: Images are not found at the moment -->
      <fo:external-graphic src="{@src}"/>
      <!-- alt text and credits need inserting -->
    </xsl:template>
  
    <xsl:template match="table">
      <!-- FIXME: Apache FOP must have column widths specified at present,
           this section can be removed when this limitation is removed from Fop. 
           Unfortunately, this means that each column is a fixed width,
           but at least the table displays! -->
  
      <xsl:variable name="max-number-columns">
        <xsl:for-each select="tr">
          <xsl:sort select="count(td|th)" data-type="number" order="descending"/>
          <xsl:if test="position() = 1">
            <xsl:value-of select="count(td|th)"/>
          </xsl:if>
        </xsl:for-each>
      </xsl:variable>
  
  
      <xsl:variable name="column-width">
        <xsl:value-of select="6.25 div number($max-number-columns)"/>in
      </xsl:variable>
  
      <fo:table>
                    
        <fo:table-column>
          <xsl:attribute name="column-width">
            <xsl:value-of select="$column-width"/>
          </xsl:attribute>
  
          <xsl:attribute name="number-columns-repeated">
            <xsl:value-of select="number($max-number-columns)"/>
          </xsl:attribute>
        </fo:table-column>
  
        <!-- End of hack for Fop support (if removing this hack, remember 
             you need the <fo:table> element) -->
  
        <fo:table-body
          font-size="10pt"
          font-family="sans-serif">
          <xsl:apply-templates select="tr"/>
        </fo:table-body>
      </fo:table>
  
      <!-- FIXME: Apache Fop does not support the caption element yet.
           This hack will display the table caption accordingly. -->
      <xsl:if test="caption">
        <fo:block
          text-align="center"
          font-weight="bold">
          Table
          <xsl:text> </xsl:text>
          <xsl:number count="table" level="multiple"/>
          <xsl:text>: </xsl:text>
          <xsl:value-of select="caption"/>
        </fo:block>
      </xsl:if>
    </xsl:template>
  
    <xsl:template match="tr">
      <fo:table-row>
        <xsl:apply-templates/>
      </fo:table-row>
    </xsl:template>
  
    <xsl:template match="th">
        <fo:table-cell
          padding-before="4pt"
          padding-after="4pt"
          padding-start="4pt"
          padding-end="4pt"
          background-color="#A0C9F5">
          <xsl:attribute name="number-columns-spanned">
            <xsl:value-of select="@colspan"/>
          </xsl:attribute>
          <xsl:attribute name="number-rows-spanned">
            <xsl:value-of select="@rowspan"/>
          </xsl:attribute>
          <fo:block
            text-align="center">
            <xsl:apply-templates/>
          </fo:block>
        </fo:table-cell>
    </xsl:template>
  
    <xsl:template match="td">
      <fo:table-cell
        padding-before="4pt"
        padding-after="4pt"
        padding-start="4pt"
        padding-end="4pt"
        border="1pt solid #A0C9F5">
        <xsl:attribute name="number-columns-spanned">
            <xsl:value-of select="@colspan"/>
          </xsl:attribute>
          <xsl:attribute name="number-rows-spanned">
            <xsl:value-of select="@rowspan"/>
          </xsl:attribute>
        <fo:block>
          <xsl:apply-templates/>
        </fo:block>
      </fo:table-cell>
    </xsl:template>
  
    <xsl:template match="br">
      <fo:block></fo:block>
    </xsl:template>
  
    <xsl:template match="legal">
      <fo:inline
        font-size="8pt">
        <xsl:apply-templates/>
      </fo:inline>
    </xsl:template>
  
  <!-- ====================================================================== -->
  <!-- Local Extensions section -->
  <!-- ====================================================================== -->
  
   <xsl:template match="citation">
     <fo:inline>
       [<xsl:value-of select="@def"/>]
     </fo:inline>
   </xsl:template>
  
  
  
  </xsl:stylesheet>
  
  
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/book2menu.xsl
  
  Index: book2menu.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="path"/> <!-- filename, eg 'index.html' -->
  
    <xsl:include href="pathutils.xsl"/>
    <xsl:variable name="filename">
      <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
    <xsl:template match="book">
      <div class="menuBar">
        <xsl:apply-templates select="menu"/>
      </div>
    </xsl:template>
  
    <xsl:template match="menu">
      <div class="menu">
        <span class="menuLabel"><xsl:value-of select="@label"/></span>
         <xsl:apply-templates/>
      </div>
    </xsl:template>
  
    <xsl:template match="menu-item">
      <div class="menuItem">
         <xsl:choose>
          <xsl:when test="starts-with(@href, $filename)">
            <span class="menuSelected"><xsl:value-of select="@label"/></span>
          </xsl:when>
          <xsl:otherwise>
            <a href="{@href}"><xsl:value-of select="@label"/></a>
          </xsl:otherwise>
        </xsl:choose>
      </div>
    </xsl:template>
  
    <xsl:template match="external">
      <li>
         <xsl:choose>
          <xsl:when test="starts-with(@href, $filename)">
           <span class="externalSelected"><xsl:value-of select="@label"/></span>
          </xsl:when>
          <xsl:otherwise>
            <a href="{@href}" target="_blank"><xsl:value-of select="@label"/></a>
          </xsl:otherwise>
        </xsl:choose>
      </li>
    </xsl:template>
  
    <xsl:template match="menu-item[@type='hidden']"/>
  
    <xsl:template match="external[@type='hidden']"/>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:include href = "split.xsl"/>
  
    <xsl:param name="isfaq"/>
    <xsl:param name="resource"/> <!-- Filename part, eg 'index' from index.html' -->
    <xsl:param name="dir"/>
    <xsl:include href="dotdots.xsl"/>
  
    <xsl:variable name="root">
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$dir"/>
      </xsl:call-template>
    </xsl:variable>
   
    <xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
  
    <xsl:template match="document">
      <div class="content">
        <xsl:if test="normalize-space(header/title)!=''">
          <table class="title">
            <tr> 
              <td valign="middle"> 
                <h1>
                  <xsl:value-of select="header/title"/>
                </h1>
              </td>
              <!--td align="center" width="80" nowrap><a href="" class="dida"><img src="images/singlepage.gif"><br>
                single page<br>
                version</a></td>
              <td align="center" width="80" nowrap="nowrap"><a href="{$resource}.pdf" class="dida"><img border="0" src="{$skin-img-dir}/printer.gif"/><br/>
                print-friendly<br/>
                version</a></td>-->
            </tr>
          </table>
        </xsl:if>
        <xsl:if test="normalize-space(header/subtitle)!=''">
          <h3>
            <xsl:value-of select="header/subtitle"/>
          </h3>
        </xsl:if>
        <xsl:if test="header/authors">
          <p>
            <font size="-2">
              <xsl:for-each select="header/authors/person">
                <xsl:choose>
                  <xsl:when test="position()=1">by&#160;</xsl:when>
                  <xsl:otherwise>,&#160;</xsl:otherwise>
                </xsl:choose>
                <xsl:value-of select="@name"/>
              </xsl:for-each>
            </font>
          </p>
        </xsl:if>
        <xsl:apply-templates select="body"/>
      </div>
    </xsl:template>
    <xsl:template match="body">
      <xsl:if test="section and not($isfaq='true')">
        <ul class="minitoc">
          <xsl:for-each select="section">
            <li>
              <a href="#{generate-id()}">
                <xsl:value-of select="title"/>
              </a>
              <xsl:if test="section">
                <ul class="minitoc">
                  <xsl:for-each select="section">
                    <li>
                      <a href="#{generate-id()}">
                        <xsl:value-of select="title"/>
                      </a>
                    </li>
                  </xsl:for-each>
                </ul>
              </xsl:if>
            </li>
          </xsl:for-each>
        </ul>
      </xsl:if>
      <xsl:apply-templates/>
    </xsl:template>
    <!--  section handling
    - <a name/> anchors are added if the id attribute is specified
    - generated anchors are still included for TOC - what should we do about this?
    - FIXME: provide a generic facility to process section irrelevant to their
      nesting depth
  -->
    <xsl:template match="section">
      <a name="{generate-id()}"/>
      <xsl:if test="normalize-space(@id)!=''">
        <a name="{@id}"/>
      </xsl:if>
      <div class="section">
      <h3>
        <xsl:value-of select="title"/>
      </h3>
      <xsl:apply-templates select="*[not(self::title)]"/>
      </div>
    </xsl:template>
    <xsl:template match="section/section">
      <a name="{generate-id()}"/>
      <xsl:if test="normalize-space(@id)!=''">
        <a name="{@id}"/>
      </xsl:if>
      <div class="subsection">
      <h4>
        <xsl:value-of select="title"/>
      </h4>
      <xsl:apply-templates select="*[not(self::title)]"/>
      </div>
    </xsl:template>
    <xsl:template match="note | warning | fixme">
      <div class="frame {local-name()}">
        <div class="label">
          <xsl:choose>
            <xsl:when test="local-name() = 'note'">Note</xsl:when>
            <xsl:when test="local-name() = 'warning'">Warning</xsl:when>
            <xsl:otherwise>Fixme (
                 <xsl:value-of select="@author"/>
  
                 )</xsl:otherwise>
          </xsl:choose>
        </div>
        <div class="content">
          <xsl:apply-templates/>
        </div>
      </div>
    </xsl:template>
    <xsl:template match="link">
      <a href="{@href}">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
    <xsl:template match="jump">
      <a href="{@href}" target="_top">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
    <xsl:template match="fork">
      <a href="{@href}" target="_blank">
        <xsl:apply-templates/>
      </a>
    </xsl:template>
    <xsl:template match="p[@xml:space='preserve']">
    <div class="pre">
      <xsl:apply-templates/>
    </div>
    </xsl:template>
    <xsl:template match="source">
      <pre class="code">
  <!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
        <xsl:apply-templates/>
  <!--
      <xsl:call-template name="format">
      <xsl:with-param select="." name="txt" /> 
       <xsl:with-param name="width">80</xsl:with-param> 
       </xsl:call-template>
  -->
      </pre>
    </xsl:template>
    <xsl:template match="anchor">
      <a name="{@id}"/>
    </xsl:template>
    <xsl:template match="icon">
      <img src="{@src}" alt="{@alt}">
        <xsl:if test="@height">
          <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
        </xsl:if>
        <xsl:if test="@width">
          <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
        </xsl:if>
      </img>
    </xsl:template>
    <xsl:template match="code">
      <span class="codefrag"><xsl:value-of select="."/></span>
    </xsl:template>
    <xsl:template match="figure">
      <div align="center">
        <img src="{@src}" alt="{@alt}" class="figure">
          <xsl:if test="@height">
            <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
          </xsl:if>
          <xsl:if test="@width">
            <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
          </xsl:if>
        </img>
      </div>
    </xsl:template>
    <xsl:template match="table">
      <table cellpadding="4" cellspacing="1" class="ForrestTable">
        <xsl:if test="@cellspacing"><xsl:attribute name="cellspacing"><xsl:value-of select="@cellspacing"/></xsl:attribute></xsl:if>
        <xsl:if test="@cellpadding"><xsl:attribute name="cellpadding"><xsl:value-of select="@cellpadding"/></xsl:attribute></xsl:if>
        <xsl:if test="@border"><xsl:attribute name="border"><xsl:value-of select="@border"/></xsl:attribute></xsl:if>
        <xsl:if test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:if>
        <xsl:if test="@bgcolor"><xsl:attribute name="bgcolor"><xsl:value-of select="@bgcolor"/></xsl:attribute></xsl:if>
        <xsl:apply-templates/>
      </table>
    </xsl:template>
    <xsl:template match="node()|@*" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/dotdots.xsl
  
  Index: dotdots.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <!--
  Contains the 'dotdots' template, which, given a path, will output a set of
  directory traversals to get back to the source directory. Handles both '/' and
  '\' directory separators.
  
  Examples:
    Input                           Output 
      index.html                    ""
      dir/index.html                "../"
      dir/subdir/index.html         "../../"
      dir//index.html              "../"
      dir/                          "../"
      dir//                         "../"
      \some\windows\path            "../../"
      \some\windows\path\           "../../../"
      \Program Files\mydir          "../"
  
  Cannot handle ..'s in the path, so don't expect 'dir/subdir/../index.html' to
  work.
  
  jefft@apache.org
  -->
  
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template name="dotdots">
      <xsl:param name="path"/>
      <xsl:variable name="dirs" select="normalize-space(translate(concat($path, 'x'), ' /\', '_  '))"/>
      <!-- The above does the following:
         o Adds a trailing character to the path. This prevents us having to deal
           with the special case of ending with '/'
         o Translates all directory separators to ' ', and normalize spaces,
  		 cunningly eliminating duplicate '//'s. We also translate any real
  		 spaces into _ to preserve them.
      -->
      <xsl:variable name="remainder" select="substring-after($dirs, ' ')"/>
      <xsl:if test="$remainder">
        <xsl:text>../</xsl:text>
        <xsl:call-template name="dotdots">
          <xsl:with-param name="path" select="translate($remainder, ' ', '/')"/>
  		<!-- Translate back to /'s because that's what the template expects. -->
        </xsl:call-template>
      </xsl:if>
    </xsl:template>
  
  <!--
    Uncomment to test.
    Usage: saxon dotdots.xsl dotdots.xsl path='/my/test/path'
  
    <xsl:param name="path"/>
    <xsl:template match="/">
      <xsl:message>Path: <xsl:value-of select="$path"/></xsl:message>
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:template>
   -->
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/pathutils.xsl
  
  Index: pathutils.xsl
  ===================================================================
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!--
  PathUtils.xsl
  
  A set of XSLT templates useful for parsing URI paths:
  
  dirname: return the directory part of a path
  filename: return the file part of a path
  ext: return the last extension of the filename in a path
  filename-noext: return the file part of a path without its last extension
  
  @author Jeff Turner <jefft@apache.org>
  $Id: pathutils.xsl,v 1.1 2002/11/05 07:36:49 jefft Exp $
  -->
  
  <!-- Returns the directory part of a path.  Equivalent to Unix 'dirname'.
  Examples:
  '' -> ''
  'foo/index.html' -> 'foo/'
  -->
  <xsl:template name="dirname">
    <xsl:param name="path" />
    <xsl:if test="contains($path, '/')">
      <xsl:value-of select="concat(substring-before($path, '/'), '/')" />
      <xsl:call-template name="dirname">
        <xsl:with-param name="path"
          select="substring-after($path, '/')" />
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
  
  
  <!-- Returns the filename part of a path.  Equivalent to Unix 'basename'
  Examples:
  'index.html'  ->  'index.html' 
  'foo/bar/'  ->  '' 
  'foo/bar/index.html'  ->  'index.html' 
  -->
  <xsl:template name="filename">
    <xsl:param name="path"/>
    <xsl:choose>
      <xsl:when test="contains($path, '/')">
        <xsl:call-template name="filename">
          <xsl:with-param name="path" select="substring-after($path, '/')"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$path"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <!-- Returns the last extension of a filename in a path.
  Examples:
  'index.html'  ->  '.html' 
  'index.dtdx.html'  ->  '.html' 
  'foo/bar/'  ->  '' 
  'foo/bar/index.html'  ->  '.html' 
  'foo/bar/index'  ->  '' 
  -->
  <xsl:template name="ext">
    <xsl:param name="path"/>
    <xsl:param name="subflag"/> <!-- Outermost call? -->
    <xsl:choose>
      <xsl:when test="contains($path, '.')">
        <xsl:call-template name="ext">
          <xsl:with-param name="path" select="substring-after($path, '.')"/>
          <xsl:with-param name="subflag" select="'sub'"/>
        </xsl:call-template>
      </xsl:when>
      <!-- Handle extension-less filenames by returning '' -->
      <xsl:when test="not($subflag) and not(contains($path, '.'))">
        <xsl:text/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="concat('.', $path)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <!-- Returns a filename of a path stripped of its last extension.
  Examples:
  'foo/bar/index.dtdx.html' -> 'index.dtdx'
  -->
  <xsl:template name="filename-noext">
    <xsl:param name="path"/>
    <xsl:variable name="filename">
      <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="ext">
      <xsl:call-template name="ext">
        <xsl:with-param name="path" select="$filename"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/>
  </xsl:template>
  
  <!--
  Uncomment this to test.
  Usage: saxon resource.xsl resource.xsl resource=foo/bar
  
  <xsl:param name="resource" select="'/foo/bar/index.html'"/>
  <xsl:template match="/">
    <xsl:message>
      resource= <xsl:value-of select="$resource"/>
      dirname= <xsl:call-template name="dirname">
        <xsl:with-param name="path" select="$resource"/>
      </xsl:call-template>
      filename= <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$resource"/>
      </xsl:call-template>
      ext= <xsl:call-template name="ext">
        <xsl:with-param name="path" select="$resource"/>
      </xsl:call-template>
      filename-noext= <xsl:call-template name="filename-noext">
        <xsl:with-param name="path" select="$resource"/>
      </xsl:call-template>
    </xsl:message>
  </xsl:template>
  -->
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/renderlogo.xsl
  
  Index: renderlogo.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  
  <!--
  A simple callable template that renders a logo for an entity. The logo will 
  be a hyperlink and may include an image (with width and height if specified)
  or else it will just include the specified text.
  
  Note that text and image are mandatory parts of the template.
  -->
  
  <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template name="renderlogo">
      <xsl:param name="name"/>
      <xsl:param name="url"/>
      <xsl:param name="logo"/>
      <xsl:param name="width"/>
      <xsl:param name="height"/>
      <xsl:param name="root"/>
      <a href="{$url}">
        <xsl:choose>
          <xsl:when test="$logo">
            <img alt="{$name}" class="logoImage" border="0">
              <xsl:attribute name="src">
  	      <xsl:if test="not(starts-with($logo, 'http://'))"><xsl:value-of select="$root"/></xsl:if>
                <xsl:value-of select="$logo"/>
              </xsl:attribute>
              <xsl:if test="$width">
                <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
              </xsl:if>
              <xsl:if test="$height">
                <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
              </xsl:if>
  	  </img>
          </xsl:when>
          <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
        </xsl:choose>
      </a>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/site2xhtml.xsl
  
  Index: site2xhtml.xsl
  ===================================================================
  <?xml version="1.0"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <!-- Default skinconf.xml in the skins/ directory -->
    <xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
    <xsl:variable name="config" select="document($config-file)/skinconfig"/>
    <xsl:param name="path"/>
    <xsl:include href="pathutils.xsl"/>
    <xsl:include href="dotdots.xsl"/>
    <xsl:include href="renderlogo.xsl"/>
  
    <xsl:variable name="root">
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
   
    <xsl:variable name="filename">
      <xsl:call-template name="filename">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
    
    <xsl:template match="site">
      <html>
        <head>
          <title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
           <link rel="stylesheet" href="{$root}skin/site.css" type="text/css"/>
        </head>
        <body>
  
      <xsl:comment>================= start Banner ==================</xsl:comment>
        <div class="banner">
          <table border="0" cellspacing="0" cellpadding="8" width="100%">
            <tr>
              <xsl:comment>================= start Group Logo ==================</xsl:comment>
              <xsl:if test="$config/group-name">
              <td align="left">
                <div class="groupLogo">
                  <xsl:call-template name="renderlogo">
                    <xsl:with-param name="name" select="$config/group-name"/>
                    <xsl:with-param name="url" select="$config/group-url"/>
                    <xsl:with-param name="logo" select="$config/group-logo"/>
                    <xsl:with-param name="root" select="$root"/>
                  </xsl:call-template>
                </div>
              </td>
              </xsl:if>
              <xsl:comment>================= end Group Logo ==================</xsl:comment>
              <xsl:comment>================= start Project Logo ==================</xsl:comment>
              <td align="right">
                <div class="projectLogo">
                  <xsl:call-template name="renderlogo">
                    <xsl:with-param name="name" select="$config/project-name"/>
                    <xsl:with-param name="url" select="$config/project-url"/>
                    <xsl:with-param name="logo" select="$config/project-logo"/>
                    <xsl:with-param name="root" select="$root"/>
                  </xsl:call-template>
                </div>
              </td>
              <xsl:comment>================= end Project Logo ==================</xsl:comment>
            </tr>
          </table>
        </div>
      <xsl:comment>================= end Banner ==================</xsl:comment>
  
      <xsl:comment>================= start Main ==================</xsl:comment>
      <table border="0" cellspacing="0" cellpadding="0" width="100%">
        <xsl:comment>================= start Status ==================</xsl:comment>
        <tr class="status">
          <td class="breadcrumb">
            <xsl:comment>================= start BreadCrumb ==================</xsl:comment>
            <xsl:for-each select="$config/trail/link">
              <xsl:if test="position()!=1">|</xsl:if>
              <a href="{@href}"><xsl:value-of select="@name"/></a>
            </xsl:for-each>
            <xsl:comment>================= end BreadCrumb ==================</xsl:comment>
          </td>
          <td class="tabs">
            <div align="right">
            <xsl:comment>================= start Tabs ==================</xsl:comment>
            <xsl:apply-templates select="div[@class='tab']"/>
            <xsl:comment>================= end Tabs ==================</xsl:comment>
            </div>
          </td>
        </tr>
        <xsl:comment>================= end Status ==================</xsl:comment>
  
        <tr valign="top">
          <xsl:comment>================= start Menu ==================</xsl:comment>
          <td width="20%">
            <div class="menuColumn">
              <xsl:apply-templates select="div[@class='menuBar']"/>
            </div>
          </td>
          <xsl:comment>================= end Menu ==================</xsl:comment>
  
          <xsl:comment>================= start Content ==================</xsl:comment>
          <td>
            <div class="contentColumn">
              <xsl:apply-templates select="div[@class='content']"/>
            </div>
          </td>
          <xsl:comment>================= end Content ==================</xsl:comment>
        </tr>
      </table>
      <xsl:comment>================= end Main ==================</xsl:comment>
  
      <xsl:comment>================= start Footer ==================</xsl:comment>
      <div class="footer">
      <table border="0"
             height="20" width="100%" cellpadding="0"
             cellspacing="0" summary="footer">
        <tr>
          <xsl:comment>================= start Copyright ==================</xsl:comment>
          <td colspan="2">
            <div align="center">
              <div class="copyright">
                Copyright &#169; <xsl:value-of select="$config/year"/>&#160;<xsl:value-of
                select="$config/vendor"/>. All rights reserved.
              </div>
            </div>
          </td>
          <xsl:comment>================= end Copyright ==================</xsl:comment>
        </tr>
        <tr>
        <td align="left">
          <xsl:comment>================= start Host ==================</xsl:comment>
          <xsl:if test="$config/host-logo and not($config/host-logo = '')">
            <div align="left">
              <div class="host">
                <xsl:call-template name="renderlogo">
                  <xsl:with-param name="name" select="$config/host-name"/>
                  <xsl:with-param name="url" select="$config/host-url"/>
                  <xsl:with-param name="logo" select="$config/host-logo"/>
                  <xsl:with-param name="root" select="$root"/>
                </xsl:call-template>
              </div>
            </div>
          </xsl:if>
          <xsl:comment>================= end Host ==================</xsl:comment>
        </td>
        <td align="right">
          <xsl:comment>================= start Credits ==================</xsl:comment>
          <div align="right">
          <div class="credit">
          <xsl:if test="$filename = 'index.html' and $config/credits">
            <xsl:for-each select="$config/credits/credit">
              <xsl:call-template name="renderlogo">
                <xsl:with-param name="name" select="name"/>
                <xsl:with-param name="url" select="url"/>
                <xsl:with-param name="logo" select="image"/>
                <xsl:with-param name="root" select="$root"/>
                <xsl:with-param name="width" select="width"/>
                <xsl:with-param name="height" select="height"/>
              </xsl:call-template>
            </xsl:for-each>
          </xsl:if>
          </div>
          </div>
          <xsl:comment>================= end Credits ==================</xsl:comment>
          </td>
        </tr>
      </table>
      </div>
      <xsl:comment>================= end Footer ==================</xsl:comment>
  
        </body>
      </html>
      </xsl:template>
  
      <xsl:template match="node()|@*" priority="-1">
        <xsl:copy>
          <xsl:apply-templates select="@*"/>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/xslt/html/split.xsl
  
  Index: split.xsl
  ===================================================================
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  <!--
   This stylesheet was taken from the XSLT FAQ http://www.dpawson.co.uk/xsl/
   
   Comments and adaption to be used without normalize-space()
    by Nicola Ken Barozzi nicolaken@apache.org
  --> 
  
  <!--
    Input:
  
  <doc>
  
  <para>
   123456 2345 343434 545454 43434 343 
   12345 343434 545454 43434 343 
   32345645 343434 545454 43434 343 
   3422222225 343434 545454 43434 343 
   llllllllllllllllllllllooooooooooooooonnnnnnnnnnnggggggggg
   345 343434 545454 43434 343 
  </para>
  
  </doc>
  
  Output:
  
  <HTML>
  <BODY>
  <PRE>123456 2345 343434 545454 
  43434 343 12345 343434 545454 
  43434 343 32345645 343434 
  545454 43434 343 3422222225 
  343434 545454 43434 343 
  lllllllllllllllllllllloooooooo
  ooooooonnnnnnnnnnnggggggggg 
  345 343434 545454 43434 
  343
  </PRE>
  </BODY>
  </HTML>
  
  Fragment ised: 
  
   <xsl:template match="/doc">
   <HTML><BODY><PRE>
      <xsl:call-template name="format">
      <xsl:with-param select="normalize-space(para)" name="txt" /> 
       <xsl:with-param name="width">30</xsl:with-param> 
       </xsl:call-template>
    </PRE></BODY></HTML>
    </xsl:template>
  
  
  -->
  
   <xsl:template match="/body">
     <body>
      <xsl:call-template name="format">
      <xsl:with-param select="source" name="txt" /> 
       <xsl:with-param name="width">40</xsl:with-param> 
       </xsl:call-template>
    </body>
    </xsl:template>
    
    <xsl:template name="format">
      <xsl:param name="txt" /> 
      <xsl:param name="width" /> 
  
      <!-- if there is still text left -->
      <xsl:if test="$txt">
      
      <xsl:variable name = "pretxt" select = "substring($txt,0, $width)" />
      
      <xsl:choose>
        <xsl:when test="contains($pretxt, '&#xA;')">
          <xsl:value-of select="substring-before($pretxt, '&#xA;')"/>
          <xsl:text>&#xA;</xsl:text> 
          <xsl:call-template name="format">
            <xsl:with-param name="txt" select="substring-after($txt,'&#xA;')"/>
            <xsl:with-param select="$width" name="width" />           
          </xsl:call-template>
        </xsl:when>
        
        <xsl:otherwise>
        <!-- get the width at which to break-->
        <xsl:variable name="real-width">
          <xsl:call-template name="tune-width">
            <xsl:with-param select="$txt" name="txt" /> 
            <xsl:with-param select="$width" name="width" /> 
            <xsl:with-param select="$width" name="def" /> 
          </xsl:call-template>
        </xsl:variable>
  
        <!-- output the first part of the broken string -->
        <xsl:value-of select="substring($txt, 1, $real-width)" /> 
  
        <!-- output a newline -->
        <xsl:text>&#xA;</xsl:text> 
  
        <!-- call itself with the remaining part of the text -->
        <xsl:call-template name="format">
         <xsl:with-param select="substring($txt,$real-width + 1)" name="txt" /> 
         <xsl:with-param select="$width" name="width" /> 
        </xsl:call-template>
        </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:template>
    
     
    <!-- used by template "format", it calculates the width at the given def 
         
         It starts at def length and comes back till it finds a space -->
    <xsl:template name="tune-width">
      <xsl:param name="txt" /> 
      <xsl:param name="width" /> 
      <xsl:param name="def" /> 
  
      <xsl:choose>
        <xsl:when test="$width = 0">
         <xsl:value-of select="$def" /> 
        </xsl:when>
                   
        <xsl:when test="substring($txt, $width, 1 ) = ' '">
            <xsl:value-of select="$width" /> 
         </xsl:when>
         
         <xsl:otherwise>
           <!-- otherwise need to tune again, trying with $width - 1 -->
           <xsl:call-template name="tune-width">
             <xsl:with-param select="$width - 1" name="width" /> 
             <xsl:with-param select="$txt" name="txt" /> 
             <xsl:with-param select="$def" name="def" /> 
           </xsl:call-template>
         </xsl:otherwise>
       </xsl:choose>
  
    </xsl:template>
  
    </xsl:stylesheet>
  
  
  
  1.1                  xml-forrest/src/resources/skins/avalon-tigris/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="path"/>
    <xsl:param name="dir_index" select="'index.html'"/>
    <xsl:include href="dotdots.xsl"/>
    <xsl:include href="pathutils.xsl"/>
  
    <!-- NOTE: Xalan has a bug (race condition?) where sometimes $root is only half-evaluated -->
    <xsl:variable name="root">
      <xsl:call-template name="dotdots">
        <xsl:with-param name="path" select="$path"/>
      </xsl:call-template>
    </xsl:variable>
  
  
    <!--
      The longest path of any tab, whose path is a subset of the current URL.  Ie,
      the path of the 'current' tab.
    -->
    <xsl:variable name="longest-dir">
      <xsl:for-each select="/tabs/tab[starts-with($path, @dir|@href)]">
        <xsl:sort select="string-length(@dir|@href)"
                  data-type="number" order="descending"/>
        <xsl:if test="position()=1">
          <xsl:value-of select="@dir|@href"/>
        </xsl:if>
      </xsl:for-each>
    </xsl:variable>
  
    <xsl:template name="separator">|</xsl:template>
  
    <xsl:template name="selected">
      <span class="selectedTab"><xsl:value-of select="@label"/></span>
    </xsl:template>
  
    <xsl:template name="not-selected">
      <span class="unselectedTab">
      <a>
        <xsl:attribute name="href">
          <xsl:if test="starts-with(@href, 'http')">
            <!-- Absolute URL -->
            <xsl:value-of select="@href"/>
          </xsl:if>
          <xsl:if test="not(starts-with(@href, 'http'))">
            <!-- Root-relative path -->
            <xsl:variable name="backpath">
              <xsl:value-of select="$root"/>
              <xsl:text>/</xsl:text>
              <xsl:value-of select="@dir|@href"/>
                <!-- If we obviously have a directory, add /index.html -->
              <xsl:if test="@dir or substring(@href, string-length(@href), string-length(@href)) = '/'">
                <xsl:text>/</xsl:text>
                <xsl:value-of select="$dir_index"/>
              </xsl:if>
            </xsl:variable>
            <xsl:value-of
                  select="translate(normalize-space(translate($backpath, ' /', '/ ')), ' /', '/ ')"/>
  
            <!-- Link to backpath, normalizing slashes -->
          </xsl:if>
        </xsl:attribute>
        <xsl:value-of select="@label"/>
      </a>
      </span>
    </xsl:template>
  
    <xsl:template match="tabs">
      <div class="tab">
        <xsl:for-each select="tab">
          <xsl:if test="position()!=1"><xsl:call-template name="separator"/></xsl:if>
          <xsl:text> </xsl:text>
          <xsl:apply-templates select="."/>
          <xsl:text> </xsl:text>
        </xsl:for-each>
      </div>
    </xsl:template>
  
    <xsl:template match="tab">
      <xsl:choose>
        <xsl:when test="@dir = $longest-dir or @href = $longest-dir">
          <xsl:call-template name="selected"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="not-selected"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  

Mime
View raw message