Re: Save changes in the original XML file



On 18 Nov., 15:11, "haigang0...@xxxxxxxxx" <haigang0...@xxxxxxxxx>
wrote:
I'm trying to update XML file using DOM. But as the dom-tree is stored
in memory, i found the original XML file is not updated after i
modified the value of certain nodes.
Is there any command that saves changes of nodes into the original XML
file?

In tdom that would be (assoming root is the top documentElement):

set f [open $outfile w]
#-- maybe fconfigure -encoding, write <?xml ...> line
$f puts [$root asXML]
close $f

Check your documentation, I'm quite sure tcldom has similar
functionality.
.



Relevant Pages