Hello vyang,
svgz indicates that the SVG file is gzipped, so you should wrap your
InputStream in a java.util.zip.GZIPInputStream before wrapping it in a
BufferedInputStream.
Regards, Thomas
vyang wrote:
Hello,
I'm having a problem creating a svgdocument from a svgz file. My coding is
as follows:
InputStream is = HTTPServerDA.getWebdavSystemFile(url);
BufferedInputStream bis = new BufferedInputStream(is);
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
SVGDocument doc = factory.createSVGDocument(null, bis);
This works fine for svg but when svgz is used it throws a IOException:
java.io.IOException: Content is not allowed in prolog.
at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
Source)
at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(Unknown
Source)
I'm not sure what the cause of the problem is(something to do with some xml
headings in svgz file?) and how to address it.
Any help is much appreciated. Thanks.
vyang
--
Thomas Behr
yWorks GmbH
Vor dem Kreuzberg 28
72070 Tuebingen, Germany
Tel.: +49 7071 9709050
Fax.: +49 7071 9709051
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]