The markup in the document following the root element must be well-formed.

还是读取 xml 文件的问题。

今天多亏前些天我总结了读取xml文件中数据转成javabean存储到数据库中的方法,因为代码没有上传svn,多亏记录了下来啊。

不过今天又遇到了别的问题:

The markup in the document following the root element must be well-formed. 

百度了一下,发现是 xml 文件的格式问题,文档中标记的地方格式不合法,通不过dtd的验证,不符合规范。

那么要怎么改呢,在xml文件的开头结尾 加上 

  1. <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"  
  2.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  3.     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
  4.     http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">  

  5.     原xml文件主体

  6. </web-app>  
这样就ok了。

猜你喜欢

转载自blog.csdn.net/alinekang/article/details/80651140