Is there a way to replace all existing values from XML with values from dictionary using Linq? I'm using c#.
XML example:
<root>
<node1> <--without attribute
<subNode1>someTextValue</subNode1>
</node1>
<node2 name="myNode2"> <--With attribute (IMPORTANT!!!)
<subNod1>someOtherTextValue</subNode1>
</node2>
</root>
Dictionary<string, Hashtable> dataFromXML;
dataFromXML Keys
from the example are node1 (because here is note an attribute), myNode2 (because here is an attribute)
...
dataFromXML Values
are subNodes.
Now lets say we make some value changes in some subNode and we want to update the XML.
How could I do this instead of looping with foreach???
Hope my question is clear defined.
EDIT
What about XElement and the ReplaceWith funcation?
Best reagards.