mybatis Mapping xml报The content of element type "mapper" must match "EMPTY". Children of type "comme
来源:互联网 发布:百度360排名优化软件 编辑:程序博客网 时间:2024/06/07 06:12
新手学习mybatis编写实体映射文件时,eclipse或者STS或者其他会显示红叉叉,将鼠标放在红叉叉上会得到这样的一串提示."The content of element type "mapper" must match "EMPTY". Children of type "comment" are not allowed."
这是因为定义实体映射xml文件的文档类型里面的属性不对的缘故。
如果是这样写的:<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">没有网络时,mybatis-3-mapper.dtd加载不到,所以下面定义的元素标签就会报红叉叉。
改成这样就好了<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Configuration 3.0//EN" "mybatis-3-mapper.dtd" >
可能有很多人对xml文件定义<!DOCTYPE这一串东西是什么意思不太了解。我也来说说我的理解,不正之处请大神斧正
<!DOCTYPE 后面跟的是是校验该XML的DTD所在的位置
什么是DTD呢?DTD全称是文档类型定义,它是xml文件格式校验的一种。
xml可以自定义标签,所以每个人写的标签可能不一样,这样的话别人要是使用怎么会知道哪个标签怎么用呢?代表什么意思呢?DTD可以解决这个问题。
dtd是一种保证xml文档格式正确的方法,它可以比较xml文档和dtd文件,从而查看文档是否符合规范,元素和标签是否使用正确。
dtd文档包含:元素定义规则,元素间关系的定义规则,元素可使用的属性,可使用的实体或符合规则。
dtd的分类:内部dtd和外部dtd。内部顾名思义包含在xml文档中,外部dtd则通过url引用。
- mybatis Mapping xml报The content of element type "mapper" must match "EMPTY". Children of type "comme
- The content of element type "configuration" must match "EMPTY". Children of type "comment" are not a
- mybatis-config.xml:报SAXParseException: The content of element type "configuration" must match
- 解决mybatis问题:The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMa
- map.xml文件报The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*
- Hibernate配置文件报错:The content of element type "session-factory" must match "(property*,mapping*,(c
- 必须为元素类型 "mapper" 声明属性 "namespace" 或The content of element type "mapper" must match "EMPTY"
- web.xml 报错The content of element type "web-app" must match
- 解决web.xml 报错The content of element type "web-app" must match
- The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|inse
- hibernate The content of element type "session-factory" must match "(property*,mapping*,(class-cache
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collectio
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache| collect
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache| collect
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collectio
- The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collectio
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache| c
- 求阶乘的最右一位非零数字
- 数据拟合
- 59.笔记 MySQL学习——MySQL数据值类别之数值
- Linux网络编程——并发服务器模型
- Python 练习实例8
- mybatis Mapping xml报The content of element type "mapper" must match "EMPTY". Children of type "comme
- Android Studio pathData
- 60.笔记 MySQL学习——MySQL数据值类别之字符串
- SQL练习题
- shell命令解析器功能说明
- 61.笔记 MySQL学习——字符串类型与字符集
- dlib安装使用教程
- ccmake: /root/anaconda2/lib/libcrypto.so.1.0.0: no version information available
- 62.笔记 MySQL学习——字符集相关的系统变量