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 / request2news.xslt < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.6 KB  |  62 lines

  1. <?xml version="1.0"?>
  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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  19.                               xmlns:r="http://apache.org/cocoon/request/2.0"
  20.                               xmlns:h="http://www.w3.org/1999/xhtml"
  21.                               xmlns="http://www.w3.org/1999/xhtml"
  22.                               exclude-result-prefixes="h r">
  23.  
  24.   <xsl:template match="/">
  25.    <xsl:apply-templates select="//r:requestParameters"/>
  26.   </xsl:template>
  27.  
  28.   <xsl:template match="r:requestParameters">
  29.    <n:news online="{r:parameter[@name='online']/r:value}" xmlns:n="http://www.betaversion.org/linotype/news/1.0">
  30.      <xsl:attribute name="author"><xsl:value-of select="r:parameter[@name='author']/r:value"/></xsl:attribute>
  31.      <xsl:attribute name="creation-date"><xsl:value-of select="r:parameter[@name='date']/r:value"/></xsl:attribute>
  32.      <xsl:attribute name="creation-time"><xsl:value-of select="r:parameter[@name='time']/r:value"/></xsl:attribute>
  33.      <xsl:attribute name="creation-fulldate"><xsl:value-of select="r:parameter[@name='fulldate']/r:value"/></xsl:attribute>
  34.      <xsl:attribute name="creation-isodate"><xsl:value-of select="r:parameter[@name='isodate']/r:value"/></xsl:attribute>
  35.      <n:title><xsl:value-of select="r:parameter[@name='title']/r:value"/></n:title>
  36.      <xsl:apply-templates select="r:parameter[@name='xml:content']/r:value/h:html/h:body"/>
  37.    </n:news>
  38.   </xsl:template>
  39.  
  40.   <xsl:template match="h:b">
  41.    <strong><xsl:apply-templates/></strong>
  42.   </xsl:template>
  43.  
  44.   <xsl:template match="h:i">
  45.    <em><xsl:apply-templates/></em>
  46.   </xsl:template>
  47.  
  48.   <!-- This template filters out unnecessary declarations of the h namespace -->
  49.   <xsl:template match="h:*">
  50.    <xsl:element name="{name(.)}" namespace="http://www.w3.org/1999/xhtml">
  51.     <xsl:apply-templates select="node()|@*"/>
  52.    </xsl:element>
  53.   </xsl:template>
  54.  
  55.   <xsl:template match="node()|@*">
  56.    <xsl:copy>
  57.     <xsl:apply-templates select="node()|@*"/>
  58.    </xsl:copy>
  59.   </xsl:template>
  60.  
  61. </xsl:stylesheet>
  62.