XML 任务错误消息十六进制无效字符
我正在开发一个 SSIS 包,用于将 XML 文件中的数据添加到现有的 SQL Server 表中。我已经完成了几个类似的项目,但在此 XML 文件上,我从 XML 任务和数据流任务之间的“数据流”选项卡收到错误:
Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message:
"'', hexadecimal value 0x15, is an invalid character. Line 28, position 54.".
Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text;
Xml Text is either invalid, null or empty string.
Task failed: XML Task
Warning: 0x80019002 at zSTU_TS_Element: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "zStu_TS_Element.dtsx" finished: Failure.
您知道如何解决此问题吗?
这是它在我的 XML 文件中引用的行:
<z:row c0='12' c1='80' c2='2006-04-17' c3='539' c4='1M2083N4N5N6N75800901110 11 '/>
I am developing a SSIS package to add data from an XML file to an existing SQL Server table. I have completed several similar projects, but on this XML file I am getting the error from the Data Flow tab between the XML Task and Data Flow Task:
Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message:
"'', hexadecimal value 0x15, is an invalid character. Line 28, position 54.".
Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text;
Xml Text is either invalid, null or empty string.
Task failed: XML Task
Warning: 0x80019002 at zSTU_TS_Element: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "zStu_TS_Element.dtsx" finished: Failure.
Do you know how I can fix this?
This is the line it is referring to from my XML file:
<z:row c0='12' c1='80' c2='2006-04-17' c3='539' c4='1M2083N4N5N6N75800901110 11 '/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并没有错。字符“U+0015 Negative Acknowledge”(0x15,ASCII 21)是不能放入 XML 1.0 文件中的控制代码。您拥有的 XML 文件格式不正确(因此不是真正的 XML 文件);尝试在任何其他 XML 阅读器(例如 IE)中打开它,您应该会得到相同的错误。
您需要使用文本编辑器将该字符从文件中删除,并查看产生它的任何损坏的源。
(不幸的是,我们看不到此处发布的该字符,因为它是一个通常不可见的控制代码,无论如何 StackOverflow 都会将其过滤掉。但是,一个好的文本编辑器应该能够显示它所在的某种标记。列号该错误表明它位于
c4
属性值的开头,尽管这不一定可靠。)It's not wrong. The character ‘U+0015 Negative Acknowledge’ (0x15, ASCII 21) is a control code which cannot be put in an XML 1.0 file. The XML file you have is not well-formed (and hence not really an XML file); try to open it in any other XML reader (eg. IE) and you should get the same error.
You'll need to hack that character out of the file using a text editor, and have a look at whatever broken source produced it.
(Unfortunately we can't see that character posted here, as it's a typically-invisible control code which StackOverflow filters out anyway. A good text editor should, however, be able to display some sort of marker that it's there. The column number in the error suggests it is at the start of the
c4
attribute value, though this isn't necessarily reliable.)