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 Justin Thomas <Ju...@RCP.co.uk> on 2003/04/25 14:07:40 UTC

Override Stylesheet

Hi I want to override the stylesheet set in an svg document with another
one.
However I am not sure how to specify it.  When I place the stylesheet in the
same dir as my app and run it the image produced looks like it failed to
pick uo the stylesheet.  What am i doing wrong?
jpgTrans.addTranscodingHint(ImageTranscoder.KEY_ALTERNATE_STYLESHEET,
"E:\\SVGRasteriser\\map1.css");
ostream = new FileOutputStream(destFile);
TranscoderOutput output = new TranscoderOutput(ostream);
// save the image
jpgTrans.transcode(input, output);

Can anyone give me any ideas please?



__________________________________________________
Justin Thomas BSc (Hons)
Software Engineer
RCP Consultants Ltd
<http://www.rcp.co.uk/>

AIM: RCPAnimal
Tel: 01235 510116
Direct: 01235 514526

"Never make anything simple and efficient when a way can be found to make it
complex and wonderful."

This e-mail and any files transmitted with it are strictly confidential and
intended only for use by the addressee unless otherwise indicated.  If you
are not the intended recipient any use, dissemination printing or copying is
strictly prohibited.

If you have received this e-mail in error, please notify us immediately.


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


Re: Override Stylesheet

Posted by Vincent Hardy <vi...@sun.com>.
Hi Justin,

To modify stylesheets in an SVG document, you can:

a. Modify the processing instruction in the document you want to modify.
    i.e., modify the line that has:
     <?xml-stylesheet type="text/css" href="something.css" ?>
    with the stylesheet you want.

b. If you want your stylesheet to override any existing stylesheets, 
you'll need to define these as the user stylesheet and define !important 
rules. In Squiggle, the preferences dialog lets you specify the location 
of your user stylesheet. The rasterizer has an option (-cssUser) that 
lets you specify the location of your stylesheet. For details on 
!important rules, see the CSS2 section 6.4.2.

I hope this helps,
Vincent.

Justin Thomas wrote:
> Hi I want to override the stylesheet set in an svg document with another
> one.
> However I am not sure how to specify it.  When I place the stylesheet in the
> same dir as my app and run it the image produced looks like it failed to
> pick uo the stylesheet.  What am i doing wrong?
> jpgTrans.addTranscodingHint(ImageTranscoder.KEY_ALTERNATE_STYLESHEET,
> "E:\\SVGRasteriser\\map1.css");
> ostream = new FileOutputStream(destFile);
> TranscoderOutput output = new TranscoderOutput(ostream);
> // save the image
> jpgTrans.transcode(input, output);
> 
> Can anyone give me any ideas please?
> 
> 
> 
> __________________________________________________
> Justin Thomas BSc (Hons)
> Software Engineer
> RCP Consultants Ltd
> <http://www.rcp.co.uk/>
> 
> AIM: RCPAnimal
> Tel: 01235 510116
> Direct: 01235 514526
> 
> "Never make anything simple and efficient when a way can be found to make it
> complex and wonderful."
> 
> This e-mail and any files transmitted with it are strictly confidential and
> intended only for use by the addressee unless otherwise indicated.  If you
> are not the intended recipient any use, dissemination printing or copying is
> strictly prohibited.
> 
> If you have received this e-mail in error, please notify us immediately.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 



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