无法验证我的xml文件,以便能够在DhtmlxGrid中使用它

时间:2012-01-03 10:24:21

标签: xml

我正在尝试使用DHTMLXGrid api创建数据网格。我的xml文档中的一小段摘录:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<records>
    <paper>
        <gid>3</gid>
        <tid>1</tid>
        <pid>4</pid>
        <title>Quality Education as I See It</title>
        <authors>Dheeraj Mehrotra</authors>
    </paper>
    <paper>
        <gid>3</gid>
        <tid>1</tid>
        <pid>5</pid>
        <title>e-Learning Concept of CMS and the Digitization of Libraries</title>
        <authors>Meenu Chopra</authors>

问题在于,当我运行代码时,它表示不正确的xml,可能的原因可能是错误的架构或使用无效字符。我尝试验证这个xml文件,它给了我这个错误:

     Missing "charset" attribute for "text/xml" document.

The HTTP Content-Type header (text/xml) sent by your web browser (Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.15 (KHTML, like Gecko) Chrome/18.0.986.0 Safari/535.15) did not contain a "charset" parameter, but the Content-Type was one of the XML text/* sub-types.

The relevant specification (RFC 3023) specifies a strong default of "us-ascii" for such documents so we will use this value regardless of any encoding you may have indicated elsewhere.

If you would like to use a different encoding, you should arrange to have your browser send this new encoding information.


Sorry, I am unable to validate this document because on line 441 it contained one or more bytes that I cannot interpret as us-ascii (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.
The error was: ascii "\xE2" does not map to Unicode

441行: 确定作物使用数据挖掘营销的风险因素

早些时候我纠正了一些错误,如双引号,但它不断发现更多......

我想用xml做的事情是验证它,以某种方式删除无效字符,并在每个纸质标签中包含唯一ID,因为它是DHTMLX API中的一项要求。我通过最初的csv文件创建了我的xml,它没有任何创建唯一ID的选项。

1 个答案:

答案 0 :(得分:1)

它是一个很长的符号。您正在使用错误的编码。确保始终使用UTF-8