You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by ccw <cc...@pair.com> on 2003/06/19 06:10:36 UTC

How to add User Data to DOMNode by modifying the source codes or derive a class from DOMNode?

Hi, I use Xerces C++ in my application. In my application, I need to build a DOM tree with 60000 nodes, each node has some user-defined data. I use setUserData and getUserData but find the efficiency of these two functions are very low since they are operating on a global hash table(fUserDataTable) and a local hash table(node_userDataTable). I try to increase the size of the global hash table from 29 to 199999, the performance is improved greatly. But due to large numbers of operations on User Data, these two functions still become the bottleneck in my application. And I think it is unnecessary for them to search or operate on a global hash table since from the semantic point, they are both local to the current DOMNode. Therefore, I wonder if it is possible to modify the source codes for DOMNode directly and embed the user-defined data in it(as a hash table or a list, I prefer the latter, since in most cases, there will not be very much user data for a single node and a simple list search will be faster) so to eliminate the global hash search. Or if it is possible to derive a DOMNode to support similar features. I try to search the source codes but cannot find the actual implementation codes of DOMNode(there is only one DOMNode.hpp, no DOMNode.cpp) so I don't know where should I make the modification. Therefore, can anyone give me some hints or guides on how to modify the source codes of Xerces. Many thanks.

Re: How to add User Data to DOMNode by modifying the source codes or derive a class from DOMNode?

Posted by da...@us.ibm.com.



> I try to search the source codes but cannot find the actual
implementation
> codes of DOMNode(there is only one DOMNode.hpp, no DOMNode.cpp) so I
don't
> know where should I make the modification. Therefore, can anyone give me
> some hints or guides on how to modify the source codes of Xerces.

xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp

DOMNode is an abstract base class, so there is no implementation.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org