XML access to a child innertext

g15g15g15

New Member
I have this XML:\[code\]<location> <character name="name" mask="pap.png" X="397" Y="60"> <look reaction="False"> text1 <answer>text2</answer> </look> <talk xml=""/> </character></location>\[/code\]and I have the access to the node . I have some problem in changing the \[code\]text1\[/code\] and the \[code\]text2\[/code\]. Here my code:\[code\]node.ChildNodes[0].InnerText = "new_text1";node.ChildNodes[0].ChildNodes[0].InnerText = "new_text2"; //this doesn't work\[/code\]after that my XML looks like:\[code\]<location> <character name="name" mask="pap.png" X="397" Y="60"> <look reaction="False">text1</look> <talk xml=""/> </character></location>\[/code\]so it cut off the \[code\]<answer/>\[/code\] child. Any ideas?
 
Back
Top