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: Error importing Images into an image tag?
Date Tue, 06 Dec 2005 01:06:20 GMT

On Mon, 2005-12-05 at 15:13 -0500, Bishop, Michael W. CONTR J9C880

> - If I load an SVG document from c:\, I don't have any XML telling the
> document it lives at c:\.
> - If I create a document in memory and save it to c:\, the in-memory
> document does not know about c:\.  I don't want to set its base URL to
> c:\ because it will break if I move it do d:\.
> - The first example doesn't have this problem.  How can I mimic the
> behavior of the first example?

Yup, this url path resolution is quite problematic for us as well, but
the Documentation states that it need base url for resolve another url.

Basicly this is what we do
1) put the Document Base URL into the document, this can be anything c:
\tmp, etc because it is only in memory path and not persisted with the
document during save.

2) use that base url to resolve the relative (we use relative path for
easier file moving maintenance)

You could set the Document URL using either
- doc.setURLObject(newURL);
- String parser = XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
            doc = f.createSVGDocument(uri,reader);

Tonny Kohar
SVG Graphics Editor

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

View raw message