xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Delmelle <andreas.delme...@telenet.be>
Subject Re: XMLFilterImpl producing SVG instream-foreign-object
Date Tue, 16 Mar 2010 18:44:06 GMT
On 15 Mar 2010, at 07:35, Raphael Parree wrote:

Hi Raphael

> I have meanwhiel found a way of making it work - i am sure there must be a better way;
what i'm doing below smells pretty bad...
> I SAX parse the SVG and propagate its SAX events to the XmlFilter's parent content handler:

The key reason, I think, the chosen approach is working (where your original cited approach
wasn't), is simply because it does not propagate the startDocument() and endDocument() events
to the parent.

(Interesting to note that FOP needs to do the exact opposite at parse-time: the embedded SVG
comes in as just another startElement(), and the child events are then routed to a delegate
ContentHandler, precisely because raising startDocument() more than once on the same ContentHandler
would lead to an exception.)

Maybe it would be slightly better to define an explicit DefaultHandler subclass, as opposed
to using anonymous overrides, but the net effect would be the same.

IMO, it would look nicer, and would definitely be preferable over your current solution if
you need the same approach in multiple places, but the bottom line is that your solution is
correct. 
It smells a bit fishy maybe, but using an intermediate DefaultHandler that swallows startDocument()
and endDocument() definitely seems like the most straightforward way to tackle this issue.


HTH!

Regards,


Andreas Delmelle
---


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message