Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xml4c extending classes

Reply
Thread Tools

xml4c extending classes

 
 
marfi95@yahoo.com
Guest
Posts: n/a
 
      10-19-2006
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.

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      10-19-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xml4c child nodes marfi95@yahoo.com XML 14 10-12-2006 10:14 PM
Extending ASP.net pages using Partial Classes =?Utf-8?B?RmF0IEVsdmlz?= ASP .Net 9 06-20-2006 08:04 AM
Extending classes written in C++ using SWIG Lars Moastuen Python 3 11-26-2004 09:24 AM
Extending/Inheriting classes to produce valid XHTML from ASP.NETv1.1 Anthony Williams ASP .Net 8 02-24-2004 09:14 AM
a parse error when using the xml4c. H.L Bai XML 1 01-05-2004 06:27 AM



Advertisments