为什么这里写了一大堆xml文件都没有链接到外部的xsd文件呢

来源:百度知道 编辑:UC知道 时间:2024/06/02 12:47:02
xml中的标签不是都是用xsd限制的 吗?

<?xml version="1.0" encoding="UTF-8"?>
<sys-configure>
<jdbc-info>
<driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
<url>jdbc:mysql://localhost:3306/drp</url>
<user-name>root</user-name>
<password>root</password>
</jdbc-info>

<beans>
<bean id="com.wo.drp.base" class="com.bjsxt.wo.base.impl"></bean>
</beans>
</sys-configure>

有没有链接外部xsd文件 没有什么关系
xsd只提供了xml的规范
只要你xml遵守这个规范在读取的时候不报错能找到这个值就行

<?xml version="1.0" encoding="utf-8"?>
<sys-configure xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="您的xsd文件名.xsd">
<jdbc-info>
<driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
<url>jdbc:mysql://localhost:3306/drp</url>
<user-name>root</user-name>
<password>root</password>
</jdbc-info>

<beans>
<bean id="com.wo.drp.base" class="com.bjsxt.wo.base.impl"></bean>
</beans>
</sys-configure>
代码应该是这样的吧,需要引用哦