Generators

Generators form the start of a pipeline and there should always be one present (but see aggregate, mount and read). Currently supported generators are:

Component Declaration

Generators are defined in the component declaration part of the Sitemap.

<map:generators default="file"> <map:generator name="file" src="resource://lib/generation/FileGenerator"/> <map:generator name="directory" src="resource://lib/generation/DirectoryGenerator"/> <map:generator name="px" src="resource://lib/generation/PXTemplateGenerator"/> </map:generators>

The default attribute specifies the type of generator to use if none is specified in a pipeline.

Using generators

Generators should always be placed first in a pipeline. The only exception to this is an aggregator (which will have an implied generator as part of its use), and the mount and read components. For example (using the above component declaration) the following is a simple pipeline extract:

<map:match pattern="*.xml"> <map:generate src="context://content/{1}.xml" label="xml-content" cachable="no" type="px"/> <-- Some transforms --> <map:serialize type="xhtml"/> </map:match>

where

Copyright 2006 – 2023 Hugh Field-Richards. All Rights Reserved.