cocoon.transformer.*
Cocoon Transformer Adaption Accessor
Index > Books > Cocoon 2 NetKernel Adaption Kit > Accessor Listing > cocoon.transformer.*


Module

urn:org:ten60:netkernel:mod:cocoon

Definition

Format

<instr>
  <type>cocoon.transformer.TraxTransformer</type>
  <operand>var:generated-data</operand>
  <src>my_style.xsl</src>
  <configuration>
    <configuration>
      <use-request-parameters>false</use-request-parameters>
    </configuration>
  </configuration>
  <target>var:transformed-data</target>
</instr>

Syntax

ElementRulesDescription
typeMandatory cocoon.transformer.*
operandMandatory input from previous stage in pipeline
srcOptional a source URI specification
paramOptional any parameterisation of transformer
configurationOptional any configuration of transformer

This adaptor accessor matches all URI of the form active:cocoon.transformer.*. All transformers shipped with the version of cocoon specified in the guide are available though many may not be useful because they have no ability to access data from the object model/environment such as the request and session. The exact match for the generators type is matched against the transformers classname, not against a name specified in a sitemap. Sitemaps are not used within the Cocoon 2 NetKernel Adaption Kit.

It provides an adaptor for instantiating and executing a standard cocoon transformers which must implement the interface org.apache.cocoon.transformation.Transformer.

The src, param and configuration arguments are optional depending upon the exact transformer. The parameter argument, if specified, should be an XML fragment as would appear in the cocoon sitemap pipeline section as the map:transform element with attributes and sub elements specifying parameters. The configuration argument, if specified, should be an XML fragment as would appear in the cocoon sitemap components section as the map:transformer with attributes and sub elements specifying configuration.

The distinction between parameters and configuration is subtle. In Cocoon components are pooled and all components of a type in a pool must have the same configuration, parameters can be applied differently each time they are used within a sitemap. Because NetKernel does not use Cocoons pooling mechanism configuration and parameters may be applied differently on each usage of a component.

The result of sucessful execution is an SAX stream generating aspect. Upon failure an exception aspect is thrown.

© 2003,2004, 1060 Research Limited
1060 registered trademark, NetKernel trademark of 1060 Research Limited