Hi Elliot,

Although I agree with you that the spec is not crystal-clear on this point,
my intuition is that implementations need to return a node that is
isomorphic to the one that's been added, but, at their discretion, this
doesn't have to be identical.  If I were you and this were important enough
to me, I'd do a simple if check to make sure the objects are identical; if
they aren't, at least you can exit gracefully and tell the user you're on
an implementation that doesn't do what you need.

But that's just my intuition; I'll ping one of the DOM WG folks and let you
know if the intention is different from my assumption.

Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]




                                                                                       
                                                
                      [EMAIL PROTECTED]                                                
                                                
                      m                        To:       [EMAIL PROTECTED]             
                                      
                                               cc:                                     
                                                
                      11/05/2003 01:12         Subject:  Re: Append Child, Insert 
Before, Remove Child, and Replace Child              
                      PM                                                               
                                                
                      Please respond to                                                
                                                
                      xerces-c-dev                                                     
                                                
                                                                                       
                                                
                                                                                       
                                                







Thanks for the reference!

Actually I had already read that and found it to be somewhat ambiguous.

Method: Append Child
Adds the node newChild to the end of the list of children of this node.  If
the newChild is already in the tree, it is first removed.
Parameters:
newChild of type Node
      The node to add
      If it is a DocumentFragment object, the entire contents of the
document fragment are moced into the child list of this node.
Return Value
Node.  The node added.

I read this to mean that the method simply returns the EXACT same node that
was passed in as the newChild.  Which leads to my question.  If the exact
same node is returned...then why is there a return value at all?  Is it
simply as a convenience for programmers?  This poses something of a problem
for me as I am introducing this behavior into a graphical environment where
return values are handled differently and can't be stacked like they can in
a text based environment.

When I looked at the source code it appeared as though the same newChild
that was passed in was returned....but I don't feel confident that I know
all the ifs and's and but's of the code.

I really appreciate everybody's help!!
Thanks!




|---------+---------------------------->
|         |           [EMAIL PROTECTED]|
|         |           s.ibm.com        |
|         |                            |
|         |           11/05/2003 12:02 |
|         |           PM               |
|         |           Please respond to|
|         |           xerces-c-dev     |
|         |                            |
|---------+---------------------------->

>--------------------------------------------------------------------------------------------------------------------|

  |
|
  |       To:       [EMAIL PROTECTED]
|
  |       cc:
|
  |       Subject:  Re: Append Child, Insert Before, Remove Child, and
Replace Child                                   |

>--------------------------------------------------------------------------------------------------------------------|









> Don't everybody answer at once ;-)
>
> I apologize if this question is obvious or inappropriate, but it is a
> behavior of the parser that I haven't been able to definitively classify
> yet.  So, if anyone could offer any help I would really appreciate it.

The DOM recommendation will answer your questions:

   http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247

Dave


---------------------------------------------------------------------
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]

Reply via email to