I want to append the existing XML document with some tags, I wrote the code but its not working . Can you please suggest me to do this.
[SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] txt = textBox1.Text.ToString();
[/SIZE][SIZE=2][COLOR=#008080]XmlDocument[/COLOR][/SIZE][SIZE=2] xdoc = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]XmlDocument[/COLOR][/SIZE]SIZE=2;
xdoc.LoadXml(txt);
[/SIZE][SIZE=2][COLOR=#008080]XmlNode[/COLOR][/SIZE][SIZE=2] root = xdoc.DocumentElement;
[/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#008080]XmlElement[/COLOR][/SIZE][SIZE=2] elem = xdoc.CreateElement([/SIZE][SIZE=2][COLOR=#800000]“price”[/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][SIZE=2]);
elem.InnerText = [/SIZE][SIZE=2][COLOR=#800000]“19.95”[/COLOR][/SIZE][SIZE=2];[/SIZE][SIZE=2][COLOR=#008000]
[/COLOR][/SIZE][SIZE=2]root.InsertAfter(elem, root.FirstChild);
[/SIZE][SIZE=2]xdoc.Save(txt);
Thanks a lot,
Anjali:jail:
[/SIZE]