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 Thomas DeWeese <Th...@Kodak.com> on 2005/03/29 12:57:30 UTC

Re: CSS

Jorg Heymans wrote:

> Is there a way of telling batik "the CSS file has changed, go and apply 
> it again"? I am dynamically generating CSS server side, and need to tell 
> my client side canvas somehow that it should reapply the CSS.

   I believe Batik will track modifications to the processing
instructions so you might be able to find the PI (it will be
a previous sibling of the root document element) and remove and
re-insert it (don't append it).

   What I would be tempted to do though would be to send the
CSS through a separate channel and make it the content of a
'style' element and just swap the style element's in the document
(replaceChild...).

> I could solve this without CSS and set individual attributes on the 
> document, but why break a good separation of data/style??

    I don't think there is any need.

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


Re: CSS

Posted by Jorg Heymans <jh...@domek.be>.
For the record, the only way i could get this to work was to statically 
create a <defs><style> element with a CDATA section on it and setting 
only the value of the CDATA section dynamically.

Dynamically creating defs, style or CDATA node did not work.

Thanks
Jorg



Thomas DeWeese wrote:
> Hi Jorg,
> 
> Jorg Heymans wrote:
> 
>> Thanks i'll try this. Is it more efficient perhaps to have an inline 
>> style element rather than have the CSS elements externalized ?
> 
> 
>    I don't think there is a significant difference (the only
> real difference is that it needs to fetch the external stylesheet
> vs getting it as part of the SVG Document).


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


Re: CSS

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

Jorg Heymans wrote:

> Thanks i'll try this. Is it more efficient perhaps to have an inline 
> style element rather than have the CSS elements externalized ?

    I don't think there is a significant difference (the only
real difference is that it needs to fetch the external stylesheet
vs getting it as part of the SVG Document).

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


Re: CSS

Posted by Jorg Heymans <jh...@domek.be>.

Thomas DeWeese wrote:
> Jorg Heymans wrote:
> 
>> Is there a way of telling batik "the CSS file has changed, go and 
>> apply it again"? I am dynamically generating CSS server side, and need 
>> to tell my client side canvas somehow that it should reapply the CSS.
> 
>   I believe Batik will track modifications to the processing
> instructions so you might be able to find the PI (it will be
> a previous sibling of the root document element) and remove and
> re-insert it (don't append it).
> 
>   What I would be tempted to do though would be to send the
> CSS through a separate channel and make it the content of a
> 'style' element and just swap the style element's in the document
> (replaceChild...).

Thanks i'll try this. Is it more efficient perhaps to have an inline 
style element rather than have the CSS elements externalized ?


Regards
Jorg


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