开发者

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.

  1. Changing an InnerText of an element.

  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜