System.Xml.XmlException:“根级别上的数据无效。
我需要将字符串转换成XmlDocument,但是在doc1.LoadXml(s);时提示错误“System.Xml.XmlException:“根级别上的数据无效。 第 1 行,位置 1。”,请问为什么?
//string s = "<?xml version=\"1.0\" encoding=\"gb2312\"?>";
string s = "<root><item></item></root>";
XmlDocument doc1 = new XmlDocument();
doc1.LoadXml(s);
...全文
相关推荐
System.Xml.XmlException(解决方案).md
项目中碰到的,记录一下解决方案
详解C#借助.NET框架中的XmlTextReader类读取XML的方法
主要介绍了详解借助.NET框架中的XmlTextReader类读取XML的方法,这种方式的执行效率还是比较令人满意的,需要的朋友可以参考下
C#读取XML配置文件
C#读取XML配置文件 C#读取XML配置文件C#读取XML配置文件C#读取XML配置文件C#读取XML配置文件
C#解析XML文件并用WinForm显示
自己写的,运用dot net解析XML文件,并在用WinForm进行显示。。。。。
javabean到XML的转换
NULL 博文链接:https://summerbell.iteye.com/blog/372963


