Steven Punte wrote: > In the cocoon environment, XSP provides a great > way of address problems that don't fit into > the paradigm of an existing generator. > > However, XSP can only be used at the first > step in a pipeline. > > I find myself writing lots of custom transformers > to address issues that don't fit into any > of the existing standard generators. > > Would there be a way to write an XSP Transformer? > How about we call this "XST" for now. Some of > it's characteristics would be:
I had started myself to write such a Transformer, but then I just didn't have enough energy and motivation to continue. If you want, I can give you some sugestions: > o A conventional transformer class would exits. XSTTransformer, from which all XSTTransformers extend. > o In a pipeline, one would specify the above > transformer and a particular xst file. Ok. > o The xst file would be compile automatically > when needed. Ok. There is a system in Cocoon that can make you do this, look in the sourcecode. > o A basic internal design would simply allow > hooks to the various SAX events (i.e. start and > end of element and document). > o Perhaps a more a more interesting internal > model would come with a stack to facilitate > more complex processing. I wrote this thing but it was complicated to debug, since there were no tools at that time to make code easier. If I would do it now, I would look at Jakarta Commons Digester, which has an XML descriptor that specifies what to do for certain conditions and can be used to do just that. > o Output events could be nicely written as in xsp > like "<yada><xst:expr>string</xst:expr></yada>" Each output could simply be a call to am XSP Generator that does not close the Document. -- Nicola Ken Barozzi [EMAIL PROTECTED] - verba volant, scripta manent - (discussions get forgotten, just code remains) --------------------------------------------------------------------- --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>