delasoul
May 16th, 2006, 04:22 AM
Hello,
i am trying out the new xml schema configuration support in Spring 2.
Therefore I followed the example on
http://www.memestorm.com/blog/
Everything works fine, but I have a question about the schema validation.
Say, I don't have connection to the internet?
Is there a way to load the necessary schemas from the classpath (a jar),
do I have to put the schemas somewhere in a directory and load them form there or should one turn off the xml parser validation?
I have tried to override FileSystemXmlApplicationContext and in
initBeanDefinitionReader() set the validation to VALIDATION_NONE.
The validation is switched off - but the bean with id sb cannot be created.
Thanx in advance for any advice..
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:md="http://www.md.com/schema/simple"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring- beans.xsd
http://www.md.com/schema/simple
simple.xsd">
<md:simpleBean id="sb" value="Hello"/>
<bean id="simpleBeanUser" class="com.mh.spring.use.schema.SimpleBeanUser" singleton="false">
<property name="simpleBean" ref="sb"/>
</bean>
</beans>
i am trying out the new xml schema configuration support in Spring 2.
Therefore I followed the example on
http://www.memestorm.com/blog/
Everything works fine, but I have a question about the schema validation.
Say, I don't have connection to the internet?
Is there a way to load the necessary schemas from the classpath (a jar),
do I have to put the schemas somewhere in a directory and load them form there or should one turn off the xml parser validation?
I have tried to override FileSystemXmlApplicationContext and in
initBeanDefinitionReader() set the validation to VALIDATION_NONE.
The validation is switched off - but the bean with id sb cannot be created.
Thanx in advance for any advice..
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:md="http://www.md.com/schema/simple"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring- beans.xsd
http://www.md.com/schema/simple
simple.xsd">
<md:simpleBean id="sb" value="Hello"/>
<bean id="simpleBeanUser" class="com.mh.spring.use.schema.SimpleBeanUser" singleton="false">
<property name="simpleBean" ref="sb"/>
</bean>
</beans>