开发者

Compressing XML File

All,

I have a requirement to Compress an XML file. At the moment I am using C# and the gzip algorithm in the .NET Classes. I does compress it but not at the rate I would like to. For example a 12MB file was compressed to a little less tha开发者_如何学Gon 4MB.

Is there any other way to compress it more than that? Speed of compression / decompression is not very important.

Thanks, M


ZIP compression is well suited for compressing XML data. In .NET you best rely on third party libraries:

  • DotNetZip
  • SharpZipLib


You may try 7zip.


7-zip has an SDK.

Use the client version of 7-zip to try different compression settings to find the one with best compression for your particular data set.


This website compared different compression libraries against large amount of text data. 7-zip is also included. I hope that this helps you to choose correct library that matches your requirements.


Take a look at System.IO.Packaging.ZipPackage in WindowsBase. It's the .NET framework code behind the DOCX & XLSX file formats and these are more or less zipped XML files. You can zip multiple files of any format together, not just XML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜