cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ricardo Trindade" <Ricardo.Trind...@myrealbox.com>
Subject RE: writing custom serializer and generator
Date Wed, 19 Jun 2002 16:59:01 GMT
where can I get the instance ? is there any particular implementation or
factory I should use ?

thanks

-----Original Message-----
From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
Sent: terca-feira, 18 de Junho de 2002 2:49
To: cocoon-users@xml.apache.org
Subject: RE: writing custom serializer and generator


> From: Ricardo Trindade [mailto:Ricardo.Trindade@myrealbox.com]
>
> could you point me to an example of converting a string to SAX events
? (my
> string contains well formed XML)

You need an instance of org.apache.avalon.excalibur.xml.Parser, then
convert your string to input stream and create InputSource object with
it, set system ID for it, set parser's consumer to generator's
contentHandler and call parse on parser - that's it.

See util.xsl, line 146-152 (v 1.4 of util.xsl)

Vadim


> thanks
> Ricardo
>
> -----Original Message-----
> From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
> Sent: segunda-feira, 17 de Junho de 2002 14:57
> To: cocoon-users@xml.apache.org
> Subject: RE: writing custom serializer and generator
>
>
> > From: Ricardo Trindade [mailto:Ricardo.Trindade@myrealbox.com]
> >
> > Hi,
> >
> > 	I'm writing a custom serializer and generator. I've already
> > written some
> > custom actions, which was easy.
> > 	I have libraries that generate XML, and I just want my generator
> > to get
> > it
> > from there. However, I don't understant how to define the output of
> > the
> > generator. I've looked at FileGenerator.java, and there's a step
> > where a
> > SourceResoler is used to convert from the filename to a Source. I
> > already
> > have my xml in a string, just want to send it to the generator
output.
>
> You will have to covert your String into SAX XML events, Cocoon event
> pipeline does not work with non-XML formats.
>
> Use XML parser for it.
>
> Vadim
>
> >
> > Thanks for any help
> > Ricardo
>


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>



---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message