blob: d9988283b75216c455fdfca9407da3abaae04609 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
<document>
<header>
<title>File Generator</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
</authors>
<abstract>This document describes the file generator of Cocoon.</abstract>
</header>
<body>
<s1 title="File Generator">
<p>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.</p>
<p>The file generator is the default generator.</p>
<ul>
<li>Name : file</li>
<li>Class: org.apache.cocoon.generation.FileGenerator</li>
<li>Cacheable: yes - uses the last modification date of the xml document for validation.</li>
</ul>
<p>The location of the source xml document is specified in
the pipeline by the src attribute.</p>
<source>
<![CDATA[
<map:generate src="document.xml" type="file"/>
<!-- The type attribute can be omitted as it is the default generator. -->
]]>
</source>
<p>
You can also use an absolute filesystem pathname. See the explanation of
<link href="../concepts/sitemap.html#file-url">file: URLs</link>
</p>
<p>
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.
</p>
</s1>
</body>
</document>