开发者

xmlElement parser need in c#

开发者 https://www.devze.com 2022-12-16 04:56 出处:网络
I need to simple xml parser like below. xmlNode root=xmlDoc.DocumentElement; root.appendChild(xmlElement.Parse(\"<book 开发者_如何转开发name=\'ff\'>sample </book>\");

I need to simple xml parser like below.

xmlNode root=xmlDoc.DocumentElement;
root.appendChild(xmlElement.Parse("<book 开发者_如何转开发name='ff'>sample </book>");

is there any parser library or extension method like this .Parse("<book name='ff'>sample </book>")


If you're using .Net 3.5, you can use the XElement class to do exactly this. Check out the documentation for XElement.Parse().


Consider using the newer Linq-to-Xml system in System.Xml.Linq. There is an XElement.Parse(string xml) function.

0

精彩评论

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