is extending DOMElements pointless?
| From: | Oliver Müller | Date: | Sun, 08 Oct 2006 08:46:01 +0000 |
| Subject: | is extending DOMElements pointless? | ||
| Groups: | php.xml.dev | ||
| Request: | Send a blank email to php-xml-dev+get-594@lists.php.net to get a copy of this message | ||
Dear developers,
can it be that implementing derived DOMElements is completely useless?
You can't write to them if they are created via 'new myDOMElement', and you can't get a version of your own class via 'myDOMDocument->createElement()'...
I want to have different myDOMElements representing objects in a tree, which benefit from the native DOM functionality and add methods like 'myDOMElement->loadChildrenFromDB()'. Currently, i am forced to use a somehow crappy implementation where myDOMElements are not derived and store the real DOMElement as a member, which has numerous drawbacks. :-|
So here are my questions:
- Is there a way to make myDOMElement writable?
- can you (kind of) typecast a native DOMElement to a myDOMElement with tricks?
- am i missing something?
- any ideas?
Regards, Oliver