如何将xmldocument转换为xdocument [英] how to convert xmldocument to xdocument
本文介绍了如何将xmldocument转换为xdocument的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
代码如下:
the code is given below
string m_URL = "http://www.ft.com/rss/home/us";
string xmlStr;
using (var wc = new WebClient())
{
wc.Headers.Add("user-agent", "Mozilla/5.0 (Windows; Windows NT 5.1; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4");
xmlStr = wc.DownloadString(m_URL);
}
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlStr);
以上代码xmlDoc包含 xmldocument
如何将其转换为 xdocument
?
请帮助我
先谢谢
the above code xmlDoc contains the xmldocument
how to convert it to xdocument
?
pls help me
Thanks in Advance
推荐答案
创建新的使用Load方法的XDocument [ ^ ]。使用它!
There's at least few ways to create new XDocument by using Load method[^]. Use it!
这篇关于如何将xmldocument转换为xdocument的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文