xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Removing DOCTYPE in the SVG XML
Date Mon, 31 Aug 2009 11:00:42 GMT
Hi Ninitha,

ninitha <nchelvavanan@inautix.co.in> wrote on 08/31/2009 05:26:33 AM:

>         I am converting jFreeCharts to SVG. When I load in one of the 
> Processor(Render X XEP), it throws time out error at the line <!DOCTYPE 
> PUBLIC '-//W3C//DTD SVG 1.0//EN'
>           'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
> If the line is removed, the XSL FO is processed and converted to PDF. So 
> there a way to remove the line in the resulting SVG XML before saving 
> file.Following is the code used to get the SVG file.

   This should really be fixed in your XSL FO Processor, it's trying to 
read that doctype and presumably you aren't directly connected to the 
internet.  There are generally ways to configure XML parsers to either
skip the Doctype or redirect certain known doctypes (like SVG) to a
local instance of the doctype.

>        // Write svg file 
>         OutputStream outputStream = new FileOutputStream(svgFileName);   

>         Writer out = new OutputStreamWriter(outputStream, "UTF-8");
>         g2.stream(out, true); 

   The SVGGraphics2D automatically emits the default SVG doctype.  You
can bypass the Graphics2D stream method and write the SVG Document using
some other XML serializer.  One possible replacement would be 

View raw message