Making new Node or Element subclasses that derive from DOM_Node or
DOM_Element is not really practical with the Xerces C++ DOM.  The problem is
that the classes that would need to be subclassed are not DOM_Node or
DOM_Element, but the underlying implementation classes, NodeImpl or
ElementImpl.  But these are not set up to support subclassing by user
programs.

I'm sure it could be done anyway, and would include the steps you mention in
your mail, but it may be tricky to make work.  The reference-counted memory
management, in particular, can be pretty confusing, and will be visible when
working at this level.  Unless you have good confidence in your ability to
dive into the code and figure out what went wrong, I'd recommend against
trying it.

  -- Andy



----- Original Message -----
From: Klaus Schipany

I have some questions about Xerces-C++ (Version 1.1.0-d15) and I really hope
that someone will give me an answer.

How can I create my own DOM_Nodes or DOM_Elements?
Someone told me that the Java-version provides the possibility to derive my
own ElementFactory in order to create own Element-Nodes.
I think I have to derive myDocumentImpl from DocumentImp and then overwrite
the method "createElement()".
But therefore I also have to create a new DOMParser class.
---------
new myDOMParser()
setDocumentClassName("myDocumentImpl")
---------
Is this true? What do I really have to do?

Is this possible in C++, too?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to