You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2001/10/27 03:32:01 UTC

Re: AW: converting DOM_Node back to DOM_Attr

"Jason E. Stewart" <ja...@openinformatics.com> writes:

> "Gero Meißner" <me...@zentrale.heinze.de> writes:
> 
> > I tried the function actual_cast() but unfortunately had no success. Here is
> > a fragment of my code:
> > 
> > :
> > $node = $docOut->importNode($root->getAttributeNode('owner'), 0);
> > $node = $node->actual_cast();
> > print $node->getValue();
> > :
> > 
> > 
> > The function 'importNode' converts the attribute named 'owner' from DOM_Attr
> > to DOM_Node. When using the function 'actual_cast' it doesn't convert $node
> > back from DOM_Node to DOM_Attr. So I always get an error when trying to use
> > the (attribute-)function 'getValue'. What I wanted to do is to directly
> > assign the imported attribute-node to an element of the Document $docOut by
> > using the function 'setAttributeNode'
> > ($docOutElement->setAttributeNode($node)).
> 
> Ok. First off, this should work fine without actual_cast(). Second,
> actual_cast() seems broken in this situation, I'll need to look into
> this. 
> 
> I was able to play around in the debugger, and getValue() works just
> fine for me... but I suspect that that something deeper is wrong here,
> let me poke around.

This was really lame. actual_cast() was being called, but there was
no condition in the switch statement for an attribute node :-O

There were a couple of others missing as well.

This is fixed in 1.5.8

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org