The basics are there. The XSLT extension tracks the ruby document peer  
that it is working against. The XSLT mark() marks the document peer,  
which should retain the reference. XPath returns node sets and those  
nodes reference their parent doucment, so when the GC runs, the  
Document is marked and should be preserved. The only instance where  
the document relationship is broken is when a clone() occurs. This is  
the intended operation.

If you have a node with no document reference, then it is a copied  
subtree. What ruby object/reference do you have that is missing the  
document?

Dan


On Jan 14, 2008, at 18:56, Marc Munro wrote:

> It's beginning to look as though something in one of my xml documents
> has been removed part-way through my use of it.
>
> I am trying to discover exactly what is happening but I have a  
> question
> about how ruby and C objects interact within libxml.
>
> My understanding is that a mapping is maintained between the C objects
> and the ruby objects, and any pointer problems should be due to this  
> map
> being in some way incorrect, or incomplete.
>
> Given that I am using both the xml and xsl libraries, and am using
> significant numbers of xpath expressions, is it possible that an xml
> object (object1) from the xsl library becomes known to the ruby xml
> library mappings through an xpath expression?  In this case, wouldn't
> the mapping within libxml show that the object has no references and  
> can
> therefore be freed, even though there are references from the xsl side
> of things?
>
> To put it another way, is there any integration of the mapping  
> mechanism
> between libxml and libxsl, and if not should there be?
>
> __
> Marc
> _______________________________________________
> libxml-devel mailing list
> libxml-devel@rubyforge.org
> http://rubyforge.org/mailman/listinfo/libxml-devel

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to