When we put the xsd in the xsi:schemaLocation, does it download the xsd from the internet and validate the xml?
I want to do an offline-validation by downloading the xsd if that is the case, How can I achieve this?
I know how to do offline-validation for DTD’s but not sure about xsd.
For DTD’s, I am currently doing the following:
<!DOCTYPE struts-config SYSTEM "struts-config_1_1.dtd">
Can I do something like this?
From
<!-- 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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"-->
to
<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
file://spring-beans-3.0.xsd
http://www.springframework.org/schema/context
file://spring-context-3.0.xsd">
EDIT:
Looks like I am wrong. The spring only goes to internet when there it doesn’t find the dtd/xsd in the jar file. I pulled the internet plug and saw that the application works fine.
Also, source: https://forum.hibernate.org/viewtopic.php?f=1&t=949031
Sorry for the trouble and wrong question.
Yes, you can; what you need to make sure though is that the URI must be valid for your scheme (file:// in your case, which on Windows is more like file://c:/something/my.xsd).
Make sure that all the XSD files are stored locally as well, and all references between XSD files are correct.