You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Michael Hughes <mi...@gf-x.com> on 2003/06/02 16:48:44 UTC

Memory ownership

With the following two methods:-

XalanDocument::createElement()
XalanDocument::createTextNode()

Am I correct in assuming that the XalanDocument instance owns the
returned XalanNodes?


Re: Memory ownership

Posted by da...@us.ibm.com.



Yes.  However, you may find they will not work.  In particular, you cannot
use the standard DOM factory functions with the default source tree
implementation.  Those functions are supported when we wrap the old Xerces
DOM, but are not support when we wrap the new one.

If you really are going to do programmatic construction of a source tree
for transformation, you should build the Xerces DOM using the Xerces
interfaces, then wrap it for transformation.  If you can build the document
in document order, take a look at the XalanDocumentBuilder sample program,
to see how you can use the default source tree.

Dave



                                                                                                                                    
                      "Michael Hughes"                                                                                              
                      <michael.hughes@         To:      <xa...@xml.apache.org>                                              
                      gf-x.com>                cc:      (bcc: David N Bertoni/Cambridge/IBM)                                        
                                               Subject: Memory ownership                                                            
                      06/02/2003 07:48                                                                                              
                      AM                                                                                                            
                                                                                                                                    



With the following two methods:-

XalanDocument::createElement()
XalanDocument::createTextNode()

Am I correct in assuming that the XalanDocument instance owns the
returned XalanNodes?