You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2006/10/12 23:07:13 UTC

Resolving xlink:href at a later time?

In a whiteboarding scenario, placing images on the whiteboard is tough
because you have to upload the XML element and the file.  We have been
sending the file first, then the image element.  This way, the image
element resolves properly because the referenced file is already there.
The drawback?  During the time it takes for the file to upload, other
users can manipulate the document by adding/updating other elements.
When the image element arrives, it won't end up in the originally
intended place.

 

That's a little vague, but here's the technical problem I'm trying to
overcome:

 

An image element is placed and the xlink:href points to a non-existant
file.  The standard "broken image" image appears on the JSVGCanvas
instead, per Batik.  Next, the correct file appears in the correct
place.  How do I tell Batik to try and resolve that again?
JSVGCanvas.setDocument(...) doesn't seem to have an effect, the image
still appears broken.

 

Michael Bishop


Re: Resolving xlink:href at a later time?

Posted by th...@kodak.com.
Hi Michael,

"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on 
10/12/2006 05:07:13 PM:

> An image element is placed and the xlink:href points to a non-existant 
file. 
> The standard ?broken image? image appears on the JSVGCanvas instead, per 

> Batik.  Next, the correct file appears in the correct place.  How do I 
tell 
> Batik to try and resolve that again?  JSVGCanvas.setDocument(?) doesn?t 
seem 
> to have an effect, the image still appears broken.

   You need to clear the entry in the URLCache:
 
org.apache.batik.ext.awt.image.URLImageCache.getDefaultCache().clear(ParsedURL 
purl);

   Then removing the image Element form it's parent and reinserting
should cause it to reload the image.


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