home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / news2html-single.xslt < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  4.6 KB  |  130 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 2002-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <xsl:stylesheet version="1.0" 
  19.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  20.   xmlns:include="http://apache.org/cocoon/include/1.0"
  21.   xmlns:n="http://www.betaversion.org/linotype/news/1.0"
  22.   xmlns:h="http://www.w3.org/1999/xhtml"
  23.   xmlns="http://www.w3.org/1999/xhtml"
  24.   exclude-result-prefixes="#default include n h"
  25. >
  26.  
  27.   <xsl:param name="home"/>
  28.  
  29.   <xsl:template match="n:news">
  30.     <html xml:lang="en" lang="en">
  31.       <head>
  32.         <title>Stefano's Linotype ~ <xsl:value-of select="n:title"/></title>
  33.         <meta name="DC.title" content="{n:title}"/>
  34.         <meta name="DC.author.personalName" content="Stefano Mazzocchi"/>
  35.         <meta name="keywords" lang="en" content="{n:keywords}"/>
  36.         <meta name="DC.date.created" content="{@creation-date}"/>
  37.         <meta name="DC.date.lastModified" content="{@creation-date}"/>
  38.         <meta name="DC.identifier" content="http://www.betaversion.org/~stefano/linotype/"/>
  39.  
  40.         <link rel="stylesheet" href="{$home}/styles/main.css" type="text/css"/>
  41.  
  42.         <rdf:RDF xmlns="http://web.resource.org/cc/"
  43.                  xmlns:dc="http://purl.org/dc/elements/1.1/"
  44.                  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  45.          <Work rdf:about="">
  46.           <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/1.0/" />
  47.          </Work>
  48.          <License rdf:about="http://creativecommons.org/licenses/by-nc-sa/1.0/">
  49.           <requires rdf:resource="http://web.resource.org/cc/Attribution" />
  50.           <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
  51.           <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
  52.           <permits rdf:resource="http://web.resource.org/cc/Distribution" />
  53.           <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
  54.           <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
  55.           <requires rdf:resource="http://web.resource.org/cc/Notice" />
  56.          </License>
  57.         </rdf:RDF>
  58.       </head>
  59.       <body>
  60.  
  61.         <div id="path"> 
  62.          <a href="../../../">Home</a> » <a href="../../">Blog</a> » <xsl:value-of select="n:title"/>
  63.         </div>
  64.      
  65.         <div id="page">
  66.           <div class="news">
  67.             <h1><img src="{$home}/images/hand.jpg" alt=""/><xsl:value-of select="n:title"/></h1>
  68.             <h2><xsl:value-of select="@creation-date"/> ~ <xsl:value-of select="@creation-time"/></h2>
  69.             <xsl:apply-templates select="h:body"/>
  70.           </div>
  71.         </div>
  72.  
  73.         <div id="footer">
  74.           <a href="http://creativecommons.org/licenses/by-nc-sa/1.0/" title="Creative Commons: some rights reserved"><img alt="Creative Commons License" src="{$home}/images/cc.gif"/></a>
  75.         </div>
  76.  
  77.         <div id="sidebar">
  78.           <a href="{$home}/backend/"><img alt="Linotype" src="{$home}/images/linotype.jpg" width="156px" height="207px" /></a>
  79.         </div>
  80.  
  81.         <div id="bottombar">
  82.           <a href="http://cocoon.apache.org" title="Apache Cocoon"><img alt="Powered by Cocoon" src="{$home}/images/cocoon.jpg"/></a>
  83.         </div>
  84.         
  85.       </body>
  86.     </html>
  87.   </xsl:template>
  88.  
  89.   <xsl:template match="h:body">
  90.    <div class="body">
  91.     <xsl:apply-templates/>
  92.    </div>
  93.   </xsl:template>
  94.   
  95.   <xsl:template match="h:p[1]">
  96.    <p>
  97.     <span class="firstletter"><xsl:value-of select="substring(text()[1],1,1)"/></span>
  98.     <xsl:value-of select="substring(text()[1],2)"/>
  99.     <xsl:apply-templates select="text()[position() > 1]|@*|*"/>
  100.    </p>
  101.   </xsl:template>
  102.  
  103.   <xsl:template match="hr">
  104.     <div class="separator"><img src="images/separator2.jpg"/></div>
  105.   </xsl:template>
  106.  
  107.   <xsl:template match="@*">
  108.    <xsl:copy>
  109.     <xsl:apply-templates/>
  110.    </xsl:copy>
  111.   </xsl:template>
  112.  
  113.   <xsl:template match="*">
  114.    <xsl:element name="{name()}">
  115.     <xsl:apply-templates select="@*|node()"/>
  116.    </xsl:element>
  117.   </xsl:template>
  118.  
  119.   <xsl:template match="text()">
  120.    <xsl:copy/>
  121.   </xsl:template>
  122.  
  123.   <xsl:template match="@*|node()">
  124.     <xsl:copy>
  125.       <xsl:apply-templates select="@*|node()"/>
  126.     </xsl:copy>
  127.   </xsl:template>
  128.  
  129. </xsl:stylesheet>
  130.