代码之家  ›  专栏  ›  技术社区  ›  salvationishere

XML任务错误消息十六进制无效字符

  •  0
  • salvationishere  · 技术社区  · 14 年前

    我正在开发一个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 '/>
    
    1 回复  |  直到 14 年前
        1
  •  1
  •   bobince    14 年前

    这不是错的。字符_U+0015负确认_(0x15,ASCII 21)是不能放入XML 1.0文件中的控制代码。您所拥有的XML文件格式不正确(因此不是真正的XML文件);请尝试在任何其他XML阅读器(例如,IE)中打开它,您应该得到相同的错误。

    您需要使用文本编辑器将该字符从文件中破解出来,并查看产生它的任何中断源。

    (不幸的是,我们看不到这个字符发布在这里,因为它是一个典型的不可见的控制代码,stackoverflow无论如何都会过滤掉它。然而,一个好的文本编辑器应该能够显示它所在的某种标记。错误中的列号表明它位于 c4 属性值,尽管这不一定可靠。)