You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ross Burton <ro...@mail.com> on 2000/03/14 14:48:35 UTC

AbstractProcessor

Hi,

This morning I started to write another Cocoon processor (which generates
directory listings basically) and realised that I was writing the same code
again and again and....

All of my processors have been modelled after the process() method in the
SQL and LDAP processors supplied with Cocoon, after some dumbing-down as
what I've been writing has been fairly simple (the most useful was a bridge
to a XQL engine).  I decided to create an AbstractProcessor class which does
this for you - it will take all instances of a specified node, create a
Dictionary of the attributes, override this with parameters in the request
URL, and get the text contained within the nodes.  This is passed to an
abstract method which returns a DocumentFragment, which is then replaced for
the original node.

Also attached is a test processor, basically it will take all <dummy>this is
a test</dummy> nodes and replace them with <dummy>tset a si siht</dummy>.

Comments, critism, flames and proposals all welcome (yes, when Cocoon 2
comes out I'll probably rework it in SAX)

Regards,
Ross Burton