OK, my SVG files and image files are in the same directory.  So for the
image elements, I put xlink:href="somePic.jpg".  This works fine for
rendering it to the JSVGCanvas.  When I try to use the transcoder, it
complains because it can't figure out the URL protocol.  I personally
don't want to use URLs, but the transcoder requirements, so I'm trying
to figure out a URL that references "./somePic.jpg" and have been unable
to do so.

Michael Bishop

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 21, 2006 2:16 PM
To: [email protected]
Cc: [email protected]
Subject: RE: Storing relative URLs?

"Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on

04/21/2006 02:06:12 PM:

> I'm not sure that solves my problem.  The problem is that my images
> don't have a URL form at all.

   I guess I don't follow this.  What do you mean by they don't have a
URL form at all?  If there is no URL that you can reference them
by, how do you expect to use a URL? ;)

> When I add one, it doesn't seem to make one relative. 
> I do set the base URL with the described method.  How
> would I make a relative file URL without the canvas or the transcoder
> complaining?

        xlink:href="somePic.jpg"

   You don't need a protocol since it is inherited from the
document base URL.


   So if the base is :
        file:///C:/test/foo.svg
   This will resolve to:
        file:///c:/test/somePic.jpg


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 21, 2006 9:31 AM
> To: [email protected]
> Cc: [email protected]
> Subject: Re: Storing relative URLs?
> 
> Hi Michael,
> 
>     See my response to Dylan on setting the base url of a Document in 
> memory.
> 
> "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote
on
> 
> 04/21/2006 09:25:19 AM:
> 
> > I embed images in my SVG document and until now I?ve just been
putting
> 
> the 
> > filename as the URL:
> > 
> > xlink:href=?somePic.jpg?
> > 
> > Batik complains when I try to export the document to a JPG or a PNG 
> because it
> > can?t determine the URL protocol to use.  The only URL I?ve gotten
to 
> work is 
> > an absolute URL (File.toURL()), but I don?t want to do that.  I
store 
> things 
> > in a temp directory that shouldn?t be referenced when a user saves a

> document.
> > Is there a way to get a relative path (relative to the SVG
document)? 
> file:
> > //./somePic.jpg didn?t work and neither did file://somePic.jpg.
> > 
> > Michael Bishop
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
> 


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

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

Reply via email to