HTML Generator
http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Main
User Documentation

Generators
Overview

Default
File Generator

Core
Directory Generator
Fragment Extractor Generator
HTML Generator
Image Directory Generator
JSP Generator
Notifying Generator
Request Generator
Script Generator
Search Generator
Server Pages Generator
Status Generator
Stream Generator
Velocity Generator

Optional
PHP Generator
XML:DB Generator
XML:DB Collection Generator

HTML Generator

The html generator reads an html document from the local file system or from any url. It acts similar to the file generator with the difference that it reads html documents and converts them using JTidy to xhtml.

This generator is optional and requires the jtidy package in the lib directory when building Cocoon. However, the distribution includes this package already.

  • Name : html
  • Class: org.apache.cocoon.generation.HTMLGenerator
  • Cacheable: yes - uses the last modification date of the html document for validation.

The location of the source html document is specified in the pipeline by the src attribute.

   
  <map:generate src="document.html" type="html"/>
     
Configuring JTidy

Without any configuration, the generator produces an XHTML document, with the proper namespace. However, JTidy offers a full range of options for converting the HTML document to XML.

These options can be specified in a properties file (key=value pairs) whose location is given in the component configuration :

		    
  <map:generator type="html" src="org.apache.cocoon.generation.HTMLGenerator">
    <jtidy-config>jtidy.properties</jtidy-config>
  </map:generator>
		    
		  

The jtidy-config URL can be either relative (to the application context), one of Cocoon's special protocols such as resouce: which searches the file in the classpath.

For more information on the available configurations, please refer to the original Tidy page. Beware that configuration examples shown there use the ':' as a separator when JTidy requires a '=' as it is a standard Java properties file.

Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.