A
Achille
Hi all,
I have a file test.xml with the following nodes:
<?xml version="1.0" encoding="ISO-8859-1"?>
<START>
<Profile1 hostname="host1" lastselected="ture"></Profile1>
<Profile2 hostname="host2" lastselected="ture"></Profile2>
<Profile3 hostname="host3" lastselected="ture"></Profile3>
</START>
and I want to change the value of attribute hostname (host1) in
Profile1 node.
I am using DOMParser and I used the following command:
node.getAttributes().item(0).setNodeValue("HostChanged");
in order to change the document in test.xml in:
<?xml version="1.0" encoding="ISO-8859-1"?>
<START>
<Profile1 hostname="HostChanged" lastselected="ture"></Profile1>
<Profile2 hostname="host2" lastselected="ture"></Profile2>
<Profile3 hostname="host3" lastselected="ture"></Profile3>
</START>
the command is ok but the DOM work in memory.
Can you help me to save the DOM tree changed in the file test.xml in
order to change the fisical file test.xml ?
Thanks!!
I have a file test.xml with the following nodes:
<?xml version="1.0" encoding="ISO-8859-1"?>
<START>
<Profile1 hostname="host1" lastselected="ture"></Profile1>
<Profile2 hostname="host2" lastselected="ture"></Profile2>
<Profile3 hostname="host3" lastselected="ture"></Profile3>
</START>
and I want to change the value of attribute hostname (host1) in
Profile1 node.
I am using DOMParser and I used the following command:
node.getAttributes().item(0).setNodeValue("HostChanged");
in order to change the document in test.xml in:
<?xml version="1.0" encoding="ISO-8859-1"?>
<START>
<Profile1 hostname="HostChanged" lastselected="ture"></Profile1>
<Profile2 hostname="host2" lastselected="ture"></Profile2>
<Profile3 hostname="host3" lastselected="ture"></Profile3>
</START>
the command is ok but the DOM work in memory.
Can you help me to save the DOM tree changed in the file test.xml in
order to change the fisical file test.xml ?
Thanks!!