Re: Extending Element class in a dom tree?

From: Date: Sun, 01 May 2005 05:41:41 +0000
Subject: Re: Extending Element class in a dom tree?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-214280@lists.php.net to get a copy of this message
Christian Stocker wrote:
Does not work, will never work, just forget about it ;)
Ok, that was not the really right answer ;) Of course it does work. You can even do stuff on that element, if you use the variable, resp. reference ($oMyElement) for doing this. What doesn't work (and I referred to that) is getting this object back from the DomDocument, so for example: $oDom->documentElement will give you the DomElement back and not your new MyElement. Hope it's a little bit clearer now chregu
chregu
You mean that dom methods for retrieving Elements will only return objects with the object methods defined in the DomElement class? Is there any way to extend Elements in the tree with own methods? Or is the dom structurue only used to handle defined methods? The method DomDocument::CreateElement() only returns instances of DomElement so maybee the Dom structure is not meant to be extended regarding elements? /Erik

« previous php.general (#214280) next »