hi:

I am not a pro in Cocoon. How do this the log transformer? check the
sources of

org.apache.cocoon.transformation.LogTransformer

And maybe there you can found your answer.

Antonio Gallardo.

Oskar Casquero dijo:
> Hi,
>
> I would like to serialize SAX events to a file inside a transformer, so
> that I can validate the file with the parser. The problem is that I
> don't how to set the serializer in order to make it able to receive the
> SAX events which the transformer is receiving from the previous
> component (a generator or another transformer). Here is a code snippet
> that shows what I'm trying to do: public class MyValidationTransformer
> extends AbstractSAXTransformer {
>
>     XMLSerializer serializer = (XMLSerializer)
> this.manager.lookup(XMLSerializer.ROLE);
>
>    FileOutputStream fos = new FileOutputStream(/tmp/tmp.xml);
>
>     serializer.setOutputStream(fos);
>
>     /*???
>
>         HOW TO SEND THE SAX EVENTS THE TRANSFORMER IS RECEIVING TO THE
> SERIALIZER
>
>      *???/
>
>     FileInputStream fis = new FileInputStream(/tmp/tmp.xml);
>
>     InputSource is = new InputSource(fis);
>
>     Parser parser = (Parser)this.manager.lookup(Parser.ROLE);
>
>     boolean validation = parameters.getParameterAsBoolean("validation",
> false);
>
>     parser.myParse(this.inputSource, super.xmlConsumer, validation);
>
> }
>
> Oskar




---------------------------------------------------------------------
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]>

Reply via email to