如Mybatis中使用DTD来验证XML
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE configuration
- PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-config.dtd">
还可以在其发行包中org.apache.ibatis.builder.xml.dynamic或org.apache.ibatis.builder.xml中找到mybatis-3-config.dtd,mybatis-3-mapper.dtd,放到类路径下,然后将上面的头改成
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
- "./mybatis-3-config.dtd">
或者
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "../../../../../mybatis-3-mapper.dtd">