> -----Original Message-----
> From: Bruno Dumon [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 10:26 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Fantastic!!!! My first Generator that connects to an EJB.
>
>
> On Mon, 2003-01-27 at 13:58, Robert Simmons wrote:
> > This sucker connects to an EJB which runs the given JDO query and
> > returns the set of found objects from the database. Best of all it
> > works!!!! See the two attached files. Next thing you know I will be
> > writing something useful. O_O
> >
>
> Just some small hints...
>
> * I see you do the following in your code:
>
> this.contentHandler.processingInstruction("xml",
>                              "version=\"1.0\" encoding=\"UTF-8\"");

Yes, Robert I was just going to write this to you - no need to do this.
If you wind up needing to serialized this out as xml at the end of
a pipeline instead of html (debugging, webservices, etc) the proper
cocoon way is to specify the encoding as a child element of the serializer.

That said, the default set up for the xml serializer is UTF-8 and the
xml declaration is added automatically for you.  By the way, remember that
the same serializer class can be set up with different sitemap "name" hints
for convenience of different set ups.  If you wanted to have a different
encoding on some pipelines, you could define the xml serializer component
in <map:serializers> as name="xml-ISO" and use that as the <map:serialize
type="xml-ISO">

>
> * For logging, instead of using log4j, you can use Avalon's logger.
> Since the class extends from AbstractGenerator, it is already available:
> simply call getLogger().error("...")

I'll speak for him - he prefers log4j.

Geoff



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