Re: [xml] xsltParseStylesheetDoc documentation/resource ownership



On Thu, Sep 28, 2006 at 01:22:49PM -0700, James Dennett wrote:
Looking at the documentation at
http://xmlsoft.org/XSLT/html/libxslt-xsltInternals.html#xsltParseStylesh
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.

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]