Re: [xml] Compressed Documents

On Sun, Sep 07, 2003 at 02:40:47AM +0800, William M. Brack wrote:
I'm working on a bug report
(, and would to ask
for further input from the list.

The reporter has pointed out that the compression mode of the input
document can be important to the library user, and without knowing
it the output mode of a document may not match the input.  At the
moment, the library does not set the compression (i.e.
xmlSetDocCompression is not called by any routine within the

From my (limited) understanding of the gzip library, I think I can
determine, when a document is first opened, whether the input file
was compressed or not.  However, it appears there is no way to
determine which compression "mode" (1-9) was used.  So, I have two
questions which I would like to open up to the list:-

1) Should the library set the compression mode of the document on
input?  The result of doing this would be that, if no action were
taken by the user, if an input document (which was compressed) were
written out it would be written as a compressed file (rather than
uncompressed as now).

  yeah, it used to work in libxml1 a long time ago, and that was dropped
at some point, I don't know why. Just make really sure that we do that only
on document which were compresed on open :-)

2) If the library is to set the mode as compressed, what "mode"
should be used (and if anyone knows how I can determine the original
compression mode of the input file, please advise)?  Is it better to
set it as "1" (minimum compression), or "9" (maximum compression),
or some other value?  Bear in mind that the user can always override
whatever default mode is set.

  I think 9 should be the default. When CPU were really slower it did
matter, now I think we shouldn't bother anymore.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]