Ok, I guess my question is really a much bigger one. Many of the DOM
functions such as removeChild, appendChild, etc return the node that is
added/removed/etc. Now, this node was also a parameter of the function.
So, in all of these functions, are the return values always the same value
as the input parameter (assuming no exception was thrown, in which case I
imagine NULL is passed)?
Assuming no errors, does removeChild always return the exact same node that
was passed in? Does appendChild always return the exact same node that was
passed in?
I ran a few tests (as I stated in the previous email), and this seems to be
the case. If it is, then isn't it reasonable to have a situation like the
following:
DOMNode *returnFoo = docEl->appendChild(foo);
So, returnFoo and foo are exactly the same. If release() is called on one,
then the other is hosed. I understand that this is generally avoidable,
but it is problematic for me as I am wrapping these functions for use by
customers....which means I can't control exactly what is done with the
return values.
So, after this rambling message, I guess my real questions are:
1) Are the input parameter and return value of such functions always the
same assuming no error was encountered?
2) Would it be considered "poor form" when providing a DOM API to customers
NOT to return a value from such functions (i.e. the return value of
removeChild is void)
3) I ran a few simple tests on MSXML and it appears as though they actually
return new nodes out of these functions (at least the ptr values are
different...no idea whats going on under the hood). Why would they behave
differently?
3) Why was the DOM standard written in this manner? What is the real value
of returning these values when theoretically it is the same node that was
passed as an input parameter?
Thanks!
"Erik Rydgren"
<[EMAIL PROTECTED] To: <[EMAIL PROTECTED]>
darinen.se> cc:
Subject: RE:
DOMNode::removeChild(oldChild) etc
05/30/2003 02:18
AM
Please respond to
xerces-c-dev
With a quick look it seems like it is the same object that is returned.
Regards
Erik Rydgren
Mandarinen systems AB
Sweden
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: den 29 maj 2003 22:39
To: [EMAIL PROTECTED]
Subject: DOMNode::removeChild(oldChild) etc
I have a question about removeChild and other functions like it. Are the
oldChild DOMNode* passed into the function and the DOMNode* returned by the
function identical? Or is a new node allocated in the parser? I am asking
b/c in my wrapper functions I need to know if I can just return the input
node or not.
Thanks!
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]