Re: [xslt] Probable memory leak (when using document()?)



On Sat, Jan 29, 2005 at 01:58:11PM +0100, Vincent Lefevre wrote:
> On 2005-01-28 16:50:15 -0500, Daniel Veillard wrote:
> > On Fri, Jan 28, 2005 at 09:11:17PM +0100, Vincent Lefevre wrote:
> > > Couldn't the DTD structure be shared, since it is read-only?
> > 
> >   Not read-only. The presence of an internal subset can override 
> > definitions done in the external subset. Detecting a-priori that
> > there no internal subset may be a bit tricky.
> 
> Hmmm... There's a command-line option (--novalid) not to load the
> DTD, but I think this would be wrong if there are some character
> entities (not the numerical ones). How about a command-line option
> to say that "there would be no problem"?
> 
> But I think that any internal subset could be seen as a private DTD.
> So, the DTD structures could be shared, and once an internal subset
> is found, then the structures corresponding to external subsets could
> be cloned[*] (even if this isn't needed a posteriori).

  Hum, really no this won't work in the general case. Entity A in the
external subset may reuse entity B. Entity B can be redefined in the
internal subset. The cached value of A loaded from a previous file
just won't work. And before saying nobody does this, well lot of people
set for example the date of the current document in an entity and
the date being reused by a more general entity doesn't look such an
uncommon use case.

  And piling up command line options, i.e. non-general tweaks to the
libxslt engine which would break "sometimes" sounds like a maintainance
nightmare to me.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
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]