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 / format-text-file.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  1.6 KB  |  53 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2.  
  3. <!--
  4.   Copyright 1999-2004 The Apache Software Foundation
  5.  
  6.   Licensed under the Apache License, Version 2.0 (the "License");
  7.   you may not use this file except in compliance with the License.
  8.   You may obtain a copy of the License at
  9.  
  10.       http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12.   Unless required by applicable law or agreed to in writing, software
  13.   distributed under the License is distributed on an "AS IS" BASIS,
  14.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.   See the License for the specific language governing permissions and
  16.   limitations under the License.
  17. -->
  18.  
  19. <!-- format the output of the SlopGenerator for inclusion in one of our pages -->
  20.  
  21. <xsl:stylesheet
  22.     version="1.0"
  23.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  24.     xmlns:slop="http://apache.org/cocoon/slop/parser/1.0"
  25. >
  26.  
  27.     <xsl:param name="filename"/>
  28.  
  29.     <!-- format slop parsed text -->
  30.     <xsl:template match="slop:parsed-text">
  31.         <div class="code">
  32.             <div class="codeFilename"><xsl:value-of select="$filename"/></div>
  33.             <xsl:apply-templates/>
  34.         </div>
  35.     </xsl:template>
  36.  
  37.     <!-- number lines -->
  38.     <xsl:template match="slop:line">
  39.         <span class="lineNumber">
  40.             <xsl:value-of select="concat(format-number(@line-number,'0000'),' ')"/>
  41.         </span>
  42.         <xsl:value-of select="."/>
  43.         <br/>
  44.     </xsl:template>
  45.  
  46.     <!-- each slop element takes one line -->
  47.     <xsl:template match="slop:*">
  48.         <xsl:value-of select="."/>
  49.         <br/>
  50.     </xsl:template>
  51.  
  52. </xsl:stylesheet>
  53.