cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rica...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java util.xsl
Date Fri, 07 Jan 2000 13:21:20 GMT
ricardo     00/01/07 05:21:20

  Modified:    src/org/apache/cocoon/processor/xsp/library/java util.xsl
  Log:
  1.4:Made compatible with XT XSLT Transformer
  
  Revision  Changes    Path
  1.4       +60 -17    xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl
  
  Index: util.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- util.xsl	2000/01/06 23:32:43	1.3
  +++ util.xsl	2000/01/07 13:21:20	1.4
  @@ -1,7 +1,60 @@
   <?xml version="1.0"?>
  +<!--
   
  + ============================================================================
  +                   The Apache Software License, Version 1.1
  + ============================================================================
  +
  +    Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
  +
  + Redistribution and use in source and binary forms, with or without modifica-
  + tion, are permitted provided that the following conditions are met:
  +
  + 1. Redistributions of  source code must  retain the above copyright  notice,
  +    this list of conditions and the following disclaimer.
  +
  + 2. Redistributions in binary form must reproduce the above copyright notice,
  +    this list of conditions and the following disclaimer in the documentation
  +    and/or other materials provided with the distribution.
  +
  + 3. The end-user documentation included with the redistribution, if any, must
  +    include  the following  acknowledgment:  "This product includes  software
  +    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  +    Alternately, this  acknowledgment may  appear in the software itself,  if
  +    and wherever such third-party acknowledgments normally appear.
  +
  + 4. The names "Cocoon" and  "Apache Software Foundation"  must not be used to
  +    endorse  or promote  products derived  from this  software without  prior
  +    written permission. For written permission, please contact
  +    apache@apache.org.
  +
  + 5. Products  derived from this software may not  be called "Apache", nor may
  +    "Apache" appear  in their name,  without prior written permission  of the
  +    Apache Software Foundation.
  +
  + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  +
  + This software  consists of voluntary contributions made  by many individuals
  + on  behalf of the Apache Software  Foundation and was  originally created by
  + Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
  + Software Foundation, please see <http://www.apache.org/>.
  +
  +-->
  +
  +<!-- written by Ricardo Rocha "ricardo@apache.org" -->
  +
  +
   <xsl:stylesheet
  -  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
  +  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xsp="http://apache.org/DTD/XSP/Layer1"
     xmlns:util="http://www.plenix.com/dtd/xsp/util"
   >
  @@ -46,14 +99,10 @@
     </xsl:template>
   
     <xsl:template match="util:embed">
  -  <!-- Retrieve "uri" parameter as either attribute or element -->
       <xsl:variable name="uri">
         <xsl:choose>
  -        <!-- As attribute (String constant) -->
           <xsl:when test="@uri">"<xsl:value-of select="@uri"/>"</xsl:when>
  -        <!-- As nested (presumably dynamic) element -->
           <xsl:when test="util:uri">
  -          <!-- Recursively evaluate nested expression -->
             <xsl:call-template name="get-nested-content">
               <xsl:with-param name="content" select="util:uri"/>
             </xsl:call-template>
  @@ -88,16 +137,11 @@
       } </xsp:logic>
     </xsl:template>
   
  -  <!-- Include file contents as text -->
     <xsl:template match="util:get-file-contents">
  -  <!-- Retrieve "filename" parameter as either attribute or element -->
       <xsl:variable name="filename">
         <xsl:choose>
  -        <!-- As attribute (String constant) -->
           <xsl:when test="@filename">"<xsl:value-of select="@filename"/>"</xsl:when>
  -        <!-- As nested (presumably dynamic) element -->
           <xsl:when test="util:filename">
  -          <!-- Recursively evaluate nested expression -->
             <xsl:call-template name="get-nested-content">
               <xsl:with-param name="content" select="util:filename"/>
             </xsl:call-template>
  @@ -152,21 +196,20 @@
       </xsp:logic>
     </xsl:template>
   
  -  <!-- Return nested element content as expression or constant -->
     <xsl:template name="get-nested-content">
  +    <xsl:param name="content"/>
       <xsl:choose>
  -      <!-- Nested element -->
         <xsl:when test="$content/*">
           <xsl:apply-templates select="$content/*"/>
         </xsl:when>
  -      <!-- Plain Text -->
  -      <xsl:otherwise>"<xsl:value-of select="normalize($content)"/>"</xsl:otherwise>
  +      <xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise>
       </xsl:choose>
     </xsl:template>
   
  -  <!-- Default copy-over -->
  -  <xsl:template match="@*|node()" priority="-1">
  -    <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
  +  <xsl:template match="@*|*|text()|processing-instruction()">
  +    <xsl:copy>
  +      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
  +    </xsl:copy>
     </xsl:template>
   
   </xsl:stylesheet>
  
  
  

Mime
View raw message