Editing an Xml file
What are the different ways for editing an Xml file in .Net without using LINQ.
The fo开发者_如何学Gollowing activity needs to be done.
Changing an InnerText of an element.
Changing an Attribute in Xml.
Regards,
Sachin K
The most hardcore way will be treating XML document as a string and doing purely string manipulations (possibly with regexes) a-la xml.Replace("<x></x>", "<x>foo</x>")
.
More reliable is an good old XmlDocument
.
Create your object to deserialize the xml change the value of the variable in the object then serialize object to xml.
精彩评论