小编use*_*311的帖子

错误:XML声明必须是文档中的第一个节点

我得到"意外的XML声明.XML声明必须是文档中的第一个节点,并且在尝试加载xml时,不允许出现空白字符".我的C#代码和XML文件的内容都在下面给出.XML定义存在于xml文件的第6行,因此存在错误.

我无法控制xml文件中的内容,因此如何使用C#编辑/重写它,以便首先出现xml声明然后加载注释而不会出现任何错误!

//xmlFilepath is the path/name of the xml file passed to this function
static function(string xmlFilepath)
{
XmlReaderSettings readerSettings = new XmlReaderSettings();
readerSettings.IgnoreComments = true;
readerSettings.IgnoreWhitespace = true;
XmlReader reader = XmlReader.Create(XmlFilePath, readerSettings);
XmlDocument xml = new XmlDocument();
xml.Load(reader);
}
Run Code Online (Sandbox Code Playgroud)

XmlDoc.xml

<!-- Customer ID: 1 -->
<!-- Import file: XmlDoc.xml -->
<!-- Start time: 8/14/12 3:15 AM -->
<!-- End time: 8/14/12 3:18 AM -->

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
-----
Run Code Online (Sandbox Code Playgroud)

.net c# xml

8
推荐指数
2
解决办法
3万
查看次数

我应该学习哪个RPA工具成为C#开发人员

我是一名.NET开发人员,从我职业生涯开始就主要使用C#开发Web和独立应用程序.我现在有兴趣学习RPA,所以RPA工具最适合我学习哪里可以更多地使用我的.NET技能.

我从谷歌那里了解到我们可以在蓝色棱镜的代码阶段使用C#但是其他着名工具如AA,UIPath,OpenSpan等都没有.

我理解最好选择基于要求的RPA工具,但我没有看到那么远,因为我还没有机会参与RPA项目.我只是从.NET的角度来看.谢谢!

c# uipath blueprism automationanywhere rpa

7
推荐指数
3
解决办法
8740
查看次数

标签 统计

c# ×2

.net ×1

automationanywhere ×1

blueprism ×1

rpa ×1

uipath ×1

xml ×1