> DOM_Element elem = static_cast<DOM_Element&>(nodeList.item(i));
nodeList.item() is returning a DOM_Node by value. The value
that you are trying to cast doesn't have a usable memory
address at that point - it's just a temporary value in the
middle of an expression - so casting it to a reference type
doesn't work. This is what the "from rvalue of ..." in the
error message means.
Adding an intermediate variable should fix the problem
DOM_Node t = nodList.item(i);
DOM_Element elem = static_cast<DOM_Element &>t;
Andy Heninger
IBM, Cupertino, CA
[EMAIL PROTECTED]
----- Original Message -----
From: "Ryan Koss" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 02, 2001 12:35 PM
Subject: Re: Casting DOM_Node to DOM_Element... still a problem.
> What compiler and OS is this running on because I still get a the
following
> compiler error when I try to do the cast that has been stated in this
> multi-threaded email... I am running Mandrake linux 7.1 and my compiler
is
> GCC 2.95.3
>
> xmlobject.cpp:446: conversion to non-const reference type `class
DOM_Element
> &'
> xmlobject.cpp:446: from rvalue of type `DOM_Node'
> make: *** [xmlobject.o] Error 1
>
> Here is the code, I am cycling through a list of DOM_Nodes here...
>
> DOM_Element elem = static_cast<DOM_Element&>(nodeList.item(i));
>
> Any help, ideas, notion, guesses would be greatly appreciated. Thanks
in
> advance
> -ryan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]