我需要像下面这样简单的XML解析器。
xmlNode root=xmlDoc.DocumentElement; root.appendChild(xmlElement.Parse("<book name='ff'>sample </book>");
有像这样的解析器库或扩展方法吗 .Parse("<book name='ff'>sample </book>")
.Parse("<book name='ff'>sample </book>")
如果使用.NET 3.5,则可以使用 XElement 类来执行此操作。查看文档 XElement.Parse() .
考虑在system.xml.linq中使用更新的linq to xml系统。有一个xelement.parse(字符串xml)函数。