----- Original Message ----- From: "Tonny Kohar" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, May 13, 2005 8:36 AM
Subject: Re: relative URIs?



Hi,

I use your example test document and load it under Batik Squiggle, it
run fine.

Try to put doc/test.svg in the folder where batik is installed and after starting Squiggle put file:doc/test.svg in Location field. It fails. Note that file:init.svg works, because init.svg is not in a subfolder.
If the first document you run has absolute URI, squiggle is somehow converting consecutive relative URIs to absolute URIs based on previous absolute URI.
So if I choose Open file from menu and init.svg file, the Location is set to file:/C:/programs/batik/batik-1.6/init.svg. Then if I put file:doc/test.svg in Location field it runs fine because Squiggle is converting it somehow automatically to file:/C:/programs/batik/batik-1.6/doc/test.svg




You can query the doc URL base using the following code, to make sure it is set in the intended path svgDocument.getURL();

How do you convert the file URI, do you use Java file.toURL() ?

The problem is the I'm not converting File object to URL (toURL method always provides absolute URLs), because i have String "file:doc/test.svg" in the configuration of my application.


As far as I know file URI, start with file:/ eg: file:/c://something (on
Windows) and file:/home/something (on Unix), It is not file:something

I think the file:/ means that this is an absolute URI path, so file:/C:/programs/batik/batik-1.6/init.svg is absolute URI but file:init.svg is relative and I want to resolve it against the my application working directory.
Maybe it is not batik question, but I thought that this problem was solved somehow in it.


Regards.
Lukasz.





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



Reply via email to