Hi -

Here's what I've come up with so far:

- Batik appears to preferentially read DTDs stored inside the jar. Not
  a very clean solution, but it works out of the box.

- I nevertheless played around with your suggestion below. Such a
  subclass exists already
  (org.apache.fop.svg.FOPSAXSVGDocumentFactory); I modified that and
  PreloaderSVG.java to use Fop's URIResolver. However, this solution
  is not very clean as it abuses an URIResolver for an EntityResolver,
  and it only works if the catalog declares <uri> substitutions; the
  URIResolver does not treat them as system ids. So, I don't think
  this is a clean solution either.

- The culprit is - surprise! - the JEuclid Fop plugin, even though my
  test document does not contain any MathML, and the problem goes away
  if I remove the DOCTYPE declaration from the included SVG document:

  If I sever my Internet connection,
  net.sourceforge.jeuclid.xmlgraphics.PreloaderMathML.parseSource()
  hangs for 40 seconds. Or more precisely, it appears to be the
  org.apache.xerces.impl.XMLEntityManager, called indirectly by that
  method, that attempts to open a HTTP connection.

  If I remove JEuclid from the classpath, the problem goes away.

It seems that the Xerces parser used by JEuclid should somehow be
convinced to use the EntityResolver available on the classpath. Or
perhaps, one might abuse FOP's URIResolver, similarly to what I
described above.

Any comments or suggestions (Max)?

Justus


Jeremias Maerki <[EMAIL PROTECTED]> wrote on Mon, 30 Jun 2008
10:40:13 +0200:

> Generally, Batik doesn't support URI resolution using EntityResolver or
> URIResolver as FOP does. Looking at your case I think this could be
> improved by subclassing Batik's SAXSVGDocumentFactory (used in
> PreloaderSVG.java) and overriding the resolveEntity() method to consult
> FOP's URIResolver. Want to give it a try?
>
> On 28.06.2008 13:25:32 Justus-bulk wrote:
>> Hi,
>> 
>> Processing my documents via command-line fop is enormously slowed down
>> by DTDs fetched over the 'net for SVG graphics included via
>> fo:external-graphic.
>> 
>> Is this a fop or a batik issue?
>> 
>> What can I do to get it to use an xml-commons-resolver?
>> 
>> Thanks,
>> Justus
>
>
>
>
> Jeremias Maerki

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to