Additional SQL Server features and topics not covered by specific categories
Do you mean to write something from code to xml?
Try something like this:
string filePath = @"C:\xxx\1.xml";
string xmlString = File.ReadAllText(filePath);
XDocument xdoc = XDocument.Parse(@xmlString);
var TotalSumInsured = xdoc.Descendants("values");
foreach (var item in TotalSumInsured)
{
foreach (var node in item.Nodes())
{
if (node.NodeType == XmlNodeType.Element)
{
Console.WriteLine(((XElement)node).Attribute("dataPath").Value);
((XElement)node).SetAttributeValue("dataPath", "xxx");
// or
((XElement)node).Attribute("dataPath").Value = "jjj";
}
}
}
xdoc.Save(filePath);
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.