noNamespaceSchemaLocation这种方式,我测试时和要编辑的XML文件放在一个目录下了。 我传到一个网站上,用schemaLocation方式,能出来了,但报错如下: -schemaLocation value = 'http://www.dcharts.com/component.xsd' must have even number of URI's.引用是这样写的:<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://www.dcharts.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dcharts.com/component.xsd"> <component name="" id="" instance-scope="SITE"> ......
schemaLocation value = 'http://www.dcharts.com/component.xsd' must have even number of URI's 需要加版本号
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
改为(beans.xsd是我保存到本地的):
<beans orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="beans.xsd">
也不行了,难道schema不能使用本地文件吗?
xsi:noNamespaceSchemaLocation="beans.xsd">
你的beans.xsd文件放在哪里?
我传到一个网站上,用schemaLocation方式,能出来了,但报错如下:
-schemaLocation value = 'http://www.dcharts.com/component.xsd' must have even number of URI's.引用是这样写的:<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.dcharts.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.dcharts.com/component.xsd">
<component name="" id="" instance-scope="SITE">
......
需要加版本号
xsi:schemaLocation="http://www.dcharts.com http://www.dcharts.com/component.xsd"