home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / OOo_3.0.1_Win32Intel_install_wJRE_en-US.exe / openofficeorg1.cab / layoutX.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2008-04-10  |  7.3 KB  |  296 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--*************************************************************************
  3.  *
  4.   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5.   
  6.   Copyright 2008 by Sun Microsystems, Inc.
  7.  
  8.   OpenOffice.org - a multi-platform office productivity suite
  9.  
  10.   $RCSfile: header.hxx,v $
  11.  
  12.   $Revision: 1.1 $
  13.  
  14.   This file is part of OpenOffice.org.
  15.  
  16.   OpenOffice.org is free software: you can redistribute it and/or modify
  17.   it under the terms of the GNU Lesser General Public License version 3
  18.   only, as published by the Free Software Foundation.
  19.  
  20.   OpenOffice.org is distributed in the hope that it will be useful,
  21.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  22.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23.   GNU Lesser General Public License version 3 for more details
  24.   (a copy is included in the LICENSE file that accompanied this code).
  25.  
  26.   You should have received a copy of the GNU Lesser General Public License
  27.   version 3 along with OpenOffice.org.  If not, see
  28.   <http://www.openoffice.org/license.html>
  29.   for a copy of the LGPLv3 License.
  30.  
  31.  ************************************************************************-->
  32.  
  33. <xsl:stylesheet version="1.0" 
  34.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  35.     xmlns="http://www.w3.org/1999/xhtml">
  36.     
  37.     <xsl:output method               = "html"
  38.                 media-type           = "text/html"
  39.                 indent               = "yes"
  40.                 doctype-public       = "-//W3C//DTD HTML 4.0 Transitional//EN"
  41.                 omit-xml-declaration = "yes"
  42.                 standalone           = "yes" />
  43.     
  44.     <xsl:include href="../layout.xsl"/>
  45.    
  46.  
  47.      <!-- =============================
  48.                    ROOT
  49.      ================================== -->
  50.  
  51.  
  52.     <xsl:template  match="/">
  53.           <html>
  54.                    <xsl:call-template name="head"/>
  55.                   <xsl:call-template name="body"/>
  56.            </html>
  57.      </xsl:template>
  58.      
  59.      
  60.      <!-- =============================
  61.                    HTML BODY
  62.      ================================== -->
  63.      
  64.      <xsl:template name="body">
  65.          <body>
  66.              <xsl:call-template name="title"/>
  67.              <xsl:call-template name="toc"/>
  68.         </body>
  69.      </xsl:template>
  70.      
  71.      
  72.      <xsl:template name="toc">
  73.         <!--
  74.              @ pre toc html here
  75.         -->
  76.         
  77.         <!-- use this to group documents, it
  78.         is for example usefull when generating tables -->
  79.         
  80.         <xsl:variable name="group" select="3"/>
  81.         
  82.         <xsl:for-each select="/session/content/document[ ( ( position() - 1 ) mod $group ) = 0 ]">
  83.             
  84.             <!-- 
  85.                 @ pre group html here 
  86.             -->
  87.             
  88.             <xsl:call-template name="document-group">
  89.               <xsl:with-param name="group" select="$group"/>
  90.             </xsl:call-template>  
  91.             
  92.             <!--
  93.                 @ post group html here
  94.             -->
  95.             
  96.         </xsl:for-each>
  97.  
  98.  
  99.         <!-- use this alternative if you do not need to use groups 
  100.         (uncomment to use - and do not forget to comment the group 
  101.         option above...)-->
  102.  
  103.         <!-- 
  104.       <xsl:apply-templates select="/session/content/document"/>
  105.         -->
  106.  
  107.         <!--
  108.              @ post toc html here
  109.         -->
  110.  
  111.      </xsl:template>
  112.      
  113.     <!-- also when using groups, in the end it comes 
  114.     to this template, which is called for each document -->
  115.     <xsl:template match="document">
  116.       <xsl:apply-templates select="@title"/>
  117.       <xsl:apply-templates select="@description"/>
  118.       <xsl:apply-templates select="@author"/>
  119.       <xsl:apply-templates select="@create-date"/>
  120.       <xsl:apply-templates select="@update-date"/>
  121.       <xsl:apply-templates select="@filename"/>
  122.       <xsl:apply-templates select="@format"/>
  123.       <xsl:apply-templates select="@format-icon"/>
  124.       <xsl:apply-templates select="@format-icon"/>
  125.     </xsl:template>
  126.         
  127.  
  128.      
  129.      <xsl:template name="document-group">
  130.          <xsl:param name="group"/>
  131.          
  132.          <!-- @ pre group code here -->
  133.          
  134.          <!-- - - -->
  135.  
  136.              <xsl:variable name="count" select="(position() - 1) * $group + 1"/>
  137.              
  138.              <xsl:for-each select="/session/content/document[$count <= position() and position() < ($count + $group)]">
  139.              
  140.                     <xsl:apply-templates select="."/>
  141.                    
  142.              </xsl:for-each>
  143.          
  144.          <!-- @ post group code here -->
  145.          
  146.          <!-- - - -->
  147.          
  148.      </xsl:template>
  149.  
  150.           
  151.      <xsl:template name="title">
  152.         <!--
  153.           @ Pre title html code here
  154.         -->
  155.         
  156.         <xsl:value-of select="/session/general-info/@title"/>
  157.         
  158.         <!--
  159.           @ Post title html code here
  160.         -->
  161.      </xsl:template>
  162.      
  163.      <!-- =============================
  164.              Document properties
  165.              
  166.      This section contains templates which
  167.      give the document properties...
  168.                    
  169.      ================================== -->
  170.      
  171.      <!-- this tempaltes gives the
  172.      relative href of the document. To use
  173.      with the <a href="..."> attribute-->
  174.     
  175.     
  176.      <xsl:template match="document" mode="href">
  177.        <xsl:value-of select="concat(../@directory,'/')"/>
  178.        <xsl:if test="@dir">
  179.          <xsl:value-of select="concat(@dir,'/')"/>
  180.        </xsl:if>
  181.        <xsl:value-of select="@fn"/>
  182.      </xsl:template>
  183.      
  184.      
  185.      <xsl:template match="document/@title">
  186.          <span class="doctitle">
  187.              <a>
  188.              <xsl:attribute name="href"> 
  189.                 <xsl:apply-templates select=".." mode="href"/>
  190.             </xsl:attribute> 
  191.             
  192.             <xsl:value-of select="."/>
  193.             </a>
  194.          </span>
  195.          <br/>
  196.      </xsl:template>
  197.      
  198.  
  199.      <xsl:template match="document/@description">
  200.          <span class="docdescription">
  201.              <xsl:value-of select="."/>
  202.          </span>
  203.          <br/>
  204.      </xsl:template>
  205.      
  206.  
  207.      <xsl:template match="document/@author">
  208.          <span class="docauthor">
  209.              <xsl:value-of select="."/>
  210.          </span>
  211.          <br/>
  212.      </xsl:template>
  213.      
  214.  
  215.      <xsl:template match="document/@create-date">
  216.          <span class="doccreationdate">
  217.              <xsl:value-of select="."/>
  218.          </span>
  219.          <br/>
  220.      </xsl:template>
  221.      
  222.  
  223.      <xsl:template match="document/@update-date">
  224.          <span class="doclastchangedate">
  225.              <xsl:value-of select="."/>
  226.          </span>
  227.          <br/>
  228.      </xsl:template>
  229.      
  230.  
  231.      <xsl:template match="document/@filename">
  232.          <span class="docfilename">
  233.              <xsl:value-of select="."/>
  234.          </span>
  235.          <br/>
  236.      </xsl:template>
  237.  
  238.  
  239.      <xsl:template match="document/@format">
  240.          <span class="docfileformatinfo">
  241.              <xsl:value-of select="."/>
  242.          </span>
  243.          <br/>
  244.      </xsl:template>
  245.  
  246.  
  247.      <xsl:template match="document/@pages">
  248.          <span class="docnumberofpages">
  249.              <xsl:value-of select="."/>
  250.          </span>
  251.          <br/>
  252.      </xsl:template>
  253.      
  254.  
  255.      <xsl:template match="document/@size">
  256.          <span class="docsizeinkb">
  257.              <xsl:value-of select="."/>
  258.          </span>
  259.          <br/>
  260.      </xsl:template>
  261.      
  262.      <xsl:template match="document/@icon">
  263.        <img src="images/{.}"/>
  264.          <br/>
  265.      </xsl:template>
  266.     
  267.  
  268.      <!-- =============================
  269.                    HTML HEAD
  270.                    
  271.     this section should not be changed
  272.      ================================== -->
  273.      
  274.      <xsl:template name="head">
  275.          <head>
  276.                 <title>
  277.                      <xsl:value-of select="/session/general-info/@title"/>
  278.                 </title>
  279.                 <!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -->
  280.                 <meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8"/>
  281.                 <meta name="description" content="{/session/general-info/@description}"/>
  282.                 <meta name="keywords" content="{/session/general-info/@keywords}"/>
  283.                 <meta name="author" content="{/session/general-info/@author}"/>
  284.                 <meta name="email" content="{/session/general-info/@email}"/>
  285.                 <meta name="copyright" content="{/session/general-info/@copyright}"/>
  286.                 <!-- create date?
  287.                      update date?
  288.                      fav icon?
  289.                      -->
  290.              <link href="style.css" rel="stylesheet" type="text/css"/>
  291.  
  292.         </head>
  293.      </xsl:template>
  294.          
  295. </xsl:stylesheet>
  296.