如何读取xml文件并将其保存在字符串中

时间:2017-08-16 19:44:57

标签: xml xamarin

如何读取我的xml url的所有内容并写入字符串,我希望它以xml中显示的方式出现,我不想将其分开。

我的字符串会这样看

string xml = @"<rss version="2.0"><channel>
       <title>exemplo</title>

       <title>exemplo</title>
      <link>exemplo</link>
     </image>
    <item>
  exemplo
    <title>
     <![CDATA[
   exemplo
    ]]>
     </title>
   <link>
      <![CDATA[
   exemplo
     ]]>
     </link>
      <description>exemplo</description>
      <pubDate>Tue, 05 Aug 2017 21:21:28 GMT</pubDate>
       </item>"

我在没有预期结果的情况下尝试了更多

  XDocument doc = XDocument.Load("url");
            string xml = doc.ToString();

0 个答案:

没有答案