File generators read an XML file and present it to the pipeline for processing. They are always the first item of a pipeline (except for an aggregator that implies a generator). So a typical use of FileGenerator would be:
where
The above code injects the file content/download.xml in the main site directory (context) into the pipeline. See also, PXTemplateGenerator.
In versions after 1.3.4 implicit entities defined by ISOlat1, ISOpub and ISOnum are translated into their numerical form. The EntityTransformer now only handles explicitly declared entities within a DOCTYPE statement within the XML file.
The FileGenerator component supports caching of the data within the pipeline. The input file is normally checked for being well-formed (no schema validation) but caching the data stores the XML after this process. As a result very little time is saved except on very large XML source files.
Note that if you have an XML file that includes other files (via xinclude), the generator caching will not detect that these other XML files have been modified. If you modify them it is important to clear out the caching to let the cache files to be rebuilt.
Enabling caching is done globally and locally. To turn on caching for all FileGenerators there is an attribute cachable that should be set to true (true/yes/1). So setting the global flag would be (default is false):
This can be overriden by using the same attribute when the pipeline component is used:
The above would turn off the caching for just this instance in the pipeline. It is also possible to change the action of the cache via the query string by using the request parameters. The following would control the generator instance by including the query string "?cachable=1" or "?cachable=0"