xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tonny Kohar <to...@kiyut.com>
Subject Re: "Broken Image" in Image-Element
Date Tue, 26 Oct 2004 02:28:47 GMT

> <symbol id="ArrowLeft">
>     <image x="0" y="0" width="46" height="46" xlink:href="Arrow_Left.svg"/>
> </symbol>
> This and similar symbols are referenced throughout my documents in use-tags similar to
this one:
> <use xlink:href="#ArrowLeft" transform="translate(916 339)"/>

> The only thing of impact (only thing of impact that comes to my mind, that is) during
said refactoring was that I 
> switched to the (more reliable) Java ClassLoader.getResource(String)-method instead of
> creating the URL to set as the documents base URL via setURLObject(URL).

If by anycase you use jnlp/webstart thing, java ClassLoader have
peculiar that you need to be aware of. The ClassLoader only can only get
resources if in the same jar file, if it is in different jar. You need
to create some empty anchor Java class to reference to the classloader
to different jar.
eg: app.jar, res.jar if you need to get something from res.jar you need
to create simple empty class and put it on the res.jar for the class
loader to work and get the class loader from that empty class file.
ClassLoader cl = TheEmptyClassAnchor.class.getClassLoader();
URL url = cl.getResource("something");

Tonny Kohar
SVG Graphics Editor

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

View raw message