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 Leo Lim <le...@fedex.com> on 2007/03/13 18:46:13 UTC
Changing stylesheets programmatically
Hi,
Is there a way to change the stylesheet of an svg file that is already
fully rendered in a JSVGCanvas.
I heard about placing extra stylesheet tags in an svg file:
E.g.
<?xml-stylesheet href="styles_austria_2.css" type="text/css" title="Night"
alternate="yes" ?>
I'm just looking for a way to programmatically activate the alternate
stylesheet.
Thanks!
Leo
Re: Changing stylesheets programmatically
Posted by th...@kodak.com.
Hi Leo,
Leo Lim <le...@fedex.com> wrote on 03/13/2007 01:46:13 PM:
> Is there a way to change the stylesheet of an svg file that is already
> fully rendered in a JSVGCanvas.
Sure you can add or remove the stylesheet elements from the
Document in memory. This is expensive as we have to rerun the
entire cascade for the document when this happens.
> I heard about placing extra stylesheet tags in an svg file:
>
> E.g.
>
> <?xml-stylesheet href="styles_austria_2.css" type="text/css"
> title="Night" alternate="yes" ?>
>
> I?m just looking for a way to programmatically activate the
> alternate stylesheet.
We do this in the Batik viewer, so you can see the code
in batik.apps.svgbrowser.JSVGViewerFrame.UseStyleSheetAction
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org