You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jim Reitz <je...@home.com> on 2000/05/07 05:50:18 UTC

How do I create a DOM_Element inside a DOM_DocumentFragment?

How do I create a DOM_Element inside a DOM_DocumentFragment?  I'm looking
for something like the DOM_Document's:

DOM_Element     createElement(const XMLCh *tagName);

Or, is this not something one would do for a fragment?

Long explanation if needed...
I want to create small short-lived DOM_DocumentFragments.  I thought this
would have less overhead than DOM_Documents.  My understanding is that if I
create a single DOM_Document, use it's createElement() method to create the
DOM_Elements, and then add the DOM_Elements to my DOM_DocumentFragment, the
DOM_Elements would be stored in this single DOM_Document, and when I delete
the associated DOM_DocumentFragment, the Element would still not be deleted
since it is still in my single DOM_Document.  I.e., sort of a memory leak.
So I thought it would be best to not even create a DOM_Document, but then I
found the dilemma of how do I create a DOM_Element.

thanks...

Jim Reitz
jereitz@home.com