By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

xml4c extending classes

P: n/a
I'm looking into adding a couple new things we need for Element nodes.
I was thinking of creating my own ElementNode class and inheriting from
DOM_Element, but I read somewhere that the XML4C dom classes were not
designed to be subclassed and thats why the Userdata field was added.
However, thats really not what I'm wanting to do.

Has anybody actually tried to extend the DOM api in XML4C ? Does
anybody have any samples they be willing to share ?

Thanks.

Oct 19 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ma*****@yahoo.com wrote:
DOM_Element, but I read somewhere that the XML4C dom classes were not
designed to be subclassed and thats why the Userdata field was added.
That's pretty generally true of DOM implementations. You would have to
subclass not just the individual nodes, but Document as well (to catch
all the node factories), plus dealing with any internal behaviors that
may construct nodes. Basically, you can't wrap additional behaviors
_around_ a DOM; you really need to build new behavior _into_ a DOM. Take
a look at the HTML DOM as an example -- that extends the XML DOM, but
needs fairly deep awareness of implementation details.

What are you actually trying to accomplish by subclassing? Sometimes the
right answer is to use the DOM event system in addition to the userdata
hook.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.