cvc-complex-type.2.4.a: Invalid content was found starting with element

cvc-complex-type.2.4.a: Invalid content was found starting with element


在写xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误.



解决方法如下:

在eclipse中配置xmlcatalog


1、Location: D:\LIB\springmodules-cache.xsd(springmodules-cache.xsd在本地的路径)
Key Type: Namespace Name
Key: http://www.springmodules.org/schema/cache/springmodules-cache.xsd
2、Location: D:\LIB\springmodules-ehcache.xsd(本地路径)
Key Type: Schema Location
Key: http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd


以上两个配置文件下载配置文件 (http://download.csdn.net/detail/pplsunny/9764322)



然后再将这连个xsd加入到web.xml中就搞定了

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance  http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
id="WebApp_ID" 
version="2.5">


==============

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念