You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Gilles FILIPPINI <Gi...@edf.fr> on 2000/02/18 19:08:02 UTC

Réf. : RE: Réf. : Re: [Xerces C++] Usage

It's OK this way.

Thanks a lot.




jdlewis@xactware.com sur 18/02/2000 16:22:00
Pour :	xerces-dev@xml.apache.org@hub
cc :	 (ccc : Gilles FILIPPINI/SEPTEN/DE/EDFGDF/FR)
Objet :	RE: Réf. : Re: [Xerces C++] Usage

You can cast the DOM_Node to a DOM_Element.

Simply perform the cast, like this:

...
DOM_Node     node = nodeList.item(i);
DOM_Element  elem = (const DOM_Element&)node;
...

You may cast-off 'const-ness' if necessary...
Kind of ugly, but it works.




-----Original Message-----
From: Gilles FILIPPINI [mailto:Gilles.Filippini@edf.fr]
Sent: Friday, February 18, 2000 7:55 AM
To: xerces-dev
Subject: Réf. : Re: [Xerces C++] Usage


I had the idea about casting l1 to DOM_Element.
Unfortunately, such an operation seems not to be allowed by the Xerces DOM
C++ implementation.

For example, with l1 being a DOM_Node, the statement :
	DOM_Element	elt = l1;
leads to the compilation error :
	Cannot use DOM_Node to initialize DOM_Element.

I also tried :
	DOM_Element	elt = DOM_Element(l1);
to obtain :
	Cannot cast from DOM_Node to DOM_Element

Any idea ?


---- snip ----