View Full Version : How to use the system id in the xml definition file?
jasoncao
Sep 20th, 2004, 08:52 PM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--DOCTYPE beans SYSTEM "spring-beans.dtd"-->
<beans>
</beans>
-------------------------------------
I just want to use the system doctype instead of the public xml doc type in my intranet env in which I cannot connect the internet.But the spring xml parse code will broken if I do this.
Can anyone help me?
katentim
Sep 20th, 2004, 09:19 PM
Does this answer your question?
http://opensource.atlassian.com/projects/spring/browse/SPR-212
jasoncao
Sep 20th, 2004, 09:45 PM
Thanks.
jasoncao
Sep 20th, 2004, 09:50 PM
The only thing need to do is add the xerces jar lib to the classpath.But I wonder how the springframework know which parser to use?
jasoncao
Sep 20th, 2004, 09:59 PM
See the javadoc :
Method DetailnewInstance public static DocumentBuilderFactory newInstance() throws FactoryConfiguration;
-------------------------------------
(1)Use the javax.xml.parsers.DocumentBuilderFactory system property. (2)Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
(3)Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory in jars available to the runtime.
(4)Platform default DocumentBuilderFactory instance.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.