lmi
[Top][All Lists]
Advanced

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

Re: [lmi] bad use of xml::init in LMI sources


From: Vaclav Slavik
Subject: Re: [lmi] bad use of xml::init in LMI sources
Date: Mon, 01 Dec 2008 01:02:47 +0100

On Wed, 2008-11-26 at 19:56 +0100, Vaclav Slavik wrote:
> of xml_lmi::dom_parser and xml_lmi::xml_document classes. That defeats
> the purpose of xml::init as MT-safe initializer (which doesn't matter
> for LMI) and -- more importantly for us -- it means that libxml2
> parser is shut down every time a document is destroyed and
> re-initialized for a new document.

There's another problem with this use of xml::init, even though it
luckily doesn't currently affect LMI. xml::init constructor initializes
some libxml2 global settings (remove ignorable whitespace, auto-indent
text output, do DTD validation etc.) and so they are reset into their
[xmlwrapp's] default state every time a xml_document instance is
created.

As I said, this doesn't currently affect LMI, because we stick to the
defaults, but if this ever changed [*], xml_document's behavior would be
highly surprising.

[*] This may make sense even now. The existing xslt_lmi.cpp code uses
    [the equivalent of] xml::init::substitute_entities(true) (this is
    the default) and xml::init::load_external_subsets(false) (this is
    not). I'm not yet sure if the latter is required (I suspect not) or
    if the rest of the code depends on it being true, but if it is
    required, then it would be nice to beable to set the flag globally
    at startup.

Regards,
Vaclav





reply via email to

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