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 / html-generator.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  3.8 KB  |  90 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  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. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
  18.  
  19. <document>
  20.     <header>
  21.         <title>HTML Generator</title>
  22.         <version>0.9</version>
  23.         <type>Technical document</type>
  24.         <authors>
  25.             <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
  26.             <person name="Sylvain Wallez" email="sylvain@apache.org"/>
  27.             <person name="Gianugo Rabellino " email="gianugo@apache.org"/>
  28.          </authors>
  29.          <abstract>This document describes the html generator of Cocoon.</abstract>
  30.     </header>
  31.     <body>
  32.         <s1 title="HTML Generator">
  33.             <p>The html generator reads an html document from the local file system or from any url.
  34.                    It acts similar to the file generator with the difference that it reads
  35.                      html documents and converts them using <link href="http://sourceforge.net/projects/jtidy">JTidy</link>
  36.                      to xhtml.</p>
  37.             <p>This generator is optional and requires the jtidy package
  38.                      in the lib directory when building Cocoon. However,
  39.                      the distribution includes this package already.</p>
  40.             <ul>
  41.                 <li>Name : html</li>
  42.                 <li>Class: org.apache.cocoon.generation.HTMLGenerator</li>
  43.                 <li>Cacheable: yes - uses the last modification date of the html document for validation.</li>
  44.             </ul>
  45.             <p>The location of the source html document is specified in
  46.                      the pipeline by the src attribute.</p>
  47.   <source>
  48.    <![CDATA[
  49.   <map:generate src="document.html" type="html"/>
  50.      ]]>
  51. </source>
  52.       <p>The html generator, however, can operate also on a request
  53.       attribute or on a XML POST request. This can be done also by the
  54.       <link href="stream-generator.html">stream generator</link>, with whom
  55.       it shares the syntax: the added bonus here is that you can
  56.       "sanitize" a possibly non well-formed XML snippet for further
  57.       reuse later. In order to use this feature for request attributes, 
  58.       just omit the "src" attribute and set a parameter like the following 
  59.       one in the sitemap:</p>
  60.  
  61. <source>
  62. <![CDATA[
  63.   <map:parameter name="form-name" value="my-request-attribute"/>
  64. ]]>
  65. </source>
  66.  
  67.         </s1>
  68.         <s1 title="Configuring JTidy">
  69.           <p>Without any configuration, the generator produces an XHTML document, with the proper namespace. However,
  70.              JTidy offers a full range of options for converting the HTML document to XML.</p>
  71.           <p>These options can be specified in a properties file (key=value pairs) whose location is given in the
  72.              component configuration :</p>
  73.           <source>
  74.             <![CDATA[
  75.   <map:generator name="html" src="org.apache.cocoon.generation.HTMLGenerator">
  76.     <jtidy-config>jtidy.properties</jtidy-config>
  77.   </map:generator>
  78.             ]]>
  79.           </source>
  80.           <p>The <code>jtidy-config</code> URL can be either relative (to the application context), one of Cocoon's special
  81.              protocols such as <code>resouce:</code> which searches the file in the classpath.</p>
  82.           <p>For more information on the available configurations, please refer to the
  83.              <link href="http://www.w3.org/People/Raggett/tidy/">original Tidy page</link>. Beware that configuration
  84.              examples shown there use the ':' as a separator when JTidy requires a '=' as it is a standard Java properties file.
  85.           </p>
  86.         </s1>
  87.  
  88.     </body>
  89. </document>
  90.