You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Salim Erradey <se...@innovance.com> on 2001/11/16 22:22:39 UTC

Using GZipOutputStream with XMLSerializer

Hi,

I have an issue with the size of XML files my application is generating, so
I decided to write to a compressed file. I have tried using the
GZipOutputStream with the org.apache.xml.serialize.XMLSerializer:

	
	GZIPOutputStream gzipOS = new GZIPOutputStream(new
FileOutputStream(new File("xml.gz")));
        	XMLSerializer xmlSerializer = new XMLSerializer(gzipOS,
outputFormat);
        	xmlSerializer.asDOMSerializer();
	xmlSerializer.serialize(document.getDocumentElement());
}

I am getting an empty file with this. Do you know if it is possible ?, Has
anyone tried this before ?. Feedback is greatly appreciated.

Best Regards,

Salim Erradey
e-mail: serradey@innovance.com