You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Tonny Kohar <to...@kiyut.com> on 2005/04/06 08:49:50 UTC

Re: SVG Xlink:href element within a Document.... tags doesnt seem to render in Batik?

Hi,

> Thomas was right about the broken links...
> [very weird since it does not report a fileNotFoundException].
> when i use a full url path like below, it works...
> image1.setAttributeNS(
> org.apache.batik.util.XMLConstants.XLINK_NAMESPACE_URI , "xlink:href",
> "file:\\\\\\C:\\Documents and
> Settings\\Administrator\\Desktop\\SVGTest\\build\\a.jpg");
> 
> this is kinda 'ghetto' though and i am gonna be maybe sending these
> svg and pics files to the user with a saveSVGAandSourcePicsZip()
> function probably.so i need to work with relative urls...

For the info Batik is work fine with both Absolute and Relative URI.

Some tips regarding Relative URI:
- make sure the document base URL is correct, otherwise it couldn't
resolve the relative path. This is normally become a problem if you
create the document on fly rather than load from file.
- Do not forget the set xlink namespace in the element that required it
eg: image
- To keep things simpler (during development debuging) try to put the
relative external resources in the same dir as the doc, however batik
relative URI is work fine in any arbitary dir

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


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


Re: SVG Xlink:href element within a Document.... tags doesnt seem to render in Batik?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Arian, Tonny,

>>Thomas was right about the broken links...
>>[very weird since it does not report a fileNotFoundException].

    If it threw a fileNotFoundException you wouldn't get
a rendering.  I believe the user agent is notified at
some point.

>>when i use a full url path like below, it works...
>>[...] i need to work with relative urls...
> 

Tonny Kohar wrote:

> For the info Batik is work fine with both Absolute and Relative URI.
> 
> Some tips regarding Relative URI:
> - make sure the document base URL is correct, otherwise it couldn't
> resolve the relative path. This is normally become a problem if you
> create the document on fly rather than load from file.

    This is almost certainly the problem here.
    When you create the TranscoderInput you can provide a
uri to use as the base URI of the document being transcoded:
	TranscoderInput.setURI(String uri)

    You can also use the 'xml:base' attribute on elements in the
document to set the base URI for URL resolution.

> - Do not forget the set xlink namespace in the element that required it
> eg: image
> - To keep things simpler (during development debuging) try to put the
> relative external resources in the same dir as the doc, however batik
> relative URI is work fine in any arbitary dir
> 
> Regards
> Tonny Kohar


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