koumides
koumides

Reputation: 2504

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 than 4MB.

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

Thanks, M

Upvotes: 1

Views: 659

Answers (5)

Enigmativity
Enigmativity

Reputation: 117029

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.

Upvotes: 0

Tx3
Tx3

Reputation: 6916

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.

Upvotes: 0

Albin Sunnanbo
Albin Sunnanbo

Reputation: 47038

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.

Upvotes: 0

Dirk Vollmar
Dirk Vollmar

Reputation: 176159

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

Upvotes: 2

Darin Dimitrov
Darin Dimitrov

Reputation: 1038720

You may try 7zip.

Upvotes: 0

Related Questions