What happens when I parse an XML file, get the document (and possibly other
nodes i.e. document element), and then parse another document?  For example
(simplified):

      // load first document
      XercesDOMParser *parser = new XercesDOMParser;
      DOMWriter         *theSerializer = ((DOMImplementationLS*)impl)
->createDOMWriter();
      XMLFormatTarget *myFormTarget;
      myFormTarget = new StdOutFormatTarget();
      parser->parse(gXmlFile);
      DOMNode                        *doc = parser->getDocument();
      DOMNode           *docel = ((DOMDocument*)doc)->getDocumentElement();
      DOMNode           *parent = docel->getParentNode();
      int               type = parent->getNodeType();
      theSerializer->writeNode(myFormTarget, *doc);

      // load another document
      parser->parse(gXmlFile2);
      doc = parser->getDocument();
      theSerializer->writeNode(myFormTarget, *doc);

It appears as thought docel from the original file still exists and still
sees doc as its parent node.  However, when I use DOMWriter to print out
the document, I see the first document during the first writeNode, and the
second document for the second write Node.

So, what is my question?  What is the status of these nodes "left over"
from the first parsing?  I thought they would be orphaned, but apparently
not.
1. Am I responsible for releasing them?
2. If they still see the doc as their parent node, why don't they show up
when the node is printed?
3. Exactly what is the status of these nodes?

Sorry to be nitpicky.  I need to know this so I can determine how to handle
this if my users try it.

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to