Hi. It seems likely that you're running into the bug where UserDataHandlers are not called on non-leaf nodes in the tree: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16817
There's a patch attached to that bug (hint, hint). :) -Nathan Codding PureEdge Solutions, Inc -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 8:45 AM To: [EMAIL PROTECTED] Subject: Problem with user data handler, I think Hi All! I'm having a problem with my DOMUserDataHandler derived class. At times when a DOMElement gets deleted, the handle method of my class doesn't get called. At least thats what seems to be happening! First, a bit of background. We've decided to wrap Xerces in a couple of classes of our own. I've got an XMLDocument class( wraps DOMDocument ) and an Element class( wraps DOMElement ). The XMLDocument object owns the wrapped DOMDocument. When the object is created by parsing an XML file, I have my XMLDocument object use the parser's adoptDocument method to get ownership. That was done so that the XMLDocument would always be responsible for releasing the document. All of the constructors for Element get a DOMElement( one way or another! ) and call its setUserData method with the Element's address, and my handler object. When the handle method gets invoked with the operation NODE_DELETED, it deletes my wrapper object.. At least thats whats supposed to happen. What I'm seeing is that the handle method is not getting called when I expect it to. I create one of my XMLDocument objects, and get a DOMDocument by using XercesDOMParser to parse an XML file. After performing various tests, I delete my XMLDocument object. Its destructor calls the release method of the DOMDocument object it owns. My understanding was that would release( which I interpreted as delete ) all the nodes owned by the document. But the handle method of my data handler object is not being called. I'm assuming that I've just misunderstood something. Just about every problem I've had with Xerces has been my not understanding how it was intended to work. So, I'm hoping one of you can clear up my confusion! I'm running version 2.2.0 on Windows, compiled with VC++ 6.0 Marc Robertson Staff Consultant AWD Development DST Technologies, Inc. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]