home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 June / PCpro_2005_06.ISO / files / opensource / openoffice / openofficeorg2.cab / layout.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-11-27  |  6.7 KB  |  242 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. #/*************************************************************************
  4. #
  5. #   $RCSfile: layout.xsl,v $
  6. #
  7. #   $Revision: 1.2 $
  8. #
  9. #   last change: $Author: kz $ $Date: 2004/05/19 15:02:49 $
  10. #
  11. #   The Contents of this file are made available subject to the terms of
  12. #   either of the following licenses
  13. #
  14. #          - GNU Lesser General Public License Version 2.1
  15. #          - Sun Industry Standards Source License Version 1.1
  16. #
  17. #   Sun Microsystems Inc., October, 2000
  18. #
  19. #   GNU Lesser General Public License Version 2.1
  20. #   =============================================
  21. #   Copyright 2000 by Sun Microsystems, Inc.
  22. #   901 San Antonio Road, Palo Alto, CA 94303, USA
  23. #
  24. #   This library is free software; you can redistribute it and/or
  25. #   modify it under the terms of the GNU Lesser General Public
  26. #   License version 2.1, as published by the Free Software Foundation.
  27. #
  28. #   This library is distributed in the hope that it will be useful,
  29. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  31. #   Lesser General Public License for more details.
  32. #
  33. #   You should have received a copy of the GNU Lesser General Public
  34. #   License along with this library; if not, write to the Free Software
  35. #   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  36. #   MA  02111-1307  USA
  37. #
  38. #
  39. #   Sun Industry Standards Source License Version 1.1
  40. #   =================================================
  41. #   The contents of this file are subject to the Sun Industry Standards
  42. #   Source License Version 1.1 (the "License"); You may not use this file
  43. #   except in compliance with the License. You may obtain a copy of the
  44. #   License at http://www.openoffice.org/license.html.
  45. #
  46. #   Software provided under this License is provided on an "AS IS" basis,
  47. #   WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  48. #   WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
  49. #   MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
  50. #   See the License for the specific provisions governing your rights and
  51. #   obligations concerning the Software.
  52. #
  53. #   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
  54. #
  55. #   Copyright: 2000 by Sun Microsystems, Inc.
  56. #
  57. #   All Rights Reserved.
  58. #
  59. #   Contributor(s): _______________________________________
  60. #
  61. #
  62. #
  63. #*************************************************************************
  64. -->
  65. <!-- =================================================
  66.  
  67. This template is a skeleton for single level TOC pages 
  68. Do not overwrite this ! copy it and complete the missing
  69. code.
  70.  
  71. I use the @ character whereever there is a missing code, so 
  72. you can use a simple find to navigate and find the
  73. places...
  74.  
  75. ====================================================== -->
  76.  
  77. <xsl:stylesheet version="1.0" 
  78.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  79.     xmlns="http://www.w3.org/1999/xhtml">
  80.     
  81.     <xsl:output method               = "html"
  82.                 media-type           = "text/html"
  83.                 indent               = "yes"
  84.                 doctype-public       = "-//W3C//DTD HTML 4.0 Transitional//EN"
  85.                 omit-xml-declaration = "yes"
  86.                 standalone           = "yes" /> 
  87.   
  88.      <!-- =============================
  89.                    ROOT
  90.      ================================== -->
  91.  
  92.  
  93.     <xsl:template  match="/">
  94.           <html>
  95.                    <xsl:call-template name="head"/>
  96.                   <xsl:call-template name="body"/>
  97.            </html>
  98.      </xsl:template>
  99.      
  100.      
  101.      <!-- =============================
  102.              Document properties
  103.              
  104.      This section contains templates which
  105.      give the document properties...
  106.                    
  107.      ================================== -->
  108.      
  109.      <!-- this tempaltes gives the
  110.      relative href of the document. To use
  111.      with the <a href="..."> attribute-->
  112.     
  113.     
  114.      <xsl:template match="document" mode="href">
  115.        <xsl:value-of select="concat(../@directory,'/')"/>
  116.        <xsl:if test="@dir">
  117.          <xsl:value-of select="concat(@dir,'/')"/>
  118.        </xsl:if>
  119.        <xsl:value-of select="@fn"/>
  120.      </xsl:template>
  121.      
  122.      
  123.     <xsl:template match="document/@title">
  124.          <xsl:param name="target" select="''"/>
  125.         
  126.          <span class="doctitle">
  127.              <a>
  128.              <xsl:attribute name="href"> 
  129.                 <xsl:apply-templates select=".." mode="href"/>
  130.             </xsl:attribute>
  131.             
  132.             <xsl:if test=" $target != ''">
  133.                 <xsl:attribute name="target">
  134.                     <xsl:value-of select="$target"/>
  135.                 </xsl:attribute>
  136.             </xsl:if>
  137.             
  138.             <xsl:value-of select="."/>
  139.             </a>
  140.          </span>
  141.          <br/>
  142.      </xsl:template>
  143.     
  144.  
  145.      <xsl:template match="document/@description">
  146.          <span class="docdescription">
  147.              <xsl:value-of select="."/>
  148.          </span>
  149.          <br/>
  150.      </xsl:template>
  151.      
  152.  
  153.      <xsl:template match="document/@author">
  154.          <span class="docauthor">
  155.              <xsl:value-of select="."/>
  156.          </span>
  157.          <br/>
  158.      </xsl:template>
  159.      
  160.  
  161.      <xsl:template match="document/@create-date">
  162.          <span class="doccreationdate">
  163.              <xsl:value-of select="."/>
  164.          </span>
  165.          <br/>
  166.      </xsl:template>
  167.      
  168.  
  169.      <xsl:template match="document/@update-date">
  170.          <span class="doclastchangedate">
  171.              <xsl:value-of select="."/>
  172.          </span>
  173.          <br/>
  174.      </xsl:template>
  175.      
  176.  
  177.      <xsl:template match="document/@filename">
  178.          <span class="docfilename">
  179.              <xsl:value-of select="."/>
  180.          </span>
  181.          <br/>
  182.      </xsl:template>
  183.  
  184.  
  185.      <xsl:template match="document/@format">
  186.          <span class="docfileformatinfo">
  187.              <xsl:value-of select="."/>
  188.          </span>
  189.          <br/>
  190.      </xsl:template>
  191.  
  192.  
  193.      <xsl:template match="document/@pages">
  194.          <span class="docnumberofpages">
  195.              <xsl:value-of select="."/>
  196.          </span>
  197.          <br/>
  198.      </xsl:template>
  199.      
  200.  
  201.      <xsl:template match="document/@size">
  202.          <span class="docsizeinkb">
  203.              <xsl:value-of select="."/>
  204.          </span>
  205.          <br/>
  206.      </xsl:template>
  207.      
  208.      <xsl:template match="document/@icon">
  209.        <img src="images/{.}"/>
  210.          <br/>
  211.      </xsl:template>
  212.     
  213.  
  214.      <!-- =============================
  215.                    HTML HEAD
  216.                    
  217.     this section should not be changed
  218.      ================================== -->
  219.      
  220.      <xsl:template name="head">
  221.          <head>
  222.                 <title>
  223.                      <xsl:value-of select="/session/general-info/@title"/>
  224.                 </title>
  225.                 <!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -->
  226.                 <meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8"/>
  227.                 <meta name="description" content="{/session/general-info/@description}"/>
  228.                 <meta name="keywords" content="{/session/general-info/@keywords}"/>
  229.                 <meta name="author" content="{/session/general-info/@author}"/>
  230.                 <meta name="email" content="{/session/general-info/@email}"/>
  231.                 <meta name="copyright" content="{/session/general-info/@copyright}"/>
  232.                 <!-- create date?
  233.                      update date?
  234.                      fav icon?
  235.                      -->
  236.              <link href="style.css" rel="stylesheet" type="text/css"/>
  237.  
  238.         </head>
  239.      </xsl:template>
  240.          
  241. </xsl:stylesheet>
  242.