还是读取 xml 文件的问题。
今天多亏前些天我总结了读取xml文件中数据转成javabean存储到数据库中的方法,因为代码没有上传svn,多亏记录了下来啊。
不过今天又遇到了别的问题:
The markup in the document following the root element must be well-formed.
百度了一下,发现是 xml 文件的格式问题,文档中标记的地方格式不合法,通不过dtd的验证,不符合规范。
那么要怎么改呢,在xml文件的开头结尾 加上
- <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- 原xml文件主体
- </web-app>