On the other hand, if you've created a DOM_Node as you describe, you may use
the following (at least, it works for me)
DOM_Node node; // created using the DOM API
DOM_Node* nodePtr = new DOM_Node(node); // calls copy contructor
// use nodePtr, pss it around, what have you
delete DOM_Node; // decreases refcount
by 1
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 31, 2001 14:52 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Why not new DOM_Node?
>
>
>
> Independent of memory management, one _SHOULD_ never create a DOM Node
> object directly. The DOM's factory methods (Document.create...())
> generally
> perform addiitonal implementation-specific and non-public
> initialization to
> make sure that the node will function properly in the context of
> a specific
> document. Bypassing those by allocating the object directly is likely to
> produce an object which does not function properly per the DOM spec.
>
> You may be able to get away with new'ing nodes in a few (very few, I
> suspect!) implementations of the DOM. It's _extremely_
> nonportable, and may
> not work in the next DOM you try, including the next release of the same
> library.
>
> Don't cheat; you're only cheating yourself.
>
>
> ---------------------------------------------------------------------
> 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]