Last post Jan 18, 2011 03:26 AM by blessyjees
Jan 13, 2011 03:00 AM|blessyjees|LINK
I am facing one problem while manipulating xml file. I am reading xml file node by node and manipulate each node value. In one case I want to replace one existing node with new node. I am not able iterate next child node after replacing one child in that
group. Please help to solve this issue.
Jan 13, 2011 12:54 PM|sansan|LINK
I am not able iterate next child node after replacing one child in that group
you might be using a for/foreach loop to traverse child nodes under a specific node and that's why you may be getting "collection modified........ " error. Maintain two XMLDocument objects and keep adding nodes to the second one by looping the first one.
And second XMLDocument object is the final modified one.
Jan 13, 2011 01:18 PM|Martin_Honnen|LINK
Consider to show us the relevant code and error message or at least explain which of the several .NET XML APIs you are using (.e.g. System.Xml.XmlDocument, System.Xml.Linq.XDocument, or?).
If you use LINQ to XML then see
Jan 18, 2011 03:26 AM|blessyjees|LINK
Thanks for your suggestions.
I am able to slove the issue. I removed foreach with for--loop , then i can able to manipulate all nodes.