Re: [xml] xsltParseStylesheetDoc documentation/resource ownership

On Thu, Sep 28, 2006 at 01:22:49PM -0700, James Dennett wrote:
Looking at the documentation at
eetDoc I don't see anything written about the ownership policy for the
xmlDocPtr passed in.  My experimentation suggested that the
xsltStylesheet takes ownership of the xmlDoc, and reading the code in
xslt.c I see that xsltFreeStylesheet does call xmlFreeDoc(style->doc);
which appears to confirm the experimental view.

 yes true. Also the document is modified.

Could/should this be documented in the documentation of xsltStylesheet
and/or the documentation of the functions that take ownership of an
xmlDoc when a stylesheet is created?  If yes, am I about to be asked for
a patch? ;-)

  I can't resist an offer for a patch, it's well-known :)

I think there are probably other places where the documentation could
make ownership policies clearer, but maybe I'm missing out on some
blanket statement(s) that would cover many common cases?

  Well that case is special, that's sure, it's a bit against the general
rule, and was mostly to avoid copying the document first. Hopefully
most people give a file path or URL to the stylesheet instead.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]