Re: [xml] reuse (aka "dict")



On Sun, Jul 20, 2008 at 10:04:04AM +0300, Eli Marmor wrote:
My first hour on this list, so please forgive me if the question is
silly (I haven't lurked... ;-)

I guess that thanks to dict, things run MUCH faster (less memory, less
string comparisons since many comparisons end with "==" of addresses,
etc.).

Unfortunately, when I'm trying to print addresses of node->name (with
equal names), I receive different addresses.

I printed doc->dict, and it's NULL.

I replaced the htmlReadMemory() by htmlCtxtReadMemory(), and finally I
see a dict (in ctxt->dict), but in the wrong place (doc->dict is still
NULL), and addresses of the same names are still different.

Under SAX the addresses (of equal strings) are equal (i.e. dict is
eanabled).

  I'm not sure the HTML parser really switched fully to dict, it should
I think but maybe this is not enabled. Usually people find the HTML parsing
speed and sdpace requirement fine.

How can I enable the "dict" feature in DOM too?

  Not sure that this means, the problem is that if the document has no
dictionary, then the SAX2 building callbacks won't try to reuse it

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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