Re: [xml] XPath queries on document fragments without a document
- From: Daniel Veillard <veillard redhat com>
- To: Sean Chittenden <sean chittenden org>
- Cc: xml gnome org
- Subject: Re: [xml] XPath queries on document fragments without a document
- Date: Thu, 26 Sep 2002 18:26:54 -0400
On Thu, Sep 26, 2002 at 03:12:01PM -0700, Sean Chittenden wrote:
I'm using xmlMemSetup() and that made a big difference in terms of
preventing libxml from stepping on Ruby's toes. I'm actually worried
that there's some place in libxml where it's still not using the
memory routines specified by xmlMemSetup(), but I couldn't find any
violators.
I run constantly in my devel environment with memory debug enabled
and under those conditions, an xmlMalloc'ed passed to free() or
a block allocated with malloc and passed to xmlFree() immediately
generate either an error message or a segfault, this is very very
unlikely to happen.
You know what Matt did in terms reference counting? I don't think
Hum, no... ask him :-)
If I parse a document with xmlParseDocument() and the document is well
formed ('<a>b</a>'), when I assign the result out of the parser
context, it seems as though when the parser context is free()'ed that
it's also free()'ing ctxt->myDoc. If I make a copy of myDoc I seem to
see for example xmlSAXParseDoc() for how to proceed, if you start
using low level APIs of libxml2, you'd better look at the existing code
in libxml2 making use of it to avoid trial and errors.
Daniel
--
Daniel Veillard | Red Hat Network https://rhn.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]