You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Anand Ravipati <An...@trcinc.com> on 2000/03/06 20:49:05 UTC

copying DOM tree

Hi,

I am using XML4C v3.0.1 for WinNT4 to parse an XML document to convert the
resulting DOM tree to another tree with a different class as a node (i.e
DOM_Node in the DOM tree corresponds to My_Node in the new tree).  I see
that DOM_Document has a static method 

createTreeWalker(DOM_Node root, short whatToShow, DOM_NodeFilter  filter);

Can the above be someway useful in my case and how should I go about doing
the conversion?

Thanks.

--
Anand R

Re: copying DOM tree

Posted by Arnaud Le Hors <le...@us.ibm.com>.
Anand Ravipati wrote:
> 
> I am using XML4C v3.0.1 for WinNT4 to parse an XML document to convert the
> resulting DOM tree to another tree with a different class as a node (i.e
> DOM_Node in the DOM tree corresponds to My_Node in the new tree).

This seems to be a common misuse of the DOM. Unless you do something
else with the DOM tree returned by the parser building one is an awful
waste of time and memory. Instead, you should really build your own
structure directly from the parser, using SAX.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group