简体   繁体   English

根级别的数据无效。 第1行,位置1-为什么在加载xml文件时出现此错误?

[英]Data at the root level is invalid. Line 1, position 1 -why do I get this error while loading an xml file?

Data at the root level is invalid. 根级别的数据无效。 Line 1, position 1 -why I get this error while load xml file 第1行,位置1-为什么在加载xml文件时出现此错误

this my code: 这是我的代码:

XmlDocument xmlDoc=new XmlDocument();
xmlDoc.LoadXml("file.xml");

The LoadXml method is for loading an XML string directly. LoadXml方法用于直接加载XML字符串。 You want to use the Load method instead. 您想改用Load方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误加载XML文件{“根级别的数据无效。 第1行,位置1。”} - Error Loading XML File {“Data at the root level is invalid. Line 1, position 1.”} 根级别的数据无效。 第1行,内存xml中有效的位置1 - Data at the root level is invalid. Line 1, position 1 on valid in memory xml “根级别的数据无效。第 1 行,position 1”解析 XML 时 - "Data at the root level is invalid. Line 1, position 1" When Parsing XML 根级别的数据无效。 第1行在XML中的位置1 - data at the root level is invalid. line 1 position 1 in XML xml.LoadData - 根级别的数据无效。 1号线,position 1 - xml.LoadData - Data at the root level is invalid. Line 1, position 1 根级别的数据无效。 第1行,第1位,同时读取xml - Data at the root level is invalid. Line 1, position 1. while reading xml 根级别的数据无效。 第1行,位置1 - Data at the root level is invalid. Line 1, position 1 URL 中的 XML - 根级别的数据无效。 第 1 行,位置 1 为什么它适用于一个 URL 而不是另一个? - XML from URL - Data at the root level is invalid. Line 1, position 1 Why it works with one URL and not the other? C# XML 解析 - 根级别的数据无效。 第 1 行,位置 1 - C# XML Parsing - Data at the root level is invalid. Line 1, position 1 使用C#根据XSD验证XML:根级别的数据无效。 第1行,位置1 - Validating XML against XSD using C#: Data at the root level is invalid. Line 1, position 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM