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]
- Casting DOM_Node to DOM_Element Arnold, Curt
- Re: Casting DOM_Node to DOM_Element John Snelson
- RE: Casting DOM_Node to DOM_Element David E. Cleary
- Re: Casting DOM_Node to DOM_Eleme... Miroslaw Dobrzanski-Neumann
- Re: Casting DOM_Node to DOM_E... Ryan Koss
- Re: Casting DOM_Node to ... Andy Heninger
- Re: Casting DOM_Node... Ryan Koss
- RE: Casting DOM_Node to DOM_Element Sean Forde
- Re: Casting DOM_Node to DOM_Element Jason E. Stewart
- Re: Casting DOM_Node to DOM_Eleme... Andy Heninger
- RE: Casting DOM_Node to DOM_Element David_N_Bertoni
- RE: Casting DOM_Node to DOM_Element peiyongz
- RE: Casting DOM_Node to DOM_Element David_N_Bertoni
- RE: Casting DOM_Node to DOM_Element peiyongz
- RE: Casting DOM_Node to DOM_Element Arnold, Curt
