用DOM解析XML时出现了如下错误:

[Fatal Error] :3:13: Open quote is expected for attribute "{1}" associated with an  element type  "id".
org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an  element type  "id".
 at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
 at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
 at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
 at com.xml.DOMDemo.parseDomXML(DOMDemo.java:26)
 at com.xml.DOMDemo.main(DOMDemo.java:14)

检查后发现我的xml文件是这样写的

<?xml version="1.0" encoding="UTF-8"?>
<message>
     <person id=1>
        <name>jerry</name>
        <age>18</age>
        <sex>男</sex>
    </person>
    <person id=2>
       <name>Aimi</name>
      <age>20</age>
      <sex>女</sex>
   </person>
</message>

错误就在于,xml元素的开始标签的属性必须用双引号括起来

改为:

<person id="1">

<person id="2">

[Fatal Error] :3:13: Open quote is expected for attribute "{1}" associated with an element type "id".的更多相关文章

  1. BUG:Open quote is expected for attribute "{1}" associated with an element type "id".

    BUG原因:Mybatis的xml文件中id缺少双引号: 正确的应该是:

  2. Open quote is expected for attribute "property" associated with an element type "result".错误

    java  Mybatis 框架下的项目 报   Open quote is expected for attribute "property" associated with a ...

  3. Open quote is expected for attribute "{1}" associated with an element type "name".

    xml属性必须用引号“”,不能缺少.

  4. Open quote is expected for attribute "{1}" associated with an element type "column".

    这个的错误的意思很简单:就是自己的配置文件是否缺少""号

  5. ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)

    1.之前搭建的kafka,过了好久,去启动kafka,发现报如下下面的错误,有错误就要解决了. 然后参考:https://blog.csdn.net/hello_world_qwp/article/d ...

  6. 【VS开发】fatal error C1853: "Debug\sift.pch"预编译头文件来自编译器的早期版本

    fatal error C1853: "Debug\sift.pch"预编译头文件来自编译器的早期版本 <pre id="best-content-12991040 ...

  7. Ubuntu 13.10 PHP 5.5.x mcrypt missing – Fatal Error: Undefined function mcrypt_encrypt()!

    [原文]http://www.tuicool.com/articles/goto?id=myM7veR I had updgraded my Ubuntu from 13.04 to 13.10 la ...

  8. Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 64 bytes) in D

    Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 64 bytes) in D 从数据库 ...

  9. FATAL ERROR: Could not find ./bin/my_print_defaults的解决办法

    对mysql数据库初始化过程中,会有如下报错信息: 1 2 3 4 5 6 7 [root@localhost scripts]# ./mysql_install_db --user=mysql FA ...

随机推荐

  1. Linux创建一个周期任务来定期删除过期的文件

    一:需求 在开发中存在这样的情况,为了防止文件的误删,不允许开发人员直接删除项目中要用到的文件,而是将它们移动到某个目录,然后由一个周期任务去检测并删除内部过期的文件: 二:检测文件是否是过期文件 有 ...

  2. cyclone iv中DDR2的本地接口时序

    本地接口 信号名 方向  描述  local_burstbegin input 如果local_ready无效不起作用.IP核在local_write_req为高时,在phy_clk上升沿采样.当lo ...

  3. TortoiseGit disconnected no supported authentication

    从远程服务器上获取到的工程,用Git没问题,而TortoiseGit报错: Disconnected: No supported authentication methods available(se ...

  4. 视图,sql注入问题,事物,存储过程

    视图:本质是一张虚拟的表数据来自select语句用途是保障原表安全 功能1:隐藏部分数据,开放指定数据功能2:因为视图可以将查询结果保存的特性,我们可以用视图来达到减少书写sql语句的功能 例如:se ...

  5. info AI drive

    Who we look for Here at comma, we don't care about the source of your education or your traditional ...

  6. 各版本.NET委托的写法回顾(转)

    转自:http://www.csharpwin.com/csharpspace/7548r2766.shtml 在<关于最近面试的一点感想>一文中,Michael同学谈到他在面试时询问对方 ...

  7. 20169207《Linux内核原理及分析》第十二周作业

    本周选做的信息安全实验为Python实现Zip文件的暴力破解 实验预备: 这次实验我们需要用到的库为zipfile.下来我们先来了解一下这个模块. 首先我们的重点是对zip文件的操作,而zipfile ...

  8. codeblocks+SDCC开发51单片机

    说到51,大部分人都是用的是KEIL开发环境,但是KEIL是商业软件,我们一般人都用的是破解版的,如果用于商业就会收到法律诉讼.然而有一款很好的编译器专为51内核而存在.SDCC最大的有点就是开源免费 ...

  9. noip第1课作业

    1.    求三个数的乘积和三次方和 [问题描述] 编程实现输入任意三个整数a, b, c,将这三个数的乘积以及三次方和输出: [样例输入] 1 2 3 [样例输出] 6 36 #include &l ...

  10. hihocoder 二分·二分答案【二分搜索,最大化最小值】 (bfs)

    题目 这道题做了几个小时了都没有做出来,首先是题意搞了半天都没有弄懂,难道真的是因为我不打游戏所以连题都读不懂了? 反正今天是弄不懂了,过几天再来看看... 题意:一个人从1点出发到T点去打boss, ...