添加xml结点的时候

var temp2 = temp1.Element("staticContent");
if (temp2 != null)
{
string str = "<remove fileExtension=\".svg\" />\r\n <mimeMap fileExtension=\".svg\" mimeType=\"image/svg+xml\" />\r\n <remove fileExtension=\".nupkg\" />\r\n <mimeMap fileExtension=\".nupkg\" mimeType=\"application/zip, application/octet-stream\" />\r\n <remove fileExtension=\".webm\" />\r\n <mimeMap fileExtension=\".webm\" mimeType=\"video/webm\" />\r\n <remove fileExtension=\".mp4\" />\r\n <mimeMap fileExtension=\".mp4\" mimeType=\"video/mp4\" />";
temp2.AddFirst(XElement.Parse(str));
}

必须把多个节点从,拆分开来,逐个添加

解析xml字符串的时候

    [Test]
public void XmlTest()
{
string xml = "<Record ID=\"135\" Key=\"CustomTableItemID\" /> <Record ID=\"23\" Key=\"CustomTableID\" />";
XElement element = XElement.Parse(xml);
Console.WriteLine(element);
}

需要添加一个根结点,才能进行解析

最新文章

  1. python基础补漏-06-其他常用模块
  2. down的另一种用法
  3. TweenMax学习一
  4. UVa 1391 Astronauts (2SAT)
  5. Linxu 安装Scala
  6. python 字符串长度
  7. Flex 选项卡加载方式简介
  8. 零散的笔记:jquery中的事件
  9. 从零开始,使用python快速开发web站点(2)
  10. linux搭建phantomjs+webdriver+testng+ant自动化工程
  11. 使用Python对Excel进行读写操作
  12. 告知服务器意图的http方法
  13. 牛客小白月赛13 小A买彩票 (记忆化搜索)
  14. 奇异值分解(SVD)
  15. OGC标准服务 WMS WCS WFS WPS
  16. webvirtmgr-重命名kvm虚拟机的名称
  17. 基于Python项目的Redis缓存消耗内存数据简单分析(附详细操作步骤)
  18. 动态规划之132 Palindrome Partitioning II
  19. 【开源.NET】 轻量级内容管理框架Grissom.CMS(第二篇前后端交互数据结构分析)
  20. 【转】每天一个linux命令(54):ping命令

热门文章

  1. mode(BZOJ 2456)
  2. Log4j2同步异步性能比较以及教程和问题(坑)汇总
  3. 在 VirtualBox 5.0 系列中让虚拟机支持 USB 3.0 必须开启 APIC
  4. 模拟用户登录-SpringMVC+Spring+Mybatis整合小案例
  5. Working with multiple environments
  6. P1717 钓鱼 洛谷
  7. 向C#的选项卡中添加自定义窗体
  8. Solidworks如何显示装饰螺纹线
  9. react 中的无状态函数式组件
  10. Katalon