I have an xml file like below:
I want to modify attributes of <chessBoard>, then loop through <item> and modify its attribute (Value) too, now what I do is just create a new xmldocument, copy (change some attribute, keep some) everything from the old file to the new then overite the old one, but I believe there's better way, reading and writing at the same time.
Plz help, tks.
VB.NET:
<?xml version="1.0" encoding="utf-8" ?>
<chessBoard columnNo="50" rowNo="50" DX="20" DY="20" Turn="X" >
<item x="0" y="0" Value="X" />
<item x="0" y="1" Value="O" />
<item x="1" y="0" Value="X" />
<item x="0" y="2" Value="O" />
</chessBoard>
I want to modify attributes of <chessBoard>, then loop through <item> and modify its attribute (Value) too, now what I do is just create a new xmldocument, copy (change some attribute, keep some) everything from the old file to the new then overite the old one, but I believe there's better way, reading and writing at the same time.
Plz help, tks.