How to delete xml element with C#?

后端 未结 1 1435
情歌与酒
情歌与酒 2021-01-26 07:08

I\'m new to XML and am having a problem understanding how to implement a solution of deleting certain elements within the tree. I\'ve searched for a solution and have tried num

相关标签:
1条回答
  • 2021-01-26 07:18

    If you have found the node to remove use this call:

    node.ParentNode.RemoveChild(node);
    

    That will bring you back to the parent and then remove the entire node(including the tags)

    0 讨论(0)
提交回复
热议问题