There may be a way to do this "auto-magically", but I don't (yet) know it.
Try the jar protocol (jar:file://nn/file.svg) ( http://docs.sun.com/source/819-0913/author/jar.html#jarprotocol) Override/extend the existing UserAgent.openLink() functionality. To save a bit of hunting on your part...The appropriate code can be found in JSVGComponent.BridgeUserAgent() ( You'll likely receive better guidance from the others on the list though. I'll update you if I see something better. On Sat, Jan 2, 2010 at 5:33 PM, dao <[email protected]> wrote: > I understand, but how can I refer to that document in an other document? > (see the xlink:href from my mail)? > > On Sat, Jan 2, 2010 at 11:27 PM, jonathan wood <[email protected] > > wrote: > >> Hi Dao, >> >> I also included a "load from jar" in the previous examples. The key is >> the line: >> >> InputStream templateStream = >> MyClass.class.getResourceAsStream("template.svg"); >> >> getResourceAsStream will allow you to load from the classpath (including >> your jar). >> >> >> to recap: >> >> InputStream templateStream = >> MyClass.class.getResourceAsStream("template.svg"); >> >> String parser = XMLResourceDescriptor.getXMLParserClassName(); >> SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); >> SVGDocument doc = null; >> >> try { >> doc = f.createSVGDocument(null, templateStream); >> } catch (IOException ex) { >> } >> >> myCanvas.setSVGDocument(doc); >> >> >> >> On Sat, Jan 2, 2010 at 3:30 PM, dao <[email protected]> wrote: >> >>> to continue with this inputstream document: >>> >>> My document that I build from an inputstream references an other document >>> by referencing some symbols (<use xlink:href="widgets.svg#warningMask" >>> ...) >>> >>> How can I do to make this work: >>> >>> Either I create an other document I receive from my server which is >>> widget.svg and tell me how I can reference it (is it necessary to create a >>> file from the stream in the file widgets.svg?) >>> >>> Either I have the widgets.svg file in my application's jar. In that case, >>> How can I reference a file in a jar? >>> >>> Do you suggest me an other way to process? >>> >>> >>> 2010/1/1 Helder Magalhães <[email protected]> >>> >>> Hi dao, >>>> >>>> >>>> Response inline... >>>> >>>> >>>> > Added in [2]. not sure of how to reference the thread.... >>>> >>>> Great! :-) I noticed an entry added to the how-to, but the actual >>>> page [1] doesn't exist yet...? >>>> >>>> To reference a thread, just copy a link from the archives [2]. While >>>> using the official archives, the "trick" seems to be selecting the >>>> desired thread or particular message and clicking on the "Message >>>> view" link in order to get the desired thread/message hyperlink. In >>>> this particular case, it would be [3]. >>>> >>>> As we're at it, given than navigation/search features are not very >>>> user friendly in the official archives IMHO, I frequently use the >>>> Nabble archive [4], specially for searches... ;-) >>>> >>>> >>>> Hope this helps, >>>> Helder >>>> >>>> >>>> [1] http://wiki.apache.org/xmlgraphics-batik/InputStreamInitialisation >>>> [2] http://mail-archives.apache.org/mod_mbox/ >>>> [3] >>>> http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%[email protected]%3e >>>> [4] http://old.nabble.com/Batik-f308.html >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: >>>> [email protected] >>>> >>>> >>> >>> >>> -- >>> Dao Hodac >>> >> >> > > > -- > Dao Hodac >
