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 Paul Wellner Bou <pa...@purecodes.org> on 2009/03/26 09:31:09 UTC

Writing out SVGs setting the 1.1 doctype

Hi,

I am using following code to generate an SVG:

         OutputStream fout = new FileOutputStream(new File(svgFilename));
         OutputStream bout = new BufferedOutputStream(fout);
         OutputStreamWriter out = new OutputStreamWriter(bout, "UTF-8");
         Writer writer = out;
         SVGGraphics2D svgGenerator = new SVGGraphics2D(doc);
         svgGenerator.stream(doc.getDocumentElement(), writer);
         writer.close();

Is there a way to indicate that it should use SVG 1.1 doctype and not 
the (default?) SVG 1.0 doctype? Or do I really need to use the 
transcoder for this?

By the way, the original document I am reading and modifying _does_ have 
SVG 1.1 doctype.

Thanks and regards
Paul.

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


Re: Writing out SVGs setting the 1.1 doctype

Posted by Paul Wellner Bou <pa...@purecodes.org>.
Hi,

Thanks for your answer. The version attribute is set to 1.1, so in the 
input as in the output document.

Using the transcoder it works better, but the xml declaration has to be 
set manually (string="<?xml...>") and I don't get it to work with the 
right char set. ... And the escaped unicode characters (&x...) are 
replaced automatically, with both methods.

Regards
Paul.

Helder Magalhães wrote:
> Hi Paul,
> 
>> Is there a way to indicate that it should use SVG 1.1 doctype and not the
>> (default?) SVG 1.0 doctype? Or do I really need to use the transcoder for
>> this?
> 
> I'm not familiar enough with the SVG generator to properly answer your
> question but you may try to set the version [1] in your document
> element (to "1.1", in this case) and see if it tricks the generator
> into the desired mode.
> 
> 
>> By the way, the original document I am reading and modifying _does_ have
>> SVG 1.1 doctype.
> 
> Maybe the document doesn't have the version property set? If so, I
> don't know how Batik deals with that. But, then again, I'm just
> guessing... ;-)
> 
> 
> Hope this helps,
>  Helder
> 
> 
> [1] http://www.w3.org/TR/SVG11/struct.html#SVGElementVersionAttribute
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 

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


Re: Writing out SVGs setting the 1.1 doctype

Posted by Helder Magalhães <he...@gmail.com>.
Hi Paul,

> Is there a way to indicate that it should use SVG 1.1 doctype and not the
> (default?) SVG 1.0 doctype? Or do I really need to use the transcoder for
> this?

I'm not familiar enough with the SVG generator to properly answer your
question but you may try to set the version [1] in your document
element (to "1.1", in this case) and see if it tricks the generator
into the desired mode.


> By the way, the original document I am reading and modifying _does_ have
> SVG 1.1 doctype.

Maybe the document doesn't have the version property set? If so, I
don't know how Batik deals with that. But, then again, I'm just
guessing... ;-)


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG11/struct.html#SVGElementVersionAttribute

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