JAVA解释XML时setValidating为true的时候报错
本帖最后由 Jason20Ming 于 2010-08-09 22:30:50 编辑 情况如下:
在/src目录下有一个access-rules.xml文件及其对应的schema文件access-rules.xsd
xml头部描述如下:
<?xml version="1.0" encoding="UTF-8"?>
<lms:access-rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://qnear.com/access-rules" xmlns:lms="http://qnear.com/access-rules"
xsi:schemaLocation="http://qnear.com/access-rules access-rules.xsd ">
Error: URI=null Line=4: Document root element "lms:access-rules", must match DOCTYPE root "null".
Error: URI=null Line=4: Document is invalid: no grammar found.