[Top][All Lists]

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

Re: [lmi] Using libxml2 with compression

From: Vadim Zeitlin
Subject: Re: [lmi] Using libxml2 with compression
Date: Wed, 30 Aug 2017 17:50:58 +0200

On Wed, 30 Aug 2017 13:03:42 +0000 Greg Chicares <address@hidden> wrote:

GC> The libxml2 documentation:
GC>   http://xmlsoft.org/html/libxml-parser.html
GC> says:
GC>   Function: xmlSAXParseFileWithData
GC>   ...
GC>   Automatic support for ZLIB/Compress compressed document is provided by 
GC> but:
GC>   Function: xmlParseDocument
GC>   [no mention of compression]
GC> Now, libxml2's 'parser.c' is 15817 lines long and I can't easily
GC> understand it, so I can't definitively say that the documentation
GC> is correct in not mentioning compression for xmlParseDocument(),

 Yes, it is correct, libxml2 supports decompression on the fly in xmlIO.c,
i.e. only in its IO code.

GC> but that hypothesis would explain my findings above. And it kind
GC> of makes sense: if we read a file, it is decompressed if needed,
GC> but if we read a string, libxml2 assumes it's not compressed.

 FWIW if we ever need this, liblzma API is simple enough to use directly.

GC> However, there's no practical problem here, because the only files
GC> we really want to compress are product data files, and those work:
GC> /opt/lmi/bin[0]$pushd ../data
GC> /opt/lmi/data[0]$for y in database funds policy rounding strata; do xz 
--stdout --threads=32 sample.$y >xz.$y; done
GC> /opt/lmi/data[0]$ls xz.*
GC> xz.database  xz.finds  xz.funds  xz.policy  xz.rounding  xz.strata
GC> /opt/lmi/data[0]$popd
GC> /opt/lmi/bin
GC> /opt/lmi/bin[0]$wine ./lmi_wx_shared --ash_nazg --data_path=/opt/lmi/data   
GC> Now I can successfully run an illustration for the 'xz' product.

 OK, so, AFAICS, there is nothing remaining to do here (at least for me) --
please let me know if I'm wrong.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]