> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]