On 08.01.2005 19:27:38 Glen Mazza wrote:
> --- Jeremias Maerki <[EMAIL PROTECTED]> wrote:

<snip/>

> > If someone embeds FOP in
> > his/her application the
> > not supplying an OutputStream when a renderer needs
> > one is a bug and so
> > it doesn't matter if the error message comes early
> > or only when the
> > renderer is started (Renderer.startRenderer()).
> > 
> 
> OK, I see what you're saying here--it would be one
> time only programmatic change for the user to fix his
> embedded code.

Yes.

> If I understand you correctly, all that would be
> needed for renderer overrides is to just raise an
> exception within Renderer.startRenderer(OutputStream)
> if the OutputStream is null (for those renderers
> requiring an OutputStream).  Arguably, the Renderer
> should be programmed to do that anyway, even if it is
> checked earlier.

Yes.

>  That makes sense--and I now agree
> with your previous change of not checking for an
> OutputStream when the RendererOverride is set.  Thanks
> for the clarification.
> 
> (I still prefer the one-line check in RendererFactory
> for our *hardcoded* renderers--for
> documentation/comprehension reasons, and it gives us a
> common error message for our own renderers.)

That's ok. I'll do the necessary changes this week.

<snip/>

> > So here's another one. Do you know about SVG Print?
> > An SVG renderer
> > could send the generated SVG using SAX. That way a
> > developer could run
> > the generated SVG through an XSLT post-processing
> > without having to
> > reparse the generated SVG. That's a place where
> > speed is very important
> > and an OutputStream-only system would be suboptimal.
> > 
> 
> I don't completely understand this idea (Namely, how
> can you send "generated SVG using SAX"--wouldn't that
> mean the "generated SVG" would have to be in XML
> format?)--but it doesn't matter anyway because, again,
> I don't have a problem with your validation change.  

"sending generated SVG using SAX" means that all the XML elements that
are generated by the SVG Renderer would be sent as start/endElement
calls through a ContentHandler interface. I'm doing the same for the
ExampleObj2XML class in the embedding examples, only that it's plain
custom XML there. You can catch these SAX events with a JAXP
Transformer(Handler) and do anything with them: simple serialization to
streamed XML (StreamResult), build a DOM (DOMResult), transform using
XSLT, whatever.


Jeremias Maerki

Reply via email to