RE: Usage of C-style cast while downcasting.

2005-03-29 Thread Michael Kochetkov
> Hi Michael, Hi, Axel, > I use to take 'static_cast' in order to obtain a > DOMElement-pointer from a DOMNode-pointer. But usually I > check the type of the node actually to be > DOMNode::ELEMENT_NODE before performing the cast. I use reinterpret_cast in my code sometimes just because it is ug

RE: Usage of C-style cast while downcasting.

2005-03-29 Thread Michael Kochetkov
> At 17.03 29/03/2005 +0400, Michael Kochetkov wrote: > > > >BTW, I have noticed that > > > >for (XMLSize_t i = 0; i < len; ++i) { > > > > XS::DOMNode* curNode = myNodes->item(i); > > > > XS::DOMElement* curElement = > > > >reinterpret_cast(curNode); > > > > XS::DOMNodeList

Re: Usage of C-style cast while downcasting.

2005-03-29 Thread Axel Weiß
Am Dienstag, 29. März 2005 13:56 schrieb Michael Kochetkov: > > Clearly you can download the source distribution of Xerces, > > turn on RTTI and use dynamic_cast in your code. > > Our management prefer to have "official" builds. > > BTW, I have noticed that > for (XMLSize_t i = 0; i < len; ++i) { >

RE: Usage of C-style cast while downcasting.

2005-03-29 Thread Alberto Massari
At 17.03 29/03/2005 +0400, Michael Kochetkov wrote: > >BTW, I have noticed that > >for (XMLSize_t i = 0; i < len; ++i) { > > XS::DOMNode* curNode = myNodes->item(i); > > XS::DOMElement* curElement = > >reinterpret_cast(curNode); > > XS::DOMNodeList *anotherNodeList = > >elem

RE: Usage of C-style cast while downcasting.

2005-03-29 Thread Michael Kochetkov
> >BTW, I have noticed that > >for (XMLSize_t i = 0; i < len; ++i) { > > XS::DOMNode* curNode = myNodes->item(i); > > XS::DOMElement* curElement = > >reinterpret_cast(curNode); > > XS::DOMNodeList *anotherNodeList = > >elem.getElementsByTagName(wsAgent.c_str()); > > > >work

RE: Usage of C-style cast while downcasting.

2005-03-29 Thread Alberto Massari
At 15.56 29/03/2005 +0400, Michael Kochetkov wrote: > Hi Michael, Hi, Alberto > unfortunately RTTI is not available on all the platforms > where Xerces compiles, so the sample code cannot make use of > dynamic_cast. Well, I only asked for /GR switch while building Xerces for VC6/7.X. > Clearly you

RE: Usage of C-style cast while downcasting.

2005-03-29 Thread Michael Kochetkov
> Hi Michael, Hi, Alberto > unfortunately RTTI is not available on all the platforms > where Xerces compiles, so the sample code cannot make use of > dynamic_cast. Well, I only asked for /GR switch while building Xerces for VC6/7.X. > Clearly you can download the source distribution of Xerces,

Re: Usage of C-style cast while downcasting.

2005-03-29 Thread Alberto Massari
Hi Michael, unfortunately RTTI is not available on all the platforms where Xerces compiles, so the sample code cannot make use of dynamic_cast. Clearly you can download the source distribution of Xerces, turn on RTTI and use dynamic_cast in your code. Alberto At 15.32 29/03/2005 +0400, Michael K