How to add a new node, where id is a specific value from a text field? This is my xml:
<Students>
<Student>
<id>111</id>
<Value>1</Value>
<information>
<data DateTime="02.04.2014 13:00:00" Value="1"/>
</information>
</Student>
</Students>
So my question is: I have a text box in which I enter the student ID. After clicking the button, I want to add a new node to the node information containing the date and time of the attribute at that moment.
Another thing is that I want the innerText in node to change from 1 to 0 and vice versa every new time I click. So this will be the second attribute in node.
The next time I click, it will add a new node, it will add this.
<information>
<data DateTime="02.04.2014 13:00:00" Value="1"/>
<data DateTime="02.04.2014 14:00:00" Value="0"/>
</information>
How can I do this with XmlLinq?
source
share