apache > cocoon
 

File Generator

File Generator

The file generator reads an xml document from the local file system or from any url. While url generator may appear to be a more suitable name, it's known as the file generator for historical reasons.

The file generator is the default generator.

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

     
  <map:generate src="document.xml" type="file"/>
  <!-- The type attribute can be omitted as it is the default generator. -->
     

You can also use an absolute filesystem pathname. See the explanation of file: URLs

Be careful to only request xml or xhtml documents, and not html documents. You would get surprising results, including network trips for HTML DTDs that are not provided by Cocoon, and xml parsing errors. Use the "HTMLGenerator instead.