cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huber, Daniel" <Daniel.Hu...@TechniDATA.DE>
Subject RE: Custom transformer - ho to get in / out Document from previous ransfromations
Date Thu, 09 Sep 2004 14:18:09 GMT
> I am writing a custom transformer that needs to extract
> some fragments from previous transformation steps in the
> running pipeline. Does anyone know how to access, from a
> sitemap component, the input / output to the transform
> method of the transformers that were applied before?

Hi Javier,

You can't access the I/O streams with a transformer directly.
A transformer won't get the complete document from its predecessor
component. It will rather get SAX events. Your component then can
manipulate the data of these events before passing them on to the next
component.

More concrete this means:

Extend the class org.apache.cocoon.transformation.AbstractTransformer
Override the method of the inherited Interface
org.xml.sax.ContentHandler.
Manipulate the incoming data and pass it then to the
super-implementation of AbstractTransformer.

The interface ContentHandler provides methods like startElement(),
endElement(), characters(), which corresponds to the opening tag,
closing tag and text node of an XML element.

For a complete list of available methods, please see
http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html



Regards,

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message