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 / docwrap.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.2 KB  |  75 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-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. <xsl:stylesheet version="1.0" 
  18.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  19.  
  20. <!-- docwrap.xsl - text line wrapping
  21.   This stylesheet includes wrap2para.xsl to handle just <source> elements
  22.   that have PCDATA.
  23.   Any other type of source element is the reponsibility of the caller xslt.
  24. -->
  25.  
  26.   <xsl:include href="wrap2para.xsl"/>
  27.  
  28.   <xsl:template match="document">
  29.     <html>
  30.       <head>
  31.         <title><xsl:value-of select="header/title"/></title>
  32.       </head>
  33.       <xsl:apply-templates/>
  34.       </html>
  35.   </xsl:template>
  36.  
  37.   <xsl:template match="body">
  38.     <body>
  39.       <h1><xsl:value-of select="header/title"/></h1>
  40.       <p>Comment from stylesheet: Only <source> elements that did not
  41.         contain an xml content model, had their long
  42.         lines handled by the included wrap2para.xsl stylesheet.
  43.       </p>
  44.       <xsl:apply-templates/>
  45.     </body>
  46.   </xsl:template>
  47.  
  48.   <xsl:template match="section">
  49.     <xsl:apply-templates/>
  50.   </xsl:template>
  51.  
  52.   <xsl:template match="source">
  53.     <pre class="code">
  54.       <xsl:apply-templates/>
  55.     </pre>
  56.   </xsl:template>
  57.  
  58.   <xsl:template match="source[not(*)]">
  59.     <div style="padding:4pt; margin-bottom:8pt; border-width:1px; border-style:solid; border-color:#0086b2;">
  60.       <xsl:call-template name="format-source">
  61.         <xsl:with-param name="source" select="string(.)"/>
  62.       </xsl:call-template>
  63.     </div>
  64.   </xsl:template>
  65.  
  66.   <xsl:template match="title">
  67.     <h2><xsl:apply-templates/></h2>
  68.   </xsl:template>
  69.  
  70.   <xsl:template match="p">
  71.     <p><xsl:apply-templates/></p>
  72.   </xsl:template>
  73.  
  74. </xsl:stylesheet>
  75.