Link to home
Start Free TrialLog in
Avatar of pwellar
pwellar

asked on

how do you write a DOMDocument to an XML file in C++

I'm using xercesc to build up my DOMDocument. This is the easy part. Now I'm trying to write this DOM to an XML file but I can't find anyway to do it. I know in java I was able to use the Transformer class. Is there anything in C++ similar? Or do I have to write each node one by one? I would hope there is some class that would do it nicely....

Thanks,
Paul
ASKER CERTIFIED SOLUTION
Avatar of dualsoul
dualsoul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pwellar
pwellar

ASKER

I did see that before, this is writing it per node. I was hoping that there was something to write it per DOMDocument. Or does this support in writing out the whole structure? If so what do you pass into the writeNode call?

Thanks!
try to pass RootNode to writeNode.
if this doen't help, i think it's rather easier to iterate over all nodes and save them :)