As per Andy Heninger's note yesterday, you cannot use dynamic_cast on
DOM_Node and its descendants, since they have no virtual functions.  You
must use getNodeType(), which certainly will return the proper type.

Dave



                                                                                       
                                   
                    "David E.                                                          
                                   
                    Cleary"              To:     <[EMAIL PROTECTED]>         
                                   
                    <davec@progre        cc:     (bcc: David N Bertoni/CAM/Lotus)      
                                   
                    ss.com>              Subject:     RE: Casting DOM_Node to 
DOM_Element                                 
                                                                                       
                                   
                    03/23/2001                                                         
                                   
                    06:20 AM                                                           
                                   
                    Please                                                             
                                   
                    respond to                                                         
                                   
                    xerces-c-dev                                                       
                                   
                                                                                       
                                   
                                                                                       
                                   





> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of John
> Snelson
>
> The C++ way of doing this is the following code fragment:
>
> if(node.getNodeType() == DOM_Node::ELEMENT_NODE) {
>   DOM_Element element = static_cast<DOM_Element&>(node);
> }

Wouldn't dynanic_cast be more what Curt is looking to do, as that will
actually perform a runtime check to see in node is indeed a DOM_Element?
I've never used these casting constructs myself, so I am interested in
hearing other's thoughts on them.

David Cleary


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