Hi Chandra,

chandra srinivasan wrote:

I have an svg file which shows an error (a splash of color with an i tag) for a image url which doesn't resolve properly. How can I catch the error in my java application, so that the color splash doesn't appear when the svg is rendered. you can recreate this problem by adding an image tag with an invalid url for xlink:href attribute to any svg.

   What do you want your application to do when this happens?
If you want the rest of the document rendered with on indication that
there was a problem you can replace the current broken link image with
one that is fully transparent (a simple 'svg' element with no children
for example).  The file that is rendered is stored as:

In Batik through 1.6:
xml-batik/resources/org/apache/batik/bridge/BrokenLink.svg

In current SVN:
xml-batik/resources/org/apache/batik/swing/svg/BrokenLink.svg

   If you want your application to stop when a broken link is
encountered then you will need to use the SVN version of Batik.
In this version broken link requests go to the UserAgent which
can (and by default does now for the transcoders) throw an exception.

   In the SVN version you could also create a small transparent
BufferedImage to return or the like, since the request is now
handled by the UserAgent which you can easily subclass and provide
a custom instance of.

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

Reply via email to