T
Timothy W. Molter
<root>
<person>
<name>bob</name>
<age>30</age>
</person>
<person>
<name>bill</name>
</person>
</root>
I'd like to navigate to the LAST "person" node and insert an "age"
element.
if I use*:
XmlNode insertNode = xmlDoc.SelectSingleNode("/root/person");
and
XmlElement xe = xmlDoc.CreateElement("age");
xe.innerText = "40";
insertNode.AppendChild(xe);
, a new "age element is inserted in the FIRST "person" node.
*not the complete code, but the main idea
How can I insert my "age" element in the LAST "person" node of the
xmlDoc?
Thanks much, Tim
<person>
<name>bob</name>
<age>30</age>
</person>
<person>
<name>bill</name>
</person>
</root>
I'd like to navigate to the LAST "person" node and insert an "age"
element.
if I use*:
XmlNode insertNode = xmlDoc.SelectSingleNode("/root/person");
and
XmlElement xe = xmlDoc.CreateElement("age");
xe.innerText = "40";
insertNode.AppendChild(xe);
, a new "age element is inserted in the FIRST "person" node.
*not the complete code, but the main idea
How can I insert my "age" element in the LAST "person" node of the
xmlDoc?
Thanks much, Tim