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 Ralf Siegel <ra...@audiofarm.de> on 2003/06/20 22:29:22 UTC

Batik's ImageTranscoder and relative links to CSS and Symbols

Hi.

I'm using the Batik 1.5 Beta 5 ImageTranscoder to create buffered images 
from external SVGs. This works like a charm, when I set the full local path 
to the stylesheet and linked symbols, e.g.
_____________________________________________________________

...

<?xml-stylesheet type="text/css" href="file:/C:/path_to_css/my.css" ?>
<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="289" height="67">
         <use id="btn" 
xlink:href="file:/C:/path_to_library/lib.svg#btnSymbol_1" class="normal"/>
</svg>

_____________________________________________________________

However, I need to put in relative paths, e.g.
_____________________________________________________________

...

<?xml-stylesheet type="text/css" href="../my.css" ?>
<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="289" height="67">
         <use id="btn" xlink:href="lib.svg#btnSymbol_1" class="normal"/>
</svg>

_____________________________________________________________

The SVG above shows up as expected when I load the whole shebang into the 
JSVGCanvas-Component, whereas the ImageTranscoder throws an exception with 
the same file.

Null Document reference: Invalid CSS document
An I/O error occured while processing the URI 'lib.svg#btnSymbol_1' 
specified on the element <use>

Any ideas?

ralf ...


-------------------------------------------------------------
Ralf Siegel - Freelance Developer
Recommended Listening: Enon - High Society (Touch & Go)
contact_site: mailto:ralf@audiofarm.de
-------------------------------------------------------------



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


Re: Batik's ImageTranscoder and relative links to CSS and Symbols

Posted by Ralf Siegel <ra...@audiofarm.de>.
>   I assume you are passing the 'source' SVG as a stream to the 
> ImageTranscoder?
>If so Batik has no way to know what the 'base' URL of the document is. You 
>can tell Batik what this is by using  the 'xml:base' attribute to provide 
>a base
>URL for relative value resolution.

Thanks Thomas for the hint! Yes, I was passing a stream to the 
ImageTranscoder indeed. Now, with passing the file's URL it works fine :o)

ralf ...


-------------------------------------------------------------
Ralf Siegel - Freelance Developer
Recommended Listening: Enon - High Society (Touch & Go)
contact_site: mailto:ralf@audiofarm.de
-------------------------------------------------------------



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


Re: Batik's ImageTranscoder and relative links to CSS and Symbols

Posted by Thomas DeWeese <Th...@Kodak.com>.
Ralf Siegel wrote:

> The SVG above shows up as expected when I load the whole shebang into 
> the JSVGCanvas-Component, whereas the ImageTranscoder throws an 
> exception with the same file.
>
> Null Document reference: Invalid CSS document
> An I/O error occured while processing the URI 'lib.svg#btnSymbol_1' 
> specified on the element <use>
>
> Any ideas?

    I assume you are passing the 'source' SVG as a stream to the 
ImageTranscoder?
 If so Batik has no way to know what the 'base' URL of the document is. 
You can tell Batik what this is by using  the 'xml:base' attribute to 
provide a base
URL for relative value resolution.




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